@stacksjs/stx 0.2.328 → 0.2.330

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 (153) hide show
  1. package/dist/{chunk-ja7q1r6p.js → chunk-0w8t922h.js} +1 -1
  2. package/dist/{chunk-0n90mnpc.js → chunk-1czvb2wx.js} +1 -1
  3. package/dist/{chunk-tv9syyhk.js → chunk-1e4sb5dk.js} +2 -2
  4. package/dist/chunk-20e4pcq1.js +2 -0
  5. package/dist/{chunk-ye7e8134.js → chunk-289vztwy.js} +1 -1
  6. package/dist/{chunk-sxbp4m27.js → chunk-2jfneptq.js} +1 -1
  7. package/dist/{chunk-srnrsany.js → chunk-2t8jekek.js} +1 -1
  8. package/dist/{chunk-68e7xdsh.js → chunk-33az7v0k.js} +1 -1
  9. package/dist/{chunk-a7a27x3z.js → chunk-33rznhw1.js} +1 -1
  10. package/dist/{chunk-z1gqmhmp.js → chunk-3cba0xw5.js} +1 -1
  11. package/dist/{chunk-832fs45r.js → chunk-3n9rvrk1.js} +1 -1
  12. package/dist/chunk-3vhf96nd.js +2 -0
  13. package/dist/{chunk-0dtcw5ca.js → chunk-3wvdm033.js} +1 -1
  14. package/dist/chunk-4mb08201.js +2 -0
  15. package/dist/{chunk-nt9y4feq.js → chunk-557n2zx7.js} +1 -1
  16. package/dist/{chunk-mt024tb1.js → chunk-5cncs85f.js} +1 -1
  17. package/dist/{chunk-nn4xr784.js → chunk-5ep11kvc.js} +1 -1
  18. package/dist/chunk-5pvfm908.js +2 -0
  19. package/dist/{chunk-zam1mxnz.js → chunk-7080py5f.js} +1 -1
  20. package/dist/{chunk-9r4bsg9f.js → chunk-70nkn5te.js} +1 -1
  21. package/dist/{chunk-krjzxnsd.js → chunk-77sa9wz4.js} +1 -1
  22. package/dist/{chunk-fg5g8yvy.js → chunk-7cp9tswt.js} +10 -10
  23. package/dist/chunk-7cvdxe22.js +2 -0
  24. package/dist/{chunk-ap3eff26.js → chunk-7ds14xsn.js} +1 -1
  25. package/dist/chunk-7f16ymjn.js +2 -0
  26. package/dist/{chunk-yqy9fp4a.js → chunk-7kfp7jde.js} +1 -1
  27. package/dist/{chunk-8x6jmbj6.js → chunk-7zjqjcc9.js} +152 -152
  28. package/dist/chunk-858xqty6.js +2 -0
  29. package/dist/chunk-8g05y0eh.js +2 -0
  30. package/dist/{chunk-8jyr1zyf.js → chunk-8kvd3g8y.js} +3 -3
  31. package/dist/chunk-8n96ck39.js +2 -0
  32. package/dist/{chunk-h9h6hna7.js → chunk-97yd8erh.js} +1 -1
  33. package/dist/{chunk-53xjmjva.js → chunk-afsy9158.js} +1 -1
  34. package/dist/{chunk-2z9q9weh.js → chunk-am42axf7.js} +1 -1
  35. package/dist/{chunk-raznshc9.js → chunk-bsa8pxtc.js} +1 -1
  36. package/dist/{chunk-8fved33k.js → chunk-bsm13y1j.js} +1 -1
  37. package/dist/chunk-c24ykq78.js +2 -0
  38. package/dist/{chunk-61y14d8d.js → chunk-c2mvx2m8.js} +1 -1
  39. package/dist/{chunk-e27f8tzs.js → chunk-cbzb7wa6.js} +2 -2
  40. package/dist/chunk-cn74d92v.js +2 -0
  41. package/dist/{chunk-p26cry7t.js → chunk-cqp01pgs.js} +2 -2
  42. package/dist/chunk-cs0brex5.js +2 -0
  43. package/dist/chunk-d3mdskgy.js +2 -0
  44. package/dist/chunk-d9gk60kk.js +2 -0
  45. package/dist/chunk-denfdjdr.js +2 -0
  46. package/dist/{chunk-yge0y55d.js → chunk-dfymexrx.js} +1 -1
  47. package/dist/{chunk-tgskej77.js → chunk-dgjfm31x.js} +1 -1
  48. package/dist/{chunk-h485av8z.js → chunk-dr0hzy88.js} +1 -1
  49. package/dist/{chunk-bjyz3yfb.js → chunk-dr0thyq9.js} +2 -2
  50. package/dist/{chunk-d28gqewj.js → chunk-dwjcmxez.js} +1 -1
  51. package/dist/{chunk-72kstb4w.js → chunk-e8z1hde4.js} +1 -1
  52. package/dist/{chunk-ke8s1zc4.js → chunk-eak7y9sv.js} +1 -1
  53. package/dist/{chunk-30fwc6na.js → chunk-erzhx49f.js} +1 -1
  54. package/dist/{chunk-mf9yyv62.js → chunk-ey4sca09.js} +11 -4
  55. package/dist/{chunk-2k16wj3k.js → chunk-fc1g65e0.js} +1 -1
  56. package/dist/chunk-ff5ztp8g.js +2 -0
  57. package/dist/{chunk-pgw0psw1.js → chunk-g3cyygvf.js} +1 -1
  58. package/dist/{chunk-kkxzsv3w.js → chunk-gcjr4mwg.js} +1 -1
  59. package/dist/{chunk-e59fq6n5.js → chunk-gne68nyp.js} +1 -1
  60. package/dist/{chunk-1hnw53jv.js → chunk-gtgnt6kn.js} +1 -1
  61. package/dist/{chunk-mb2m7f5q.js → chunk-gwrrs1qh.js} +1 -1
  62. package/dist/chunk-gzzgnw3t.js +2 -0
  63. package/dist/chunk-h3w1y4q7.js +2 -0
  64. package/dist/{chunk-rksnsjf9.js → chunk-he0pgw47.js} +2 -2
  65. package/dist/{chunk-4phb1fg3.js → chunk-hfwwqvmn.js} +1 -1
  66. package/dist/chunk-jhhp2d7n.js +2 -0
  67. package/dist/{chunk-k2jg35y6.js → chunk-jsff6z2m.js} +2 -2
  68. package/dist/{chunk-f2xr3mfr.js → chunk-jwkmc175.js} +1 -1
  69. package/dist/chunk-k14sz6cz.js +2 -0
  70. package/dist/{chunk-habj6qnb.js → chunk-kcn1ay55.js} +1 -1
  71. package/dist/chunk-m9b8ahkp.js +2 -0
  72. package/dist/{chunk-dews384p.js → chunk-meqcxfpr.js} +1 -1
  73. package/dist/{chunk-ns9k6ez3.js → chunk-mk51d96e.js} +1 -1
  74. package/dist/{chunk-vyk3bzxz.js → chunk-mnsaf11z.js} +1 -1
  75. package/dist/{chunk-g4yyd077.js → chunk-ms2kjpdt.js} +1 -1
  76. package/dist/{chunk-mykp2dwz.js → chunk-mywrt0dp.js} +1 -1
  77. package/dist/chunk-n26hw8ak.js +2 -0
  78. package/dist/{chunk-96vth1xh.js → chunk-ncfbxy9j.js} +1 -1
  79. package/dist/{chunk-26w2sdre.js → chunk-nxbje85a.js} +1 -1
  80. package/dist/{chunk-e0c8k4n1.js → chunk-peqad61h.js} +1 -1
  81. package/dist/{chunk-qb20yjqd.js → chunk-pew5av90.js} +1 -1
  82. package/dist/chunk-pkbj0aht.js +2 -0
  83. package/dist/chunk-pm3t0mdq.js +2 -0
  84. package/dist/{chunk-y38dwb99.js → chunk-qcf4506g.js} +1 -1
  85. package/dist/{chunk-c28ws2ep.js → chunk-qnx0eb8x.js} +1 -1
  86. package/dist/chunk-qqceavq5.js +2 -0
  87. package/dist/chunk-r7pr9mch.js +2 -0
  88. package/dist/{chunk-7bsr7h63.js → chunk-rkna71t2.js} +1 -1
  89. package/dist/{chunk-cq386y8q.js → chunk-tjhzxbxa.js} +1 -1
  90. package/dist/chunk-tm5rsehg.js +2 -0
  91. package/dist/{chunk-mk6j4hhx.js → chunk-tp6wkx7g.js} +1 -1
  92. package/dist/{chunk-8g6spg1e.js → chunk-v91ge29x.js} +1 -1
  93. package/dist/{chunk-brtbjw1m.js → chunk-vd0bvmas.js} +1 -1
  94. package/dist/{chunk-625ww1wr.js → chunk-wd71swap.js} +1 -1
  95. package/dist/{chunk-z6mphydy.js → chunk-wv9v9mj9.js} +1 -1
  96. package/dist/{chunk-2gr3wwxa.js → chunk-wx3kf6tm.js} +1 -1
  97. package/dist/{chunk-9r70kyap.js → chunk-x1ra8wrz.js} +1 -1
  98. package/dist/{chunk-h6akyz4p.js → chunk-x3p8ardj.js} +1 -1
  99. package/dist/{chunk-9tg2x4eb.js → chunk-xgj1jw4p.js} +1 -1
  100. package/dist/chunk-xjaen1xx.js +2 -0
  101. package/dist/{chunk-y4ny304g.js → chunk-xjw29mp3.js} +1 -1
  102. package/dist/chunk-xqqfajvm.js +2 -0
  103. package/dist/{chunk-g2vevtny.js → chunk-xt7bsyj7.js} +1 -1
  104. package/dist/{chunk-xptrceyd.js → chunk-xzkc36wt.js} +1 -1
  105. package/dist/{chunk-mhahh2e7.js → chunk-yjkaqxtc.js} +1 -1
  106. package/dist/{chunk-mdj85hgb.js → chunk-ykhhn5ed.js} +1 -1
  107. package/dist/chunk-yns8ygvd.js +2 -0
  108. package/dist/{chunk-wcc30cjt.js → chunk-ys8sm556.js} +1 -1
  109. package/dist/{chunk-j7hfhq4b.js → chunk-z1121pkn.js} +2 -2
  110. package/dist/{chunk-ex75w96f.js → chunk-z6xtb8fj.js} +1 -1
  111. package/dist/chunk-zt78vydy.js +2 -0
  112. package/dist/{chunk-5vccw7bd.js → chunk-zyb5gfr0.js} +1 -1
  113. package/dist/cli.js +14 -14
  114. package/dist/client-script.d.ts +12 -0
  115. package/dist/client-script.js +22 -2
  116. package/dist/craft-entry.js +1 -1
  117. package/dist/craft.js +1 -1
  118. package/dist/database.js +1 -1
  119. package/dist/pwa.js +2 -2
  120. package/dist/ssg.js +2 -2
  121. package/dist/visual-testing.js +1 -1
  122. package/package.json +5 -5
  123. package/dist/chunk-02n4m7c1.js +0 -2
  124. package/dist/chunk-04687bed.js +0 -2
  125. package/dist/chunk-1jcgnwrn.js +0 -2
  126. package/dist/chunk-2sf768xb.js +0 -2
  127. package/dist/chunk-6pwwxxxk.js +0 -2
  128. package/dist/chunk-7h2a1qcc.js +0 -2
  129. package/dist/chunk-9yzs3bs7.js +0 -2
  130. package/dist/chunk-a1t7gfgf.js +0 -2
  131. package/dist/chunk-brhwe7w2.js +0 -2
  132. package/dist/chunk-f5994k7z.js +0 -2
  133. package/dist/chunk-fsef8xw9.js +0 -2
  134. package/dist/chunk-gnjfhktx.js +0 -2
  135. package/dist/chunk-j3m3ydzv.js +0 -2
  136. package/dist/chunk-k38dv15t.js +0 -2
  137. package/dist/chunk-kczw9gx1.js +0 -2
  138. package/dist/chunk-ngggy0k6.js +0 -2
  139. package/dist/chunk-nxj2sv43.js +0 -2
  140. package/dist/chunk-pkmejk2p.js +0 -2
  141. package/dist/chunk-q0s18twx.js +0 -2
  142. package/dist/chunk-q548wy1d.js +0 -2
  143. package/dist/chunk-q5zxa0vh.js +0 -2
  144. package/dist/chunk-s8nhhxe3.js +0 -2
  145. package/dist/chunk-tt0n1ycm.js +0 -2
  146. package/dist/chunk-v26qp1p5.js +0 -2
  147. package/dist/chunk-v9rtg3q7.js +0 -2
  148. package/dist/chunk-vv8yr1a0.js +0 -2
  149. package/dist/chunk-wf9cmyj7.js +0 -2
  150. package/dist/chunk-x887namm.js +0 -2
  151. package/dist/chunk-xgt1t9dw.js +0 -2
  152. package/dist/chunk-xq95p9y3.js +0 -2
  153. package/dist/chunk-z7jx68nh.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Or as Q0,Qr as L9,Rr as H3,Sr as O9,Us as M8,Ys as I8,Zr as E2,as as N8,cs as G0,gs as b2,gt as D7,hs as D8,ht as A7,js as r0,ks as A8,rs as j3,ss as a4,ts as Z0,us as B0,vs as b0,ws as V9,xs as J2,ys as H0,zs as F9}from"./chunk-p26cry7t.js";import{mt as g0,nt as VZ}from"./chunk-2k16wj3k.js";import{st as s2}from"./chunk-0dtcw5ca.js";import{At as E1,Ct as H1,Dt as QZ,Et as GZ,Ft as Q2,Gt as l2,Ht as _9,It as T2,Jt as U8,Kt as t6,Lt as B1,Mt as n0,Nt as l9,Rt as b8,St as C9,du as y8,xt as n1,yt as f1,zt as E8}from"./chunk-8jyr1zyf.js";import{fu as G4,gu as z4,hu as q4,ku as W4,lu as U4}from"./chunk-61y14d8d.js";import{ru as T7,su as E7,tu as e2,uu as $9}from"./chunk-8fved33k.js";import{Bu as j2,wu as M7,yu as I7,zu as k7}from"./chunk-e59fq6n5.js";import{Cu as S9}from"./chunk-j7hfhq4b.js";import{Eu as l8,Fu as c8,Gu as p8,Hu as i8,Iu as n8,Ku as T8}from"./chunk-zam1mxnz.js";import{Lu as C8,Pu as r2,Ru as s8}from"./chunk-mhahh2e7.js";import{$u as Z1}from"./chunk-mk6j4hhx.js";import{cv as S8}from"./chunk-nt9y4feq.js";import{dv as B3,ev as jZ,fv as YZ,gv as i1,kv as BZ,lv as t$,mv as a6,ov as b4,rv as g4}from"./chunk-cq386y8q.js";import{Cv as M$,Fv as v6,Mv as H$,bw as k8,dw as gG,ew as $5,gw as K2}from"./chunk-mf9yyv62.js";import{lw as b7}from"./chunk-c28ws2ep.js";import{qw as f}from"./chunk-nn4xr784.js";import y1 from"path";import C2 from"fs";var o$=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"]),r$={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"},RZ=new Set(["ctrl","alt","shift","meta"]),e$={left:0,middle:1,right:2};function a$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let J of $){let X=J.toLowerCase();if(X==="prevent")Z.prevent=!0;else if(X==="stop")Z.stop=!0;else if(X==="once")Z.once=!0;else if(X==="capture")Z.capture=!0;else if(X==="self")Z.self=!0;else if(X==="passive")Z.passive=!0;else if(RZ.has(X))Z.systemKeys.push(X);else if(X in e$)Z.mouse=X;else if(X in r$||/^[a-z]$/.test(X))Z.keys.push(r$[X]||X.toUpperCase());else if(X.startsWith("debounce")){let Q=X.match(/debounce(?:\.(\d+))?/);Z.debounce=Q?.[1]?Number.parseInt(Q[1],10):300}else if(X.startsWith("throttle")){let Q=X.match(/throttle(?:\.(\d+))?/);Z.throttle=Q?.[1]?Number.parseInt(Q[1],10):300}}return Z}function $3($){let Z=[],J=0,X=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Q;while((Q=X.exec($))!==null){let[Y,G,z]=Q,q=Q.index,K=q+Y.length,W=`__stx_evt_${J++}`,U=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}if(U.length>0)Z.push({originalTag:Y,elementId:W,events:U,startIndex:q,endIndex:K})}return Z}function NZ($){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((Q)=>`$event.key === '${Q}'`).join(" || ");Z.push(`if (!(${X})) return`)}if(J.mouse!==null){let X=e$[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 DZ($,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 h9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function AZ($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=NZ($),Q=DZ(h9($.handler),Z),Y=[];if(Z.once)Y.push("once: true");if(Z.capture)Y.push("capture: true");if(Z.passive)Y.push("passive: true");let G=Y.length>0?`, { ${Y.join(", ")} }`:"",z=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
2
+ import{As as F9,Pr as Q0,Rr as L9,Sr as H3,Tr as O9,Vs as M8,Zs as I8,_r as E2,bs as N8,ds as G0,hs as b2,ht as D7,is as D8,it as A7,ks as r0,ls as A8,ss as j3,ts as a4,us as Z0,vs as B0,ws as b0,xs as V9,ys as J2,zs as H0}from"./chunk-cqp01pgs.js";import{nt as g0,ot as VZ}from"./chunk-fc1g65e0.js";import{tt as s2}from"./chunk-3wvdm033.js";import{At as E8,Bt as E1,Dt as H1,Et as QZ,Ft as GZ,Gt as Q2,Ht as l2,It as _9,Jt as T2,Kt as U8,Lt as t6,Mt as B1,Nt as n0,Ot as l9,St as b8,Tt as C9,eu as y8,yt as n1,zt as f1}from"./chunk-8kvd3g8y.js";import{gu as G4,hu as z4,iu as q4,lu as W4,mu as U4}from"./chunk-c2mvx2m8.js";import{su as T7,tu as E7,uu as e2,vu as $9}from"./chunk-bsm13y1j.js";import{Au as k7,Cu as j2,xu as M7,zu as I7}from"./chunk-gne68nyp.js";import{Du as S9}from"./chunk-z1121pkn.js";import{Fu as l8,Gu as c8,Hu as p8,Iu as i8,Ju as n8,Lu as T8}from"./chunk-7080py5f.js";import{Mu as C8,Qu as r2,Su as s8}from"./chunk-yjkaqxtc.js";import{av as Z1}from"./chunk-tp6wkx7g.js";import{dv as S8}from"./chunk-557n2zx7.js";import{ev as B3,fv as jZ,gv as YZ,hv as i1,lv as BZ,mv as t$,nv as a6,pv as b4,sv as g4}from"./chunk-tjhzxbxa.js";import{Dv as M$,Gv as v6,Nv as H$,cw as k8,ew as hG,fw as $5,hw as K2}from"./chunk-ey4sca09.js";import{mw as b7}from"./chunk-qnx0eb8x.js";import{rw as f}from"./chunk-5ep11kvc.js";import y1 from"path";import C2 from"fs";var o$=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"]),r$={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"},NZ=new Set(["ctrl","alt","shift","meta"]),e$={left:0,middle:1,right:2};function a$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let J of $){let X=J.toLowerCase();if(X==="prevent")Z.prevent=!0;else if(X==="stop")Z.stop=!0;else if(X==="once")Z.once=!0;else if(X==="capture")Z.capture=!0;else if(X==="self")Z.self=!0;else if(X==="passive")Z.passive=!0;else if(NZ.has(X))Z.systemKeys.push(X);else if(X in e$)Z.mouse=X;else if(X in r$||/^[a-z]$/.test(X))Z.keys.push(r$[X]||X.toUpperCase());else if(X.startsWith("debounce")){let Q=X.match(/debounce(?:\.(\d+))?/);Z.debounce=Q?.[1]?Number.parseInt(Q[1],10):300}else if(X.startsWith("throttle")){let Q=X.match(/throttle(?:\.(\d+))?/);Z.throttle=Q?.[1]?Number.parseInt(Q[1],10):300}}return Z}function $3($){let Z=[],J=0,X=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Q;while((Q=X.exec($))!==null){let[Y,G,z]=Q,q=Q.index,K=q+Y.length,W=`__stx_evt_${J++}`,U=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,V,F]=j,L=V.split("."),O=L[0];if(!o$.has(O))continue;U.push({attribute:`@${V}`,event:O,handler:F,modifiers:a$(L.slice(1)),elementId:W})}if(U.length>0)Z.push({originalTag:Y,elementId:W,events:U,startIndex:q,endIndex:K})}return Z}function DZ($){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((Q)=>`$event.key === '${Q}'`).join(" || ");Z.push(`if (!(${X})) return`)}if(J.mouse!==null){let X=e$[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 AZ($,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 h9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function MZ($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=DZ($),Q=AZ(h9($.handler),Z),Y=[];if(Z.once)Y.push("once: true");if(Z.capture)Y.push("capture: true");if(Z.passive)Y.push("passive: true");let G=Y.length>0?`, { ${Y.join(", ")} }`:"",z=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${J}');
5
5
  if (!$el) return;
@@ -108,11 +108,11 @@ else {
108
108
  }
109
109
 
110
110
  // Event listeners
111
- ${$.map(AZ).join(`
111
+ ${$.map(MZ).join(`
112
112
  `)}
113
113
  })();
114
- </script>`}function MZ($){let Z=$3($);if(Z.length===0)return{template:$,bindings:[]};let J=$,X=[];for(let Q=Z.length-1;Q>=0;Q--){let Y=Z[Q],G=Y.originalTag;if(!G.includes(" id="))G=G.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${Y.elementId}"`);else{let z=G.match(/id=["']([^"']+)["']/);if(z)for(let q of Y.events)q.elementId=z[1]}for(let z of Y.events){let q=z.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`\\s*${q}\\s*=\\s*"[^"]*"`,"g"),W=new RegExp(`\\s*${q}\\s*=\\s*'[^']*'`,"g");G=G.replace(K,""),G=G.replace(W,"")}J=J.slice(0,Y.startIndex)+G+J.slice(Y.endIndex),X.push(...Y.events)}return{template:J,bindings:X}}function Z3($,Z,J){if(t$($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:z,bindings:q}=MZ($),K=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...K,...q],z}let X=$3($);if(X.length===0)return $;let Q=$;for(let z=X.length-1;z>=0;z--){let q=X[z],K=q.originalTag;if(!K.includes(" id="))K=K.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${q.elementId}"`);else{let W=K.match(/id=["']([^"']+)["']/);if(W)for(let U of q.events)U.elementId=W[1]}for(let W of q.events){let U=W.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${U}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${U}\\s*=\\s*'[^']*'`,"g");K=K.replace(H,""),K=K.replace(j,"")}Q=Q.slice(0,q.startIndex)+K+Q.slice(q.endIndex)}let Y=u9(X.flatMap((z)=>z.events)),G=Q.lastIndexOf("</body>");if(G!==-1)Q=Q.slice(0,G)+Y+`
115
- `+Q.slice(G);else Q+=Y;return Q}function Gq($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}import zZ from"fs";import x from"path";import{createHash as IZ}from"crypto";var h2="__stx_component_client_factories";function u2($){let Z=$[h2];return Z instanceof Map?Z:null}function X3($){$[h2]=new Map}function d9($,Z){let J=u2($);if(!J)return null;let X=IZ("sha256").update(Z).digest("hex").slice(0,16),Q=J.get(X);if(Q)Q.instances++;else J.set(X,{body:Z,instances:1});return X}function Y3($,Z){let J=u2(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 Q=[];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)Q.push({start:H.index,end:H.index+H[0].length,replacement:`(${j})(${H[2]});`});H=U.exec($)}}let Y=[...J].filter(([,W])=>W.instances>1);if(Y.length===0)return J3($,Q);let z=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
114
+ </script>`}function IZ($){let Z=$3($);if(Z.length===0)return{template:$,bindings:[]};let J=$,X=[];for(let Q=Z.length-1;Q>=0;Q--){let Y=Z[Q],G=Y.originalTag;if(!G.includes(" id="))G=G.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${Y.elementId}"`);else{let z=G.match(/id=["']([^"']+)["']/);if(z)for(let q of Y.events)q.elementId=z[1]}for(let z of Y.events){let q=z.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`\\s*${q}\\s*=\\s*"[^"]*"`,"g"),W=new RegExp(`\\s*${q}\\s*=\\s*'[^']*'`,"g");G=G.replace(K,""),G=G.replace(W,"")}J=J.slice(0,Y.startIndex)+G+J.slice(Y.endIndex),X.push(...Y.events)}return{template:J,bindings:X}}function Z3($,Z,J){if(t$($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:z,bindings:q}=IZ($),K=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...K,...q],z}let X=$3($);if(X.length===0)return $;let Q=$;for(let z=X.length-1;z>=0;z--){let q=X[z],K=q.originalTag;if(!K.includes(" id="))K=K.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${q.elementId}"`);else{let W=K.match(/id=["']([^"']+)["']/);if(W)for(let U of q.events)U.elementId=W[1]}for(let W of q.events){let U=W.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${U}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${U}\\s*=\\s*'[^']*'`,"g");K=K.replace(H,""),K=K.replace(j,"")}Q=Q.slice(0,q.startIndex)+K+Q.slice(q.endIndex)}let Y=u9(X.flatMap((z)=>z.events)),G=Q.lastIndexOf("</body>");if(G!==-1)Q=Q.slice(0,G)+Y+`
115
+ `+Q.slice(G);else Q+=Y;return Q}function zq($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}import zZ from"fs";import x from"path";import{createHash as kZ}from"crypto";var h2="__stx_component_client_factories";function u2($){let Z=$[h2];return Z instanceof Map?Z:null}function X3($){$[h2]=new Map}function d9($,Z){let J=u2($);if(!J)return null;let X=kZ("sha256").update(Z).digest("hex").slice(0,16),Q=J.get(X);if(Q)Q.instances++;else J.set(X,{body:Z,instances:1});return X}function Y3($,Z){let J=u2(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 Q=[];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)Q.push({start:H.index,end:H.index+H[0].length,replacement:`(${j})(${H[2]});`});H=U.exec($)}}let Y=[...J].filter(([,W])=>W.instances>1);if(Y.length===0)return J3($,Q);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
  ${Y.map(([W,U])=>` try { factories[${JSON.stringify(W)}] = factories[${JSON.stringify(W)}] || ${U.body}; }
@@ -120,8 +120,8 @@ ${Y.map(([W,U])=>` try { factories[${JSON.stringify(W)}] = factories[${JSON.str
120
120
  `)}
121
121
  })();
122
122
  </script>`,q=$.search(/<script\b(?=[^>]*\bdata-stx-scoped\b)/i),K=q<0?0:q;return Q.push({start:K,end:K,replacement:`${z}
123
- `}),J3($,Q)}function J3($,Z){if(Z.length===0)return $;Z.sort((Y,G)=>Y.start-G.start||Y.end-G.end);let J=Array(Z.length*2+1),X=0,Q=0;for(let Y of Z)J[Q++]=$.slice(X,Y.start),J[Q++]=Y.replacement,X=Y.end;return J[Q]=$.slice(X),J.join("")}function Q3($){let Z=u2($),J=new Map;if(Z)for(let[X,Q]of Z)J.set(X,Q.instances);return J}function G3($,Z){let J=u2($);if(!J)return[];let X=[];for(let[Q,Y]of J){let G=Y.instances-(Z.get(Q)??0);if(G>0)X.push({body:Y.body,count:G})}return X}function z3($,Z){for(let{body:J,count:X}of Z)for(let Q=0;Q<X;Q++)d9($,J)}import K3 from"fs";var q3=0,d2=new Map;function Wq(){q3=0,d2.clear()}function m2($,Z){let J=q3++,X=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return d2.set(X,{type:$,expression:Z}),X}function Uq(){let $={};for(let[Z,J]of d2)$[Z]={type:J.type,expression:J.expression};return $}function Hq($){let Z={},J=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=J.exec($))!==null){let Q=X[0],Y=X[1].toLowerCase(),G=d2.get(Q);Z[Q]={type:Y,expression:G?.expression||""}}return Z}function jq($,Z){let J=$;for(let[X,Q]of Z)J=J.split(X).join(Q);return J}function Bq($){return $.includes("<!--__STX_")}var G2={},W3=new Map;function kZ($){let Z=W3.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),W3.set($,Z)}return Z.lastIndex=0,Z}var c2={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 V3(String($))},translate:($,Z,J={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,Q=Z.__i18nConfig?.fallbackToKey??!0,Y=String($).split("."),G=X;for(let q of Y){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Q?$:"";let z=String(G);return Object.entries(J).forEach(([q,K])=>{z=z.replace(kZ(q),String(K))}),z},t:($,Z,J={})=>{return c2.translate($,Z,J)},truncate:($,Z,J=50,X="...")=>{if($===void 0||$===null)return"";let Q=String($);if(Q.length<=J)return Q;if(J<=X.length)return X.substring(0,J);return Q.substring(0,J-X.length)+X},date:($,Z,J="short",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=$ instanceof Date?$:new Date($);if(Number.isNaN(Q.getTime()))return String($);let Y={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 Q.toISOString();return new Intl.DateTimeFormat(X,Y[J]||Y.short).format(Q)}catch{return String($)}},currency:($,Z,J="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=Number($);if(Number.isNaN(Q))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:J}).format(Q)}catch{return String($)}},pluralize:($,Z,J,X)=>{let Q=Number($);if(Number.isNaN(Q))return J;let Y=X||`${J}s`;return Q===1?J:Y},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 Q=J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Q,"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 Q=10**J;return Math.round(X*Q)/Q}};function TZ($,Z){if($ in c2)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);G2[$]=Z}function Aq($){for(let[Z,J]of Object.entries($))TZ(Z,J)}function EZ(){return{...c2,...G2}}function Mq(){for(let $ of Object.keys(G2))delete G2[$]}function c9($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function V3($){return c9($).replace(/\{{2,}/g,(Z)=>bZ(Z.length)).replace(/\{(?=!)/g,`&#123;${_3}`)}var _3="&#8288;";function bZ($){return Array.from({length:$},()=>"&#123;").join(_3)}function Y1($,Z){let{scripts:J}=n0($);for(let X of J){let Q=X.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);if(!Q||/\bserver\b|\bsrc\s*=/.test(Q[1]))continue;let Y=Q[2];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(Y))return!0;if(B3(Y,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 U3($,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,""),Q="",Y=!1,G=0;for(let K=0;K<X.length;K++){let W=X[K];if(!Y&&W==="`"){Y=!0,G=0;continue}if(Y){if(W==="`"&&G===0){Y=!1;continue}if(W==="$"&&X[K+1]==="{"){G++,K++,Q+=" ";continue}if(W==="}"&&G>0){G--;continue}if(G>0){Q+=W;continue}continue}Q+=W}X=Q;let z=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,q;while((q=z.exec(X))!==null){let K=q[1];if(!X.substring(0,q.index).trimEnd().endsWith(".")){if(!J.includes(K)&&!(K in Z))return!1}}return!0}function yZ($,Z){let J=Z.__stx_serverDeclared;if(!J||J.size===0)return!1;let X=g0($);for(let Q of J)if(new RegExp(`(?<![.#\\w$])${Q}(?![\\w$])`).test(X))return!0;return!1}function p9($,Z){let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let Y=v0(Q,Z);if(Y===void 0)return X;return Y===null?"":String(Y)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{let Y=Q.trim();if(/^__[A-Z_]+__$/.test(Y))return X;try{let G=v0(Q,Z);if(G===void 0)return X;return JSON.stringify(G).replace(/</g,"\\u003c")}catch{return X}}),J}function CZ($,Z){if(!$.includes("{"))return $;let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let Y=v0(Q,Z);if(Y===void 0)return X;return Y===null?"":String(Y)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{let Y=Q.trim();if(/^__[A-Z_]+__$/.test(Y))return X;try{let G=v0(Q,Z);if(G===void 0)return X;if(G===null)return"";return String(G).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch{return X}}),J}function Iq($,Z,J={}){let{output:X,scripts:Q}=n0($),Y=Q.map((G)=>{let z=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),q=G.match(/^<script\b[^>]*>/i),K=G.search(/<\/script\s*>$/i);if(!z||!q||K===-1)return G;let 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${CZ(W,Z)}>`;if(/\bsrc\s*=/.test(W)||/\btype\s*=\s*["']application\/json["']/.test(W))return j+U+G.slice(K);return j+p9(U,Z)+G.slice(K)});return l9(X,Y)}function V1($,Z,J){let X=$,Q=(U,H)=>{let j=l2(U,H);if(j===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(U.slice(H,j))?-1:j},Y=(U,H,j,B)=>{let V=j.length,{output:F,tokens:L}=B1(U,H,(O,_)=>B(V+_));return j.push(...L),F},G=[];X=Y(X,Q,G,(U)=>`<!--__STX_STYLE_${U}__-->`);let z=[];X=Y(X,Q2,z,(U)=>`<!--__STX_SCRIPT_EXPR_${U}__-->`);let q=Z?.__stx_signals_gate===!0||Y1($),K=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:[]);if(X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(U,H,j)=>{try{let B=v0(H,Z,!1,(V)=>m9(V,U,J,$));return B!==void 0&&B!==null?String(B):""}catch(B){let V=B instanceof Error?B.message:String(B);return _0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${V}`,J,$,j,U)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(U,H,j)=>{try{let B=v0(H,Z,!1,(V)=>m9(V,U,J,$));if(B===void 0&&Z.__stx_buildMode==="compile")return m2("raw",H.trim());return B!==void 0&&B!==null?String(B):""}catch(B){if(Z.__stx_buildMode==="compile")return m2("raw",H.trim());let V=B instanceof Error?B.message:String(B);return _0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${V}`,J,$,j,U)}}),X=Y(X,Q2,z,(U)=>`<!--__STX_SCRIPT_EXPR_${U}__-->`),X=Y(X,Q,G,(U)=>`<!--__STX_STYLE_${U}__-->`),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(U,H,j)=>{let B=H.trim();if(W.has(B))return U;let V=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],F=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,O=B.match(F)?.[1],_=O&&((O in Z)||V.includes(O)),w=Boolean(O&&K.has(O)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,N=B.match(R),A=N&&!V.includes(N[1])&&!(N[1]in Z);if(/^__[A-Z_]+__$/.test(B))return"";let k;try{let D=v0(H,Z,!1,(I)=>{k=I});if(w)return U;if(q&&!U3(B,Z))return U;if(k)m9(k,U,J,$);if(Z.__stx_buildMode==="compile"&&!q&&(D===void 0||yZ(B,Z)))return m2("expr",B);return D!==void 0&&D!==null?V3(String(D)):""}catch(D){if(w)return U;if(q&&!U3(B,Z))return U;if(A)return U;let I=D instanceof Error?D.message:String(D);return _0("Expression",`Error evaluating: {{ ${B} }}: ${I}`,J,$,j,U)}}),z.length>0)X=X.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(U,H)=>z[Number(H)]??U);if(G.length>0)X=X.replace(/<!--__STX_STYLE_(\d+)__-->/g,(U,H)=>G[Number(H)]??U);return X}function SZ($,Z,J){if(!Z.trim())return $;let X=$,Q=Z.trim();while(Q.length>0){let Y=Q.match(/^(\w+)/);if(!Y)break;let G=Y[1];Q=Q.substring(G.length).trim();let z=G2[G]||c2[G];if(!z)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(EZ()).join(", ")}`);let q=[];if(Q.startsWith(":")){let K=Q.match(/^:([^|\s]+)/);if(K){let W=K[1].trim();try{let U=Number(W);q=[Number.isNaN(U)?W:U]}catch{q=[W]}Q=Q.substring(K[0].length).trim()}}else if(Q.startsWith("(")){let K=1,W=1;while(K>0&&W<Q.length){if(Q[W]==="(")K++;if(Q[W]===")")K--;W++}if(K===0){let U=Q.substring(1,W-1).trim();if(U)try{if(U.startsWith("{")&&U.endsWith("}"))q=[v0(`(${U})`,J,!0)];else{let H=[],j="",B=null,V=0,F=0,L=0,O=!1;for(let _=0;_<U.length;_++){let w=U[_];if(O){j+=w,O=!1;continue}if(w==="\\"){j+=w,O=!0;continue}if(B){if(j+=w,w===B)B=null;continue}if(w==='"'||w==="'"||w==="`"){B=w,j+=w;continue}if(w==="(")V++;else if(w===")")V--;else if(w==="[")F++;else if(w==="]")F--;else if(w==="{")L++;else if(w==="}")L--;if(w===","&&V===0&&F===0&&L===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);q=H.map((_)=>{let w=_.trim();return v0(w,J,!0)})}}catch{q=[U]}Q=Q.substring(W).trim()}}try{X=z(X,J,...q)}catch(K){let W=K instanceof Error?K.message:String(K);throw Error(`Error applying filter '${G}': ${W}`)}if(Q.startsWith("|"))Q=Q.substring(1).trim();else break}return X}function PZ($){let Z=!1,J="",X=0,Q=0,Y=0,G=!1;for(let z=0;z<$.length;z++){let q=$[z],K=$[z+1];if(Z&&G){G=!1;continue}if(Z&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Z)Z=!0,J=q;else if(q===J)Z=!1,J="";continue}if(Z&&J==="`"&&q==="$"&&K==="{"){let 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(q==="(")X++;else if(q===")")X--;else if(q==="[")Q++;else if(q==="]")Q--;else if(q==="{")Y++;else if(q==="}")Y--;if(q==="|"&&X===0&&Q===0&&Y===0){if(K==="|"){z++;continue}if(K==="="){z++;continue}return z}}return-1}var Y2=new Set,vZ=1000;function kq(){Y2.clear()}function m9($,Z,J,X){if(!H3())return;let Q=`${J}\x00${$.expression}`;if(Y2.has(Q))return;if(Y2.size>=vZ)Y2.clear();Y2.add(Q);let Y=J,G=X;try{if(J&&K3.existsSync(J))G=K3.readFileSync(J,"utf8")}catch{}let z=G.indexOf(Z);if(z>=0)Y=`${J}:${G.slice(0,z).split(`
124
- `).length}`;console.warn(`${Y}: 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 v0($,Z,J=!1,X){try{let Q=$.trim(),Y=PZ(Q);if(Y>0){let z=Q.substring(0,Y).trim(),q=Q.substring(Y+1).trim(),K=v0(z,Z,!0,X);return SZ(K,q,Z)}let G=j3(Q);if(G!==null){X?.({expression:Q,rule:G});return}try{let z=Object.keys(Z),q=Object.values(Z);return H0(Q,z)(...q)}catch{return Z0(Q,Z)}}catch(Q){if(Q instanceof ReferenceError){let Y=/(\b\w+)\s+is not defined/.exec(Q.message);if(Y){let G=Y[1],z=fZ(G,Object.keys(Z));if(z&&z!==G)Q.message=`${Q.message} \u2014 did you mean '${z}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,Q);throw Q}}function fZ($,Z){let J=null;for(let Q of Z){if(Q===$)continue;let Y=xZ($,Q);if(J===null||Y<J.dist)J={key:Q,dist:Y}}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 xZ($,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,$],Q=Array(J.length+1),Y=Array(J.length+1);for(let G=0;G<=J.length;G++)Q[G]=G;for(let G=1;G<=X.length;G++){Y[0]=G;for(let z=1;z<=J.length;z++){let q=J[z-1]===X[G-1]?0:1;Y[z]=Math.min(Y[z-1]+1,Q[z]+1,Q[z-1]+q)}for(let z=0;z<=J.length;z++)Q[z]=Y[z]}return Q[J.length]}function Tq($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import hG from"fs";import T0 from"path";var i9=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],L3=/<body\b([^>]*)>/gi;function s0($){let Z=0,J,X=i9.map(()=>{return});while(Z<$.length){if(J===void 0||J!==null&&J.index<Z)L3.lastIndex=Z,J=L3.exec($);if(!J)return null;let Q=J.index,Y=-1,G=null;for(let q=0;q<i9.length;q++){let K=i9[q],W=X[q];if(W===void 0||W!==null&&W.index<Z)K.open.lastIndex=Z,W=K.open.exec($),X[q]=W;if(!W)continue;if(W.index<Q&&(Y===-1||W.index<Y))Y=W.index,G=K.close}if(Y===-1||!G)return{index:Q,tag:J[0],attrs:J[1]??""};G.lastIndex=Y;let z=G.exec($);if(!z)return null;Z=z.index+z[0].length}return null}function C1($,Z){let J=s0($);if(!J)return $;return $.slice(0,J.index)+Z(J.tag,J.attrs)+$.slice(J.index+J.tag.length)}var O3=/<style\b[^>]*>/iy,F3=/<\/style>/gi,w3=/<script\b[^>]*>/iy,R3=/<template(?=[\s>/])[^>]*>/iy,N3=/<\/template\s*>/iy;function z2($){let Z=0,J=0,X=-1;while(Z<$.length){let Q=$.indexOf("<",Z);if(Q===-1)return-1;if($.startsWith("<!--",Q)){let q=$.indexOf("-->",Q+4);Z=q===-1?$.length:q+3;continue}O3.lastIndex=Q;let Y=O3.exec($);if(Y){F3.lastIndex=Q+Y[0].length;let q=F3.exec($);Z=q===null?$.length:q.index+8;continue}R3.lastIndex=Q;let G=R3.exec($);if(G){if(J===0)X=Q;J++,Z=Q+G[0].length;continue}N3.lastIndex=Q;let z=N3.exec($);if(z){if(J>0)J--;Z=Q+z[0].length;continue}if(w3.lastIndex=Q,w3.test($))return J>0?X:Q;Z=Q+1}return-1}var D3=null;function gZ($){if(!D3)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return D3}function Cq($){let Z=gZ("onUpdate");if(Z)Z.updateHooks.push($)}function A3(){return`
123
+ `}),J3($,Q)}function J3($,Z){if(Z.length===0)return $;Z.sort((Y,G)=>Y.start-G.start||Y.end-G.end);let J=Array(Z.length*2+1),X=0,Q=0;for(let Y of Z)J[Q++]=$.slice(X,Y.start),J[Q++]=Y.replacement,X=Y.end;return J[Q]=$.slice(X),J.join("")}function Q3($){let Z=u2($),J=new Map;if(Z)for(let[X,Q]of Z)J.set(X,Q.instances);return J}function G3($,Z){let J=u2($);if(!J)return[];let X=[];for(let[Q,Y]of J){let G=Y.instances-(Z.get(Q)??0);if(G>0)X.push({body:Y.body,count:G})}return X}function z3($,Z){for(let{body:J,count:X}of Z)for(let Q=0;Q<X;Q++)d9($,J)}import K3 from"fs";var q3=0,d2=new Map;function Uq(){q3=0,d2.clear()}function m2($,Z){let J=q3++,X=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return d2.set(X,{type:$,expression:Z}),X}function Hq(){let $={};for(let[Z,J]of d2)$[Z]={type:J.type,expression:J.expression};return $}function jq($){let Z={},J=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=J.exec($))!==null){let Q=X[0],Y=X[1].toLowerCase(),G=d2.get(Q);Z[Q]={type:Y,expression:G?.expression||""}}return Z}function Bq($,Z){let J=$;for(let[X,Q]of Z)J=J.split(X).join(Q);return J}function Vq($){return $.includes("<!--__STX_")}var G2={},W3=new Map;function TZ($){let Z=W3.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),W3.set($,Z)}return Z.lastIndex=0,Z}var c2={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 V3(String($))},translate:($,Z,J={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,Q=Z.__i18nConfig?.fallbackToKey??!0,Y=String($).split("."),G=X;for(let q of Y){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Q?$:"";let z=String(G);return Object.entries(J).forEach(([q,K])=>{z=z.replace(TZ(q),String(K))}),z},t:($,Z,J={})=>{return c2.translate($,Z,J)},truncate:($,Z,J=50,X="...")=>{if($===void 0||$===null)return"";let Q=String($);if(Q.length<=J)return Q;if(J<=X.length)return X.substring(0,J);return Q.substring(0,J-X.length)+X},date:($,Z,J="short",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=$ instanceof Date?$:new Date($);if(Number.isNaN(Q.getTime()))return String($);let Y={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 Q.toISOString();return new Intl.DateTimeFormat(X,Y[J]||Y.short).format(Q)}catch{return String($)}},currency:($,Z,J="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let Q=Number($);if(Number.isNaN(Q))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:J}).format(Q)}catch{return String($)}},pluralize:($,Z,J,X)=>{let Q=Number($);if(Number.isNaN(Q))return J;let Y=X||`${J}s`;return Q===1?J:Y},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 Q=J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Q,"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 Q=10**J;return Math.round(X*Q)/Q}};function EZ($,Z){if($ in c2)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);G2[$]=Z}function Mq($){for(let[Z,J]of Object.entries($))EZ(Z,J)}function bZ(){return{...c2,...G2}}function Iq(){for(let $ of Object.keys(G2))delete G2[$]}function c9($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function V3($){return c9($).replace(/\{{2,}/g,(Z)=>yZ(Z.length)).replace(/\{(?=!)/g,`&#123;${_3}`)}var _3="&#8288;";function yZ($){return Array.from({length:$},()=>"&#123;").join(_3)}function Y1($,Z){let{scripts:J}=n0($);for(let X of J){let Q=X.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);if(!Q||/\bserver\b|\bsrc\s*=/.test(Q[1]))continue;let Y=Q[2];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(Y))return!0;if(B3(Y,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 U3($,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,""),Q="",Y=!1,G=0;for(let K=0;K<X.length;K++){let W=X[K];if(!Y&&W==="`"){Y=!0,G=0;continue}if(Y){if(W==="`"&&G===0){Y=!1;continue}if(W==="$"&&X[K+1]==="{"){G++,K++,Q+=" ";continue}if(W==="}"&&G>0){G--;continue}if(G>0){Q+=W;continue}continue}Q+=W}X=Q;let z=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,q;while((q=z.exec(X))!==null){let K=q[1];if(!X.substring(0,q.index).trimEnd().endsWith(".")){if(!J.includes(K)&&!(K in Z))return!1}}return!0}function CZ($,Z){let J=Z.__stx_serverDeclared;if(!J||J.size===0)return!1;let X=g0($);for(let Q of J)if(new RegExp(`(?<![.#\\w$])${Q}(?![\\w$])`).test(X))return!0;return!1}function p9($,Z){let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let Y=v0(Q,Z);if(Y===void 0)return X;return Y===null?"":String(Y)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{let Y=Q.trim();if(/^__[A-Z_]+__$/.test(Y))return X;try{let G=v0(Q,Z);if(G===void 0)return X;return JSON.stringify(G).replace(/</g,"\\u003c")}catch{return X}}),J}function SZ($,Z){if(!$.includes("{"))return $;let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Q)=>{try{let Y=v0(Q,Z);if(Y===void 0)return X;return Y===null?"":String(Y)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Q)=>{let Y=Q.trim();if(/^__[A-Z_]+__$/.test(Y))return X;try{let G=v0(Q,Z);if(G===void 0)return X;if(G===null)return"";return String(G).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch{return X}}),J}function kq($,Z,J={}){let{output:X,scripts:Q}=n0($),Y=Q.map((G)=>{let z=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),q=G.match(/^<script\b[^>]*>/i),K=G.search(/<\/script\s*>$/i);if(!z||!q||K===-1)return G;let 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${SZ(W,Z)}>`;if(/\bsrc\s*=/.test(W)||/\btype\s*=\s*["']application\/json["']/.test(W))return j+U+G.slice(K);return j+p9(U,Z)+G.slice(K)});return l9(X,Y)}function V1($,Z,J){let X=$,Q=(U,H)=>{let j=l2(U,H);if(j===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(U.slice(H,j))?-1:j},Y=(U,H,j,B)=>{let V=j.length,{output:F,tokens:L}=B1(U,H,(O,_)=>B(V+_));return j.push(...L),F},G=[];X=Y(X,Q,G,(U)=>`<!--__STX_STYLE_${U}__-->`);let z=[];X=Y(X,Q2,z,(U)=>`<!--__STX_SCRIPT_EXPR_${U}__-->`);let q=Z?.__stx_signals_gate===!0||Y1($),K=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:[]);if(X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(U,H,j)=>{try{let B=v0(H,Z,!1,(V)=>m9(V,U,J,$));return B!==void 0&&B!==null?String(B):""}catch(B){let V=B instanceof Error?B.message:String(B);return _0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${V}`,J,$,j,U)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(U,H,j)=>{try{let B=v0(H,Z,!1,(V)=>m9(V,U,J,$));if(B===void 0&&Z.__stx_buildMode==="compile")return m2("raw",H.trim());return B!==void 0&&B!==null?String(B):""}catch(B){if(Z.__stx_buildMode==="compile")return m2("raw",H.trim());let V=B instanceof Error?B.message:String(B);return _0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${V}`,J,$,j,U)}}),X=Y(X,Q2,z,(U)=>`<!--__STX_SCRIPT_EXPR_${U}__-->`),X=Y(X,Q,G,(U)=>`<!--__STX_STYLE_${U}__-->`),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(U,H,j)=>{let B=H.trim();if(W.has(B))return U;let V=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],F=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,O=B.match(F)?.[1],_=O&&((O in Z)||V.includes(O)),w=Boolean(O&&K.has(O)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,N=B.match(R),A=N&&!V.includes(N[1])&&!(N[1]in Z);if(/^__[A-Z_]+__$/.test(B))return"";let k;try{let D=v0(H,Z,!1,(I)=>{k=I});if(w)return U;if(q&&!U3(B,Z))return U;if(k)m9(k,U,J,$);if(Z.__stx_buildMode==="compile"&&!q&&(D===void 0||CZ(B,Z)))return m2("expr",B);return D!==void 0&&D!==null?V3(String(D)):""}catch(D){if(w)return U;if(q&&!U3(B,Z))return U;if(A)return U;let I=D instanceof Error?D.message:String(D);return _0("Expression",`Error evaluating: {{ ${B} }}: ${I}`,J,$,j,U)}}),z.length>0)X=X.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(U,H)=>z[Number(H)]??U);if(G.length>0)X=X.replace(/<!--__STX_STYLE_(\d+)__-->/g,(U,H)=>G[Number(H)]??U);return X}function PZ($,Z,J){if(!Z.trim())return $;let X=$,Q=Z.trim();while(Q.length>0){let Y=Q.match(/^(\w+)/);if(!Y)break;let G=Y[1];Q=Q.substring(G.length).trim();let z=G2[G]||c2[G];if(!z)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(bZ()).join(", ")}`);let q=[];if(Q.startsWith(":")){let K=Q.match(/^:([^|\s]+)/);if(K){let W=K[1].trim();try{let U=Number(W);q=[Number.isNaN(U)?W:U]}catch{q=[W]}Q=Q.substring(K[0].length).trim()}}else if(Q.startsWith("(")){let K=1,W=1;while(K>0&&W<Q.length){if(Q[W]==="(")K++;if(Q[W]===")")K--;W++}if(K===0){let U=Q.substring(1,W-1).trim();if(U)try{if(U.startsWith("{")&&U.endsWith("}"))q=[v0(`(${U})`,J,!0)];else{let H=[],j="",B=null,V=0,F=0,L=0,O=!1;for(let _=0;_<U.length;_++){let w=U[_];if(O){j+=w,O=!1;continue}if(w==="\\"){j+=w,O=!0;continue}if(B){if(j+=w,w===B)B=null;continue}if(w==='"'||w==="'"||w==="`"){B=w,j+=w;continue}if(w==="(")V++;else if(w===")")V--;else if(w==="[")F++;else if(w==="]")F--;else if(w==="{")L++;else if(w==="}")L--;if(w===","&&V===0&&F===0&&L===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);q=H.map((_)=>{let w=_.trim();return v0(w,J,!0)})}}catch{q=[U]}Q=Q.substring(W).trim()}}try{X=z(X,J,...q)}catch(K){let W=K instanceof Error?K.message:String(K);throw Error(`Error applying filter '${G}': ${W}`)}if(Q.startsWith("|"))Q=Q.substring(1).trim();else break}return X}function vZ($){let Z=!1,J="",X=0,Q=0,Y=0,G=!1;for(let z=0;z<$.length;z++){let q=$[z],K=$[z+1];if(Z&&G){G=!1;continue}if(Z&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Z)Z=!0,J=q;else if(q===J)Z=!1,J="";continue}if(Z&&J==="`"&&q==="$"&&K==="{"){let 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(q==="(")X++;else if(q===")")X--;else if(q==="[")Q++;else if(q==="]")Q--;else if(q==="{")Y++;else if(q==="}")Y--;if(q==="|"&&X===0&&Q===0&&Y===0){if(K==="|"){z++;continue}if(K==="="){z++;continue}return z}}return-1}var Y2=new Set,fZ=1000;function Tq(){Y2.clear()}function m9($,Z,J,X){if(!H3())return;let Q=`${J}\x00${$.expression}`;if(Y2.has(Q))return;if(Y2.size>=fZ)Y2.clear();Y2.add(Q);let Y=J,G=X;try{if(J&&K3.existsSync(J))G=K3.readFileSync(J,"utf8")}catch{}let z=G.indexOf(Z);if(z>=0)Y=`${J}:${G.slice(0,z).split(`
124
+ `).length}`;console.warn(`${Y}: 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 v0($,Z,J=!1,X){try{let Q=$.trim(),Y=vZ(Q);if(Y>0){let z=Q.substring(0,Y).trim(),q=Q.substring(Y+1).trim(),K=v0(z,Z,!0,X);return PZ(K,q,Z)}let G=j3(Q);if(G!==null){X?.({expression:Q,rule:G});return}try{let z=Object.keys(Z),q=Object.values(Z);return H0(Q,z)(...q)}catch{return Z0(Q,Z)}}catch(Q){if(Q instanceof ReferenceError){let Y=/(\b\w+)\s+is not defined/.exec(Q.message);if(Y){let G=Y[1],z=xZ(G,Object.keys(Z));if(z&&z!==G)Q.message=`${Q.message} \u2014 did you mean '${z}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,Q);throw Q}}function xZ($,Z){let J=null;for(let Q of Z){if(Q===$)continue;let Y=gZ($,Q);if(J===null||Y<J.dist)J={key:Q,dist:Y}}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 gZ($,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,$],Q=Array(J.length+1),Y=Array(J.length+1);for(let G=0;G<=J.length;G++)Q[G]=G;for(let G=1;G<=X.length;G++){Y[0]=G;for(let z=1;z<=J.length;z++){let q=J[z-1]===X[G-1]?0:1;Y[z]=Math.min(Y[z-1]+1,Q[z]+1,Q[z-1]+q)}for(let z=0;z<=J.length;z++)Q[z]=Y[z]}return Q[J.length]}function Eq($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import uG from"fs";import T0 from"path";var i9=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],L3=/<body\b([^>]*)>/gi;function s0($){let Z=0,J,X=i9.map(()=>{return});while(Z<$.length){if(J===void 0||J!==null&&J.index<Z)L3.lastIndex=Z,J=L3.exec($);if(!J)return null;let Q=J.index,Y=-1,G=null;for(let q=0;q<i9.length;q++){let K=i9[q],W=X[q];if(W===void 0||W!==null&&W.index<Z)K.open.lastIndex=Z,W=K.open.exec($),X[q]=W;if(!W)continue;if(W.index<Q&&(Y===-1||W.index<Y))Y=W.index,G=K.close}if(Y===-1||!G)return{index:Q,tag:J[0],attrs:J[1]??""};G.lastIndex=Y;let z=G.exec($);if(!z)return null;Z=z.index+z[0].length}return null}function C1($,Z){let J=s0($);if(!J)return $;return $.slice(0,J.index)+Z(J.tag,J.attrs)+$.slice(J.index+J.tag.length)}var O3=/<style\b[^>]*>/iy,F3=/<\/style>/gi,w3=/<script\b[^>]*>/iy,R3=/<template(?=[\s>/])[^>]*>/iy,N3=/<\/template\s*>/iy;function z2($){let Z=0,J=0,X=-1;while(Z<$.length){let Q=$.indexOf("<",Z);if(Q===-1)return-1;if($.startsWith("<!--",Q)){let q=$.indexOf("-->",Q+4);Z=q===-1?$.length:q+3;continue}O3.lastIndex=Q;let Y=O3.exec($);if(Y){F3.lastIndex=Q+Y[0].length;let q=F3.exec($);Z=q===null?$.length:q.index+8;continue}R3.lastIndex=Q;let G=R3.exec($);if(G){if(J===0)X=Q;J++,Z=Q+G[0].length;continue}N3.lastIndex=Q;let z=N3.exec($);if(z){if(J>0)J--;Z=Q+z[0].length;continue}if(w3.lastIndex=Q,w3.test($))return J>0?X:Q;Z=Q+1}return-1}var D3=null;function hZ($){if(!D3)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return D3}function Sq($){let Z=hZ("onUpdate");if(Z)Z.updateHooks.push($)}function A3(){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 n9($){return Symbol($)}var Sq=n9("theme"),Pq=n9("router"),vq=n9("i18n");import*as I3 from"crypto";function M3($){let Z=/\$(\w+)\./g,J=[],X;while((X=Z.exec($))!==null)if(!J.includes(X[1]))J.push(X[1]);return J}function hZ(){return`stx-${I3.randomBytes(4).toString("hex")}`}function uZ($){return/\$\w+\./.test($)}function dZ($){if(!$.includes("{{")||!/\$\w+\./.test($))return{html:$,bindings:[],stores:new Set};let Z=[],J=new Set,X=/<(\w+)([^>]*?)(\s*\/?>)/g,Q=$;return Q=Q.replace(X,(Y,G,z,q)=>{if(["script","style","template"].includes(G.toLowerCase()))return Y;let K=[],W=!1,U=z,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...z.matchAll(H)];for(let F of j){let L=F[0],O=F[1],_=F[2];if(uZ(_)){W=!0;let w=_.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(K.push({attr:O,expr:R,fullMatch:L,originalAttr:O}),M3(R).forEach((A)=>J.add(A)),O==="text")U=U.replace(L,"");else if(O==="class")U=U.replace(L,'class=""');else if(O==="disabled"||O==="hidden")U=U.replace(L,"");else U=U.replace(L,`${O}=""`)}}}if(!W)return Y;let B=U.match(/\bid\s*=\s*"([^"]+)"/),V;if(B)V=B[1];else V=hZ(),U=` id="${V}"${U}`;for(let F of K)Z.push({elementId:V,attribute:F.attr,expression:F.expr,stores:M3(F.expr)});return`<${G}${U}${q}`}),{html:Q,bindings:Z,stores:J}}function mZ($,Z){if($.length===0)return"";let J=Array.from(Z),X=`
472
+ `}function n9($){return Symbol($)}var Pq=n9("theme"),vq=n9("router"),fq=n9("i18n");import*as I3 from"crypto";function M3($){let Z=/\$(\w+)\./g,J=[],X;while((X=Z.exec($))!==null)if(!J.includes(X[1]))J.push(X[1]);return J}function uZ(){return`stx-${I3.randomBytes(4).toString("hex")}`}function dZ($){return/\$\w+\./.test($)}function mZ($){if(!$.includes("{{")||!/\$\w+\./.test($))return{html:$,bindings:[],stores:new Set};let Z=[],J=new Set,X=/<(\w+)([^>]*?)(\s*\/?>)/g,Q=$;return Q=Q.replace(X,(Y,G,z,q)=>{if(["script","style","template"].includes(G.toLowerCase()))return Y;let K=[],W=!1,U=z,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...z.matchAll(H)];for(let F of j){let L=F[0],O=F[1],_=F[2];if(dZ(_)){W=!0;let w=_.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(K.push({attr:O,expr:R,fullMatch:L,originalAttr:O}),M3(R).forEach((A)=>J.add(A)),O==="text")U=U.replace(L,"");else if(O==="class")U=U.replace(L,'class=""');else if(O==="disabled"||O==="hidden")U=U.replace(L,"");else U=U.replace(L,`${O}=""`)}}}if(!W)return Y;let B=U.match(/\bid\s*=\s*"([^"]+)"/),V;if(B)V=B[1];else V=uZ(),U=` id="${V}"${U}`;for(let F of K)Z.push({elementId:V,attribute:F.attr,expression:F.expr,stores:M3(F.expr)});return`<${G}${U}${q}`}),{html:Q,bindings:Z,stores:J}}function lZ($,Z){if($.length===0)return"";let J=Array.from(Z),X=`
473
473
  <script>
474
474
  (function() {
475
475
  'use strict';
@@ -627,10 +627,10 @@ else {
627
627
  }
628
628
  })();
629
629
  </script>
630
- `,X}function k3($){let{html:Z,bindings:J,stores:X}=dZ($);if(J.length===0)return $;let Q=mZ(J,X),Y=Z.lastIndexOf("</body>");if(Y!==-1)return Z.slice(0,Y)+Q+Z.slice(Y);return Z+Q}function T3($){let Z=$.analytics;if(!Z?.enabled)return"";switch(Z.driver){case"fathom":return lZ(Z);case"google-analytics":return cZ(Z);case"plausible":return pZ(Z);case"self-hosted":return iZ(Z);case"custom":return nZ(Z);default:return""}}function lZ($){let Z=$.fathom;if(!Z?.siteId)return"";let J=Z.scriptUrl||"https://cdn.usefathom.com/script.js",X=Z.defer!==!1?" defer":"",Q=[`data-site="${f0(Z.siteId)}"`];if(Z.honorDnt)Q.push('data-honor-dnt="true"');if(Z.spa)Q.push('data-spa="auto"');if(Z.canonical)Q.push(`data-canonical="${f0(Z.canonical)}"`);if(Z.auto===!1)Q.push('data-auto="false"');return`
630
+ `,X}function k3($){let{html:Z,bindings:J,stores:X}=mZ($);if(J.length===0)return $;let Q=lZ(J,X),Y=Z.lastIndexOf("</body>");if(Y!==-1)return Z.slice(0,Y)+Q+Z.slice(Y);return Z+Q}function T3($){let Z=$.analytics;if(!Z?.enabled)return"";switch(Z.driver){case"fathom":return cZ(Z);case"google-analytics":return pZ(Z);case"plausible":return iZ(Z);case"self-hosted":return nZ(Z);case"custom":return sZ(Z);default:return""}}function cZ($){let Z=$.fathom;if(!Z?.siteId)return"";let J=Z.scriptUrl||"https://cdn.usefathom.com/script.js",X=Z.defer!==!1?" defer":"",Q=[`data-site="${f0(Z.siteId)}"`];if(Z.honorDnt)Q.push('data-honor-dnt="true"');if(Z.spa)Q.push('data-spa="auto"');if(Z.canonical)Q.push(`data-canonical="${f0(Z.canonical)}"`);if(Z.auto===!1)Q.push('data-auto="false"');return`
631
631
  <!-- Fathom Analytics -->
632
632
  <script src="${f0(J)}" ${Q.join(" ")}${X}></script>
633
- `}function cZ($){let Z=$.googleAnalytics;if(!Z?.measurementId)return"";let J=f0(Z.measurementId),X=Z.debug?`gtag('config', '${J}', { 'debug_mode': true });`:"";return`
633
+ `}function pZ($){let Z=$.googleAnalytics;if(!Z?.measurementId)return"";let J=f0(Z.measurementId),X=Z.debug?`gtag('config', '${J}', { 'debug_mode': true });`:"";return`
634
634
  <!-- Google Analytics -->
635
635
  <script async src="https://www.googletagmanager.com/gtag/js?id=${J}"></script>
636
636
  <script>
@@ -640,10 +640,10 @@ else {
640
640
  gtag('config', '${J}');
641
641
  ${X}
642
642
  </script>
643
- `}function pZ($){let Z=$.plausible;if(!Z?.domain)return"";let J=Z.scriptUrl||"https://plausible.io/js/script.js",X=[`data-domain="${f0(Z.domain)}"`],Q=J,Y=[];if(Z.trackLocalhost)Y.push("local");if(Z.hashMode)Y.push("hash");if(Y.length>0&&J==="https://plausible.io/js/script.js")Q=`https://plausible.io/js/script.${Y.join(".")}.js`;return`
643
+ `}function iZ($){let Z=$.plausible;if(!Z?.domain)return"";let J=Z.scriptUrl||"https://plausible.io/js/script.js",X=[`data-domain="${f0(Z.domain)}"`],Q=J,Y=[];if(Z.trackLocalhost)Y.push("local");if(Z.hashMode)Y.push("hash");if(Y.length>0&&J==="https://plausible.io/js/script.js")Q=`https://plausible.io/js/script.${Y.join(".")}.js`;return`
644
644
  <!-- Plausible Analytics -->
645
645
  <script defer data-domain="${f0(Z.domain)}" src="${f0(Q)}"></script>
646
- `}function iZ($){let Z=$.selfHosted;if(!Z?.siteId||!Z?.apiEndpoint)return"";let J=f0(Z.siteId),X=f0(Z.apiEndpoint),Q=Z.honorDnt?'if(n.doNotTrack==="1")return;':"",Y=Z.trackHashChanges?"w.addEventListener('hashchange',pv);":"",G=Z.trackOutboundLinks?`
646
+ `}function nZ($){let Z=$.selfHosted;if(!Z?.siteId||!Z?.apiEndpoint)return"";let J=f0(Z.siteId),X=f0(Z.apiEndpoint),Q=Z.honorDnt?'if(n.doNotTrack==="1")return;':"",Y=Z.trackHashChanges?"w.addEventListener('hashchange',pv);":"",G=Z.trackOutboundLinks?`
647
647
  d.addEventListener('click',function(e){
648
648
  var a=e.target.closest('a');
649
649
  if(a&&a.hostname!==location.hostname){
@@ -676,7 +676,7 @@ else {
676
676
  w.stxAnalytics={track:function(n,v){t('event',{name:n,value:v});}};
677
677
  })();
678
678
  </script>
679
- `}function nZ($){let Z=$.custom;if(!Z)return"";if(Z.inlineScript)return`
679
+ `}function sZ($){let Z=$.custom;if(!Z)return"";if(Z.inlineScript)return`
680
680
  <!-- Custom Analytics -->
681
681
  <script>
682
682
  ${Z.inlineScript}
@@ -684,7 +684,7 @@ ${Z.inlineScript}
684
684
  `;if(!Z.scriptUrl)return"";let J=[];if(Z.scriptId)J.push(`id="${f0(Z.scriptId)}"`);if(Z.attributes)for(let[Q,Y]of Object.entries(Z.attributes))J.push(`${f0(Q)}="${f0(Y)}"`);return`
685
685
  <!-- Custom Analytics -->
686
686
  <script${J.length>0?` ${J.join(" ")}`:""} src="${f0(Z.scriptUrl)}" defer></script>
687
- `}function E3($,Z){let J=T3(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 f0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var gq={name:"analytics",hasEndTag:!1,handler:async($,Z,J,X)=>{let Q=J.__stx_config||{};return T3(Q)}};var sZ={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 b3($){let Z=$.heatmap;if(!Z?.enabled)return"";let J={...sZ,...Z};return`
687
+ `}function E3($,Z){let J=T3(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 f0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var hq={name:"analytics",hasEndTag:!1,handler:async($,Z,J,X)=>{let Q=J.__stx_config||{};return T3(Q)}};var oZ={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 b3($){let Z=$.heatmap;if(!Z?.enabled)return"";let J={...oZ,...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 y3($,Z){let J=b3(Z);if(!J)return $;let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}var C3={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async($,Z,J,X)=>{let Q=J.__stx_config||{};if(Z.length>0){let Y=oZ(Z.join(" "));Q.heatmap={...Q.heatmap,...Y,enabled:!0}}return b3(Q)}};function oZ($){let Z={},J=$.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let X of J){let[Q,Y]=X.split("="),G=Y?.replace(/["']/g,"");switch(Q){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 S3{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,Q])=>({depth:X,count:Q})).sort((X,Q)=>X.depth-Q.depth)}getZoneStats($){let Z=new Map,J=this.getPageData($);for(let X of J)if(X.zone){let Q=Z.get(X.zone)||{clicks:0,hovers:0};if(X.type==="click")Q.clicks++;else if(X.type==="move")Q.hovers++;Z.set(X.zone,Q)}return Z}generateGridData($,Z=20){let J=this.getPageData($),X=[];for(let Y=0;Y<Z;Y++){X[Y]=[];for(let G=0;G<Z;G++)X[Y][G]=0}for(let Y of J){let G=Math.min(Math.floor(Y.x/100*Z),Z-1),z=Math.min(Math.floor(Y.y/100*Z),Z-1);X[z][G]+=Y.type==="click"?3:1}let Q=0;for(let Y of X)for(let G of Y)Q=Math.max(Q,G);return X.map((Y,G)=>Y.map((z,q)=>({x:q,y:G,intensity:Q>0?z/Q: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 uq(){return new S3}var rZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(rZ||={});var aZ;((X)=>{X.In="in";X.Out="out";X.Both="both"})(aZ||={});var tZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(tZ||={});var e0={duration:300,delay:0,ease:"ease",direction:"both"};function eZ($,Z={}){let{duration:J,delay:X,ease:Q,direction:Y,custom:G}={...e0,...Z};if($==="custom"&&G)return G;switch($){case"fade":return`${Y==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Y==="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 y3($,Z){let J=b3(Z);if(!J)return $;let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}var C3={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async($,Z,J,X)=>{let Q=J.__stx_config||{};if(Z.length>0){let Y=rZ(Z.join(" "));Q.heatmap={...Q.heatmap,...Y,enabled:!0}}return b3(Q)}};function rZ($){let Z={},J=$.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let X of J){let[Q,Y]=X.split("="),G=Y?.replace(/["']/g,"");switch(Q){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 S3{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,Q])=>({depth:X,count:Q})).sort((X,Q)=>X.depth-Q.depth)}getZoneStats($){let Z=new Map,J=this.getPageData($);for(let X of J)if(X.zone){let Q=Z.get(X.zone)||{clicks:0,hovers:0};if(X.type==="click")Q.clicks++;else if(X.type==="move")Q.hovers++;Z.set(X.zone,Q)}return Z}generateGridData($,Z=20){let J=this.getPageData($),X=[];for(let Y=0;Y<Z;Y++){X[Y]=[];for(let G=0;G<Z;G++)X[Y][G]=0}for(let Y of J){let G=Math.min(Math.floor(Y.x/100*Z),Z-1),z=Math.min(Math.floor(Y.y/100*Z),Z-1);X[z][G]+=Y.type==="click"?3:1}let Q=0;for(let Y of X)for(let G of Y)Q=Math.max(Q,G);return X.map((Y,G)=>Y.map((z,q)=>({x:q,y:G,intensity:Q>0?z/Q: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 dq(){return new S3}var aZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(aZ||={});var tZ;((X)=>{X.In="in";X.Out="out";X.Both="both"})(tZ||={});var eZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(eZ||={});var e0={duration:300,delay:0,ease:"ease",direction:"both"};function $J($,Z={}){let{duration:J,delay:X,ease:Q,direction:Y,custom:G}={...e0,...Z};if($==="custom"&&G)return G;switch($){case"fade":return`${Y==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Y==="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`${Y==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Y==="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; } }
@@ -1077,7 +1077,7 @@ else {
1077
1077
  @keyframes flipIn { from { transform: perspective(400px) rotateX(-90deg); opacity: 0; } to { transform: perspective(400px) rotateX(0); opacity: 1; } }
1078
1078
  @keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${Y==="in"?"transform: rotate(-90deg); opacity: 0; animation: rotateIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Y==="out"?"transform: rotate(0); opacity: 1; animation: rotateOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: rotate(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
1079
1079
  @keyframes rotateIn { from { transform: rotate(-90deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
1080
- @keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function $J(){return`
1080
+ @keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function ZJ(){return`
1081
1081
  <script data-stx-scoped data-stx-run="once">
1082
1082
  // Motion preferences handling
1083
1083
  (function() {
@@ -1105,7 +1105,7 @@ else {
1105
1105
  });
1106
1106
  })();
1107
1107
  </script>
1108
- `}function ZJ($){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((J)=>J.test($))}function JJ($=0.1,Z="0px"){return`
1108
+ `}function JJ($){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((J)=>J.test($))}function XJ($=0.1,Z="0px"){return`
1109
1109
  <script data-stx-scoped data-stx-run="always">
1110
1110
  // Intersection Observer for scroll animations
1111
1111
  (function() {
@@ -1148,7 +1148,7 @@ else {
1148
1148
  }
1149
1149
  })();
1150
1150
  </script>
1151
- `}function XJ(){return`
1151
+ `}function YJ(){return`
1152
1152
  <style id="stx-animation-base">
1153
1153
  :root {
1154
1154
  --stx-transition-duration: 300ms;
@@ -1263,7 +1263,7 @@ else {
1263
1263
  transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
1264
1264
  }
1265
1265
  </style>
1266
- `}function YJ($,Z,J={}){let{staggerDelay:X=50,sequence:Q=!1}=J;return`
1266
+ `}function QJ($,Z,J={}){let{staggerDelay:X=50,sequence:Q=!1}=J;return`
1267
1267
  <script data-stx-scoped data-stx-run="always">
1268
1268
  // Animation Group: ${$}
1269
1269
  (function() {
@@ -1300,21 +1300,21 @@ else {
1300
1300
  }
1301
1301
  })();
1302
1302
  </script>
1303
- `}var s9={name:"transition",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${$}`;let Q=Z[0],Y=Z.length>1?Number.parseInt(Z[1],10)||e0.duration:e0.duration,G=Z.length>2?Z[2]||e0.ease:e0.ease,z=Z.length>3?Number.parseInt(Z[3],10)||e0.delay:e0.delay,q=Z.length>4?Z[4]||e0.direction:e0.direction,K=`stx-transition-${Math.random().toString(36).substr(2,9)}`,W=eZ(Q,{duration:Y,delay:z,ease:G,direction:q}),U="stx-transition",H="";if(Q==="fade")H="stx-fade";else if(Q==="slide")H="stx-slide";else if(Q==="scale")H="stx-scale";else if(Q==="flip")H="stx-flip";else if(Q==="rotate")H="stx-rotate";return`<div id="${K}" class="${U} ${H} ${q==="out"?"stx-out":""}"
1304
- style="--stx-transition-duration: ${Y}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${z}ms;">${$}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},o9={name:"scrollAnimate",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${$}`;let Q=Z[0],Y=Z.length>1?Number.parseInt(Z[1],10)||300:300,G=Z.length>2?Z[2]||"ease":"ease",z=Z.length>3?Number.parseFloat(Z[3])||0.2:0.2,q=Z.length>4?Number.parseInt(Z[4],10)||0:0,K=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,W=`--stx-transition-duration: ${Y}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${q}ms; will-change: opacity, transform;`,U="stx-transition stx-observe stx-out";if(Q==="fade")U+=" stx-fade";else if(Q==="slide-up"||Q==="slide")U+=" stx-from-bottom";else if(Q==="slide-down")U+=" stx-from-top";else if(Q==="slide-left")U+=" stx-from-right";else if(Q==="slide-right")U+=" stx-from-left";else if(Q==="scale")U+=" stx-scale";else if(Q.includes("-"))U+=` stx-${Q}`;else U+=` stx-${Q}`;return`<div id="${K}" class="${U}" style="${W}" data-threshold="${z}">${$}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},r9={name:"animationGroup",handler:($,Z,J,X)=>{if(Z.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${$}`;let Q=Z[0],Y=Z.slice(1).map((K)=>K.startsWith("#")||K.startsWith(".")?K:`#${K}`),G=J.staggerDelay||50,z=J.sequence||!0,q=YJ(Q,Y,{staggerDelay:G,sequence:z});return`${$}
1305
- ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},a9={name:"motion",handler:($,Z,J,X)=>{let Q=Z.length>0?Z[0].toLowerCase()==="true":!0,Y=$J();return`<div data-animate="${Q?"auto":"true"}">${$}</div>${Y}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function v3($,Z,J,X){let Q=$;if(X.animation?.enabled===!1)return Q;let Y=J.includes("test")&&J.includes("animation");if(!ZJ(Q)&&!Y)return Q;if(!Q.includes('<style id="stx-animation-base">')){let z=XJ();Q=Q.replace("</head>",`${z}
1306
- </head>`)}if(Q.includes("stx-observe")){if(!Q.includes("Intersection Observer for scroll animations")){let q=JJ(),K=Q.lastIndexOf("</body>");if(K!==-1)Q=Q.slice(0,K)+q+`
1307
- `+Q.slice(K)}}return Q}var P3={default:{stiffness:100,damping:10,mass:1},gentle:{stiffness:120,damping:14,mass:1},wobbly:{stiffness:180,damping:12,mass:1},stiff:{stiffness:210,damping:20,mass:1},slow:{stiffness:280,damping:60,mass:1},molasses:{stiffness:280,damping:120,mass:1}};function QJ($,Z){let J=Z.map((X)=>{let Q=X.offset!==void 0?`${X.offset*100}%`:"from",Y=Object.entries(X.properties).map(([G,z])=>`${G}: ${z}`).join("; ");return`${Q} { ${Y} }`}).join(`
1303
+ `}var s9={name:"transition",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${$}`;let Q=Z[0],Y=Z.length>1?Number.parseInt(Z[1],10)||e0.duration:e0.duration,G=Z.length>2?Z[2]||e0.ease:e0.ease,z=Z.length>3?Number.parseInt(Z[3],10)||e0.delay:e0.delay,q=Z.length>4?Z[4]||e0.direction:e0.direction,K=`stx-transition-${Math.random().toString(36).substr(2,9)}`,W=$J(Q,{duration:Y,delay:z,ease:G,direction:q}),U="stx-transition",H="";if(Q==="fade")H="stx-fade";else if(Q==="slide")H="stx-slide";else if(Q==="scale")H="stx-scale";else if(Q==="flip")H="stx-flip";else if(Q==="rotate")H="stx-rotate";return`<div id="${K}" class="${U} ${H} ${q==="out"?"stx-out":""}"
1304
+ style="--stx-transition-duration: ${Y}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${z}ms;">${$}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},o9={name:"scrollAnimate",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${$}`;let Q=Z[0],Y=Z.length>1?Number.parseInt(Z[1],10)||300:300,G=Z.length>2?Z[2]||"ease":"ease",z=Z.length>3?Number.parseFloat(Z[3])||0.2:0.2,q=Z.length>4?Number.parseInt(Z[4],10)||0:0,K=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,W=`--stx-transition-duration: ${Y}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${q}ms; will-change: opacity, transform;`,U="stx-transition stx-observe stx-out";if(Q==="fade")U+=" stx-fade";else if(Q==="slide-up"||Q==="slide")U+=" stx-from-bottom";else if(Q==="slide-down")U+=" stx-from-top";else if(Q==="slide-left")U+=" stx-from-right";else if(Q==="slide-right")U+=" stx-from-left";else if(Q==="scale")U+=" stx-scale";else if(Q.includes("-"))U+=` stx-${Q}`;else U+=` stx-${Q}`;return`<div id="${K}" class="${U}" style="${W}" data-threshold="${z}">${$}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},r9={name:"animationGroup",handler:($,Z,J,X)=>{if(Z.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${$}`;let Q=Z[0],Y=Z.slice(1).map((K)=>K.startsWith("#")||K.startsWith(".")?K:`#${K}`),G=J.staggerDelay||50,z=J.sequence||!0,q=QJ(Q,Y,{staggerDelay:G,sequence:z});return`${$}
1305
+ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},a9={name:"motion",handler:($,Z,J,X)=>{let Q=Z.length>0?Z[0].toLowerCase()==="true":!0,Y=ZJ();return`<div data-animate="${Q?"auto":"true"}">${$}</div>${Y}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function v3($,Z,J,X){let Q=$;if(X.animation?.enabled===!1)return Q;let Y=J.includes("test")&&J.includes("animation");if(!JJ(Q)&&!Y)return Q;if(!Q.includes('<style id="stx-animation-base">')){let z=YJ();Q=Q.replace("</head>",`${z}
1306
+ </head>`)}if(Q.includes("stx-observe")){if(!Q.includes("Intersection Observer for scroll animations")){let q=XJ(),K=Q.lastIndexOf("</body>");if(K!==-1)Q=Q.slice(0,K)+q+`
1307
+ `+Q.slice(K)}}return Q}var P3={default:{stiffness:100,damping:10,mass:1},gentle:{stiffness:120,damping:14,mass:1},wobbly:{stiffness:180,damping:12,mass:1},stiff:{stiffness:210,damping:20,mass:1},slow:{stiffness:280,damping:60,mass:1},molasses:{stiffness:280,damping:120,mass:1}};function GJ($,Z){let J=Z.map((X)=>{let Q=X.offset!==void 0?`${X.offset*100}%`:"from",Y=Object.entries(X.properties).map(([G,z])=>`${G}: ${z}`).join("; ");return`${Q} { ${Y} }`}).join(`
1308
1308
  `);return`@keyframes ${$} {
1309
1309
  ${J}
1310
- }`}var GJ={name:"keyframe",hasEndTag:!0,handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@keyframe requires an animation name</div>${$}`;let Q=Z[0].replace(/['"`]/g,""),Y=Z[1]?Number.parseInt(Z[1],10):1000,G=Z[2]?.replace(/['"`]/g,"")||"ease",z=Z[3]||"1",q=Z[4]?.replace(/['"`]/g,"")||"normal",K=Z[5]?.replace(/['"`]/g,"")||"forwards",W=`stx-keyframe-${Math.random().toString(36).slice(2,9)}`,U=`
1310
+ }`}var zJ={name:"keyframe",hasEndTag:!0,handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@keyframe requires an animation name</div>${$}`;let Q=Z[0].replace(/['"`]/g,""),Y=Z[1]?Number.parseInt(Z[1],10):1000,G=Z[2]?.replace(/['"`]/g,"")||"ease",z=Z[3]||"1",q=Z[4]?.replace(/['"`]/g,"")||"normal",K=Z[5]?.replace(/['"`]/g,"")||"forwards",W=`stx-keyframe-${Math.random().toString(36).slice(2,9)}`,U=`
1311
1311
  animation-name: ${Q};
1312
1312
  animation-duration: ${Y}ms;
1313
1313
  animation-timing-function: ${G};
1314
1314
  animation-iteration-count: ${z};
1315
1315
  animation-direction: ${q};
1316
1316
  animation-fill-mode: ${K};
1317
- `.trim().replace(/\s+/g," ");return`<div id="${W}" style="${U}">${$}</div>`},description:"Applies a keyframe animation to an element"};function zJ($,Z,J,X,Q){return`
1317
+ `.trim().replace(/\s+/g," ");return`<div id="${W}" style="${U}">${$}</div>`},description:"Applies a keyframe animation to an element"};function qJ($,Z,J,X,Q){return`
1318
1318
  <script data-stx-scoped data-stx-run="always">
1319
1319
  (function() {
1320
1320
  const container = document.getElementById('${$}');
@@ -1328,7 +1328,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1328
1328
  child.classList.add('${Q}');
1329
1329
  });
1330
1330
  })();
1331
- </script>`}var qJ={name:"stagger",hasEndTag:!0,handler:($,Z,J,X)=>{let Q=Z[0]?.replace(/['"`]/g,"")||"> *",Y=Z[1]?Number.parseInt(Z[1],10):100,G=Z[2]?Number.parseInt(Z[2],10):0,z=Z[3]?.replace(/['"`]/g,"")||"fade",q=`stx-stagger-${Math.random().toString(36).slice(2,9)}`,K="stx-stagger-item";if(z==="fade")K+=" stx-fade";else if(z==="slide")K+=" stx-from-bottom";else if(z==="scale")K+=" stx-scale";let W=zJ(q,Q,G,Y,K);return`${`
1331
+ </script>`}var KJ={name:"stagger",hasEndTag:!0,handler:($,Z,J,X)=>{let Q=Z[0]?.replace(/['"`]/g,"")||"> *",Y=Z[1]?Number.parseInt(Z[1],10):100,G=Z[2]?Number.parseInt(Z[2],10):0,z=Z[3]?.replace(/['"`]/g,"")||"fade",q=`stx-stagger-${Math.random().toString(36).slice(2,9)}`,K="stx-stagger-item";if(z==="fade")K+=" stx-fade";else if(z==="slide")K+=" stx-from-bottom";else if(z==="scale")K+=" stx-scale";let W=qJ(q,Q,G,Y,K);return`${`
1332
1332
  <style>
1333
1333
  #${q} .stx-stagger-item {
1334
1334
  opacity: 0;
@@ -1338,12 +1338,12 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1338
1338
  from { opacity: 0; transform: translateY(10px); }
1339
1339
  to { opacity: 1; transform: translateY(0); }
1340
1340
  }
1341
- </style>`}<div id="${q}" class="stx-stagger-container">${$}</div>${W}`},description:"Applies staggered animations to child elements"};function KJ($){let{stiffness:Z,damping:J}=$,X=J/(2*Math.sqrt(Z));if(X<0.5)return"cubic-bezier(0.175, 0.885, 0.32, 1.275)";else if(X<1)return"cubic-bezier(0.34, 1.56, 0.64, 1)";else return"cubic-bezier(0.25, 0.1, 0.25, 1)"}var WJ={name:"spring",hasEndTag:!0,handler:($,Z,J,X)=>{let Q=Z[0]?.replace(/['"`]/g,"")||"default",Y;if(P3[Q])Y=P3[Q];else Y={stiffness:Number.parseInt(Q,10)||100,damping:Z[1]?Number.parseInt(Z[1],10):10,mass:Z[2]?Number.parseFloat(Z[2]):1};let G=Z[3]?Number.parseInt(Z[3],10):500,z=`stx-spring-${Math.random().toString(36).slice(2,9)}`,q=KJ(Y),K=`
1341
+ </style>`}<div id="${q}" class="stx-stagger-container">${$}</div>${W}`},description:"Applies staggered animations to child elements"};function WJ($){let{stiffness:Z,damping:J}=$,X=J/(2*Math.sqrt(Z));if(X<0.5)return"cubic-bezier(0.175, 0.885, 0.32, 1.275)";else if(X<1)return"cubic-bezier(0.34, 1.56, 0.64, 1)";else return"cubic-bezier(0.25, 0.1, 0.25, 1)"}var UJ={name:"spring",hasEndTag:!0,handler:($,Z,J,X)=>{let Q=Z[0]?.replace(/['"`]/g,"")||"default",Y;if(P3[Q])Y=P3[Q];else Y={stiffness:Number.parseInt(Q,10)||100,damping:Z[1]?Number.parseInt(Z[1],10):10,mass:Z[2]?Number.parseFloat(Z[2]):1};let G=Z[3]?Number.parseInt(Z[3],10):500,z=`stx-spring-${Math.random().toString(36).slice(2,9)}`,q=WJ(Y),K=`
1342
1342
  transition: all ${G}ms ${q};
1343
1343
  --stx-spring-stiffness: ${Y.stiffness};
1344
1344
  --stx-spring-damping: ${Y.damping};
1345
1345
  --stx-spring-mass: ${Y.mass};
1346
- `.trim().replace(/\s+/g," ");return`<div id="${z}" class="stx-spring" style="${K}">${$}</div>`},description:"Applies spring physics animations to an element"};function mq($){let Z=`stx-timeline-${Math.random().toString(36).slice(2,9)}`;return`
1346
+ `.trim().replace(/\s+/g," ");return`<div id="${z}" class="stx-spring" style="${K}">${$}</div>`},description:"Applies spring physics animations to an element"};function lq($){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 lq($,Z,J){let X=QJ($,Z),Q=`
1383
+ </script>`}function cq($,Z,J){let X=GJ($,Z),Q=`
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
- ${Q}`}function cq($){let Z=$.trim().split(/\s+/),J={duration:300};for(let X=0;X<Z.length;X++){let Q=Z[X];if(/^\d+(?:ms|s)?$/.test(Q)){let Y=Number.parseInt(Q,10);if(X===0)J.duration=Q.endsWith("s")&&!Q.endsWith("ms")?Y*1000:Y;else J.delay=Q.endsWith("s")&&!Q.endsWith("ms")?Y*1000:Y}else if(Q==="infinite"||/^\d+$/.test(Q))J.iterations=Q==="infinite"?"infinite":Number.parseInt(Q,10);else if(["normal","reverse","alternate","alternate-reverse"].includes(Q))J.direction=Q;else if(["none","forwards","backwards","both"].includes(Q))J.fill=Q;else J.easing=Q}return J}function pq(){return`
1393
+ ${Q}`}function pq($){let Z=$.trim().split(/\s+/),J={duration:300};for(let X=0;X<Z.length;X++){let Q=Z[X];if(/^\d+(?:ms|s)?$/.test(Q)){let Y=Number.parseInt(Q,10);if(X===0)J.duration=Q.endsWith("s")&&!Q.endsWith("ms")?Y*1000:Y;else J.delay=Q.endsWith("s")&&!Q.endsWith("ms")?Y*1000:Y}else if(Q==="infinite"||/^\d+$/.test(Q))J.iterations=Q==="infinite"?"infinite":Number.parseInt(Q,10);else if(["normal","reverse","alternate","alternate-reverse"].includes(Q))J.direction=Q;else if(["none","forwards","backwards","both"].includes(Q))J.fill=Q;else J.easing=Q}return J}function iq(){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 iq($){let Z=$.customDirectives||[];return Z.push(s9),Z.push(r9),Z.push(a9),Z.push(o9),Z.push(GJ),Z.push(qJ),Z.push(WJ),{...$,customDirectives:Z}}function f3($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function x3($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var UJ=100,HJ=599,e9="__stxResponseStatus",q2="__stxResponseHeaders";function p2($){return typeof $==="number"&&Number.isInteger($)&&$>=UJ&&$<=HJ}function rq($){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(p2(X))return X}return}function t9($,Z){if(!$||typeof $!=="object")return!1;let J=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!p2(J))return!1;return $[e9]=J,!0}function jJ($,Z,J){if(!$||typeof $!=="object")return;let X=String(Z??"").trim();if(!X)return;$[q2]={...$[q2],[X]:String(J)}}function BJ($){let Z=$?.[e9];return p2(Z)?Z:void 0}function VJ($){let Z=$?.[q2];if(!Z||typeof Z!=="object")return;let J=Object.entries(Z).map(([X,Q])=>[X,String(Q)]);return J.length>0?Object.fromEntries(J):void 0}function aq($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let J=BJ($);if(J!==void 0)Z[e9]=J;let X=VJ($);if(X)Z[q2]={...Z[q2],...X}}function g3($){return{setResponseStatus:(Z)=>{t9($,Z)},notFound:(Z=404)=>{let J=p2(Z)&&Z>=400?Z:404;t9($,J)},setResponseHeader:(Z,J)=>{jJ($,Z,J)}}}function h3($,Z,J={}){if(!$.includes("@status"))return $;let{filePath:X,buildMode:Q}=J,Y=Q==="compile",G="",z=0,q=/@status\s*\(/g,K;while((K=q.exec($))!==null){let W=_J($,K.index+K[0].length-1);if(W<0)break;let U=$.slice(K.index+K[0].length,W).trim(),H=/^\d+$/.test(U)?Number(U):Z0(U,Z),j=X?` in ${X}`:"";if(Y)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(!t9(Z,H))console.warn(`[stx] @status(${U})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(z,K.index),z=W+1+($.slice(W+1).match(/^[^\S\n]*\n?/)?.[0].length??0),q.lastIndex=z}return z===0?$:G+$.slice(z)}function _J($,Z){let J=1,X=null,Q=!1;for(let Y=Z+1;Y<$.length;Y++){let G=$[Y];if(Q){Q=!1;continue}if(X){if(G==="\\")Q=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Y}return-1}var LJ=0,OJ=0;function u3($,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 FJ($){let Z=[],J=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,X;while((X=J.exec($))!==null){let[Q,Y,G]=X,z=X.index,q=u3(G,"x-data");if(!q)continue;let K=`__stx_scope_${LJ++}`,W=u3(G,"x-init"),U=wJ($,Y,z+Q.length),H=$.slice(z,U.endIndex),j=RJ(H);Z.push({id:K,selector:`[data-stx-scope="${K}"]`,stateExpr:q,initExpr:W,bindings:[],refs:j})}return Z}function wJ($,Z,J){let X=1,Q=J,Y=new RegExp(`<${Z}(?:\\s|>)`,"gi"),G=new RegExp(`</${Z}>`,"gi"),z=new RegExp(`<${Z}[^>]*/\\s*>`,"gi");while(X>0&&Q<$.length){Y.lastIndex=Q,G.lastIndex=Q,z.lastIndex=Q;let q=Y.exec($),K=G.exec($),W=z.exec($);if(W&&W.index<(q?.index??1/0)){Q=W.index+W[0].length;continue}if(!K)return{endIndex:$.length};if(q&&q.index<K.index)X++,Q=q.index+q[0].length;else{if(X--,X===0)return{endIndex:K.index+K[0].length};Q=K.index+K[0].length}}return{endIndex:$.length}}function RJ($){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,Q;while((Q=X.exec(J))!==null){let[,Y,G]=Q,z=NJ(Y);Z.set(G,z)}return Z}function NJ($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${OJ++}`}function DJ(){return`
1465
+ </script>`}function nq($){let Z=$.customDirectives||[];return Z.push(s9),Z.push(r9),Z.push(a9),Z.push(o9),Z.push(zJ),Z.push(KJ),Z.push(UJ),{...$,customDirectives:Z}}function f3($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function x3($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var HJ=100,jJ=599,e9="__stxResponseStatus",q2="__stxResponseHeaders";function p2($){return typeof $==="number"&&Number.isInteger($)&&$>=HJ&&$<=jJ}function aq($){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(p2(X))return X}return}function t9($,Z){if(!$||typeof $!=="object")return!1;let J=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!p2(J))return!1;return $[e9]=J,!0}function BJ($,Z,J){if(!$||typeof $!=="object")return;let X=String(Z??"").trim();if(!X)return;$[q2]={...$[q2],[X]:String(J)}}function VJ($){let Z=$?.[e9];return p2(Z)?Z:void 0}function _J($){let Z=$?.[q2];if(!Z||typeof Z!=="object")return;let J=Object.entries(Z).map(([X,Q])=>[X,String(Q)]);return J.length>0?Object.fromEntries(J):void 0}function tq($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let J=VJ($);if(J!==void 0)Z[e9]=J;let X=_J($);if(X)Z[q2]={...Z[q2],...X}}function g3($){return{setResponseStatus:(Z)=>{t9($,Z)},notFound:(Z=404)=>{let J=p2(Z)&&Z>=400?Z:404;t9($,J)},setResponseHeader:(Z,J)=>{BJ($,Z,J)}}}function h3($,Z,J={}){if(!$.includes("@status"))return $;let{filePath:X,buildMode:Q}=J,Y=Q==="compile",G="",z=0,q=/@status\s*\(/g,K;while((K=q.exec($))!==null){let W=LJ($,K.index+K[0].length-1);if(W<0)break;let U=$.slice(K.index+K[0].length,W).trim(),H=/^\d+$/.test(U)?Number(U):Z0(U,Z),j=X?` in ${X}`:"";if(Y)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(!t9(Z,H))console.warn(`[stx] @status(${U})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(z,K.index),z=W+1+($.slice(W+1).match(/^[^\S\n]*\n?/)?.[0].length??0),q.lastIndex=z}return z===0?$:G+$.slice(z)}function LJ($,Z){let J=1,X=null,Q=!1;for(let Y=Z+1;Y<$.length;Y++){let G=$[Y];if(Q){Q=!1;continue}if(X){if(G==="\\")Q=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Y}return-1}var OJ=0,FJ=0;function u3($,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 wJ($){let Z=[],J=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,X;while((X=J.exec($))!==null){let[Q,Y,G]=X,z=X.index,q=u3(G,"x-data");if(!q)continue;let K=`__stx_scope_${OJ++}`,W=u3(G,"x-init"),U=RJ($,Y,z+Q.length),H=$.slice(z,U.endIndex),j=NJ(H);Z.push({id:K,selector:`[data-stx-scope="${K}"]`,stateExpr:q,initExpr:W,bindings:[],refs:j})}return Z}function RJ($,Z,J){let X=1,Q=J,Y=new RegExp(`<${Z}(?:\\s|>)`,"gi"),G=new RegExp(`</${Z}>`,"gi"),z=new RegExp(`<${Z}[^>]*/\\s*>`,"gi");while(X>0&&Q<$.length){Y.lastIndex=Q,G.lastIndex=Q,z.lastIndex=Q;let q=Y.exec($),K=G.exec($),W=z.exec($);if(W&&W.index<(q?.index??1/0)){Q=W.index+W[0].length;continue}if(!K)return{endIndex:$.length};if(q&&q.index<K.index)X++,Q=q.index+q[0].length;else{if(X--,X===0)return{endIndex:K.index+K[0].length};Q=K.index+K[0].length}}return{endIndex:$.length}}function NJ($){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,Q;while((Q=X.exec(J))!==null){let[,Y,G]=Q,z=DJ(Y);Z.set(G,z)}return Z}function DJ($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${FJ++}`}function AJ(){return`
1466
1466
  // STX Reactive Runtime - x-cloak and transition CSS
1467
1467
  (function() {
1468
1468
  var style = document.createElement('style');
@@ -1669,7 +1669,7 @@ window.__stx_reactive = (function() {
1669
1669
 
1670
1670
  return { initScope: initScope, reactive: reactive };
1671
1671
  })();
1672
- `}function d3($,Z){let J=$.replace(/\{!!([\s\S]*?)!!\}/g,(z,q)=>{try{let K=v0(q,Z,!0);if(K===void 0)return z;return String(K)}catch{return z}}),X="",Q=0,Y=null;while(Q<J.length){let z=J[Q];if(Y&&z==="\\"){X+=z+(J[Q+1]??""),Q+=2;continue}if(z==="{"&&J[Q+1]==="{"){let q=J.indexOf("}}",Q+2);if(q!==-1){let K=J.slice(Q,q+2);X+=G(J.slice(Q+2,q),K,Y),Q=q+2;continue}}if(Y){if(z===Y)Y=null}else if(z==="'"||z==='"'||z==="`")Y=z;X+=z,Q++}return X;function G(z,q,K){let W;try{W=v0(z,Z,!0)}catch{return q}if(W===void 0)return q;if(K){let U=String(W).replace(/\\/g,"\\\\").replace(new RegExp(K==="`"?"`":K,"g"),`\\${K}`).replace(/\r/g,"\\r").replace(/\n/g,"\\n");return K==="`"?U.replace(/\$\{/g,"\\${"):U}if(typeof W==="string"){let U=W.trim();if(U.startsWith("{")&&U.endsWith("}")||U.startsWith("[")&&U.endsWith("]"))try{return JSON.parse(U),U}catch{}}return JSON.stringify(W)}}function AJ($,Z){if($.length===0)return"";let J=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),Y=d3(X.stateExpr,Z),G=X.initExpr?d3(X.initExpr,Z):null,z=JSON.stringify(Y),q=G?JSON.stringify(G):"null";return`
1672
+ `}function d3($,Z){let J=$.replace(/\{!!([\s\S]*?)!!\}/g,(z,q)=>{try{let K=v0(q,Z,!0);if(K===void 0)return z;return String(K)}catch{return z}}),X="",Q=0,Y=null;while(Q<J.length){let z=J[Q];if(Y&&z==="\\"){X+=z+(J[Q+1]??""),Q+=2;continue}if(z==="{"&&J[Q+1]==="{"){let q=J.indexOf("}}",Q+2);if(q!==-1){let K=J.slice(Q,q+2);X+=G(J.slice(Q+2,q),K,Y),Q=q+2;continue}}if(Y){if(z===Y)Y=null}else if(z==="'"||z==='"'||z==="`")Y=z;X+=z,Q++}return X;function G(z,q,K){let W;try{W=v0(z,Z,!0)}catch{return q}if(W===void 0)return q;if(K){let U=String(W).replace(/\\/g,"\\\\").replace(new RegExp(K==="`"?"`":K,"g"),`\\${K}`).replace(/\r/g,"\\r").replace(/\n/g,"\\n");return K==="`"?U.replace(/\$\{/g,"\\${"):U}if(typeof W==="string"){let U=W.trim();if(U.startsWith("{")&&U.endsWith("}")||U.startsWith("[")&&U.endsWith("]"))try{return JSON.parse(U),U}catch{}}return JSON.stringify(W)}}function MJ($,Z){if($.length===0)return"";let J=$.map((X)=>{let Q=JSON.stringify(Object.fromEntries(X.refs)),Y=d3(X.stateExpr,Z),G=X.initExpr?d3(X.initExpr,Z):null,z=JSON.stringify(Y),q=G?JSON.stringify(G):"null";return`
1673
1673
  (function() {
1674
1674
  var scopeEl = document.querySelector('${X.selector}');
1675
1675
  if (!scopeEl) return;
@@ -1678,10 +1678,10 @@ window.__stx_reactive = (function() {
1678
1678
  })();`}).join(`
1679
1679
  `);return`
1680
1680
  <script data-stx-scoped data-stx-reactive data-stx-run="always">
1681
- ${DJ()}
1681
+ ${AJ()}
1682
1682
  ${J}
1683
- </script>`}function m3($,Z,J){if(!IJ($))return $;let X=FJ($);if(X.length===0)return $;let Q=MJ($,X),Y=AJ(X,Z),G=Q.lastIndexOf("</body>");if(G!==-1)Q=Q.slice(0,G)+Y+`
1684
- `+Q.slice(G);else Q+=Y;return Q}function MJ($,Z){let J=0,X=$.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(Q,Y,G)=>{let z=Z[J++];if(!z)return Q;let q=/data-stx-scope="([^"]*)"/.exec(G);if(q)return z.id=q[1],z.selector=`[data-stx-scope="${z.id}"]`,Q;return`<${Y} data-stx-scope="${z.id}"${G}>`});return X=X.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),X=X.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),X=X.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),X=X.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),X}function IJ($){return/x-data\s*=\s*["']/.test($)}import RX from"fs";import F5 from"path";import{createHighlighter as NX}from"ts-syntax-highlighter";import Z9 from"fs";import y0 from"path";import{loadConfigWithResult as BX}from"bunfig";K2();async function kJ($,Z,J,X){let Q=Z[0]?.replace(/['"]/g,"")||"main",Y=$5();if(Q!=="main")Y=Y.replace("container:'main'",`container:'${Q}'`);return`<script data-stx-router>${Y}</script>`}var l3={name:"stxRouter",handler:kJ,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};function Q1($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function c3($){let Z=$.trim().toLowerCase();return!Z.startsWith("javascript:")&&!Z.startsWith("vbscript:")&&!Z.startsWith("data:text/html")}function p3($){let Z=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,J=$.match(Z);if(!J)return{data:{},content:$.trim()};let X=J[1],Q=$.slice(J[0].length),Y={};for(let G of X.split(`
1683
+ </script>`}function m3($,Z,J){if(!kJ($))return $;let X=wJ($);if(X.length===0)return $;let Q=IJ($,X),Y=MJ(X,Z),G=Q.lastIndexOf("</body>");if(G!==-1)Q=Q.slice(0,G)+Y+`
1684
+ `+Q.slice(G);else Q+=Y;return Q}function IJ($,Z){let J=0,X=$.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(Q,Y,G)=>{let z=Z[J++];if(!z)return Q;let q=/data-stx-scope="([^"]*)"/.exec(G);if(q)return z.id=q[1],z.selector=`[data-stx-scope="${z.id}"]`,Q;return`<${Y} data-stx-scope="${z.id}"${G}>`});return X=X.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),X=X.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),X=X.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),X=X.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),X}function kJ($){return/x-data\s*=\s*["']/.test($)}import NX from"fs";import F5 from"path";import{createHighlighter as DX}from"ts-syntax-highlighter";import Z9 from"fs";import y0 from"path";import{loadConfigWithResult as VX}from"bunfig";K2();async function TJ($,Z,J,X){let Q=Z[0]?.replace(/['"]/g,"")||"main",Y=$5();if(Q!=="main")Y=Y.replace("container:'main'",`container:'${Q}'`);return`<script data-stx-router>${Y}</script>`}var l3={name:"stxRouter",handler:TJ,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};function Q1($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function c3($){let Z=$.trim().toLowerCase();return!Z.startsWith("javascript:")&&!Z.startsWith("vbscript:")&&!Z.startsWith("data:text/html")}function p3($){let Z=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,J=$.match(Z);if(!J)return{data:{},content:$.trim()};let X=J[1],Q=$.slice(J[0].length),Y={};for(let G of X.split(`
1685
1685
  `)){let z=G.trim();if(!z||z.startsWith("#"))continue;let q=z.indexOf(":");if(q===-1)continue;let K=z.slice(0,q).trim(),W=z.slice(q+1).trim();if(typeof W==="string"){if(W.startsWith('"')&&W.endsWith('"')||W.startsWith("'")&&W.endsWith("'"))W=W.slice(1,-1);else if(W.startsWith("[")&&W.endsWith("]"))try{W=JSON.parse(W)}catch{}else if(W==="true")W=!0;else if(W==="false")W=!1;else if(/^-?\d+(?:\.\d+)?$/.test(W))W=Number(W)}Y[K]=W}return{data:Y,content:Q.trim()}}function W2($,Z={}){let{gfm:J=!0,breaks:X=!1}=Z,Q=$,Y=[];if(Q=Q.replace(/```(\w*)\n([\s\S]*?)```/g,(W,U,H)=>{let j=Y.length,B=U?` class="language-${Q1(U)}"`:"";return Y.push(`<pre><code${B}>${Q1(H.trim())}</code></pre>`),`\x00CODEBLOCK${j}\x00`}),Q=Q.replace(/`([^`]*)`/g,(W,U)=>`<code>${Q1(U)}</code>`),Q=Q.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),Q=Q.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),Q=Q.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),Q=Q.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),Q=Q.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),Q=Q.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),Q=Q.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),Q=Q.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),Q=Q.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),Q=Q.replace(/__(.+?)__/g,"<strong>$1</strong>"),Q=Q.replace(/\*(.+?)\*/g,"<em>$1</em>"),Q=Q.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),J)Q=Q.replace(/~~(.+?)~~/g,"<del>$1</del>");if(Q=Q.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(W,U,H)=>{return`<img src="${c3(H)?Q1(H):""}" alt="${Q1(U)}" />`}),Q=Q.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(W,U,H)=>{return`<a href="${c3(H)?Q1(H):""}">${U}</a>`}),Q=Q.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),Q=Q.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),Q=Q.replace(/<\/blockquote>\n<blockquote>/g,`
1686
1686
  `),Q=Q.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),Q=Q.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),Q=Q.replace(/<\/ul>\n<ul>/g,""),Q=Q.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),Q=Q.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),Q=Q.replace(/<\/ol>\n<ol>/g,""),Q=Q.replace(/<li data-ul>/g,"<li>"),Q=Q.replace(/<li data-ol>/g,"<li>"),J)Q=Q.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(W,U,H)=>{let B=`<tr>${U.split("|").map((F)=>F.trim()).filter(Boolean).map((F)=>`<th>${Q1(F)}</th>`).join("")}</tr>`,V=H.trim().split(`
1687
1687
  `).map((F)=>{return`<tr>${F.split("|").map((O)=>O.trim()).filter(Boolean).map((O)=>`<td>${Q1(O)}</td>`).join("")}</tr>`}).join(`
@@ -1700,8 +1700,8 @@ ${V}
1700
1700
  `)}</p>`);if(Q=z.join(`
1701
1701
  `),X)Q=Q.replace(/\n/g,`<br />
1702
1702
  `);for(let W=0;W<Y.length;W++)Q=Q.replace(`\x00CODEBLOCK${W}\x00`,Y[W]);return Q=Q.replace(/<p>\s*<\/p>/g,""),Q.trim()}async function i3($,Z,J=""){let X=$,Q=[],Y=/@markdown(?:\([^)]*\))?/g,G;while((G=Y.exec($))!==null){let z=G.index,q=G[0].match(/@markdown\(([^)]*)\)/),K=q?q[1]:"",W=z+G[0].length,U=1,H=W,j=-1;while(U>0&&H<$.length){let F=$.indexOf("@markdown",H),L=$.indexOf("@endmarkdown",H);if(L===-1)break;if(F!==-1&&F<L&&F!==z){let O=$[F+9];if(O==="("||O===`
1703
- `||O==="\r"||O===" "||O===void 0)U++;H=F+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);Q.push({fullMatch:V,options:K,content:B,index:z}),Y.lastIndex=j+12}for(let{fullMatch:z,options:q,content:K,index:W}of Q)try{let U={};if(q)q.split(",").forEach((B)=>{let V=B.trim();if(V)U[V]=!0});let H={gfm:U.gfm??!0,breaks:U.breaks??!1},j=W2(K.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 n3($,Z,J,X){let Q={gfm:!0,breaks:!1};return Z.forEach((Y)=>{let G=Y.trim().replace(/['"]/g,"");if(G==="breaks")Q.breaks=!0;if(G==="no-gfm")Q.gfm=!1}),W2($.trim(),Q)}var _1=[320,480,640,768,1024,1280,1536,1920,2560],s3=[1,1.5,2,3],S1=["avif","webp","jpeg"],o3={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},TJ={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function U2($,Z=_1,J={},X){return Z.sort((Q,Y)=>Q-Y).map((Q)=>{return`${G1($,{...J,w:Q,fm:X})} ${Q}w`}).join(", ")}function WK($,Z=320,J=2560,X=0.08,Q={},Y){let G=EJ(Z,J,X);return U2($,G,Q,Y)}function EJ($,Z,J=0.08){let X=[],Q=$;while(Q<Z)X.push(Math.round(Q)),Q*=1+J*2;if(X[X.length-1]!==Z)X.push(Z);return X}function Z5($,Z,J=s3,X={},Q){return J.sort((Y,G)=>Y-G).map((Y)=>{let G=Math.round(Z*Y);return`${G1($,{...X,w:G,dpr:Y,fm:Q})} ${Y}x`}).join(", ")}function UK($,Z,J=s3,X=80,Q={},Y){let G={1:X,1.5:Math.round(X*0.9),2:Math.round(X*0.8),3:Math.round(X*0.7),4:Math.round(X*0.6),5:Math.round(X*0.5)};return J.sort((z,q)=>z-q).map((z)=>{let q=Math.round(Z*z),K=G[z]||Math.round(X*Math.max(0.5,1-z*0.1));return`${G1($,{...Q,w:q,q:K,dpr:z,fm:Y})} ${z}x`}).join(", ")}function J5($,Z="100vw"){if(!$||Object.keys($).length===0)return Z;let X=Object.entries($).map(([Q,Y])=>{let G=/^\d+$/.test(Q)?`${Q}px`:Q;return{bp:G,size:Y,numericBp:Number.parseInt(G)||0}}).sort((Q,Y)=>Q.numericBp-Y.numericBp).map(({bp:Q,size:Y})=>`(max-width: ${Q}) ${Y}`);return X.push(Z),X.join(", ")}function HK($,Z="100vw"){if(!$||$.length===0)return Z;let X=[...$].sort((Q,Y)=>(Q.maxWidth||0)-(Y.maxWidth||0)).filter((Q)=>Q.maxWidth).map((Q)=>`(max-width: ${Q.maxWidth}px) ${Q.imageWidth}`);return X.push(Z),X.join(", ")}var jK={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(([,Y])=>Y!==void 0&&Y!==null).map(([Y,G])=>{if(Array.isArray(G))return[Y,G.join(",")];return[Y,String(G)]});if(J.length===0)return $;let X=J.map(([Y,G])=>`${Y}=${encodeURIComponent(G)}`).join("&"),Q=$.includes("?")?"&":"?";return`${$}${Q}${X}`}function BK($){let[Z,J]=$.split("?"),X={};if(J)new URLSearchParams(J).forEach((Y,G)=>{if(/^\d+$/.test(Y))X[G]=Number.parseInt(Y,10);else if(/^\d+\.\d+$/.test(Y))X[G]=Number.parseFloat(Y);else if(Y==="true")X[G]=!0;else if(Y==="false")X[G]=!1;else X[G]=Y});return{src:Z,params:X}}function VK($){let{src:Z,widths:J,dprValues:X,fixedWidth:Q,formats:Y=S1,baseUrl:G="",params:z={}}=$,q=[];for(let K of Y){let W,U;if(Q!==void 0&&X)W=Z5(Z,Q,X,z,K),U=X.map((H)=>({path:"",url:G1(Z,{...z,w:Math.round(Q*H),fm:K}),width:Math.round(Q*H),height:0,format:K,size:0,dpr:H}));else{let H=J||_1;W=U2(Z,H,z,K),U=H.map((j)=>({path:"",url:G1(Z,{...z,w:j,fm:K}),width:j,height:0,format:K,size:0}))}q.push({srcset:W,format:K,mimeType:o3[K],variants:U})}return q}function _K($,Z="100vw"){return $.map(({srcset:J,mimeType:X})=>`<source type="${X}" srcset="${J}" sizes="${Z}" />`).join(`
1704
- `)}function LK($,Z){if($.length===0)return;let J=[...$].sort((Q,Y)=>Q.width-Y.width),X=J.find((Q)=>Q.width>=Z);if(X)return X;return J[J.length-1]}function X5($){return o3[$]||"application/octet-stream"}function OK($){return TJ[$]||$}function FK($){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 bJ={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},Y5=`
1703
+ `||O==="\r"||O===" "||O===void 0)U++;H=F+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);Q.push({fullMatch:V,options:K,content:B,index:z}),Y.lastIndex=j+12}for(let{fullMatch:z,options:q,content:K,index:W}of Q)try{let U={};if(q)q.split(",").forEach((B)=>{let V=B.trim();if(V)U[V]=!0});let H={gfm:U.gfm??!0,breaks:U.breaks??!1},j=W2(K.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 n3($,Z,J,X){let Q={gfm:!0,breaks:!1};return Z.forEach((Y)=>{let G=Y.trim().replace(/['"]/g,"");if(G==="breaks")Q.breaks=!0;if(G==="no-gfm")Q.gfm=!1}),W2($.trim(),Q)}var _1=[320,480,640,768,1024,1280,1536,1920,2560],s3=[1,1.5,2,3],S1=["avif","webp","jpeg"],o3={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},EJ={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function U2($,Z=_1,J={},X){return Z.sort((Q,Y)=>Q-Y).map((Q)=>{return`${G1($,{...J,w:Q,fm:X})} ${Q}w`}).join(", ")}function UK($,Z=320,J=2560,X=0.08,Q={},Y){let G=bJ(Z,J,X);return U2($,G,Q,Y)}function bJ($,Z,J=0.08){let X=[],Q=$;while(Q<Z)X.push(Math.round(Q)),Q*=1+J*2;if(X[X.length-1]!==Z)X.push(Z);return X}function Z5($,Z,J=s3,X={},Q){return J.sort((Y,G)=>Y-G).map((Y)=>{let G=Math.round(Z*Y);return`${G1($,{...X,w:G,dpr:Y,fm:Q})} ${Y}x`}).join(", ")}function HK($,Z,J=s3,X=80,Q={},Y){let G={1:X,1.5:Math.round(X*0.9),2:Math.round(X*0.8),3:Math.round(X*0.7),4:Math.round(X*0.6),5:Math.round(X*0.5)};return J.sort((z,q)=>z-q).map((z)=>{let q=Math.round(Z*z),K=G[z]||Math.round(X*Math.max(0.5,1-z*0.1));return`${G1($,{...Q,w:q,q:K,dpr:z,fm:Y})} ${z}x`}).join(", ")}function J5($,Z="100vw"){if(!$||Object.keys($).length===0)return Z;let X=Object.entries($).map(([Q,Y])=>{let G=/^\d+$/.test(Q)?`${Q}px`:Q;return{bp:G,size:Y,numericBp:Number.parseInt(G)||0}}).sort((Q,Y)=>Q.numericBp-Y.numericBp).map(({bp:Q,size:Y})=>`(max-width: ${Q}) ${Y}`);return X.push(Z),X.join(", ")}function jK($,Z="100vw"){if(!$||$.length===0)return Z;let X=[...$].sort((Q,Y)=>(Q.maxWidth||0)-(Y.maxWidth||0)).filter((Q)=>Q.maxWidth).map((Q)=>`(max-width: ${Q.maxWidth}px) ${Q.imageWidth}`);return X.push(Z),X.join(", ")}var BK={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(([,Y])=>Y!==void 0&&Y!==null).map(([Y,G])=>{if(Array.isArray(G))return[Y,G.join(",")];return[Y,String(G)]});if(J.length===0)return $;let X=J.map(([Y,G])=>`${Y}=${encodeURIComponent(G)}`).join("&"),Q=$.includes("?")?"&":"?";return`${$}${Q}${X}`}function VK($){let[Z,J]=$.split("?"),X={};if(J)new URLSearchParams(J).forEach((Y,G)=>{if(/^\d+$/.test(Y))X[G]=Number.parseInt(Y,10);else if(/^\d+\.\d+$/.test(Y))X[G]=Number.parseFloat(Y);else if(Y==="true")X[G]=!0;else if(Y==="false")X[G]=!1;else X[G]=Y});return{src:Z,params:X}}function _K($){let{src:Z,widths:J,dprValues:X,fixedWidth:Q,formats:Y=S1,baseUrl:G="",params:z={}}=$,q=[];for(let K of Y){let W,U;if(Q!==void 0&&X)W=Z5(Z,Q,X,z,K),U=X.map((H)=>({path:"",url:G1(Z,{...z,w:Math.round(Q*H),fm:K}),width:Math.round(Q*H),height:0,format:K,size:0,dpr:H}));else{let H=J||_1;W=U2(Z,H,z,K),U=H.map((j)=>({path:"",url:G1(Z,{...z,w:j,fm:K}),width:j,height:0,format:K,size:0}))}q.push({srcset:W,format:K,mimeType:o3[K],variants:U})}return q}function LK($,Z="100vw"){return $.map(({srcset:J,mimeType:X})=>`<source type="${X}" srcset="${J}" sizes="${Z}" />`).join(`
1704
+ `)}function OK($,Z){if($.length===0)return;let J=[...$].sort((Q,Y)=>Q.width-Y.width),X=J.find((Q)=>Q.width>=Z);if(X)return X;return J[J.length-1]}function X5($){return o3[$]||"application/octet-stream"}function FK($){return EJ[$]||$}function wK($){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 yJ={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},Y5=`
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 Q5(){try{return await import("ts-images")}catch{return null}}async function r3($,Z={}){let J={...bJ,...Z},X=await Q5();if(X)try{return await yJ($,J,X)}catch(Q){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Q}`)}return a3($,J)}async function yJ($,Z,J){let{generatePlaceholder:X,generateThumbHash:Q}=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 Q($)).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 a3($,Z){let J=Z.width||20,X=Z.height||J,Q="#e5e7eb",Y=`<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(Y)}`,width:J,height:X,aspectRatio:J/X,originalWidth:0,originalHeight:0,strategy:Z.strategy,dominantColor:"#e5e7eb"}}async function RK($){let Z=await Q5();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await a3($,{strategy:"thumbhash",width:32,height:32})).dataURL}function NK($){let Z=$[0]|$[1]<<8|$[2]<<16,J=(Z&63)/63,X=(Z>>6&63)/31.5-1,Q=(Z>>12&63)/31.5-1,Y=(Z>>18&31)/31,G=Z>>23!==0,z=$[3]|$[4]<<8,q=(z>>3&63)/63,K=(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))),F=Math.max(0,Math.min(255,Math.round(J*255))),L=Math.max(0,Math.min(255,Math.round((J-X)*255))),O=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1733
+ `.trim();async function Q5(){try{return await import("ts-images")}catch{return null}}async function r3($,Z={}){let J={...yJ,...Z},X=await Q5();if(X)try{return await CJ($,J,X)}catch(Q){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Q}`)}return a3($,J)}async function CJ($,Z,J){let{generatePlaceholder:X,generateThumbHash:Q}=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 Q($)).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 a3($,Z){let J=Z.width||20,X=Z.height||J,Q="#e5e7eb",Y=`<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(Y)}`,width:J,height:X,aspectRatio:J/X,originalWidth:0,originalHeight:0,strategy:Z.strategy,dominantColor:"#e5e7eb"}}async function NK($){let Z=await Q5();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await a3($,{strategy:"thumbhash",width:32,height:32})).dataURL}function DK($){let Z=$[0]|$[1]<<8|$[2]<<16,J=(Z&63)/63,X=(Z>>6&63)/31.5-1,Q=(Z>>12&63)/31.5-1,Y=(Z>>18&31)/31,G=Z>>23!==0,z=$[3]|$[4]<<8,q=(z>>3&63)/63,K=(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))),F=Math.max(0,Math.min(255,Math.round(J*255))),L=Math.max(0,Math.min(255,Math.round((J-X)*255))),O=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1734
1734
  <rect fill="rgb(${V},${F},${L})" width="32" height="32"/>
1735
- </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(O)}`}async function DK($,Z=20,J=50){return r3($,{strategy:"blur",width:Z,quality:J,blurLevel:40})}async function AK($){let Z=await Q5();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function MK($,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 t3($,Z,J={}){let X=J.transitionDuration||300,Q=J.easing||"ease-out";return`
1735
+ </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(O)}`}async function AK($,Z=20,J=50){return r3($,{strategy:"blur",width:Z,quality:J,blurLevel:40})}async function MK($){let Z=await Q5();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function IK($,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 t3($,Z,J={}){let X=J.transitionDuration||300,Q=J.easing||"ease-out";return`
1736
1736
  #${$} {
1737
1737
  --stx-img-transition-duration: ${X}ms;
1738
1738
  --stx-img-transition-easing: ${Q};
@@ -1749,8 +1749,8 @@ ${V}
1749
1749
  #${$}.stx-img-loaded img {
1750
1750
  opacity: 1;
1751
1751
  }
1752
- `.trim()}function IK($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var P1=new Map;async function e3($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(P1.has(J))return P1.get(J);let X=await r3($,Z);return P1.set(J,X),X}function kK(){P1.clear()}function TK(){return{size:P1.size,keys:Array.from(P1.keys())}}async function CJ(){try{return await import("./chunk-xptrceyd.js")}catch($){if(!$7)console.warn("[stx-media] Image processor not available, some features disabled:",$),$7=!0;return null}}var $7=!1,G5=80,i2="async",n2="lazy",Z7=!1;async function H2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return xJ(X,J)}if(J.processedResult?.processed)return K5($,J.processedResult,Z);if(J.responsiveVariants)return Y7($,J.responsiveVariants,Z);let{src:Q,alt:Y,width:G,height:z,sizes:q,widths:K=_1,dpr:W,formats:U=S1,quality:H=G5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:F=!0,priority:L=!1,loading:O=L?"eager":n2,decoding:_=i2,fetchpriority:w,objectFit:R,objectPosition:N,crossorigin:A,referrerpolicy:k}=$,D=$.class,I=$.style,T=$.id,M=$.data||{},{isDev:E=!1,baseUrl:C=""}=Z;if(E&&!Z.optimize)return vJ($);let y,b,P=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!L)try{y=await e3(Q,{strategy:B,...V}),b=t3(P,y,V)}catch{}let g=W!==void 0&&G!==void 0,c;if(g)c=PJ($,P,y,Z);else c=await SJ($,P,y,Z);let l;if(L){let u=U.includes("webp")?"webp":U[0],z0=U2(Q,K,{...j,q:H},u),d0=typeof q==="object"?J5(q):q||"100vw";l=`<link rel="preload" as="image" imagesrcset="${z0}" imagesizes="${d0}" />`}let h=[];if(!Z7&&B!=="none")h.push(Y5),Z7=!0;if(b)h.push(b);let s=F?X7(P):void 0;return{html:c,preloadLink:l,css:h.length>0?h.join(`
1753
- `):void 0,script:s}}async function SJ($,Z,J,X){let{src:Q,alt:Y,width:G,height:z,sizes:q,widths:K=_1,formats:W=S1,quality:U=G5,params:H={},lazy:j=!0,priority:B=!1,loading:V=B?"eager":n2,decoding:F=i2,fetchpriority:L,objectFit:O,objectPosition:_,crossorigin:w,referrerpolicy:R}=$,N=$.class,A=$.style,k=$.data||{},D=typeof q==="object"?J5(q):q||"100vw",I=[];for(let E of W){let C=U2(Q,K,{...H,q:U},E),y=X5(E);if(j&&!B)I.push(` <source type="${y}" data-srcset="${C}" data-sizes="${D}" />`);else I.push(` <source type="${y}" srcset="${C}" sizes="${D}" />`)}let T=z5({src:G1(Q,{...H,q:U}),alt:Y,width:G,height:z,loading:B?void 0:V,decoding:F,fetchpriority:B?"high":L,objectFit:O,objectPosition:_,crossorigin:w,referrerpolicy:R,className:J7(N,J),style:q5(A,O,_,J),lazy:j&&!B,data:k}),M;if(J){let E=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;M=`<div id="${Z}" class="stx-img-placeholder" style="${E}">
1752
+ `.trim()}function kK($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var P1=new Map;async function e3($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(P1.has(J))return P1.get(J);let X=await r3($,Z);return P1.set(J,X),X}function TK(){P1.clear()}function EK(){return{size:P1.size,keys:Array.from(P1.keys())}}async function SJ(){try{return await import("./chunk-xzkc36wt.js")}catch($){if(!$7)console.warn("[stx-media] Image processor not available, some features disabled:",$),$7=!0;return null}}var $7=!1,G5=80,i2="async",n2="lazy",Z7=!1;async function H2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return gJ(X,J)}if(J.processedResult?.processed)return K5($,J.processedResult,Z);if(J.responsiveVariants)return Y7($,J.responsiveVariants,Z);let{src:Q,alt:Y,width:G,height:z,sizes:q,widths:K=_1,dpr:W,formats:U=S1,quality:H=G5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:F=!0,priority:L=!1,loading:O=L?"eager":n2,decoding:_=i2,fetchpriority:w,objectFit:R,objectPosition:N,crossorigin:A,referrerpolicy:k}=$,D=$.class,I=$.style,T=$.id,M=$.data||{},{isDev:E=!1,baseUrl:C=""}=Z;if(E&&!Z.optimize)return fJ($);let y,b,P=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!L)try{y=await e3(Q,{strategy:B,...V}),b=t3(P,y,V)}catch{}let g=W!==void 0&&G!==void 0,c;if(g)c=vJ($,P,y,Z);else c=await PJ($,P,y,Z);let l;if(L){let u=U.includes("webp")?"webp":U[0],z0=U2(Q,K,{...j,q:H},u),d0=typeof q==="object"?J5(q):q||"100vw";l=`<link rel="preload" as="image" imagesrcset="${z0}" imagesizes="${d0}" />`}let h=[];if(!Z7&&B!=="none")h.push(Y5),Z7=!0;if(b)h.push(b);let s=F?X7(P):void 0;return{html:c,preloadLink:l,css:h.length>0?h.join(`
1753
+ `):void 0,script:s}}async function PJ($,Z,J,X){let{src:Q,alt:Y,width:G,height:z,sizes:q,widths:K=_1,formats:W=S1,quality:U=G5,params:H={},lazy:j=!0,priority:B=!1,loading:V=B?"eager":n2,decoding:F=i2,fetchpriority:L,objectFit:O,objectPosition:_,crossorigin:w,referrerpolicy:R}=$,N=$.class,A=$.style,k=$.data||{},D=typeof q==="object"?J5(q):q||"100vw",I=[];for(let E of W){let C=U2(Q,K,{...H,q:U},E),y=X5(E);if(j&&!B)I.push(` <source type="${y}" data-srcset="${C}" data-sizes="${D}" />`);else I.push(` <source type="${y}" srcset="${C}" sizes="${D}" />`)}let T=z5({src:G1(Q,{...H,q:U}),alt:Y,width:G,height:z,loading:B?void 0:V,decoding:F,fetchpriority:B?"high":L,objectFit:O,objectPosition:_,crossorigin:w,referrerpolicy:R,className:J7(N,J),style:q5(A,O,_,J),lazy:j&&!B,data:k}),M;if(J){let E=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;M=`<div id="${Z}" class="stx-img-placeholder" style="${E}">
1754
1754
  <picture>
1755
1755
  ${I.join(`
1756
1756
  `)}
@@ -1760,9 +1760,9 @@ ${I.join(`
1760
1760
  ${I.join(`
1761
1761
  `)}
1762
1762
  <img ${T} />
1763
- </picture>`;return M}function PJ($,Z,J,X){let{src:Q,alt:Y,width:G,height:z,dpr:q=[1,2,3],quality:K=G5,params:W={},lazy:U=!0,priority:H=!1,loading:j=H?"eager":n2,decoding:B=i2,fetchpriority:V,objectFit:F,objectPosition:L,crossorigin:O,referrerpolicy:_}=$,w=$.class,R=$.style,N=$.data||{},A=typeof G==="number"?G:Number.parseInt(String(G),10),k=Z5(Q,A,q,{...W,q:K}),D=z5({src:G1(Q,{...W,w:A,q:K}),alt:Y,width:G,height:z,loading:H?void 0:j,decoding:B,fetchpriority:H?"high":V,objectFit:F,objectPosition:L,crossorigin:O,referrerpolicy:_,className:J7(w,J),style:q5(R,F,L,J),lazy:U&&!H,data:N}),I=U&&!H?`data-srcset="${k}"`:`srcset="${k}"`;if(J){let T=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${Z}" class="stx-img-placeholder" style="${T}">
1763
+ </picture>`;return M}function vJ($,Z,J,X){let{src:Q,alt:Y,width:G,height:z,dpr:q=[1,2,3],quality:K=G5,params:W={},lazy:U=!0,priority:H=!1,loading:j=H?"eager":n2,decoding:B=i2,fetchpriority:V,objectFit:F,objectPosition:L,crossorigin:O,referrerpolicy:_}=$,w=$.class,R=$.style,N=$.data||{},A=typeof G==="number"?G:Number.parseInt(String(G),10),k=Z5(Q,A,q,{...W,q:K}),D=z5({src:G1(Q,{...W,w:A,q:K}),alt:Y,width:G,height:z,loading:H?void 0:j,decoding:B,fetchpriority:H?"high":V,objectFit:F,objectPosition:L,crossorigin:O,referrerpolicy:_,className:J7(w,J),style:q5(R,F,L,J),lazy:U&&!H,data:N}),I=U&&!H?`data-srcset="${k}"`:`srcset="${k}"`;if(J){let T=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${Z}" class="stx-img-placeholder" style="${T}">
1764
1764
  <img ${D} ${I} />
1765
- </div>`}return`<img ${Z?`id="${Z}" `:""}${D} ${I} />`}function vJ($){let{src:Z,alt:J,width:X,height:Q,loading:Y=n2,decoding:G=i2,fetchpriority:z,objectFit:q,objectPosition:K,crossorigin:W,referrerpolicy:U,priority:H=!1}=$,j=$.class,B=$.style,V=$.id,F=$.data||{};return{html:`<img ${z5({src:Z,alt:J,width:X,height:Q,loading:H?"eager":Y,decoding:G,fetchpriority:H?"high":z,objectFit:q,objectPosition:K,crossorigin:W,referrerpolicy:U,className:j,style:q5(B,q,K),id:V,data:F})} />`}}function z5($){let Z=[];if($.lazy)Z.push(`data-src="${p0($.src)}"`),Z.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else Z.push(`src="${p0($.src)}"`);if(Z.push(`alt="${p0($.alt)}"`),$.width)Z.push(`width="${$.width}"`);if($.height)Z.push(`height="${$.height}"`);if($.loading)Z.push(`loading="${$.loading}"`);if($.decoding)Z.push(`decoding="${$.decoding}"`);if($.fetchpriority)Z.push(`fetchpriority="${$.fetchpriority}"`);if($.crossorigin)Z.push(`crossorigin="${$.crossorigin}"`);if($.referrerpolicy)Z.push(`referrerpolicy="${$.referrerpolicy}"`);if($.className)Z.push(`class="${p0($.className)}"`);if($.style)Z.push(`style="${p0($.style)}"`);if($.id)Z.push(`id="${p0($.id)}"`);if($.data)for(let[J,X]of Object.entries($.data))Z.push(`data-${J}="${p0(X)}"`);if($.lazy)Z.push("data-stx-lazy");return Z.join(" ")}function J7($,Z){let J=[];if($)J.push($);if(Z)J.push("stx-img-blur");return J.join(" ")||""}function q5($,Z,J,X){let Q=[];if(Z)Q.push(`object-fit: ${Z}`);if(J)Q.push(`object-position: ${J}`);if(X)Q.push("opacity: 0; transition: opacity 300ms ease-out");if($)Q.push($);return Q.join("; ")}function p0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function X7($){return`
1765
+ </div>`}return`<img ${Z?`id="${Z}" `:""}${D} ${I} />`}function fJ($){let{src:Z,alt:J,width:X,height:Q,loading:Y=n2,decoding:G=i2,fetchpriority:z,objectFit:q,objectPosition:K,crossorigin:W,referrerpolicy:U,priority:H=!1}=$,j=$.class,B=$.style,V=$.id,F=$.data||{};return{html:`<img ${z5({src:Z,alt:J,width:X,height:Q,loading:H?"eager":Y,decoding:G,fetchpriority:H?"high":z,objectFit:q,objectPosition:K,crossorigin:W,referrerpolicy:U,className:j,style:q5(B,q,K),id:V,data:F})} />`}}function z5($){let Z=[];if($.lazy)Z.push(`data-src="${p0($.src)}"`),Z.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else Z.push(`src="${p0($.src)}"`);if(Z.push(`alt="${p0($.alt)}"`),$.width)Z.push(`width="${$.width}"`);if($.height)Z.push(`height="${$.height}"`);if($.loading)Z.push(`loading="${$.loading}"`);if($.decoding)Z.push(`decoding="${$.decoding}"`);if($.fetchpriority)Z.push(`fetchpriority="${$.fetchpriority}"`);if($.crossorigin)Z.push(`crossorigin="${$.crossorigin}"`);if($.referrerpolicy)Z.push(`referrerpolicy="${$.referrerpolicy}"`);if($.className)Z.push(`class="${p0($.className)}"`);if($.style)Z.push(`style="${p0($.style)}"`);if($.id)Z.push(`id="${p0($.id)}"`);if($.data)for(let[J,X]of Object.entries($.data))Z.push(`data-${J}="${p0(X)}"`);if($.lazy)Z.push("data-stx-lazy");return Z.join(" ")}function J7($,Z){let J=[];if($)J.push($);if(Z)J.push("stx-img-blur");return J.join(" ")||""}function q5($,Z,J,X){let Q=[];if(Z)Q.push(`object-fit: ${Z}`);if(J)Q.push(`object-position: ${J}`);if(X)Q.push("opacity: 0; transition: opacity 300ms ease-out");if($)Q.push($);return Q.join("; ")}function p0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function X7($){return`
1766
1766
  (function() {
1767
1767
  const container = document.getElementById('${$}');
1768
1768
  if (!container) return;
@@ -1799,7 +1799,7 @@ ${I.join(`
1799
1799
 
1800
1800
  observer.observe(container);
1801
1801
  })();
1802
- `.trim()}function fJ($){let Z=$.match(/<Img\s+([^>]*?)\/?>/);if(!Z)return null;let J=Z[1],X={},Q=/(:?)(\w+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]+)\}))?/g,Y;while((Y=Q.exec(J))!==null){let[,G,z,q,K,W]=Y,U=q??K??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 CK($,Z={}){let J=/<Img\s+[^>]*?\/?>/g,X=[],Q=[],Y=[],G=$,z=[],q;while((q=J.exec($))!==null)z.push({match:q[0],index:q.index});for(let K=z.length-1;K>=0;K--){let{match:W}=z[K],U=fJ(W);if(U){let H=await H2(U,Z);if(G=G.replace(W,H.html),H.preloadLink)X.push(H.preloadLink);if(H.css)Q.push(H.css);if(H.script)Y.push(H.script)}}return{html:G,preloadLinks:X,styles:Q,scripts:Y}}async function xJ($,Z){let J=await CJ();if(!J)return H2({...$,process:!1},Z);let X=Z.tsImagesConfig;if($.responsiveWidths&&$.responsiveWidths.length>0||$.widths&&$.widths.length>0||!$.width&&!$.dpr){let Y=await J.generateResponsiveVariants($.src,$,X);if(Y)return Y7($,Y,Z)}else{let Y=await J.processImage($.src,$,X);if(Y.processed)return K5($,Y,Z)}return H2({...$,process:!1},Z)}async function K5($,Z,J){let{alt:X,width:Q,height:Y,lazy:G=!0,priority:z=!1,objectFit:q,objectPosition:K,crossorigin:W,referrerpolicy:U}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,V=$.data||{},F=Z.variants||[],L=F.find((b)=>b.format==="jpeg")||F.find((b)=>b.format==="webp")||F[0],O=L?.url||$.src,_=F.filter((b)=>b.format===(L?.format||"jpeg")).map((b)=>`${b.url} ${b.width}w`).join(", "),w=new Map;for(let b of F){if(!w.has(b.format))w.set(b.format,[]);w.get(b.format).push(b)}let R=[],N=["avif","webp","jpeg","png"];for(let b of N){let P=w.get(b);if(P&&P.length>0){let g=P.map((l)=>`${l.url} ${l.width}w`).join(", "),c=X5(b);if(G&&!z)R.push(` <source type="${c}" data-srcset="${g}" />`);else R.push(` <source type="${c}" srcset="${g}" />`)}}let A=[];if(G&&!z){if(A.push(`data-src="${p0(O)}"`),A.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),_)A.push(`data-srcset="${_}"`)}else if(A.push(`src="${p0(O)}"`),_)A.push(`srcset="${_}"`);A.push(`alt="${p0(X)}"`);let k=Q||Z.originalWidth,D=Y||Z.originalHeight;if(k)A.push(`width="${k}"`);if(D)A.push(`height="${D}"`);if(!z)A.push(`loading="${G?"lazy":"eager"}"`);if(A.push('decoding="async"'),z)A.push('fetchpriority="high"');if(W)A.push(`crossorigin="${W}"`);if(U)A.push(`referrerpolicy="${U}"`);let I=[];if(q)I.push(`object-fit: ${q}`);if(K)I.push(`object-position: ${K}`);if(Z.placeholder&&G)I.push("opacity: 0; transition: opacity 300ms ease-out");if(j)I.push(j);if(I.length>0)A.push(`style="${I.join("; ")}"`);let T=[];if(H)T.push(H);if(Z.placeholder)T.push("stx-img-blur");if(T.length>0)A.push(`class="${T.join(" ")}"`);if(G&&!z)A.push("data-stx-lazy");for(let[b,P]of Object.entries(V))A.push(`data-${b}="${p0(P)}"`);let M;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let b=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;M=`<div id="${B}" class="stx-img-placeholder" style="${b}">
1802
+ `.trim()}function xJ($){let Z=$.match(/<Img\s+([^>]*?)\/?>/);if(!Z)return null;let J=Z[1],X={},Q=/(:?)(\w+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]+)\}))?/g,Y;while((Y=Q.exec(J))!==null){let[,G,z,q,K,W]=Y,U=q??K??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 SK($,Z={}){let J=/<Img\s+[^>]*?\/?>/g,X=[],Q=[],Y=[],G=$,z=[],q;while((q=J.exec($))!==null)z.push({match:q[0],index:q.index});for(let K=z.length-1;K>=0;K--){let{match:W}=z[K],U=xJ(W);if(U){let H=await H2(U,Z);if(G=G.replace(W,H.html),H.preloadLink)X.push(H.preloadLink);if(H.css)Q.push(H.css);if(H.script)Y.push(H.script)}}return{html:G,preloadLinks:X,styles:Q,scripts:Y}}async function gJ($,Z){let J=await SJ();if(!J)return H2({...$,process:!1},Z);let X=Z.tsImagesConfig;if($.responsiveWidths&&$.responsiveWidths.length>0||$.widths&&$.widths.length>0||!$.width&&!$.dpr){let Y=await J.generateResponsiveVariants($.src,$,X);if(Y)return Y7($,Y,Z)}else{let Y=await J.processImage($.src,$,X);if(Y.processed)return K5($,Y,Z)}return H2({...$,process:!1},Z)}async function K5($,Z,J){let{alt:X,width:Q,height:Y,lazy:G=!0,priority:z=!1,objectFit:q,objectPosition:K,crossorigin:W,referrerpolicy:U}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,V=$.data||{},F=Z.variants||[],L=F.find((b)=>b.format==="jpeg")||F.find((b)=>b.format==="webp")||F[0],O=L?.url||$.src,_=F.filter((b)=>b.format===(L?.format||"jpeg")).map((b)=>`${b.url} ${b.width}w`).join(", "),w=new Map;for(let b of F){if(!w.has(b.format))w.set(b.format,[]);w.get(b.format).push(b)}let R=[],N=["avif","webp","jpeg","png"];for(let b of N){let P=w.get(b);if(P&&P.length>0){let g=P.map((l)=>`${l.url} ${l.width}w`).join(", "),c=X5(b);if(G&&!z)R.push(` <source type="${c}" data-srcset="${g}" />`);else R.push(` <source type="${c}" srcset="${g}" />`)}}let A=[];if(G&&!z){if(A.push(`data-src="${p0(O)}"`),A.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),_)A.push(`data-srcset="${_}"`)}else if(A.push(`src="${p0(O)}"`),_)A.push(`srcset="${_}"`);A.push(`alt="${p0(X)}"`);let k=Q||Z.originalWidth,D=Y||Z.originalHeight;if(k)A.push(`width="${k}"`);if(D)A.push(`height="${D}"`);if(!z)A.push(`loading="${G?"lazy":"eager"}"`);if(A.push('decoding="async"'),z)A.push('fetchpriority="high"');if(W)A.push(`crossorigin="${W}"`);if(U)A.push(`referrerpolicy="${U}"`);let I=[];if(q)I.push(`object-fit: ${q}`);if(K)I.push(`object-position: ${K}`);if(Z.placeholder&&G)I.push("opacity: 0; transition: opacity 300ms ease-out");if(j)I.push(j);if(I.length>0)A.push(`style="${I.join("; ")}"`);let T=[];if(H)T.push(H);if(Z.placeholder)T.push("stx-img-blur");if(T.length>0)A.push(`class="${T.join(" ")}"`);if(G&&!z)A.push("data-stx-lazy");for(let[b,P]of Object.entries(V))A.push(`data-${b}="${p0(P)}"`);let M;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let b=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;M=`<div id="${B}" class="stx-img-placeholder" style="${b}">
1803
1803
  <picture>
1804
1804
  ${R.join(`
1805
1805
  `)}
@@ -1810,10 +1810,10 @@ ${R.join(`
1810
1810
  `)}
1811
1811
  <img ${A.join(" ")} />
1812
1812
  </picture>`;let E=[];if(Z.placeholder)E.push(Y5);let C=G?X7(B):void 0,y;if(z&&_)y=`<link rel="preload" as="image" imagesrcset="${_}" />`;return{html:M,preloadLink:y,css:E.length>0?E.join(`
1813
- `):void 0,script:C}}async function Y7($,Z,J){let X={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Q,Y]of Object.entries(Z.byFormat))if(Y)X.variants.push(...Y);return K5($,X,J)}function gJ(){return s2({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,J,X)=>{let{src:Q,alt:Y,options:G}=hJ($,Z,J);if(!Q)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let z={src:Q,alt:Y||"",widths:G.widths||_1,formats:G.formats||S1,quality:G.quality,sizes:G.sizes,dpr:G.dpr,params:G.params,placeholder:G.placeholder,placeholderOptions:G.placeholderOptions,lazy:G.lazy!==!1,priority:G.priority||!1,loading:G.loading,decoding:G.decoding,fetchpriority:G.fetchpriority,objectFit:G.objectFit,objectPosition:G.objectPosition,class:G.class,style:G.style,id:G.id,width:G.width,height:G.height},q=J.__isDev||!1,K=await H2(z,{isDev:q}),W=K.html;if(K.preloadLink)W=K.preloadLink+`
1813
+ `):void 0,script:C}}async function Y7($,Z,J){let X={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Q,Y]of Object.entries(Z.byFormat))if(Y)X.variants.push(...Y);return K5($,X,J)}function hJ(){return s2({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,J,X)=>{let{src:Q,alt:Y,options:G}=uJ($,Z,J);if(!Q)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let z={src:Q,alt:Y||"",widths:G.widths||_1,formats:G.formats||S1,quality:G.quality,sizes:G.sizes,dpr:G.dpr,params:G.params,placeholder:G.placeholder,placeholderOptions:G.placeholderOptions,lazy:G.lazy!==!1,priority:G.priority||!1,loading:G.loading,decoding:G.decoding,fetchpriority:G.fetchpriority,objectFit:G.objectFit,objectPosition:G.objectPosition,class:G.class,style:G.style,id:G.id,width:G.width,height:G.height},q=J.__isDev||!1,K=await H2(z,{isDev:q}),W=K.html;if(K.preloadLink)W=K.preloadLink+`
1814
1814
  `+W;if(K.css)W+=`
1815
1815
  <style>${K.css}</style>`;if(K.script)W+=`
1816
- <script>${K.script}</script>`;return W},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function hJ($,Z,J){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let X=$.trim();if(X.startsWith("@img(")||X.startsWith("("))X=X.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Q=uJ(X),Y=W5(Q[0],J)||"",G=W5(Q[1],J)||"",z={};if(Q[2]){let q=W5(Q[2],J);if(typeof q==="object"&&q!==null)z=q;else if(typeof Q[2]==="string")try{z=JSON.parse(Q[2])}catch{}}return{src:Y,alt:G,options:z}}function uJ($){let Z=[],J="",X=!1,Q="",Y=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Q=q;else if(q===Q)X=!1,Q="";else J+=q;continue}if(!X){if(q==="{")Y++;if(q==="}")Y--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Y===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function W5($,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 Q7=gJ();async function z7(){try{return await import("./chunk-ex75w96f.js")}catch($){if(!G7)console.warn("[stx-media] Video processor not available, some features disabled:",$),G7=!0;return null}}var G7=!1,q7=!0,K7="metadata",dJ="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function o2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return iJ(X,J)}if(J.processedResult?.processed)return U7($,J.processedResult,Z);let Q;if(X.generatePoster&&X.src&&!$.poster)Q=await nJ(X,J);let{src:Y,sources:G=[],poster:z,posterPlaceholder:q,controls:K=q7,autoplay:W=!1,muted:U=!1,loop:H=!1,preload:j=K7,playsinline:B=!0,lazy:V=!0,player:F="native",type:L,width:O,height:_,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:N=!1}=$,A=Q||z,k=$.class,D=$.style,I=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return lJ($,Z);if(L&&L!=="video")return mJ(Y||"",L,$);let T=G.length>0?G:Y?[{src:Y,type:W7(Y)}]:[],M=[`id="${I}"`];if(K)M.push("controls");if(W)M.push("autoplay");if(U)M.push("muted");if(H)M.push("loop");if(B)M.push("playsinline");if(R)M.push("disablepictureinpicture");if(N)M.push("disableremoteplayback");if(w)M.push(`crossorigin="${w}"`);if(V){if(M.push(`data-preload="${j}"`),M.push('preload="none"'),A)M.push(`data-poster="${I0(A)}"`);M.push("data-stx-lazy")}else if(M.push(`preload="${j}"`),A)M.push(`poster="${I0(A)}"`);if(O)M.push(`width="${O}"`);if(_)M.push(`height="${_}"`);if(k)M.push(`class="${I0(k)}"`);if(D)M.push(`style="${I0(D)}"`);let E=T.map((b)=>{return` <source ${V?`data-src="${I0(b.src)}"`:`src="${I0(b.src)}"`} type="${b.type}"${b.media?` media="${b.media}"`:""} />`}).join(`
1816
+ <script>${K.script}</script>`;return W},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function uJ($,Z,J){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let X=$.trim();if(X.startsWith("@img(")||X.startsWith("("))X=X.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Q=dJ(X),Y=W5(Q[0],J)||"",G=W5(Q[1],J)||"",z={};if(Q[2]){let q=W5(Q[2],J);if(typeof q==="object"&&q!==null)z=q;else if(typeof Q[2]==="string")try{z=JSON.parse(Q[2])}catch{}}return{src:Y,alt:G,options:z}}function dJ($){let Z=[],J="",X=!1,Q="",Y=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Q=q;else if(q===Q)X=!1,Q="";else J+=q;continue}if(!X){if(q==="{")Y++;if(q==="}")Y--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Y===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function W5($,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 Q7=hJ();async function z7(){try{return await import("./chunk-z6xtb8fj.js")}catch($){if(!G7)console.warn("[stx-media] Video processor not available, some features disabled:",$),G7=!0;return null}}var G7=!1,q7=!0,K7="metadata",mJ="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function o2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return nJ(X,J)}if(J.processedResult?.processed)return U7($,J.processedResult,Z);let Q;if(X.generatePoster&&X.src&&!$.poster)Q=await sJ(X,J);let{src:Y,sources:G=[],poster:z,posterPlaceholder:q,controls:K=q7,autoplay:W=!1,muted:U=!1,loop:H=!1,preload:j=K7,playsinline:B=!0,lazy:V=!0,player:F="native",type:L,width:O,height:_,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:N=!1}=$,A=Q||z,k=$.class,D=$.style,I=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return cJ($,Z);if(L&&L!=="video")return lJ(Y||"",L,$);let T=G.length>0?G:Y?[{src:Y,type:W7(Y)}]:[],M=[`id="${I}"`];if(K)M.push("controls");if(W)M.push("autoplay");if(U)M.push("muted");if(H)M.push("loop");if(B)M.push("playsinline");if(R)M.push("disablepictureinpicture");if(N)M.push("disableremoteplayback");if(w)M.push(`crossorigin="${w}"`);if(V){if(M.push(`data-preload="${j}"`),M.push('preload="none"'),A)M.push(`data-poster="${I0(A)}"`);M.push("data-stx-lazy")}else if(M.push(`preload="${j}"`),A)M.push(`poster="${I0(A)}"`);if(O)M.push(`width="${O}"`);if(_)M.push(`height="${_}"`);if(k)M.push(`class="${I0(k)}"`);if(D)M.push(`style="${I0(D)}"`);let E=T.map((b)=>{return` <source ${V?`data-src="${I0(b.src)}"`:`src="${I0(b.src)}"`} type="${b.type}"${b.media?` media="${b.media}"`:""} />`}).join(`
1817
1817
  `),C=`<video ${M.join(" ")}>
1818
1818
  ${E}
1819
1819
  Your browser does not support the video tag.
@@ -1852,9 +1852,9 @@ ${E}
1852
1852
 
1853
1853
  observer.observe(video);
1854
1854
  })();
1855
- `.trim();return{html:C,script:y}}function mJ($,Z,J){let{width:X=640,height:Q=360}=J,Y=J.class,G=J.style,z=J.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,q,K=null;switch(Z){case"youtube":K=cJ($),q=K?`https://www.youtube-nocookie.com/embed/${K}`:$;break;case"vimeo":K=pJ($),q=K?`https://player.vimeo.com/video/${K}`:$;break;case"dailymotion":K=$.split("/").pop()||"",q=`https://www.dailymotion.com/embed/video/${K}`;break;case"twitch":K=$.split("/").pop()||"",q=`https://player.twitch.tv/?video=${K}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:q=$}let W=[`id="${z}"`,`src="${I0(q)}"`,`width="${X}"`,`height="${Q}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(Y)W.push(`class="${I0(Y)}"`);if(G)W.push(`style="${I0(G)}"`);if(J.lazy)W.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
1855
+ `.trim();return{html:C,script:y}}function lJ($,Z,J){let{width:X=640,height:Q=360}=J,Y=J.class,G=J.style,z=J.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,q,K=null;switch(Z){case"youtube":K=pJ($),q=K?`https://www.youtube-nocookie.com/embed/${K}`:$;break;case"vimeo":K=iJ($),q=K?`https://player.vimeo.com/video/${K}`:$;break;case"dailymotion":K=$.split("/").pop()||"",q=`https://www.dailymotion.com/embed/video/${K}`;break;case"twitch":K=$.split("/").pop()||"",q=`https://player.twitch.tv/?video=${K}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:q=$}let W=[`id="${z}"`,`src="${I0(q)}"`,`width="${X}"`,`height="${Q}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(Y)W.push(`class="${I0(Y)}"`);if(G)W.push(`style="${I0(G)}"`);if(J.lazy)W.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
1856
1856
  <iframe ${W.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
1857
- </div>`}}function lJ($,Z={}){let{src:J,sources:X=[],poster:Q,controls:Y=!0,autoplay:G=!1,muted:z=!1,loop:q=!1,preload:K="metadata",playsinline:W=!0,lazy:U=!0,width:H,height:j}=$,B=$.class,V=$.style,F=$.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,L={src:X.length>0?X:J,autoplay:G,loop:q,muted:z,playsinline:W,preload:K,poster:Q,controls:Y,title:$.title},O=["position: relative",H?`width: ${typeof H==="number"?H+"px":H}`:"width: 100%",j?`height: ${typeof j==="number"?j+"px":j}`:"",V||""].filter(Boolean).join("; "),_=`
1857
+ </div>`}}function cJ($,Z={}){let{src:J,sources:X=[],poster:Q,controls:Y=!0,autoplay:G=!1,muted:z=!1,loop:q=!1,preload:K="metadata",playsinline:W=!0,lazy:U=!0,width:H,height:j}=$,B=$.class,V=$.style,F=$.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,L={src:X.length>0?X:J,autoplay:G,loop:q,muted:z,playsinline:W,preload:K,poster:Q,controls:Y,title:$.title},O=["position: relative",H?`width: ${typeof H==="number"?H+"px":H}`:"width: 100%",j?`height: ${typeof j==="number"?j+"px":j}`:"",V||""].filter(Boolean).join("; "),_=`
1858
1858
  <div
1859
1859
  id="${F}"
1860
1860
  class="ts-video-player${B?" "+I0(B):""}"
@@ -1891,7 +1891,7 @@ ${E}
1891
1891
 
1892
1892
  // Load ts-video-player from CDN
1893
1893
  var script = document.createElement('script');
1894
- script.src = '${dJ}';
1894
+ script.src = '${mJ}';
1895
1895
  script.onload = initPlayer;
1896
1896
  script.onerror = function() {
1897
1897
  console.error('[stx] Failed to load ts-video-player');
@@ -2021,7 +2021,7 @@ else {
2021
2021
  .ts-video-player__play-button svg {
2022
2022
  margin-left: 4px;
2023
2023
  }
2024
- `.trim();return{html:_,script:w,css:R}}function W7($){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 cJ($){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 pJ($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function I0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function gK($,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 Q=X.indexOf(",");if(Q===-1)return{src:X.replace(/^['"]|['"]$/g,"")};let Y=X.slice(0,Q).trim().replace(/^['"]|['"]$/g,""),G=X.slice(Q+1).trim();try{let z=JSON.parse(G);return{src:Y,...z}}catch{return{src:Y}}}async function iJ($,Z){let J=await z7();if(!J)return o2({...$,process:!1},Z);let X=Z.tsVideosConfig,Q=await J.processVideo($.src,$,X,$.onProcessProgress);if(Q.processed)return U7($,Q,Z);return o2({...$,process:!1},Z)}async function nJ($,Z){let J=await z7();if(!J||!$.src)return;let X=typeof $.generatePoster==="object"?$.generatePoster:{timestamp:0},Q=Z.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await J.generatePoster($.src,X,Q.outputDir,Q.baseUrl||"/videos"))?.url}function U7($,Z,J){let{controls:X=q7,autoplay:Q=!1,muted:Y=!1,loop:G=!1,preload:z=K7,playsinline:q=!0,lazy:K=!0,width:W,height:U,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,V=$.class,F=$.style,L=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,O=$.src,_=W7(O);if(Z.transcoded)O=Z.transcoded.url,_="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)O=Z.streaming.hls.manifestUrl,_="application/x-mpegURL";else if(Z.streaming?.dash)O=Z.streaming.dash.manifestUrl,_="application/dash+xml"}let R=Z.poster?.url||$.poster,N=[`id="${L}"`];if(X)N.push("controls");if(Q)N.push("autoplay");if(Y)N.push("muted");if(G)N.push("loop");if(q)N.push("playsinline");if(j)N.push("disablepictureinpicture");if(B)N.push("disableremoteplayback");if(H)N.push(`crossorigin="${H}"`);if(K){if(N.push(`data-preload="${z}"`),N.push('preload="none"'),R)N.push(`data-poster="${I0(R)}"`);N.push("data-stx-lazy")}else if(N.push(`preload="${z}"`),R)N.push(`poster="${I0(R)}"`);let A=W||Z.metadata?.width,k=U||Z.metadata?.height;if(A)N.push(`width="${A}"`);if(k)N.push(`height="${k}"`);if(V)N.push(`class="${I0(V)}"`);if(F)N.push(`style="${I0(F)}"`);let I=` <source ${K?`data-src="${I0(O)}"`:`src="${I0(O)}"`} type="${_}" />`,T=`<video ${N.join(" ")}>
2024
+ `.trim();return{html:_,script:w,css:R}}function W7($){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 pJ($){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 iJ($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function I0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function hK($,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 Q=X.indexOf(",");if(Q===-1)return{src:X.replace(/^['"]|['"]$/g,"")};let Y=X.slice(0,Q).trim().replace(/^['"]|['"]$/g,""),G=X.slice(Q+1).trim();try{let z=JSON.parse(G);return{src:Y,...z}}catch{return{src:Y}}}async function nJ($,Z){let J=await z7();if(!J)return o2({...$,process:!1},Z);let X=Z.tsVideosConfig,Q=await J.processVideo($.src,$,X,$.onProcessProgress);if(Q.processed)return U7($,Q,Z);return o2({...$,process:!1},Z)}async function sJ($,Z){let J=await z7();if(!J||!$.src)return;let X=typeof $.generatePoster==="object"?$.generatePoster:{timestamp:0},Q=Z.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await J.generatePoster($.src,X,Q.outputDir,Q.baseUrl||"/videos"))?.url}function U7($,Z,J){let{controls:X=q7,autoplay:Q=!1,muted:Y=!1,loop:G=!1,preload:z=K7,playsinline:q=!0,lazy:K=!0,width:W,height:U,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,V=$.class,F=$.style,L=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,O=$.src,_=W7(O);if(Z.transcoded)O=Z.transcoded.url,_="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)O=Z.streaming.hls.manifestUrl,_="application/x-mpegURL";else if(Z.streaming?.dash)O=Z.streaming.dash.manifestUrl,_="application/dash+xml"}let R=Z.poster?.url||$.poster,N=[`id="${L}"`];if(X)N.push("controls");if(Q)N.push("autoplay");if(Y)N.push("muted");if(G)N.push("loop");if(q)N.push("playsinline");if(j)N.push("disablepictureinpicture");if(B)N.push("disableremoteplayback");if(H)N.push(`crossorigin="${H}"`);if(K){if(N.push(`data-preload="${z}"`),N.push('preload="none"'),R)N.push(`data-poster="${I0(R)}"`);N.push("data-stx-lazy")}else if(N.push(`preload="${z}"`),R)N.push(`poster="${I0(R)}"`);let A=W||Z.metadata?.width,k=U||Z.metadata?.height;if(A)N.push(`width="${A}"`);if(k)N.push(`height="${k}"`);if(V)N.push(`class="${I0(V)}"`);if(F)N.push(`style="${I0(F)}"`);let I=` <source ${K?`data-src="${I0(O)}"`:`src="${I0(O)}"`} type="${_}" />`,T=`<video ${N.join(" ")}>
2025
2025
  ${I}
2026
2026
  Your browser does not support the video tag.
2027
2027
  </video>`;if(Z.spriteSheet)T=`<div class="stx-video-wrapper" data-sprite-sheet="${I0(Z.spriteSheet.url)}" data-sprite-cols="${Z.spriteSheet.columns}" data-sprite-interval="${Z.spriteSheet.interval}">
@@ -2070,9 +2070,9 @@ ${T}
2070
2070
  width: 100%;
2071
2071
  height: auto;
2072
2072
  }
2073
- `.trim();return{html:T,script:M,css:E}}function H7(){return s2({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async($,Z,J,X)=>{let{src:Q,options:Y}=sJ($,Z,J);if(!Q)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let G={src:Q,poster:Y.poster,controls:Y.controls!==!1,autoplay:Y.autoplay||!1,muted:Y.muted||!1,loop:Y.loop||!1,preload:Y.preload||"metadata",playsinline:Y.playsinline!==!1,lazy:Y.lazy!==!1,player:Y.player||"native",type:Y.type,width:Y.width,height:Y.height,class:Y.class,style:Y.style,id:Y.id,crossorigin:Y.crossorigin,disablePictureInPicture:Y.disablePictureInPicture,disableRemotePlayback:Y.disableRemotePlayback,title:Y.title,quality:Y.quality,platform:Y.platform,process:Y.process,generatePoster:Y.generatePoster,streaming:Y.streaming,transcode:Y.transcode,spriteSheet:Y.spriteSheet,waveform:Y.waveform},q={isDev:J.__isDev||!1,tsVideosConfig:J.__tsVideosConfig},K=await o2(G,q),W=K.html;if(K.css)W+=`
2073
+ `.trim();return{html:T,script:M,css:E}}function H7(){return s2({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async($,Z,J,X)=>{let{src:Q,options:Y}=oJ($,Z,J);if(!Q)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let G={src:Q,poster:Y.poster,controls:Y.controls!==!1,autoplay:Y.autoplay||!1,muted:Y.muted||!1,loop:Y.loop||!1,preload:Y.preload||"metadata",playsinline:Y.playsinline!==!1,lazy:Y.lazy!==!1,player:Y.player||"native",type:Y.type,width:Y.width,height:Y.height,class:Y.class,style:Y.style,id:Y.id,crossorigin:Y.crossorigin,disablePictureInPicture:Y.disablePictureInPicture,disableRemotePlayback:Y.disableRemotePlayback,title:Y.title,quality:Y.quality,platform:Y.platform,process:Y.process,generatePoster:Y.generatePoster,streaming:Y.streaming,transcode:Y.transcode,spriteSheet:Y.spriteSheet,waveform:Y.waveform},q={isDev:J.__isDev||!1,tsVideosConfig:J.__tsVideosConfig},K=await o2(G,q),W=K.html;if(K.css)W+=`
2074
2074
  <style>${K.css}</style>`;if(K.script)W+=`
2075
- <script>${K.script}</script>`;return W},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function sJ($,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 Q=oJ(X),Y=j7(Q[0],J)||"",G={};if(Q[1]){let z=j7(Q[1],J);if(typeof z==="object"&&z!==null)G=z;else if(typeof Q[1]==="string")try{G=JSON.parse(Q[1])}catch{}}return{src:Y,options:G}}function oJ($){let Z=[],J="",X=!1,Q="",Y=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Q=q;else if(q===Q)X=!1,Q="";else J+=q;continue}if(!X){if(q==="{")Y++;if(q==="}")Y--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Y===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function j7($,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 U5=H7();function V7($,Z,J,X){let Q=$;Q=Q.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(z,q,K)=>{if(!K&&q.includes(":")){let W=q.split(":"),U=q,H=W.length>1?W[1]:"";if(H&&Z[H])K=Z[H];else if(U.startsWith("og:")&&Z.openGraph&&Z.openGraph[W[1]])K=Z.openGraph[W[1]];else K="";return K?`<meta property="${n(U)}" content="${n(K)}">`:""}return K?`<meta name="${n(q)}" content="${n(K)}">`:""});let Y=/@metaTag\s*\(/g,G;while((G=Y.exec(Q))!==null){let z=G.index,q=z+G[0].length-1,K=1,W=q+1;while(W<Q.length&&K>0){if(Q[W]==="(")K++;else if(Q[W]===")"){if(K--,K===0)break}W++}if(K!==0)break;let U=Q.substring(q+1,W).trim(),H=W+1,j=(()=>{try{let B=b0(U,Z);if(!B)return"";let V="<meta";if(B.name)V+=` name="${n(String(B.name))}"`;if(B.property)V+=` property="${n(String(B.property))}"`;if(B.httpEquiv)V+=` http-equiv="${n(String(B.httpEquiv))}"`;if(B.content)V+=` content="${n(String(B.content))}"`;return V+=">",V}catch(B){let V=B instanceof Error?B.message:String(B);return G0("MetaTag",V,Q0.EVALUATION_ERROR)}})();Q=Q.substring(0,z)+j+Q.substring(H),Y.lastIndex=0}return Q}function _7($,Z,J){let X=$,Q=/@structuredData\s*\(/g,Y;while((Y=Q.exec(X))!==null){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)break;let W=X.substring(z+1,K).trim(),U=K+1,H=(()=>{try{let j=b0(W,Z);if(!j)return"";if(!j["@context"])j["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(j).replace(/<\//g,"<\\/")}</script>`}catch(j){let B=j instanceof Error?j.message:String(j);return G0("StructuredData",B,Q0.EVALUATION_ERROR)}})();X=X.substring(0,G)+H+X.substring(U),Q.lastIndex=0}return X}function L7($,Z,J,X){let Q=$,Y=/@seo\s*\(\s*\{/g,G;while((G=Y.exec(Q))!==null){let z=Q.indexOf("{",G.index+4),q=1,K=z+1,W=null,U=!1;while(K<Q.length&&q>0){let L=Q[K];if(U){U=!1,K++;continue}if(L==="\\"&&W){U=!0,K++;continue}if(W){if(L===W)W=null;K++;continue}if(L==='"'||L==="'"||L==="`"){W=L,K++;continue}if(L==="{")q++;else if(L==="}")q--;K++}if(q!==0)break;let H=Q.substring(K).match(/^\s*\)/);if(!H)break;let j=K+H[0].length,B=Q.substring(z,K),V=Q.substring(G.index,j),F=((L)=>{try{let O=b0(L,Z);if(!O)return"";let _="";if(O.title)_+=`<title>${n(O.title)}</title>
2075
+ <script>${K.script}</script>`;return W},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function oJ($,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 Q=rJ(X),Y=j7(Q[0],J)||"",G={};if(Q[1]){let z=j7(Q[1],J);if(typeof z==="object"&&z!==null)G=z;else if(typeof Q[1]==="string")try{G=JSON.parse(Q[1])}catch{}}return{src:Y,options:G}}function rJ($){let Z=[],J="",X=!1,Q="",Y=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Q=q;else if(q===Q)X=!1,Q="";else J+=q;continue}if(!X){if(q==="{")Y++;if(q==="}")Y--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Y===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function j7($,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 U5=H7();function V7($,Z,J,X){let Q=$;Q=Q.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(z,q,K)=>{if(!K&&q.includes(":")){let W=q.split(":"),U=q,H=W.length>1?W[1]:"";if(H&&Z[H])K=Z[H];else if(U.startsWith("og:")&&Z.openGraph&&Z.openGraph[W[1]])K=Z.openGraph[W[1]];else K="";return K?`<meta property="${n(U)}" content="${n(K)}">`:""}return K?`<meta name="${n(q)}" content="${n(K)}">`:""});let Y=/@metaTag\s*\(/g,G;while((G=Y.exec(Q))!==null){let z=G.index,q=z+G[0].length-1,K=1,W=q+1;while(W<Q.length&&K>0){if(Q[W]==="(")K++;else if(Q[W]===")"){if(K--,K===0)break}W++}if(K!==0)break;let U=Q.substring(q+1,W).trim(),H=W+1,j=(()=>{try{let B=b0(U,Z);if(!B)return"";let V="<meta";if(B.name)V+=` name="${n(String(B.name))}"`;if(B.property)V+=` property="${n(String(B.property))}"`;if(B.httpEquiv)V+=` http-equiv="${n(String(B.httpEquiv))}"`;if(B.content)V+=` content="${n(String(B.content))}"`;return V+=">",V}catch(B){let V=B instanceof Error?B.message:String(B);return G0("MetaTag",V,Q0.EVALUATION_ERROR)}})();Q=Q.substring(0,z)+j+Q.substring(H),Y.lastIndex=0}return Q}function _7($,Z,J){let X=$,Q=/@structuredData\s*\(/g,Y;while((Y=Q.exec(X))!==null){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)break;let W=X.substring(z+1,K).trim(),U=K+1,H=(()=>{try{let j=b0(W,Z);if(!j)return"";if(!j["@context"])j["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(j).replace(/<\//g,"<\\/")}</script>`}catch(j){let B=j instanceof Error?j.message:String(j);return G0("StructuredData",B,Q0.EVALUATION_ERROR)}})();X=X.substring(0,G)+H+X.substring(U),Q.lastIndex=0}return X}function L7($,Z,J,X){let Q=$,Y=/@seo\s*\(\s*\{/g,G;while((G=Y.exec(Q))!==null){let z=Q.indexOf("{",G.index+4),q=1,K=z+1,W=null,U=!1;while(K<Q.length&&q>0){let L=Q[K];if(U){U=!1,K++;continue}if(L==="\\"&&W){U=!0,K++;continue}if(W){if(L===W)W=null;K++;continue}if(L==='"'||L==="'"||L==="`"){W=L,K++;continue}if(L==="{")q++;else if(L==="}")q--;K++}if(q!==0)break;let H=Q.substring(K).match(/^\s*\)/);if(!H)break;let j=K+H[0].length,B=Q.substring(z,K),V=Q.substring(G.index,j),F=((L)=>{try{let O=b0(L,Z);if(!O)return"";let _="";if(O.title)_+=`<title>${n(O.title)}</title>
2076
2076
  `,_+=`<meta name="title" content="${n(O.title)}">
2077
2077
  `;if(O.description)_+=`<meta name="description" content="${n(O.description)}">
2078
2078
  `;if(O.keywords){let w=Array.isArray(O.keywords)?O.keywords.join(", "):O.keywords;_+=`<meta name="keywords" content="${n(w)}">
@@ -2098,8 +2098,8 @@ ${T}
2098
2098
  `}if(w.site)_+=`<meta name="twitter:site" content="${n(w.site)}">
2099
2099
  `;if(w.creator)_+=`<meta name="twitter:creator" content="${n(w.creator)}">
2100
2100
  `}if(O.structuredData){let w=JSON.stringify(O.structuredData).replace(/<\//g,"<\\/");_+=`<script type="application/ld+json">${w}</script>
2101
- `}return _.trim()}catch(O){let _=O instanceof Error?O.message:String(O);return G0("SEO",`Error processing @seo directive: ${_}`,Q0.EVALUATION_ERROR)}})(B);Q=Q.substring(0,G.index)+F+Q.substring(j),Y.lastIndex=G.index+F.length}return Q}function O7($,Z,J){if(J.seo?.enabled===!1)return $;if($.includes("<!-- stx SEO Tags -->")||Z.__stx_seo_staged===!0||J.skipDefaultSeoTags===!0)return $;let X=Z.__stx_runtime_head;if(!!(X?.title||X?.meta?.some((L)=>L.property==="og:title"||L.name==="og:title"||L.name==="twitter:title"||L.name==="description")))return $;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test($))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let Y=$.includes("<title>")||$.includes("</title>"),G=rJ($),z=aJ(G),q=eJ(G),K="";if(Z.title)K=Z.title;else if(Z.meta&&Z.meta.title)K=Z.meta.title;else if(z)K=z;else if(J.seo?.defaultConfig?.title)K=J.seo.defaultConfig.title;else K=J.defaultTitle||"stx Project";let W="";if(Z.description)W=Z.description;else if(Z.meta&&Z.meta.description)W=Z.meta.description;else if(q)W=q;else if(J.seo?.defaultConfig?.description)W=J.seo.defaultConfig.description;else W=J.defaultDescription||"A website built with stx templating engine";let U="";if(Z.image)U=Z.image;else if(Z.meta&&Z.meta.image)U=Z.meta.image;else if(Z.openGraph&&Z.openGraph.image)U=Z.openGraph.image;else if(J.seo?.defaultImage)U=J.seo.defaultImage;else if(J.defaultImage)U=J.defaultImage;let H=Y?"":`
2102
- <meta name="title" content="${n(K)}">`,j=tJ(G)?"":`
2101
+ `}return _.trim()}catch(O){let _=O instanceof Error?O.message:String(O);return G0("SEO",`Error processing @seo directive: ${_}`,Q0.EVALUATION_ERROR)}})(B);Q=Q.substring(0,G.index)+F+Q.substring(j),Y.lastIndex=G.index+F.length}return Q}function O7($,Z,J){if(J.seo?.enabled===!1)return $;if($.includes("<!-- stx SEO Tags -->")||Z.__stx_seo_staged===!0||J.skipDefaultSeoTags===!0)return $;let X=Z.__stx_runtime_head;if(!!(X?.title||X?.meta?.some((L)=>L.property==="og:title"||L.name==="og:title"||L.name==="twitter:title"||L.name==="description")))return $;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test($))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let Y=$.includes("<title>")||$.includes("</title>"),G=aJ($),z=tJ(G),q=$X(G),K="";if(Z.title)K=Z.title;else if(Z.meta&&Z.meta.title)K=Z.meta.title;else if(z)K=z;else if(J.seo?.defaultConfig?.title)K=J.seo.defaultConfig.title;else K=J.defaultTitle||"stx Project";let W="";if(Z.description)W=Z.description;else if(Z.meta&&Z.meta.description)W=Z.meta.description;else if(q)W=q;else if(J.seo?.defaultConfig?.description)W=J.seo.defaultConfig.description;else W=J.defaultDescription||"A website built with stx templating engine";let U="";if(Z.image)U=Z.image;else if(Z.meta&&Z.meta.image)U=Z.meta.image;else if(Z.openGraph&&Z.openGraph.image)U=Z.openGraph.image;else if(J.seo?.defaultImage)U=J.seo.defaultImage;else if(J.defaultImage)U=J.defaultImage;let H=Y?"":`
2102
+ <meta name="title" content="${n(K)}">`,j=eJ(G)?"":`
2103
2103
  <meta name="description" content="${n(W)}">`,B=`
2104
2104
  <!-- stx SEO Tags -->${H}${j}
2105
2105
  <meta property="og:title" content="${n(K)}">
@@ -2116,15 +2116,15 @@ ${T}
2116
2116
  ${B}
2117
2117
  `),V;return V.replace(/<head[^>]*>/,`$&
2118
2118
  ${B}
2119
- `)}function rJ($){let Z=$.search(/<\/head\s*>/i);return Z===-1?$:$.slice(0,Z)}function F7($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function aJ($){let Z=$.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return Z?F7(Z[1].trim()):""}function w7($){return($.match(/<meta\s[^>]*>/gi)||[]).filter((Z)=>/\sname\s*=\s*["']description["']/i.test(Z))}function tJ($){return w7($).length>0}function eJ($){for(let Z of w7($)){let J=Z.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),X=(J?.[1]??J?.[2]??"").trim();if(X)return F7(X)}return""}function n($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var $X=["og:","article:","book:","profile:","fb:","music:","video:"];function B7($){let Z=$.trim(),J=Z[0];if((J==="'"||J==='"'||J==="`")&&Z.length>1&&Z.at(-1)===J)return{value:Z.slice(1,-1),quoted:!0};return{value:Z,quoted:!1}}var H5={name:"meta",handler:($,Z,J,X)=>{if(Z.length<1)return G0("Meta","meta directive requires at least the meta name",Q0.INVALID_DIRECTIVE_SYNTAX);let Q=B7(Z[0]).value,Y;if(Z.length>1){let q=B7(Z[1]);Y=q.quoted?q.value:String(J?.[q.value]??q.value)}else{let q=Q.includes(":")?Q.slice(Q.indexOf(":")+1):Q,K=J?.openGraph;Y=String(J?.[q]??K?.[q]??"")}if(!Y)return"";let z=$X.some((q)=>Q.startsWith(q))?{property:Q,content:Y}:{name:Q,content:Y};if(J)J.__stx_runtime_head=r2(J.__stx_runtime_head??{},{meta:[z]});return""},hasEndTag:!1},j5={name:"structuredData",handler:($,Z,J,X)=>{if($.trim()==="")return G0("StructuredData","structuredData directive requires JSON-LD content",Q0.INVALID_DIRECTIVE_SYNTAX);try{let Q=JSON.parse($);if(!Q["@context"])Q["@context"]="https://schema.org";if(!Q["@type"])return G0("StructuredData","structuredData requires @type property",Q0.INVALID_DIRECTIVE_SYNTAX);return`<script type="application/ld+json">${JSON.stringify(Q)}</script>`}catch(Q){let Y=Q instanceof Error?Q.message:String(Q);return G0("StructuredData",Y,Q0.EVALUATION_ERROR)}},hasEndTag:!0};function nK(){return[H5,j5]}function sK($,Z){let J=Z.replace(/\/$/,""),X=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2119
+ `)}function aJ($){let Z=$.search(/<\/head\s*>/i);return Z===-1?$:$.slice(0,Z)}function F7($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function tJ($){let Z=$.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return Z?F7(Z[1].trim()):""}function w7($){return($.match(/<meta\s[^>]*>/gi)||[]).filter((Z)=>/\sname\s*=\s*["']description["']/i.test(Z))}function eJ($){return w7($).length>0}function $X($){for(let Z of w7($)){let J=Z.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),X=(J?.[1]??J?.[2]??"").trim();if(X)return F7(X)}return""}function n($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var ZX=["og:","article:","book:","profile:","fb:","music:","video:"];function B7($){let Z=$.trim(),J=Z[0];if((J==="'"||J==='"'||J==="`")&&Z.length>1&&Z.at(-1)===J)return{value:Z.slice(1,-1),quoted:!0};return{value:Z,quoted:!1}}var H5={name:"meta",handler:($,Z,J,X)=>{if(Z.length<1)return G0("Meta","meta directive requires at least the meta name",Q0.INVALID_DIRECTIVE_SYNTAX);let Q=B7(Z[0]).value,Y;if(Z.length>1){let q=B7(Z[1]);Y=q.quoted?q.value:String(J?.[q.value]??q.value)}else{let q=Q.includes(":")?Q.slice(Q.indexOf(":")+1):Q,K=J?.openGraph;Y=String(J?.[q]??K?.[q]??"")}if(!Y)return"";let z=ZX.some((q)=>Q.startsWith(q))?{property:Q,content:Y}:{name:Q,content:Y};if(J)J.__stx_runtime_head=r2(J.__stx_runtime_head??{},{meta:[z]});return""},hasEndTag:!1},j5={name:"structuredData",handler:($,Z,J,X)=>{if($.trim()==="")return G0("StructuredData","structuredData directive requires JSON-LD content",Q0.INVALID_DIRECTIVE_SYNTAX);try{let Q=JSON.parse($);if(!Q["@context"])Q["@context"]="https://schema.org";if(!Q["@type"])return G0("StructuredData","structuredData requires @type property",Q0.INVALID_DIRECTIVE_SYNTAX);return`<script type="application/ld+json">${JSON.stringify(Q)}</script>`}catch(Q){let Y=Q instanceof Error?Q.message:String(Q);return G0("StructuredData",Y,Q0.EVALUATION_ERROR)}},hasEndTag:!0};function sK(){return[H5,j5]}function oK($,Z){let J=Z.replace(/\/$/,""),X=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2120
2120
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
2121
2121
  ${$.map((Y)=>{let G=Y.startsWith("http")?Y:`${J}${Y.startsWith("/")?"":"/"}${Y}`;return` <sitemap>
2122
- <loc>${JX(G)}</loc>
2122
+ <loc>${XX(G)}</loc>
2123
2123
  <lastmod>${X}</lastmod>
2124
2124
  </sitemap>`}).join(`
2125
2125
  `)}
2126
- </sitemapindex>`}async function oK($,Z){let{extensions:J=[".stx",".html",".htm"],ignore:X=["_*",".*","node_modules","components","partials","layouts"]}=Z,Q=[],Y=J.length===1?`*${J[0]}`:`*{${J.join(",")}}`,G=new Bun.Glob(`**/${Y}`);for await(let z of G.scan($)){if(X.some((H)=>{if(H.startsWith("*"))return z.includes(H.slice(1));return z.startsWith(H)||z.includes(`/${H}`)}))continue;let K=z.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!K.startsWith("/"))K=`/${K}`;if(K!=="/"&&K.endsWith("/"))K=K.slice(0,-1);let W=`${$}/${z}`,U;try{let H=await Bun.file(W).stat();if(H)U=new Date(H.mtime).toISOString().split("T")[0]}catch{}Q.push({loc:K||"/",lastmod:U,priority:K==="/"?1:0.5})}return Q.sort((z,q)=>z.loc.localeCompare(q.loc)),Q}function ZX($){let Z=[];for(let J of $.rules){if(Z.push(`User-agent: ${J.userAgent}`),J.allow)for(let X of J.allow)Z.push(`Allow: ${X}`);if(J.disallow)for(let X of J.disallow)Z.push(`Disallow: ${X}`);if(J.crawlDelay!==void 0)Z.push(`Crawl-delay: ${J.crawlDelay}`);Z.push("")}if($.sitemap){let J=Array.isArray($.sitemap)?$.sitemap:[$.sitemap];for(let X of J)Z.push(`Sitemap: ${X}`)}if($.host)Z.push(`Host: ${$.host}`);return Z.join(`
2127
- `).trim()}function rK($){return ZX({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function JX($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import XX from"fs";import h0 from"path";async function JW($,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 Q of J)try{let Y=await YX(Q,$,Z);if(Y)X.push(Y)}catch(Y){if(console.error(`Error building web component ${Q.name}:`,Y),$.debug)throw Y}}return X}async function YX($,Z,J){let{name:X,file:Q,tag:Y,extends:G}=$;if(!X||!Q||!Y)return console.error("Invalid web component configuration, missing required fields:",$),null;let z=null;if(h0.isAbsolute(Q)&&await e(Q))z=Q;else if(Z.componentsDir){let V=h0.join(Z.componentsDir,Q);if(await e(V))z=V}if(!z)z=await a2(Q,process.cwd(),Z,J);if(!z)return console.error(`Web component source file not found: ${Q}`),null;let q=await Bun.file(z).text();J.add(z);let W=($.outputFormat||"js")==="ts",U=W?GX({name:X,tag:Y,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):QX({name:X,tag:Y,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await XX.promises.mkdir(H,{recursive:!0});let j=W?"ts":"js",B=h0.join(H,`${Y}.${j}`);if(await Bun.write(B,U),Z.debug)console.log(`Built web component ${X} -> ${B}`);return B}function QX($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Q,shadowDOM:Y,template:G,styleSource:z,attributes:q=[]}=$,K=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Y)K=K.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),K=K.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),K=K.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),K=K.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let W="";if(z)W=`<link rel="stylesheet" href="${z}">`;return`/**
2126
+ </sitemapindex>`}async function rK($,Z){let{extensions:J=[".stx",".html",".htm"],ignore:X=["_*",".*","node_modules","components","partials","layouts"]}=Z,Q=[],Y=J.length===1?`*${J[0]}`:`*{${J.join(",")}}`,G=new Bun.Glob(`**/${Y}`);for await(let z of G.scan($)){if(X.some((H)=>{if(H.startsWith("*"))return z.includes(H.slice(1));return z.startsWith(H)||z.includes(`/${H}`)}))continue;let K=z.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!K.startsWith("/"))K=`/${K}`;if(K!=="/"&&K.endsWith("/"))K=K.slice(0,-1);let W=`${$}/${z}`,U;try{let H=await Bun.file(W).stat();if(H)U=new Date(H.mtime).toISOString().split("T")[0]}catch{}Q.push({loc:K||"/",lastmod:U,priority:K==="/"?1:0.5})}return Q.sort((z,q)=>z.loc.localeCompare(q.loc)),Q}function JX($){let Z=[];for(let J of $.rules){if(Z.push(`User-agent: ${J.userAgent}`),J.allow)for(let X of J.allow)Z.push(`Allow: ${X}`);if(J.disallow)for(let X of J.disallow)Z.push(`Disallow: ${X}`);if(J.crawlDelay!==void 0)Z.push(`Crawl-delay: ${J.crawlDelay}`);Z.push("")}if($.sitemap){let J=Array.isArray($.sitemap)?$.sitemap:[$.sitemap];for(let X of J)Z.push(`Sitemap: ${X}`)}if($.host)Z.push(`Host: ${$.host}`);return Z.join(`
2127
+ `).trim()}function aK($){return JX({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function XX($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import YX from"fs";import h0 from"path";async function XW($,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 Q of J)try{let Y=await QX(Q,$,Z);if(Y)X.push(Y)}catch(Y){if(console.error(`Error building web component ${Q.name}:`,Y),$.debug)throw Y}}return X}async function QX($,Z,J){let{name:X,file:Q,tag:Y,extends:G}=$;if(!X||!Q||!Y)return console.error("Invalid web component configuration, missing required fields:",$),null;let z=null;if(h0.isAbsolute(Q)&&await e(Q))z=Q;else if(Z.componentsDir){let V=h0.join(Z.componentsDir,Q);if(await e(V))z=V}if(!z)z=await a2(Q,process.cwd(),Z,J);if(!z)return console.error(`Web component source file not found: ${Q}`),null;let q=await Bun.file(z).text();J.add(z);let W=($.outputFormat||"js")==="ts",U=W?zX({name:X,tag:Y,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):GX({name:X,tag:Y,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await YX.promises.mkdir(H,{recursive:!0});let j=W?"ts":"js",B=h0.join(H,`${Y}.${j}`);if(await Bun.write(B,U),Z.debug)console.log(`Built web component ${X} -> ${B}`);return B}function GX($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Q,shadowDOM:Y,template:G,styleSource:z,attributes:q=[]}=$,K=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Y)K=K.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),K=K.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),K=K.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),K=K.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let W="";if(z)W=`<link rel="stylesheet" href="${z}">`;return`/**
2128
2128
  * ${Z} Web Component
2129
2129
  * Auto-generated from stx component
2130
2130
  */
@@ -2216,7 +2216,7 @@ class ${Z.replace(/\W/g,"")} extends ${X} {
2216
2216
 
2217
2217
  // Register the web component
2218
2218
  customElements.define('${J}', ${Z.replace(/\W/g,"")})
2219
- `}function GX($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Q,shadowDOM:Y,template:G,styleSource:z,attributes:q=[],attributeTypes:K={}}=$,W=Z.replace(/\W/g,""),U=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Y)U=U.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),U=U.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),U=U.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),U=U.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");U=U.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let H=z?`<link rel="stylesheet" href="${z}">`:"",j=(R)=>{switch(K[R]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},B=(R)=>R.replace(/-([a-z])/g,(N,A)=>A.toUpperCase()),V=q.map((R)=>` private _${B(R)}: ${j(R)} | null = null;`).join(`
2219
+ `}function zX($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Q,shadowDOM:Y,template:G,styleSource:z,attributes:q=[],attributeTypes:K={}}=$,W=Z.replace(/\W/g,""),U=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Y)U=U.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),U=U.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),U=U.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),U=U.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");U=U.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let H=z?`<link rel="stylesheet" href="${z}">`:"",j=(R)=>{switch(K[R]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},B=(R)=>R.replace(/-([a-z])/g,(N,A)=>A.toUpperCase()),V=q.map((R)=>` private _${B(R)}: ${j(R)} | null = null;`).join(`
2220
2220
  `),F=q.map((R)=>{let N=j(R),A=B(R);return`
2221
2221
  get ${A}(): ${N} | null {
2222
2222
  return this._${A};
@@ -2371,9 +2371,9 @@ declare global {
2371
2371
 
2372
2372
  // Register the web component
2373
2373
  customElements.define('${J}', ${W});
2374
- `}var B5={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 zX($,Z,J={}){let X={...B5,...J},Q=V5(Z);switch(X.strategy){case"shadow":return $;case"prefix":return KX($,X.prefix||Z,X.preserveOriginal);case"attribute":return qX($,Q,X.attributeName||"data-v",X.preserveOriginal);case"bem":return WX($,Z,X.preserveOriginal);default:return $}}function qX($,Z,J,X){let Q=`[${J}-${Z}]`;return $.replace(/([.#]?[\w-]+|\*)\s*(\{|,)/g,(Y,G,z)=>{if(G.startsWith("@"))return Y;if(/^(?::root|:host|html|body)$/i.test(G))return Y;return`${X?`${G}${Q}`:`${G}${Q}`}${z}`})}function KX($,Z,J){return $.replace(/\.([a-z_][\w-]*)/gi,(X,Q)=>{if(Q.startsWith(Z))return X;let Y=`${Z}__${Q}`;return J?`.${Y}`:`.${Y}`})}function WX($,Z,J){let X=Z.replace(/[^a-z0-9]/gi,"-");return $.replace(/\.([a-z_][\w-]*)/gi,(Q,Y)=>{if(Y.includes("__")||Y.includes("--")){if(!Y.startsWith(X))return`.${X}__${Y}`;return Q}let G=`${X}__${Y}`;return J?`.${G}`:`.${G}`})}function UX($,Z,J={}){let X={...B5,...J};if(X.strategy==="shadow")return $;if(X.strategy==="attribute"){let Q=V5(Z),G=`${X.attributeName||"data-v"}-${Q}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(z,q,K)=>{if(/^(?:script|style|!--)$/i.test(q))return z;let W=K.trimEnd().endsWith("/"),U=W?K.slice(0,-1):K;return`<${q}${U} ${G}${W?"/":""}>`})}if(X.strategy==="prefix"||X.strategy==="bem"){let Q=X.strategy==="bem"?Z.replace(/[^a-z0-9]/gi,"-"):X.prefix||Z;return $.replace(/\bclass\s*=\s*["']([^"']+)["']/gi,(Y,G)=>{return`class="${G.split(/\s+/).map((q)=>{if(!q)return q;if(q.startsWith(Q))return q;return`${Q}__${q}`}).join(" ")}"`})}return $}function XW($,Z={}){let J={...B5,...Z},X=V5($);return`${J.attributeName||"data-v"}-${X}`}function YW($,Z,J={}){let X="",Q=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,z,q)=>{if(/\bscoped\b/i.test(z)||J.strategy!=="shadow")X+=`${zX(q,Z,J)}
2374
+ `}var B5={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 qX($,Z,J={}){let X={...B5,...J},Q=V5(Z);switch(X.strategy){case"shadow":return $;case"prefix":return WX($,X.prefix||Z,X.preserveOriginal);case"attribute":return KX($,Q,X.attributeName||"data-v",X.preserveOriginal);case"bem":return UX($,Z,X.preserveOriginal);default:return $}}function KX($,Z,J,X){let Q=`[${J}-${Z}]`;return $.replace(/([.#]?[\w-]+|\*)\s*(\{|,)/g,(Y,G,z)=>{if(G.startsWith("@"))return Y;if(/^(?::root|:host|html|body)$/i.test(G))return Y;return`${X?`${G}${Q}`:`${G}${Q}`}${z}`})}function WX($,Z,J){return $.replace(/\.([a-z_][\w-]*)/gi,(X,Q)=>{if(Q.startsWith(Z))return X;let Y=`${Z}__${Q}`;return J?`.${Y}`:`.${Y}`})}function UX($,Z,J){let X=Z.replace(/[^a-z0-9]/gi,"-");return $.replace(/\.([a-z_][\w-]*)/gi,(Q,Y)=>{if(Y.includes("__")||Y.includes("--")){if(!Y.startsWith(X))return`.${X}__${Y}`;return Q}let G=`${X}__${Y}`;return J?`.${G}`:`.${G}`})}function HX($,Z,J={}){let X={...B5,...J};if(X.strategy==="shadow")return $;if(X.strategy==="attribute"){let Q=V5(Z),G=`${X.attributeName||"data-v"}-${Q}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(z,q,K)=>{if(/^(?:script|style|!--)$/i.test(q))return z;let W=K.trimEnd().endsWith("/"),U=W?K.slice(0,-1):K;return`<${q}${U} ${G}${W?"/":""}>`})}if(X.strategy==="prefix"||X.strategy==="bem"){let Q=X.strategy==="bem"?Z.replace(/[^a-z0-9]/gi,"-"):X.prefix||Z;return $.replace(/\bclass\s*=\s*["']([^"']+)["']/gi,(Y,G)=>{return`class="${G.split(/\s+/).map((q)=>{if(!q)return q;if(q.startsWith(Q))return q;return`${Q}__${q}`}).join(" ")}"`})}return $}function YW($,Z={}){let J={...B5,...Z},X=V5($);return`${J.attributeName||"data-v"}-${X}`}function QW($,Z,J={}){let X="",Q=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,z,q)=>{if(/\bscoped\b/i.test(z)||J.strategy!=="shadow")X+=`${qX(q,Z,J)}
2375
2375
  `;else X+=`${q}
2376
- `;return""});return{html:UX(Q,Z,J),css:X.trim()}}function v1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function QW($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Q,styles:Y="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((k)=>z[k].attribute!==!1).map((k)=>z[k].attribute||v1(k)),V=j.map((k)=>{let D=z[k],I=D.default!==void 0?JSON.stringify(D.default):D.type==="string"?'""':D.type==="number"?"0":D.type==="boolean"?"false":D.type==="array"?"[]":"{}";return` this._${k} = ${I};`}).join(`
2376
+ `;return""});return{html:HX(Q,Z,J),css:X.trim()}}function v1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function GW($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Q,styles:Y="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((k)=>z[k].attribute!==!1).map((k)=>z[k].attribute||v1(k)),V=j.map((k)=>{let D=z[k],I=D.default!==void 0?JSON.stringify(D.default):D.type==="string"?'""':D.type==="number"?"0":D.type==="boolean"?"false":D.type==="array"?"[]":"{}";return` this._${k} = ${I};`}).join(`
2377
2377
  `),F=j.map((k)=>{let D=z[k],I=D.attribute!==!1?D.attribute||v1(k):null,T=D.reflect&&I?`
2378
2378
  if (value !== null && value !== undefined) {
2379
2379
  ${D.type==="boolean"?`if (value) { this.setAttribute('${I}', ''); }
@@ -2575,7 +2575,7 @@ customElements.define('${J}', ${H});
2575
2575
  // Export for module usage
2576
2576
  export { ${H} };
2577
2577
  export default ${H};
2578
- `}function GW($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Q,styles:Y="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((D)=>z[D].attribute!==!1).map((D)=>z[D].attribute||v1(D)),V=(D)=>{switch(D){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";case"array":return"unknown[]";default:return"unknown"}},F=j.length>0?`
2578
+ `}function zW($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Q,styles:Y="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((D)=>z[D].attribute!==!1).map((D)=>z[D].attribute||v1(D)),V=(D)=>{switch(D){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";case"array":return"unknown[]";default:return"unknown"}},F=j.length>0?`
2579
2579
  /**
2580
2580
  * Props interface for ${Z}
2581
2581
  */
@@ -2827,7 +2827,7 @@ declare global {
2827
2827
  customElements.define('${J}', ${H});
2828
2828
 
2829
2829
  export default ${H};
2830
- `}function zW(){return`/**
2830
+ `}function qW(){return`/**
2831
2831
  * ReactiveElement Mixin
2832
2832
  * Adds reactive properties and lifecycle management to web components
2833
2833
  */
@@ -2949,7 +2949,7 @@ else {
2949
2949
 
2950
2950
  export { ReactiveElement };
2951
2951
  export default ReactiveElement;
2952
- `}function qW(){return`/**
2952
+ `}function KW(){return`/**
2953
2953
  * stx Reactive Web Components Runtime
2954
2954
  * Provides base classes and utilities for reactive web components
2955
2955
  */
@@ -3166,7 +3166,7 @@ else {
3166
3166
  };
3167
3167
 
3168
3168
  })(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
3169
- `}function HX($,Z){let J=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=J?J[1].trim():"",Q=Z,Y=[],G=!0;if(X){let U=X.match(/export\s+default\s+({[\s\S]*})/);if(U)try{let H=U[1],j=H.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(j)Q=j[1];let B=H.match(/props\s*:\s*\[([\s\S]*?)\]/);if(B)Y=B[1].split(",").map((F)=>F.trim().replace(/['"`]/g,"")).filter((F)=>F.length>0);let V=H.match(/shadowDOM\s*:\s*(true|false)/);if(V)G=V[1]==="true"}catch{}}let z=$.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),q=z?z[1].trim():"",K=$.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),W=K?K[1].trim():"";return{tag:Q,props:Y,template:q,styles:W,script:X,shadowDOM:G}}function jX($){let{tag:Z,props:J,template:X,styles:Q,shadowDOM:Y}=$,G=Z.split("-").map((U)=>U.charAt(0).toUpperCase()+U.slice(1)).join(""),z=X.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),q=Q.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),K=J.map((U)=>`'${U}'`).join(", "),W=J.map((U)=>`
3169
+ `}function jX($,Z){let J=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=J?J[1].trim():"",Q=Z,Y=[],G=!0;if(X){let U=X.match(/export\s+default\s+({[\s\S]*})/);if(U)try{let H=U[1],j=H.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(j)Q=j[1];let B=H.match(/props\s*:\s*\[([\s\S]*?)\]/);if(B)Y=B[1].split(",").map((F)=>F.trim().replace(/['"`]/g,"")).filter((F)=>F.length>0);let V=H.match(/shadowDOM\s*:\s*(true|false)/);if(V)G=V[1]==="true"}catch{}}let z=$.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),q=z?z[1].trim():"",K=$.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),W=K?K[1].trim():"";return{tag:Q,props:Y,template:q,styles:W,script:X,shadowDOM:G}}function BX($){let{tag:Z,props:J,template:X,styles:Q,shadowDOM:Y}=$,G=Z.split("-").map((U)=>U.charAt(0).toUpperCase()+U.slice(1)).join(""),z=X.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),q=Q.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),K=J.map((U)=>`'${U}'`).join(", "),W=J.map((U)=>`
3170
3170
  get ${U}() {
3171
3171
  return this.getAttribute('${U}') || '';
3172
3172
  }
@@ -3217,14 +3217,14 @@ ${W}
3217
3217
  }
3218
3218
 
3219
3219
  customElements.define('${Z}', ${G});
3220
- `}async function R7($,Z,J,X){if(Z.length<1)return G0("WebComponent","@webcomponent directive requires at least the tag name parameter",Q0.INVALID_DIRECTIVE_SYNTAX);let Q=Z[0].replace(/['"]/g,""),G=(J.__stx_options||{}).componentsDir||"components",z=h0.isAbsolute(G)?[h0.join(G,`${Q}.stx`),h0.join(h0.dirname(X),`${Q}.stx`)]:[h0.join(h0.dirname(X),G,`${Q}.stx`),h0.join(process.cwd(),G,`${Q}.stx`),h0.join(h0.dirname(X),`${Q}.stx`)],q=null;for(let U of z)if(await e(U)){q=await Bun.file(U).text();break}if(!q)return G0("WebComponent",`Component file not found: ${Q}.stx`,Q0.FILE_NOT_FOUND);let K=HX(q,Q);return`<script type="module">
3221
- ${jX(K)}
3222
- </script>`}var _5={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:M7,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:n3,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:R7,hasEndTag:!1,description:"Include a web component in the template"},D7,A7,H5,j5,s9,r9,a9,o9,l3,C3,Q7,U5,...b7],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function VX($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Q=J||process.cwd(),Y=y0.join(Q,"resources","views"),G=y0.join(Q,"resources","layouts");if(Z9.existsSync(Y)&&Z9.existsSync(G))return{root:"resources",pagesDir:"views"};let z=y0.join(Q,"resources","views","pages");if(Z9.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var N7=new Set,J9=["partialsDir","componentsDir","layoutsDir"],L5=new WeakMap;function _X($,Z){let J=Z.replace(/[\\/]+$/,"");if(!J||J===".")return!0;let X=$.replace(/\\/g,"/"),Q=J.replace(/\\/g,"/");return X===Q||X.startsWith(`${Q}/`)}function LX($,Z){let J=!$.root,X=VX($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Q=`${Z}::${X.root}`;if(!N7.has(Q))N7.add(Q),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(!L5.has($)){let Q={};for(let Y of J9){let G=$[Y];if(typeof G==="string"&&G)Q[Y]=G}L5.set($,Q)}if($.root&&$.root!=="."){let Q=$.root;for(let Y of J9){let G=$[Y];if(typeof G!=="string"||!G)continue;if(y0.isAbsolute(G)||_X(G,Q))continue;$[Y]=y0.join(Q,G)}}for(let Q of J9){let Y=$[Q];if(typeof Y!=="string"||!Y||y0.isAbsolute(Y))continue;$[Q]=y0.resolve(Z,Y)}return $}function OX($,Z){let J=L5.get($);for(let X of J9){let Q=$[X];if(typeof Q!=="string"||!Q)continue;let Y=y0.isAbsolute(Q)?Q:y0.join(Z,Q);if(Z9.existsSync(Y))continue;let G=J?.[X]??Q,z=$.root,q=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Y}", which does not exist. Configured as "${G}"`+(q?`, resolved under root "${z}".`:"."))}}function FX($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function wX($){if(I7($.stateDir),$.stateDir=k7(),$.cachePath=j2($.cachePath),$.build)$.build.cacheDir=j2($.build.cacheDir);if($.media?.cache)$.media.cache.directory=j2($.media.cache.directory);if($.story)$.story.outDir=j2($.story.outDir)}var z1=null,L1=new Map,t2=new Map,B2=null;async function O5($){let Z=$?y0.resolve($):process.cwd(),J=t2.get(Z);if(J&&J.signature!==e2(J.graph)){let Y=L1.get(Z);if(L1.delete(Z),t2.delete(Z),!$)z1=null,B2=null;let{clearComponentCache:G}=await import("./chunk-1jcgnwrn.js"),{partialsCache:z}=await import("./chunk-k38dv15t.js");if(G(),z.clear(),Y&&J.configSignature===$9(J.graph)){let q=Y.then(async(K)=>{let W={...J.graph};await E7(W,Z),t2.set(Z,{graph:W,signature:e2(W),configSignature:$9(W)});let U={...K,_layerGraph:W};if(!$)z1=U;return U});return L1.set(Z,q),q}}if(!$){if(z1)return z1;if(B2)return B2}let X=L1.get(Z);if(X)return X;let Q=(async()=>{let G=(await BX({name:"stx",alias:"ui",cwd:Z,defaultConfig:_5,verbose:!1})).config;if(G.extends!==void 0||J){let z=await T7(Z,_5);G=z.config,t2.set(Z,{graph:z.graph,signature:e2(z.graph),configSignature:$9(z.graph)})}if(G.runtimeConfig){let{resolveRuntimeConfig:z}=await import("./chunk-raznshc9.js");z(G.runtimeConfig,{});let{generateRuntimeConfigTypes:q}=await import("./chunk-04687bed.js");await q(Z,G.runtimeConfig)}if(FX(G),wX(G),LX(G,Z),OX(G,Z),G.plugins&&G.plugins.length>0){let{pluginManager:z}=await import("./chunk-53xjmjva.js"),q=[],K=[];for(let W of G.plugins){let U=typeof W==="string"?W:W[0],H=typeof W==="string"?{}:W[1]||{};try{let j,B;try{j=await import(U),B=y0.dirname(f.resolve(U))}catch{let F=y0.resolve(Z,U);j=await import(F),B=y0.dirname(F)}let V=j.default||j;if(!z.has(V.name))await z.register(V,G);if(V.components){let F=Array.isArray(V.components)?V.components:[V.components];for(let L of F)q.push(y0.resolve(B,L))}if(V.pages){let F=y0.resolve(B,V.pages),L=H.path||"/";K.push({dir:F,prefix:L})}if(V.setup){let F={addDirective:(L)=>{G.customDirectives=G.customDirectives||[],G.customDirectives.push(L)},addRoute:(L,O)=>{G.apiRoutes=G.apiRoutes||{},G.apiRoutes[L]=O},addMiddleware:(L)=>{G.middleware=G.middleware||[],G.middleware.push(L)},pluginDir:B,config:G};await V.setup(H,F)}console.log(`[stx] Plugin loaded: ${V.name||U}`)}catch(j){console.warn(`[stx] Failed to load plugin ${U}:`,j.message)}}G._pluginComponentDirs=q,G._pluginPageDirs=K}return G})();if(L1.set(Z,Q),Q.catch(()=>{if(L1.get(Z)===Q)L1.delete(Z)}),!$)B2=Q,Q.then((Y)=>{z1=Y}).catch(()=>{});return Q}var y7=new Proxy(_5,{get($,Z){if(z1&&Z in z1)return z1[Z];if(!B2)O5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function MW($){return $}function IW($){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,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`customDirectives[${Q}].name`,message:"Custom directive must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`customDirectives[${Q}].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,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`middleware[${Q}].name`,message:"Middleware must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`middleware[${Q}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!X.timing||!["before","after"].includes(X.timing))Z.push({path:`middleware[${Q}].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((Q,Y)=>{if(!Q.pattern||typeof Q.pattern!=="string")Z.push({path:`pwa.routes[${Y}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!X.includes(Q.strategy))Z.push({path:`pwa.routes[${Y}].strategy`,message:`PWA route strategy must be one of: ${X.join(", ")}`,severity:"error"});if(Q.maxAgeSeconds!==void 0&&(typeof Q.maxAgeSeconds!=="number"||Q.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Y}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Q.maxEntries!==void 0&&(typeof Q.maxEntries!=="number"||Q.maxEntries<1))Z.push({path:`pwa.routes[${Y}].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((Q)=>typeof Q!=="number"||Q<16||Q>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((Y)=>!X.includes(Y)).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 w5=new Map;async function DX($,Z={}){try{if(!await e($))throw Error(`Markdown file not found: ${$}`);let X=(await RX.promises.stat($)).mtime.getTime();if(Z.cache&&w5.has($)){let U=w5.get($);if(U.updatedAt>=X)return{content:U.content,data:U.data}}let Q=await Bun.file($).text(),{data:Y,content:G}=p3(Q),z=Z.markdown||y7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=W2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)K=await AX(K,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let W={content:K,data:Y||{}};if(Z.cache)w5.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 X9=null;async function AX($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!X9)try{X9=await NX({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Q=async(z,q,K,W)=>{let U=W.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(J?"text":"");if(!H)return z;try{if(!X9.getSupportedLanguages().includes(H))return z;return(await X9.highlight(U,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return z},Y=$,G=$.matchAll(X);for(let z of G){let[q,K,W,U]=z,H=await Q(q,K,W,U);Y=Y.replace(q,H)}return Y}async function C7($,Z,J="",X={}){return await MX($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,q,K)=>{try{let W=z;if(!F5.isAbsolute(z))W=F5.resolve(F5.dirname(J),z);let U={};if(q)try{try{U=JSON.parse(q)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let O=q.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let _ of O){let w=_.indexOf(":");if(w>0){let R=_.substring(0,w).trim(),N=_.substring(w+1).trim(),A=N.startsWith('"')&&N.endsWith('"'),k=N.startsWith("'")&&N.endsWith("'");if(A||k)N=N.substring(1,N.length-1);U[R]=N}}}}catch(L){if(X.debug)console.error("Error parsing context in @markdown-file directive:",L)}let{content:H,data:j}=await DX(W,X),B={...Z,...j,...U},V=H,F=/\{\{([^}]+)\}\}/g;return V=V.replace(F,(L,O)=>{let _=O.trim();return B[_]!==void 0?String(B[_]):L}),V}catch(W){let U=W instanceof Error?W.message:String(W);return _0("Markdown File",`Error including markdown file: ${U}`,J,$,K,G)}})}async function MX($,Z,J){let X=[],Q;while((Q=Z.exec($))!==null){let z=Q[0],q=Q.index,K=Q;X.push(J(...K).then((W)=>({match:z,replacement:W,index:q})))}let Y=await Promise.all(X);Y.sort((z,q)=>q.index-z.index);let G=$;for(let{match:z,replacement:q}of Y)G=G.replace(z,()=>q);return G}function q1($,Z){try{let J=$.trim();if(B0(J))return H0(J,Object.keys(Z))(...Object.values(Z));else return Z0(J,Z)}catch{return!1}}class Y9{source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let $=this.pos,Z=this.line,J=this.column,X=this.source[this.pos];if(/\s/.test(X))return this.readWhitespace($,Z,J);if(X==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,J);if(X==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,J);if(X==='"'||X==="'")return this.readString(X,$,Z,J);if(X==="`")return this.readTemplateString($,Z,J);if(/\d/.test(X)||X==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,J);if(/[a-z_$]/i.test(X))return this.readIdentifier($,Z,J);if(X==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:J}}if(X==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:J}}if(X==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:J};if(X==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,J);let Q=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Y of Q)if(this.source.slice(this.pos,this.pos+Y.length)===Y)return this.advance(Y.length),{type:"OPERATOR",value:Y,start:$,end:this.pos,line:Z,column:J};if(/[+\-*/%<>=!&|^~?:]/.test(X))return this.advance(),{type:"OPERATOR",value:X,start:$,end:this.pos,line:Z,column:J};if(/[()[\]{},;.]/.test(X))return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J};return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J}}readWhitespace($,Z,J){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readLineComment($,Z,J){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3220
+ `}async function R7($,Z,J,X){if(Z.length<1)return G0("WebComponent","@webcomponent directive requires at least the tag name parameter",Q0.INVALID_DIRECTIVE_SYNTAX);let Q=Z[0].replace(/['"]/g,""),G=(J.__stx_options||{}).componentsDir||"components",z=h0.isAbsolute(G)?[h0.join(G,`${Q}.stx`),h0.join(h0.dirname(X),`${Q}.stx`)]:[h0.join(h0.dirname(X),G,`${Q}.stx`),h0.join(process.cwd(),G,`${Q}.stx`),h0.join(h0.dirname(X),`${Q}.stx`)],q=null;for(let U of z)if(await e(U)){q=await Bun.file(U).text();break}if(!q)return G0("WebComponent",`Component file not found: ${Q}.stx`,Q0.FILE_NOT_FOUND);let K=jX(q,Q);return`<script type="module">
3221
+ ${BX(K)}
3222
+ </script>`}var _5={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:M7,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:n3,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:R7,hasEndTag:!1,description:"Include a web component in the template"},D7,A7,H5,j5,s9,r9,a9,o9,l3,C3,Q7,U5,...b7],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function _X($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Q=J||process.cwd(),Y=y0.join(Q,"resources","views"),G=y0.join(Q,"resources","layouts");if(Z9.existsSync(Y)&&Z9.existsSync(G))return{root:"resources",pagesDir:"views"};let z=y0.join(Q,"resources","views","pages");if(Z9.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var N7=new Set,J9=["partialsDir","componentsDir","layoutsDir"],L5=new WeakMap;function LX($,Z){let J=Z.replace(/[\\/]+$/,"");if(!J||J===".")return!0;let X=$.replace(/\\/g,"/"),Q=J.replace(/\\/g,"/");return X===Q||X.startsWith(`${Q}/`)}function OX($,Z){let J=!$.root,X=_X($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Q=`${Z}::${X.root}`;if(!N7.has(Q))N7.add(Q),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(!L5.has($)){let Q={};for(let Y of J9){let G=$[Y];if(typeof G==="string"&&G)Q[Y]=G}L5.set($,Q)}if($.root&&$.root!=="."){let Q=$.root;for(let Y of J9){let G=$[Y];if(typeof G!=="string"||!G)continue;if(y0.isAbsolute(G)||LX(G,Q))continue;$[Y]=y0.join(Q,G)}}for(let Q of J9){let Y=$[Q];if(typeof Y!=="string"||!Y||y0.isAbsolute(Y))continue;$[Q]=y0.resolve(Z,Y)}return $}function FX($,Z){let J=L5.get($);for(let X of J9){let Q=$[X];if(typeof Q!=="string"||!Q)continue;let Y=y0.isAbsolute(Q)?Q:y0.join(Z,Q);if(Z9.existsSync(Y))continue;let G=J?.[X]??Q,z=$.root,q=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Y}", which does not exist. Configured as "${G}"`+(q?`, resolved under root "${z}".`:"."))}}function wX($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function RX($){if(I7($.stateDir),$.stateDir=k7(),$.cachePath=j2($.cachePath),$.build)$.build.cacheDir=j2($.build.cacheDir);if($.media?.cache)$.media.cache.directory=j2($.media.cache.directory);if($.story)$.story.outDir=j2($.story.outDir)}var z1=null,L1=new Map,t2=new Map,B2=null;async function O5($){let Z=$?y0.resolve($):process.cwd(),J=t2.get(Z);if(J&&J.signature!==e2(J.graph)){let Y=L1.get(Z);if(L1.delete(Z),t2.delete(Z),!$)z1=null,B2=null;let{clearComponentCache:G}=await import("./chunk-7cvdxe22.js"),{partialsCache:z}=await import("./chunk-ff5ztp8g.js");if(G(),z.clear(),Y&&J.configSignature===$9(J.graph)){let q=Y.then(async(K)=>{let W={...J.graph};await E7(W,Z),t2.set(Z,{graph:W,signature:e2(W),configSignature:$9(W)});let U={...K,_layerGraph:W};if(!$)z1=U;return U});return L1.set(Z,q),q}}if(!$){if(z1)return z1;if(B2)return B2}let X=L1.get(Z);if(X)return X;let Q=(async()=>{let G=(await VX({name:"stx",alias:"ui",cwd:Z,defaultConfig:_5,verbose:!1})).config;if(G.extends!==void 0||J){let z=await T7(Z,_5);G=z.config,t2.set(Z,{graph:z.graph,signature:e2(z.graph),configSignature:$9(z.graph)})}if(G.runtimeConfig){let{resolveRuntimeConfig:z}=await import("./chunk-bsa8pxtc.js");z(G.runtimeConfig,{});let{generateRuntimeConfigTypes:q}=await import("./chunk-qqceavq5.js");await q(Z,G.runtimeConfig)}if(wX(G),RX(G),OX(G,Z),FX(G,Z),G.plugins&&G.plugins.length>0){let{pluginManager:z}=await import("./chunk-afsy9158.js"),q=[],K=[];for(let W of G.plugins){let U=typeof W==="string"?W:W[0],H=typeof W==="string"?{}:W[1]||{};try{let j,B;try{j=await import(U),B=y0.dirname(f.resolve(U))}catch{let F=y0.resolve(Z,U);j=await import(F),B=y0.dirname(F)}let V=j.default||j;if(!z.has(V.name))await z.register(V,G);if(V.components){let F=Array.isArray(V.components)?V.components:[V.components];for(let L of F)q.push(y0.resolve(B,L))}if(V.pages){let F=y0.resolve(B,V.pages),L=H.path||"/";K.push({dir:F,prefix:L})}if(V.setup){let F={addDirective:(L)=>{G.customDirectives=G.customDirectives||[],G.customDirectives.push(L)},addRoute:(L,O)=>{G.apiRoutes=G.apiRoutes||{},G.apiRoutes[L]=O},addMiddleware:(L)=>{G.middleware=G.middleware||[],G.middleware.push(L)},pluginDir:B,config:G};await V.setup(H,F)}console.log(`[stx] Plugin loaded: ${V.name||U}`)}catch(j){console.warn(`[stx] Failed to load plugin ${U}:`,j.message)}}G._pluginComponentDirs=q,G._pluginPageDirs=K}return G})();if(L1.set(Z,Q),Q.catch(()=>{if(L1.get(Z)===Q)L1.delete(Z)}),!$)B2=Q,Q.then((Y)=>{z1=Y}).catch(()=>{});return Q}var y7=new Proxy(_5,{get($,Z){if(z1&&Z in z1)return z1[Z];if(!B2)O5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function IW($){return $}function kW($){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,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`customDirectives[${Q}].name`,message:"Custom directive must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`customDirectives[${Q}].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,Q)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`middleware[${Q}].name`,message:"Middleware must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`middleware[${Q}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!X.timing||!["before","after"].includes(X.timing))Z.push({path:`middleware[${Q}].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((Q,Y)=>{if(!Q.pattern||typeof Q.pattern!=="string")Z.push({path:`pwa.routes[${Y}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!X.includes(Q.strategy))Z.push({path:`pwa.routes[${Y}].strategy`,message:`PWA route strategy must be one of: ${X.join(", ")}`,severity:"error"});if(Q.maxAgeSeconds!==void 0&&(typeof Q.maxAgeSeconds!=="number"||Q.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Y}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Q.maxEntries!==void 0&&(typeof Q.maxEntries!=="number"||Q.maxEntries<1))Z.push({path:`pwa.routes[${Y}].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((Q)=>typeof Q!=="number"||Q<16||Q>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((Y)=>!X.includes(Y)).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 w5=new Map;async function AX($,Z={}){try{if(!await e($))throw Error(`Markdown file not found: ${$}`);let X=(await NX.promises.stat($)).mtime.getTime();if(Z.cache&&w5.has($)){let U=w5.get($);if(U.updatedAt>=X)return{content:U.content,data:U.data}}let Q=await Bun.file($).text(),{data:Y,content:G}=p3(Q),z=Z.markdown||y7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=W2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)K=await MX(K,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let W={content:K,data:Y||{}};if(Z.cache)w5.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 X9=null;async function MX($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!X9)try{X9=await DX({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Q=async(z,q,K,W)=>{let U=W.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(J?"text":"");if(!H)return z;try{if(!X9.getSupportedLanguages().includes(H))return z;return(await X9.highlight(U,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return z},Y=$,G=$.matchAll(X);for(let z of G){let[q,K,W,U]=z,H=await Q(q,K,W,U);Y=Y.replace(q,H)}return Y}async function C7($,Z,J="",X={}){return await IX($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,q,K)=>{try{let W=z;if(!F5.isAbsolute(z))W=F5.resolve(F5.dirname(J),z);let U={};if(q)try{try{U=JSON.parse(q)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let O=q.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let _ of O){let w=_.indexOf(":");if(w>0){let R=_.substring(0,w).trim(),N=_.substring(w+1).trim(),A=N.startsWith('"')&&N.endsWith('"'),k=N.startsWith("'")&&N.endsWith("'");if(A||k)N=N.substring(1,N.length-1);U[R]=N}}}}catch(L){if(X.debug)console.error("Error parsing context in @markdown-file directive:",L)}let{content:H,data:j}=await AX(W,X),B={...Z,...j,...U},V=H,F=/\{\{([^}]+)\}\}/g;return V=V.replace(F,(L,O)=>{let _=O.trim();return B[_]!==void 0?String(B[_]):L}),V}catch(W){let U=W instanceof Error?W.message:String(W);return _0("Markdown File",`Error including markdown file: ${U}`,J,$,K,G)}})}async function IX($,Z,J){let X=[],Q;while((Q=Z.exec($))!==null){let z=Q[0],q=Q.index,K=Q;X.push(J(...K).then((W)=>({match:z,replacement:W,index:q})))}let Y=await Promise.all(X);Y.sort((z,q)=>q.index-z.index);let G=$;for(let{match:z,replacement:q}of Y)G=G.replace(z,()=>q);return G}function q1($,Z){try{let J=$.trim();if(B0(J))return H0(J,Object.keys(Z))(...Object.values(Z));else return Z0(J,Z)}catch{return!1}}class Y9{source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let $=this.pos,Z=this.line,J=this.column,X=this.source[this.pos];if(/\s/.test(X))return this.readWhitespace($,Z,J);if(X==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,J);if(X==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,J);if(X==='"'||X==="'")return this.readString(X,$,Z,J);if(X==="`")return this.readTemplateString($,Z,J);if(/\d/.test(X)||X==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,J);if(/[a-z_$]/i.test(X))return this.readIdentifier($,Z,J);if(X==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:J}}if(X==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:J}}if(X==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:J};if(X==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,J);let Q=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Y of Q)if(this.source.slice(this.pos,this.pos+Y.length)===Y)return this.advance(Y.length),{type:"OPERATOR",value:Y,start:$,end:this.pos,line:Z,column:J};if(/[+\-*/%<>=!&|^~?:]/.test(X))return this.advance(),{type:"OPERATOR",value:X,start:$,end:this.pos,line:Z,column:J};if(/[()[\]{},;.]/.test(X))return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J};return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J}}readWhitespace($,Z,J){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readLineComment($,Z,J){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3223
3223
  `)this.advance();return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readBlockComment($,Z,J){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readString($,Z,J,X){this.advance();while(this.pos<this.source.length){let Q=this.source[this.pos];if(Q==="\\"){this.advance(2);continue}if(Q===$){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(Z,this.pos),start:Z,end:this.pos,line:J,column:X}}readTemplateString($,Z,J){this.advance();let X=0,Q=256;while(this.pos<this.source.length){let Y=this.source[this.pos];if(Y==="\\"){this.advance(2);continue}if(Y==="$"&&this.peek(1)==="{"){if(X>=Q){this.pos=this.source.length;break}this.advance(2),X++;continue}if(Y==="{"&&X>0){X++,this.advance();continue}if(Y==="}"&&X>0){X--,this.advance();continue}if(Y==="`"&&X===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readNumber($,Z,J){if(this.source[this.pos]==="0"){let X=this.peek(1)?.toLowerCase();if(X==="x"||X==="o"||X==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readIdentifier($,Z,J){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readDirective($,Z,J){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}advance($=1){for(let Z=0;Z<$&&this.pos<this.source.length;Z++){if(this.source[this.pos]===`
3224
- `)this.line++,this.column=0;else this.column++;this.pos++}}peek($){return this.source[this.pos+$]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState($){this.pos=$.pos,this.line=$.line,this.column=$.column}}function w0($,Z,J,X=0){let Q=0,Y=X,G=null,z=0,q=!1;while(Y<$.length){let K=$[Y];if(G&&q){q=!1,Y++;continue}if(G&&K==="\\"){q=!0,Y++;continue}if(q=!1,(K==='"'||K==="'"||K==="`")&&!G){G=K,Y++;continue}if(K===G&&G!=="`"){G=null,Y++;continue}if(G==="`"&&K==="$"&&$[Y+1]==="{"){z++,Y+=2;continue}if(z>0&&K==="}"){z--,Y++;continue}if(K==="`"&&G==="`"&&z===0){G=null,Y++;continue}if(G){Y++;continue}if(K===Z)Q++;else if(K===J){if(Q--,Q===0)return Y}Y++}return-1}function S7($,Z){let J=Z,X={paren:0,bracket:0,brace:0},Q=null,Y=0;while(J<$.length){let G=$[J];if((J>0?$[J-1]:"")==="\\"&&Q){J++;continue}if((G==='"'||G==="'")&&!Q){Q=G,J++;continue}if(G===Q&&Q!=="`"){Q=null,J++;continue}if(G==="`"&&!Q){Q="`",J++;continue}if(G==="`"&&Q==="`"&&Y===0){Q=null,J++;continue}if(Q==="`"&&G==="$"&&$[J+1]==="{"){Y++,J+=2;continue}if(Y>0){if(G==="{")Y++;else if(G==="}")Y--;J++;continue}if(Q){J++;continue}if(X.paren===0&&X.bracket===0&&X.brace===0){if($.slice(J,J+2)==="}}"||$.slice(J,J+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")X.paren++;else if(G===")"){if(X.paren--,X.paren<0)break}else if(G==="[")X.bracket++;else if(G==="]"){if(X.bracket--,X.bracket<0)break}else if(G==="{")X.brace++;else if(G==="}"){if(X.brace--,X.brace<0)break}J++}return{expression:$.slice(Z,J),endPos:J}}function R5($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Q=null,Y=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Q){J+=z;continue}if((z==='"'||z==="'")&&!Q){Q=z,J+=z;continue}if(z===Q&&Q!=="`"){Q=null,J+=z;continue}if(z==="`"&&!Q){Q="`",J+=z;continue}if(z==="`"&&Q==="`"&&Y===0){Q=null,J+=z;continue}if(Q==="`"&&z==="$"&&$[G+1]==="{"){Y++,J+=z+$[G+1],G++;continue}if(Y>0&&z==="{"){Y++,J+=z;continue}if(Y>0&&z==="}"){Y--,J+=z;continue}if(Q){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}if(z==="|"&&$[G-1]==="\\"&&!Q){J=J.slice(0,-1)+z;continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function K1($,Z){let J=IX($,Z);return J.ok?{expression:J.expression,endPos:J.endPos}:null}function IX($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return{ok:!1,reason:"missing-open-paren",pos:J};let X=w0($,"(",")",J);if(X===-1)return{ok:!1,reason:"unclosed-paren",pos:J};return{ok:!0,expression:$.slice(J+1,X),endPos:X+1}}function kX($,Z){let J=$.lastIndexOf("<",Z);if(J===-1)return!1;return J>$.lastIndexOf(">",Z)}function O1($,Z,J,X){let Q=1,Y=X,G=new RegExp(`@${Z}\\s*\\(`,"g"),z=new RegExp(`@${J}(?![a-z])`,"g");while(Y<$.length&&Q>0){G.lastIndex=Y,z.lastIndex=Y;let q=G.exec($),K=z.exec($),W=q?q.index:1/0,U=K?K.index:1/0;if(W<U)Q++,Y=W+q[0].length;else if(U<1/0){if(Q--,Q===0)return U;Y=U+K[0].length}else break}return-1}function P7($,Z){let J=$.slice(Z).match(/^@if\s*/);if(!J)return null;let X=Z+J[0].length,Q=K1($,X);if(!Q)return null;let Y=Q.endPos,G=O1($,"if","endif",Y);if(G===-1)return null;let z=$.slice(Y,G),q=[],K=0,W="if",U=Q.expression,H=0,j=0;while(K<z.length){let B=z.indexOf("@",K);if(B===-1)break;K=B;let V=z.substring(B);if(kX(z,B)){K++;continue}if(/^@if\s*\(/.test(V)){j++,K++;continue}if(/^@endif(?![a-z])/.test(V)){j--,K+=6;continue}if(j===0){let F=V.match(/^@elseif\s*/);if(F){q.push({type:W,condition:U,content:z.substring(H,K),start:Y+H,end:Y+K});let L=K+F[0].length,O=K1(z,L);if(!O){K++;continue}W="elseif",U=O.expression,K=O.endPos,H=K;continue}else if(/^@else(?![a-z])/.test(V)){q.push({type:W,condition:U,content:z.substring(H,K),start:Y+H,end:Y+K}),W="else",U=void 0,K+=5,H=K;continue}}K++}return q.push({type:W,condition:U,content:z.slice(H),start:Y+H,end:Y+z.length}),{fullMatch:$.slice(Z,G+6),branches:q,start:Z,end:G+6}}function V2($){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 Y=P7($,X.index);if(Y)Z.push(Y),J.lastIndex=Y.end;X=J.exec($)}return Z}function Q9($,Z,J){let X=[],Q=new RegExp(`@${Z}\\s*\\(`,"g"),Y=Q.exec($);while(Y!==null){if(X.some((V)=>Y.index>V.start&&Y.index<V.end)){Y=Q.exec($);continue}let z=Y.index,q=z+Y[0].length-1,K=w0($,"(",")",q);if(K===-1){Y=Q.exec($);continue}let W=$.slice(q+1,K),U=K+1,H=O1($,Z,J,U);if(H===-1){Y=Q.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}),Q.lastIndex=B,Y=Q.exec($)}return X}function N5($,Z){let J=$.slice(Z).match(/^@switch\s*/);if(!J)return null;let X=Z+J[0].length,Q=K1($,X);if(!Q)return null;let Y=Q.endPos,G=O1($,"switch","endswitch",Y);if(G===-1)return null;let z=$.slice(Y,G),q=[],K=0,W=null,U=0;while(K<z.length){let H=z.slice(K),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(U++,W)W.content+=j[0];K+=j[0].length;continue}if(B){if(U--,W)W.content+=B[0];K+=B[0].length;continue}if(U>0){if(W)W.content+=z[K];K++;continue}let V=H.match(/^@case\s*/),F=H.match(/^@default(?![a-z])/),L=H.match(/^@break(?![a-z])/);if(V&&H.startsWith("@case")){if(W)q.push(W);let O=K+V[0].length,_=K1(z,O);if(!_){K++;continue}W={type:"case",value:_.expression,content:""},K=_.endPos}else if(F&&H.startsWith("@default")){if(W)q.push(W);W={type:"default",content:""},K+=F[0].length}else if(L&&H.startsWith("@break"))K+=L[0].length;else{if(W)W.content+=z[K];K++}}if(W)q.push(W);return{fullMatch:$.slice(Z,G+10),expression:Q.expression,cases:q,start:Z,end:G+10}}function TX($){let Z=[],J=0;while(J<$.length){let X=$.indexOf("{{",J),Q=$.indexOf("{!!",J),Y=!1,G;if(X===-1&&Q===-1)break;else if(X===-1)G=Q,Y=!0;else if(Q===-1)G=X,Y=!1;else if(Q<X)G=Q,Y=!0;else G=X,Y=!1;if(!Y&&$.slice(G,G+3)==="{{{")Y=!0;let z=Y?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",q=Y?z==="{{{"?"}}}":"!!}":"}}",K=G+z.length,W=EX($,K,q);if(W===-1){J=G+1;continue}let U=$.slice(K,W).trim(),H=W+q.length;Z.push({fullMatch:$.slice(G,H),expression:U,start:G,end:H,isRaw:Y}),J=H}return Z}function EX($,Z,J){let X=Z,Q=null,Y={paren:0,bracket:0,brace:0},G=0;while(X<$.length){let z=$[X];if((X>0?$[X-1]:"")==="\\"&&Q){X++;continue}if((z==='"'||z==="'")&&!Q){Q=z,X++;continue}if(z===Q&&Q!=="`"){Q=null,X++;continue}if(z==="`"&&!Q){Q="`",X++;continue}if(z==="`"&&Q==="`"&&G===0){Q=null,X++;continue}if(Q==="`"&&z==="$"&&$[X+1]==="{"){G++,X+=2;continue}if(G>0){if(z==="{")G++;else if(z==="}")G--;X++;continue}if(Q){X++;continue}if(z==="(")Y.paren++;else if(z===")")Y.paren--;else if(z==="[")Y.bracket++;else if(z==="]")Y.bracket--;else if(z==="{")Y.brace++;else if(z==="}")Y.brace--;if(Y.paren===0&&Y.bracket===0&&Y.brace<=0){if($.slice(X,X+J.length)===J)return X}X++}return-1}function bX($){let Z=R5($);if(Z.length===0)return{baseExpression:"",filters:[]};let J=Z[0],X=[];for(let Q=1;Q<Z.length;Q++){let Y=yX(Z[Q]);if(Y)X.push(Y)}return{baseExpression:J,filters:X}}function yX($){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(),Q=J+1,Y=w0(Z,"(",")",J);if(Y===-1)return{name:X,args:[]};let G=Z.slice(Q,Y),z=x7(G);return{name:X,args:z}}function x7($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Q=null,Y=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Q){J+=z;continue}if((z==='"'||z==="'")&&!Q){Q=z,J+=z;continue}if(z===Q&&Q!=="`"){Q=null,J+=z;continue}if(z==="`"&&!Q){Q="`",J+=z;continue}if(z==="`"&&Q==="`"&&Y===0){Q=null,J+=z;continue}if(Q==="`"&&z==="$"&&$[G+1]==="{"){Y++,J+="${",G++;continue}if(Y>0&&z==="{"){Y++,J+=z;continue}if(Y>0&&z==="}"){Y--,J+=z;continue}if(Q){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 CX($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;let X=w0($,"(",")",J);if(X===-1)return null;return{params:$.slice(J+1,X),endPos:X+1}}function SX($){let Z=[],X=new Y9($).tokenize().filter((Y)=>Y.type!=="WHITESPACE"&&Y.type!=="COMMENT"),Q=0;while(Q<X.length){let Y=X[Q],G=!1;if(Y.type==="IDENTIFIER"&&Y.value==="export"){if(G=!0,Q++,Q>=X.length)break}let z=X[Q];if(z.type==="IDENTIFIER"&&(z.value==="const"||z.value==="let"||z.value==="var")){let q=z.value;if(Q++,Q>=X.length)break;let K=X[Q];if(K.type==="IDENTIFIER"){let W=K.value;if(Q++,Q<X.length&&X[Q].type==="OPERATOR"&&X[Q].value==="="){Q++;let U=Q<X.length?X[Q].start:$.length,H=v7(X,Q,$);Q=H.nextIndex,Z.push({type:"variable",name:W,value:$.slice(U,H.endPos),exported:G,start:z.start,end:H.endPos})}}else if(K.type==="PUNCTUATION"&&(K.value==="{"||K.value==="[")){let W=K.start,U=K.value==="{"?"}":"]",H=w0($,K.value,U,W);if(H!==-1){let j=$.slice(W,H+1);if(Q=f7(X,H+1),Q<X.length&&X[Q].type==="OPERATOR"&&X[Q].value==="="){Q++;let B=Q<X.length?X[Q].start:$.length,V=v7(X,Q,$);Q=V.nextIndex;let F=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:F,value:`${$.slice(B,V.endPos)}; ${q} ${j} = ${F}`,exported:G,start:z.start,end:V.endPos})}}}}else if(z.type==="IDENTIFIER"&&z.value==="function"){let q=G?X[Q-1].start:z.start;if(Q++,Q>=X.length)break;let K=X[Q];if(K.type==="IDENTIFIER"){let W=K.value;Q++;let U=-1;while(Q<X.length){if(X[Q].type==="PUNCTUATION"&&X[Q].value==="{"){U=X[Q].start;break}Q++}if(U!==-1){let H=w0($,"{","}",U);if(H!==-1)Z.push({type:"function",name:W,value:$.slice(q,H+1).replace(/^export\s+/,""),exported:G,start:q,end:H+1}),Q=f7(X,H+1)}}}else Q++}return Z}function v7($,Z,J){let X=Z,Q={paren:0,bracket:0,brace:0},Y=Z<$.length?$[Z].start:J.length;while(X<$.length){let G=$[X];if(G.type==="PUNCTUATION"){if(G.value==="(")Q.paren++;else if(G.value===")")Q.paren--;else if(G.value==="[")Q.bracket++;else if(G.value==="]")Q.bracket--;else if(G.value==="{")Q.brace++;else if(G.value==="}")Q.brace--;if(G.value===";"&&Q.paren===0&&Q.bracket===0&&Q.brace===0){Y=G.start,X++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Q.paren===0&&Q.bracket===0&&Q.brace===0){Y=$[X-1]?.end??G.start;break}}Y=G.end,X++}return{nextIndex:X,endPos:Y}}function f7($,Z){for(let J=0;J<$.length;J++)if($[J].start>=Z)return J;return $.length}function PX($,Z,J){let X=$,Q=!0;while(Q){Q=!1;let Y=X.match(/@switch\s*\(/);if(!Y||Y.index===void 0)break;let G=Y.index,z=N5(X,G);if(!z)break;try{let q;if(B0(z.expression))q=H0(z.expression,Object.keys(Z))(...Object.values(Z));else q=Z0(z.expression,Z);let K="",W=!1;for(let U of z.cases)if(U.type==="default"){if(!W)K=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=Z0(U.value,Z);if(q===H){K=U.content.trim(),W=!0;break}}catch{continue}X=X.substring(0,G)+K+X.substring(z.end),Q=!0}catch(q){let K=q instanceof Error?q.message:String(q),W=G0("Switch",`Error evaluating @switch expression: ${K}`,Q0.EVALUATION_ERROR);X=X.substring(0,G)+W+X.substring(z.end);break}}return X}function vX($){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 fX($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(J,X)=>Z[Number(X)]??J)}function $1($,Z,J){let{masked:X,scripts:Q}=vX($);return fX(xX(X,Z,J),Q)}function xX($,Z,J){let X=$;X=PX(X,Z,J);{let Y=!0;while(Y){Y=!1;let G=X.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=K1(X,z+7);if(!q)break;let K=q.endPos,W=O1(X,"unless","endunless",K);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(K,W),H=q.expression,j=-1;{let V=0,F=/@(?:if|unless)\s*\(/g,L=/@(?:endif|endunless)(?![a-z])/g,O=/@else(?![a-z])/g,_=[],w;while((w=F.exec(U))!==null)_.push({pos:w.index,type:"open"});while((w=L.exec(U))!==null)_.push({pos:w.index,type:"close"});while((w=O.exec(U))!==null)_.push({pos:w.index,type:"else"});_.sort((R,N)=>R.pos-N.pos);for(let R of _)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),F=U.slice(j+5);B=`@if (${H})${F}@else ${V}@endif`}else B=`@if (!(${H}))${U}@endif`;X=X.substring(0,z)+B+X.substring(W+10),Y=!0}}X=A5(X,Z,J),X=M5(X,Z,J),X=D5(X,Z);let Q=()=>{let Y=V2(X);if(Y.length===0)return!1;let G=Array(Y.length);for(let K=Y.length-1;K>=0;K--){let W=Y[K];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=Z0(j.condition,Z);if(B)U=j.content,H=!0}catch(B){U=G0(j.type==="if"?"If":"Elseif",`Error in @${j.type}(${j.condition}): ${B instanceof Error?B.message:String(B)}`,Q0.EVALUATION_ERROR),H=!0}}G[K]=U}catch(U){let H=U instanceof Error?U.message:String(U);G[K]=G0("If",`Error processing @if block: ${H}`,Q0.EVALUATION_ERROR)}}let z=Array(Y.length*2+1),q=0;for(let K=0;K<Y.length;K++){let W=Y[K];z[K*2]=X.slice(q,W.start),z[K*2+1]=G[K],q=W.end}return z[Y.length*2]=X.slice(q),X=z.join(""),!0};while(!0){let Y=X;if(!Q())break;if(X===Y)break}return X}function g7($){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 Q=$[Z];if(Q==="\\"&&Z+1<$.length){X.push($[Z+1]),Z+=2;continue}if(Q===J){Z++;break}X.push(Q),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:X.join(""),consumed:Z}}function D5($,Z){let J=$;function X(z,q,K,W){let U=1,H=W,j=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${K}(?![a-z])`,"g");while(H<z.length&&U>0){j.lastIndex=H,B.lastIndex=H;let V=j.exec(z),F=B.exec(z),L=V?V.index:1/0,O=F?F.index:1/0;if(L<O)U++,H=L+V[0].length;else if(O<1/0){if(U--,U===0)return O;H=O+F[0].length}else break}return-1}function Q(z,q,K){let W=0,U=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${K}(?![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((F,L)=>F.pos-L.pos);for(let F of B)if(F.type==="open")W++;else if(F.type==="close")W--;else if(F.type==="else"&&W===0)return F.pos;return-1}{let z=!0;while(z){z=!1;let q=J.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,W,U,H=J.slice(K+5),j=g7(H);if(j)W=j.value,U=K+5+j.consumed;else U=K+5;let B=X(J,"auth","endauth",U);if(B===-1){console.warn(`[stx] @auth directive at position ${K} has no matching @endauth \u2014 the block was skipped.`);break}let V=J.slice(U,B),F=Q(V,"auth","endauth"),L;if(!Z.auth)L=!1;else L=W?q1(`auth?.check && auth?.user?.[${W}]`,Z):q1("auth?.check",Z);let O;if(F!==-1){let _=V.slice(0,F),w=V.slice(F+5);O=L?_:w}else O=L?V:"";J=J.substring(0,K)+O+J.substring(B+8),z=!0}}{let z=!0;while(z){z=!1;let q=J.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,W,U,H=J.slice(K+6),j=g7(H);if(j)W=j.value,U=K+6+j.consumed;else U=K+6;let B=X(J,"guest","endguest",U);if(B===-1){console.warn(`[stx] @guest directive at position ${K} has no matching @endguest \u2014 the block was skipped.`);break}let V=J.slice(U,B),F=Q(V,"guest","endguest"),L;if(!Z.auth)L=!0;else L=W?q1(`!auth?.check || !auth?.user?.[${W}]`,Z):q1("!auth?.check",Z);let O;if(F!==-1){let _=V.slice(0,F),w=V.slice(F+5);O=L?_:w}else O=L?V:"";J=J.substring(0,K)+O+J.substring(B+9),z=!0}}function Y(z,q,K){if(Z.userCan&&typeof Z.userCan[z]==="boolean")return Z.userCan[z];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let W=[z];if(q)W.push(q);if(K){let U=q1(K,Z);W.push(U)}return Z.permissions.check(...W)}catch{return!1}return!1}function G(z){let q=z.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!q)return null;return{ability:q[1],type:q[2],id:q[3]?.trim(),paramsEnd:q[0].length}}for(let z of["can","cannot"]){let q=`end${z}`,K=z==="can"?"elsecan":"elsecannot",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,F=X(J,z,q,V);if(F===-1){console.warn(`[stx] @${z} directive at position ${H} has no matching @${q} \u2014 the block was skipped.`);break}let L=J.slice(V,F),O=[],_=0,w=new RegExp(`@${z}\\s*\\(`,"g"),R=new RegExp(`@${q}(?![a-z])`,"g"),N=new RegExp(`@${K}\\s*\\(`,"g"),A=/@else(?![a-z])/g,k=[],D;while((D=w.exec(L))!==null)k.push({pos:D.index,type:"open"});while((D=R.exec(L))!==null)k.push({pos:D.index,type:"close"});while((D=N.exec(L))!==null)k.push({pos:D.index,type:"elseDirective"});while((D=A.exec(L))!==null)k.push({pos:D.index,type:"else"});k.sort((y,b)=>y.pos-b.pos);for(let y of k){if(y.type==="open"){_++;continue}if(y.type==="close"){_--;continue}if(_===0)O.push(y)}let I=[],T=0;for(let y=0;y<O.length;y++){let b=O[y];if(I.push({content:L.slice(T,b.pos),ability:void 0}),b.type==="elseDirective"){let P=L.slice(b.pos+`@${K}`.length),g=G(P);if(g){I[I.length-1]={content:L.slice(T,b.pos)},T=b.pos+`@${K}`.length+g.paramsEnd,I.push({content:"",ability:g.ability,type:g.type,id:g.id}),I.pop();let c=O[y+1],l=c?c.pos:L.length;I.push({content:L.slice(T,l),ability:g.ability,type:g.type,id:g.id}),T=l}}else T=b.pos+5}if(T<L.length){let y=I[I.length-1];if(O.length>0&&O[O.length-1].type==="else")I.push({content:L.slice(T),isFinalElse:!0});else if(I.length===0)I.push({content:L.slice(T)})}let M=Y(B.ability,B.type,B.id),E=z==="can"?M:!M,C="";if(E)C=I[0]?.content||"";else{let y=!1;for(let b=1;b<I.length;b++){let P=I[b];if(P.isFinalElse){C=P.content,y=!0;break}if(P.ability){let g=Y(P.ability,P.type,P.id);if(z==="can"?g:!g){C=P.content,y=!0;break}}}if(!y&&I.length>0){let b=I[I.length-1];if(b.isFinalElse)C=b.content}}J=J.substring(0,H)+C+J.substring(F+`@${q}`.length),W=!0}}return J}function A5($,Z,J){let X=$;function Q(Y,G,z,q,K){let W=!0;while(W){W=!1;let U=new RegExp(`@${G}\\s*\\(`),H=Y.match(U);if(!H||H.index===void 0)break;let j=H.index,B=K1(Y,j+`@${G}`.length);if(!B)break;let V=B.endPos,F=O1(Y,G,z,V);if(F===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${z} \u2014 the block was skipped.`);break}let L=Y.slice(V,F),O=B.expression,_=-1,w=0,R=0;while(R<L.length){let N=L.indexOf("@",R);if(N===-1)break;let A=L.substring(N);if(/^@(?:if|unless|isset|empty)\s*\(/.test(A)){w++,R=N+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(A)){w--,R=N+1;continue}if(w===0&&/^@else(?![a-z])/.test(A)){_=N;break}R=N+1}try{let N=q(O.trim()),A;if(_!==-1){let k=L.slice(0,_),D=L.slice(_+5);A=N?k:D}else A=N?L:"";Y=Y.substring(0,j)+A+Y.substring(F+`@${z}`.length),W=!0}catch(N){let A=N instanceof Error?N.message:String(N),k=G0(K,`Error processing @${G} directive: ${A}`,Q0.EVALUATION_ERROR);Y=Y.substring(0,j)+k+Y.substring(F+`@${z}`.length);break}}return Y}return X=Q(X,"isset","endisset",(Y)=>{let G=q1(Y,Z);return G!==void 0&&G!==null},"Isset"),X=Q(X,"empty","endempty",(Y)=>{let G=q1(Y,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 M5($,Z,J){let X=$,Q="development";function Y(G,z,q,K){let W=new RegExp(`@${z}(?![a-z])`,"g"),U=new RegExp(`@${q}(?![a-z])`,"g"),H=new RegExp(`^@${z}(?![a-z])`),j=new RegExp(`^@${q}(?![a-z])`),B=G,V=!0;while(V){V=!1,W.lastIndex=0;let F=W.exec(B);if(!F)break;let L=F.index,O=L+F[0].length;if(z==="env"){let M=B.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!M)break;O+=M[0].length,K=Q===M[2]}let _=1,w=O,R=-1;while(_>0&&w<B.length){W.lastIndex=w,U.lastIndex=w;let M=W.exec(B),E=U.exec(B),C=M?M.index:1/0,y=E?E.index:1/0;if(C<y)_++,w=C+M[0].length;else if(y<1/0){if(_--,_===0){R=y;break}w=y+E[0].length}else break}if(R===-1){console.warn(`[stx] @${z} directive at position ${L} has no matching @${q} \u2014 the block was skipped.`);break}let N=B.substring(O,R),A=-1,k=0,D=0;while(D<N.length){let M=N.indexOf("@",D);if(M===-1)break;let E=N.substring(M);if(H.test(E)){k++,D=M+1;continue}if(j.test(E)){k--,D=M+1;continue}if(k===0&&/^@else(?![a-z])/.test(E)){A=M;break}D=M+1}let I;if(A!==-1){let M=N.slice(0,A),E=N.slice(A+5);I=K?M:E}else I=K?N:"";let T=`@${q}`.length;B=B.substring(0,L)+I+B.substring(R+T),V=!0}return B}return X=Y(X,"env","endenv",!1),X=Y(X,"production","endproduction",Q==="production"),X=Y(X,"development","enddevelopment",Q==="development"),X=Y(X,"staging","endstaging",Q==="staging"),X=Y(X,"testing","endtesting",Q==="testing"),X}var I5=new WeakMap;function h7($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function F1($,Z){if(!$)return Z?.nonceGenerator?.()??h7();let J=I5.get($);if(!J)J=Z?.nonceGenerator?.()??h7(),I5.set($,J);return J}function eW($){I5.delete($)}function u7($,Z){let J=[];for(let[X,Q]of Object.entries($)){if(Q===void 0||Q===null)continue;if(typeof Q==="boolean"){if(Q)J.push(X);continue}if(Array.isArray(Q)){let Y=[...Q];if(Z&&(X==="script-src"||X==="style-src"))Y=Y.filter((G)=>!G.startsWith("'nonce-")),Y.push(`'nonce-${Z}'`);if(Y.length>0)J.push(`${X} ${Y.join(" ")}`)}}return J.join("; ")}function T5($,Z){return`<meta http-equiv="Content-Security-Policy" content="${u7($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var gX={"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},k5={"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},hX={"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'"]},uX={"default-src":["'none'"],"frame-ancestors":["'none'"]};function $U($){return{enabled:!0,directives:{strict:gX,moderate:k5,relaxed:hX,api:uX}[$]||k5,useNonce:$==="strict",addMetaTag:!0}}function ZU($,Z){let J={...$};for(let[X,Q]of Object.entries(Z)){let Y=X,G=J[Y];if(Q===void 0||Q===null)continue;if(typeof Q==="boolean")J[Y]=G||Q;else if(Array.isArray(Q)){let z=Array.isArray(G)?G:[],q=[...new Set([...z,...Q])];J[Y]=q}}return J}function d7($,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?F1(J,Z):void 0,Q=T5(Z.directives,X);return $.replace(/<head([^>]*)>/,`<head$1>
3225
- ${Q}`)}function m7($,Z){let J=$;return J=J.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(X,Q)=>{if(Q.includes("nonce="))return X;return`<script nonce="${Z}"${Q}>`}),J=J.replace(/<style([^>]*)>/gi,(X,Q)=>{if(Q.includes("nonce="))return X;return`<style nonce="${Z}"${Q}>`}),J}function l7($,Z,J,X){let Q=$,Y=X.csp;if(Q=Q.replace(/@csp\b/g,()=>{if(!Y?.enabled||!Y.directives)return"<!-- CSP not configured -->";let G=Y.useNonce?F1(Z,Y):void 0;return T5(Y.directives,G)}),Q=Q.replace(/@cspNonce\b/g,()=>{if(!Y?.enabled||!Y.useNonce)return"";return F1(Z,Y)}),Y?.enabled&&Y.useNonce)Z.cspNonce=F1(Z,Y);return Q}var dX={name:"csp",handler:($,Z,J,X)=>{let Y=J.__stx_options?.csp;if(!Y?.enabled||!Y.directives)return"<!-- CSP not configured -->";let G=Y.useNonce?F1(J,Y):void 0;return T5(Y.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},mX={name:"cspNonce",handler:($,Z,J,X)=>{let Y=J.__stx_options?.csp;if(!Y?.enabled||!Y.useNonce)return"";return F1(J,Y)},hasEndTag:!1,description:"Output the current CSP nonce value"};function JU(){return[dX,mX]}function XU($){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 lX($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function YU($,Z){if(!$.enabled)return{};let J=$.useNonce?F1(Z,$):void 0,X=u7($.directives,J);return{[lX($.reportOnly)]:X}}var QU={enabled:!1,reportOnly:!1,directives:k5,useNonce:!1,addMetaTag:!0};import cX from"crypto";var pX=40,c7="_token",E5=null;function iX($=pX){let Z=cX.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return E5=Z,Z}function nX(){if(!E5)iX();return E5}function sX($=c7){let Z=nX();return`<input type="hidden" name="${$}" value="${Z}">`}function p7($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,J,X)=>{return sX(X||c7)})}async function i7($,Z,J,X){if(!X.customDirectives||X.customDirectives.length===0)return $;let Q=$;for(let Y of X.customDirectives){if(!Y.name||typeof Y.handler!=="function"){if(X.debug)console.warn("Invalid custom directive:",Y);continue}if(Y.hasEndTag)Q=await oX(Q,Y,Z,J,X);else Q=await rX(Q,Y,Z,J,X)}return Q}async function oX($,Z,J,X,Q){let{name:Y,handler:G}=Z,z=`@${Y}`,q=`@end${Y}`,K=$,W=f1(`${z}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${q}`,"g"),U=[],H=W.exec(K);while(H!==null){let[j,B="",V=""]=H,F=H.index||0;try{let L=B?n7(B):[],O=V.trim(),_=await G(O,L,J,X);U.push({original:j,processed:_,startIndex:F})}catch(L){let O=L instanceof Error?L.message:String(L);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,L);U.push({original:j,processed:G0("CustomDirective",`Error in @${Y}${B?`(${B})`:""}: ${O}`,Q0.EVALUATION_ERROR),startIndex:F})}H=W.exec(K)}for(let j=U.length-1;j>=0;j--){let{original:B,processed:V}=U[j];K=K.replace(B,V)}return K}async function rX($,Z,J,X,Q){let{name:Y,handler:G}=Z,z=$,q=f1(`@${Y}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),K=[],W=q.exec(z);while(W!==null){let[j,B=""]=W,V=W.index||0;try{let F=n7(B),L=await G("",F,J,X);K.push({original:j,processed:L,startIndex:V})}catch(F){let L=F instanceof Error?F.message:String(F);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,F);K.push({original:j,processed:G0("CustomDirective",`Error in @${Y}(${B}): ${L}`,Q0.EVALUATION_ERROR),startIndex:V})}W=q.exec(z)}let U=f1(`@${Y}(?!\\w)(?!\\s*\\()`,"g"),H=U.exec(z);while(H!==null){let[j]=H,B=H.index||0;try{let V=await G("",[],J,X);K.push({original:j,processed:V,startIndex:B})}catch(V){let F=V instanceof Error?V.message:String(V);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,V);K.push({original:j,processed:G0("CustomDirective",`Error in @${Y}: ${F}`,Q0.EVALUATION_ERROR),startIndex:B})}H=U.exec(z)}for(let j=K.length-1;j>=0;j--){let{original:B,processed:V}=K[j];z=z.replace(B,V)}return z}function n7($){if(!$.trim())return[];let Z=[],J="",X=!1,Q="";for(let Y=0;Y<$.length;Y++){let G=$[Y];if((G==='"'||G==="'")&&(Y===0||$[Y-1]!=="\\"))if(!X)X=!0,Q=G;else if(G===Q)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((Y)=>{let G=Y.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var s7=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,o7=/^[A-Za-z_$][\w$]*$/,aX=new Set(["light","dark","system"]);function w1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function tX($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,J=Z.appearance,X=Z.colorMode;if(w1(Z.storageKey,"storageKey"),!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap appearance must be an object");if(!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap colorMode must be an object");if(w1(J.key,"appearance.key"),w1(J.attribute,"appearance.attribute"),w1(J.default,"appearance.default"),w1(X.key,"colorMode.key"),w1(X.attribute,"colorMode.attribute"),w1(X.default,"colorMode.default"),!o7.test(J.key)||!o7.test(X.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!s7.test(J.attribute)||!s7.test(X.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(J.allowed)||J.allowed.length===0||J.allowed.some((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");if(!aX.has(X.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:J.key,attribute:J.attribute,allowed:[...new Set(J.allowed)],default:J.default},colorMode:{key:X.key,attribute:X.attribute,default:X.default}}}function eX($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function $Y($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${eX($)};const root=document.documentElement;const MODES=["light","dark","system"];function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);const parsed=raw?JSON.parse(raw):{};if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed))stored=parsed}catch{}return stored}function write(stored){try{localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();return{appearance:config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default,colorMode:MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default}}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return store(config.appearance.key,config.appearance.allowed,name)},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function ZY($,Z){let J=1,X=null,Q=!1;for(let Y=Z+1;Y<$.length;Y++){let G=$[Y];if(Q){Q=!1;continue}if(X){if(G==="\\")Q=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Y}return-1}function r7($,Z){let J=$,X=/@appearanceBootstrap\s*\(/g,Q;while((Q=X.exec(J))!==null){let Y=Q.index+Q[0].length-1,G=ZY(J,Y);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let z=J.slice(Y+1,G).trim(),q=Z0(`(${z})`,Z),K=$Y(tX(q));J=J.slice(0,Q.index)+K+J.slice(G+1),X.lastIndex=Q.index+K.length}return J}import JY from"crypto";function R0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var y5={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function XY($){return{...y5,...$.forms?.classes}}function G9($,Z,J,X){let Q=$||Z;return J?`${Q} ${X}`:Q}function u0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function x1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${R0(Z)}"`}function b5($,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="${R0(`${u0($)}-error`)}"`;return X}function YY(){return JY.randomUUID()}function _U($,Z,J,X){let Q=XY(X),Y=$;return Y=GY(Y,Z),Y=O2(Y,Z),Y=C5(Y,Z,Q),Y=S5(Y,Z,Q),Y}function O2($,Z){let J=$;return J=J.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let X=YY();Z.csrf={token:X}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${R0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),J=J.replace(/@method\(['"]([^'"]+)['"]\)/g,(X,Q)=>{let Y=Q.toUpperCase();if(Q&&!["GET","POST"].includes(Y))return`<input type="hidden" name="_method" value="${R0(Y)}">`;return X}),J}function C5($,Z,J=y5){let X=$;return X=X.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Q,Y,G,z,q,K="")=>{let W=Y||G||"POST",U=z||q||"",H=W1(K),j=W.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",V=`<form method="${R0(B)}" action="${R0(U)}"${H?` ${H}`:""}>`;if(V+=`
3224
+ `)this.line++,this.column=0;else this.column++;this.pos++}}peek($){return this.source[this.pos+$]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState($){this.pos=$.pos,this.line=$.line,this.column=$.column}}function w0($,Z,J,X=0){let Q=0,Y=X,G=null,z=0,q=!1;while(Y<$.length){let K=$[Y];if(G&&q){q=!1,Y++;continue}if(G&&K==="\\"){q=!0,Y++;continue}if(q=!1,(K==='"'||K==="'"||K==="`")&&!G){G=K,Y++;continue}if(K===G&&G!=="`"){G=null,Y++;continue}if(G==="`"&&K==="$"&&$[Y+1]==="{"){z++,Y+=2;continue}if(z>0&&K==="}"){z--,Y++;continue}if(K==="`"&&G==="`"&&z===0){G=null,Y++;continue}if(G){Y++;continue}if(K===Z)Q++;else if(K===J){if(Q--,Q===0)return Y}Y++}return-1}function S7($,Z){let J=Z,X={paren:0,bracket:0,brace:0},Q=null,Y=0;while(J<$.length){let G=$[J];if((J>0?$[J-1]:"")==="\\"&&Q){J++;continue}if((G==='"'||G==="'")&&!Q){Q=G,J++;continue}if(G===Q&&Q!=="`"){Q=null,J++;continue}if(G==="`"&&!Q){Q="`",J++;continue}if(G==="`"&&Q==="`"&&Y===0){Q=null,J++;continue}if(Q==="`"&&G==="$"&&$[J+1]==="{"){Y++,J+=2;continue}if(Y>0){if(G==="{")Y++;else if(G==="}")Y--;J++;continue}if(Q){J++;continue}if(X.paren===0&&X.bracket===0&&X.brace===0){if($.slice(J,J+2)==="}}"||$.slice(J,J+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")X.paren++;else if(G===")"){if(X.paren--,X.paren<0)break}else if(G==="[")X.bracket++;else if(G==="]"){if(X.bracket--,X.bracket<0)break}else if(G==="{")X.brace++;else if(G==="}"){if(X.brace--,X.brace<0)break}J++}return{expression:$.slice(Z,J),endPos:J}}function R5($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Q=null,Y=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Q){J+=z;continue}if((z==='"'||z==="'")&&!Q){Q=z,J+=z;continue}if(z===Q&&Q!=="`"){Q=null,J+=z;continue}if(z==="`"&&!Q){Q="`",J+=z;continue}if(z==="`"&&Q==="`"&&Y===0){Q=null,J+=z;continue}if(Q==="`"&&z==="$"&&$[G+1]==="{"){Y++,J+=z+$[G+1],G++;continue}if(Y>0&&z==="{"){Y++,J+=z;continue}if(Y>0&&z==="}"){Y--,J+=z;continue}if(Q){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}if(z==="|"&&$[G-1]==="\\"&&!Q){J=J.slice(0,-1)+z;continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function K1($,Z){let J=kX($,Z);return J.ok?{expression:J.expression,endPos:J.endPos}:null}function kX($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return{ok:!1,reason:"missing-open-paren",pos:J};let X=w0($,"(",")",J);if(X===-1)return{ok:!1,reason:"unclosed-paren",pos:J};return{ok:!0,expression:$.slice(J+1,X),endPos:X+1}}function TX($,Z){let J=$.lastIndexOf("<",Z);if(J===-1)return!1;return J>$.lastIndexOf(">",Z)}function O1($,Z,J,X){let Q=1,Y=X,G=new RegExp(`@${Z}\\s*\\(`,"g"),z=new RegExp(`@${J}(?![a-z])`,"g");while(Y<$.length&&Q>0){G.lastIndex=Y,z.lastIndex=Y;let q=G.exec($),K=z.exec($),W=q?q.index:1/0,U=K?K.index:1/0;if(W<U)Q++,Y=W+q[0].length;else if(U<1/0){if(Q--,Q===0)return U;Y=U+K[0].length}else break}return-1}function P7($,Z){let J=$.slice(Z).match(/^@if\s*/);if(!J)return null;let X=Z+J[0].length,Q=K1($,X);if(!Q)return null;let Y=Q.endPos,G=O1($,"if","endif",Y);if(G===-1)return null;let z=$.slice(Y,G),q=[],K=0,W="if",U=Q.expression,H=0,j=0;while(K<z.length){let B=z.indexOf("@",K);if(B===-1)break;K=B;let V=z.substring(B);if(TX(z,B)){K++;continue}if(/^@if\s*\(/.test(V)){j++,K++;continue}if(/^@endif(?![a-z])/.test(V)){j--,K+=6;continue}if(j===0){let F=V.match(/^@elseif\s*/);if(F){q.push({type:W,condition:U,content:z.substring(H,K),start:Y+H,end:Y+K});let L=K+F[0].length,O=K1(z,L);if(!O){K++;continue}W="elseif",U=O.expression,K=O.endPos,H=K;continue}else if(/^@else(?![a-z])/.test(V)){q.push({type:W,condition:U,content:z.substring(H,K),start:Y+H,end:Y+K}),W="else",U=void 0,K+=5,H=K;continue}}K++}return q.push({type:W,condition:U,content:z.slice(H),start:Y+H,end:Y+z.length}),{fullMatch:$.slice(Z,G+6),branches:q,start:Z,end:G+6}}function V2($){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 Y=P7($,X.index);if(Y)Z.push(Y),J.lastIndex=Y.end;X=J.exec($)}return Z}function Q9($,Z,J){let X=[],Q=new RegExp(`@${Z}\\s*\\(`,"g"),Y=Q.exec($);while(Y!==null){if(X.some((V)=>Y.index>V.start&&Y.index<V.end)){Y=Q.exec($);continue}let z=Y.index,q=z+Y[0].length-1,K=w0($,"(",")",q);if(K===-1){Y=Q.exec($);continue}let W=$.slice(q+1,K),U=K+1,H=O1($,Z,J,U);if(H===-1){Y=Q.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}),Q.lastIndex=B,Y=Q.exec($)}return X}function N5($,Z){let J=$.slice(Z).match(/^@switch\s*/);if(!J)return null;let X=Z+J[0].length,Q=K1($,X);if(!Q)return null;let Y=Q.endPos,G=O1($,"switch","endswitch",Y);if(G===-1)return null;let z=$.slice(Y,G),q=[],K=0,W=null,U=0;while(K<z.length){let H=z.slice(K),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(U++,W)W.content+=j[0];K+=j[0].length;continue}if(B){if(U--,W)W.content+=B[0];K+=B[0].length;continue}if(U>0){if(W)W.content+=z[K];K++;continue}let V=H.match(/^@case\s*/),F=H.match(/^@default(?![a-z])/),L=H.match(/^@break(?![a-z])/);if(V&&H.startsWith("@case")){if(W)q.push(W);let O=K+V[0].length,_=K1(z,O);if(!_){K++;continue}W={type:"case",value:_.expression,content:""},K=_.endPos}else if(F&&H.startsWith("@default")){if(W)q.push(W);W={type:"default",content:""},K+=F[0].length}else if(L&&H.startsWith("@break"))K+=L[0].length;else{if(W)W.content+=z[K];K++}}if(W)q.push(W);return{fullMatch:$.slice(Z,G+10),expression:Q.expression,cases:q,start:Z,end:G+10}}function EX($){let Z=[],J=0;while(J<$.length){let X=$.indexOf("{{",J),Q=$.indexOf("{!!",J),Y=!1,G;if(X===-1&&Q===-1)break;else if(X===-1)G=Q,Y=!0;else if(Q===-1)G=X,Y=!1;else if(Q<X)G=Q,Y=!0;else G=X,Y=!1;if(!Y&&$.slice(G,G+3)==="{{{")Y=!0;let z=Y?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",q=Y?z==="{{{"?"}}}":"!!}":"}}",K=G+z.length,W=bX($,K,q);if(W===-1){J=G+1;continue}let U=$.slice(K,W).trim(),H=W+q.length;Z.push({fullMatch:$.slice(G,H),expression:U,start:G,end:H,isRaw:Y}),J=H}return Z}function bX($,Z,J){let X=Z,Q=null,Y={paren:0,bracket:0,brace:0},G=0;while(X<$.length){let z=$[X];if((X>0?$[X-1]:"")==="\\"&&Q){X++;continue}if((z==='"'||z==="'")&&!Q){Q=z,X++;continue}if(z===Q&&Q!=="`"){Q=null,X++;continue}if(z==="`"&&!Q){Q="`",X++;continue}if(z==="`"&&Q==="`"&&G===0){Q=null,X++;continue}if(Q==="`"&&z==="$"&&$[X+1]==="{"){G++,X+=2;continue}if(G>0){if(z==="{")G++;else if(z==="}")G--;X++;continue}if(Q){X++;continue}if(z==="(")Y.paren++;else if(z===")")Y.paren--;else if(z==="[")Y.bracket++;else if(z==="]")Y.bracket--;else if(z==="{")Y.brace++;else if(z==="}")Y.brace--;if(Y.paren===0&&Y.bracket===0&&Y.brace<=0){if($.slice(X,X+J.length)===J)return X}X++}return-1}function yX($){let Z=R5($);if(Z.length===0)return{baseExpression:"",filters:[]};let J=Z[0],X=[];for(let Q=1;Q<Z.length;Q++){let Y=CX(Z[Q]);if(Y)X.push(Y)}return{baseExpression:J,filters:X}}function CX($){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(),Q=J+1,Y=w0(Z,"(",")",J);if(Y===-1)return{name:X,args:[]};let G=Z.slice(Q,Y),z=x7(G);return{name:X,args:z}}function x7($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Q=null,Y=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Q){J+=z;continue}if((z==='"'||z==="'")&&!Q){Q=z,J+=z;continue}if(z===Q&&Q!=="`"){Q=null,J+=z;continue}if(z==="`"&&!Q){Q="`",J+=z;continue}if(z==="`"&&Q==="`"&&Y===0){Q=null,J+=z;continue}if(Q==="`"&&z==="$"&&$[G+1]==="{"){Y++,J+="${",G++;continue}if(Y>0&&z==="{"){Y++,J+=z;continue}if(Y>0&&z==="}"){Y--,J+=z;continue}if(Q){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 SX($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;let X=w0($,"(",")",J);if(X===-1)return null;return{params:$.slice(J+1,X),endPos:X+1}}function PX($){let Z=[],X=new Y9($).tokenize().filter((Y)=>Y.type!=="WHITESPACE"&&Y.type!=="COMMENT"),Q=0;while(Q<X.length){let Y=X[Q],G=!1;if(Y.type==="IDENTIFIER"&&Y.value==="export"){if(G=!0,Q++,Q>=X.length)break}let z=X[Q];if(z.type==="IDENTIFIER"&&(z.value==="const"||z.value==="let"||z.value==="var")){let q=z.value;if(Q++,Q>=X.length)break;let K=X[Q];if(K.type==="IDENTIFIER"){let W=K.value;if(Q++,Q<X.length&&X[Q].type==="OPERATOR"&&X[Q].value==="="){Q++;let U=Q<X.length?X[Q].start:$.length,H=v7(X,Q,$);Q=H.nextIndex,Z.push({type:"variable",name:W,value:$.slice(U,H.endPos),exported:G,start:z.start,end:H.endPos})}}else if(K.type==="PUNCTUATION"&&(K.value==="{"||K.value==="[")){let W=K.start,U=K.value==="{"?"}":"]",H=w0($,K.value,U,W);if(H!==-1){let j=$.slice(W,H+1);if(Q=f7(X,H+1),Q<X.length&&X[Q].type==="OPERATOR"&&X[Q].value==="="){Q++;let B=Q<X.length?X[Q].start:$.length,V=v7(X,Q,$);Q=V.nextIndex;let F=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:F,value:`${$.slice(B,V.endPos)}; ${q} ${j} = ${F}`,exported:G,start:z.start,end:V.endPos})}}}}else if(z.type==="IDENTIFIER"&&z.value==="function"){let q=G?X[Q-1].start:z.start;if(Q++,Q>=X.length)break;let K=X[Q];if(K.type==="IDENTIFIER"){let W=K.value;Q++;let U=-1;while(Q<X.length){if(X[Q].type==="PUNCTUATION"&&X[Q].value==="{"){U=X[Q].start;break}Q++}if(U!==-1){let H=w0($,"{","}",U);if(H!==-1)Z.push({type:"function",name:W,value:$.slice(q,H+1).replace(/^export\s+/,""),exported:G,start:q,end:H+1}),Q=f7(X,H+1)}}}else Q++}return Z}function v7($,Z,J){let X=Z,Q={paren:0,bracket:0,brace:0},Y=Z<$.length?$[Z].start:J.length;while(X<$.length){let G=$[X];if(G.type==="PUNCTUATION"){if(G.value==="(")Q.paren++;else if(G.value===")")Q.paren--;else if(G.value==="[")Q.bracket++;else if(G.value==="]")Q.bracket--;else if(G.value==="{")Q.brace++;else if(G.value==="}")Q.brace--;if(G.value===";"&&Q.paren===0&&Q.bracket===0&&Q.brace===0){Y=G.start,X++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Q.paren===0&&Q.bracket===0&&Q.brace===0){Y=$[X-1]?.end??G.start;break}}Y=G.end,X++}return{nextIndex:X,endPos:Y}}function f7($,Z){for(let J=0;J<$.length;J++)if($[J].start>=Z)return J;return $.length}function vX($,Z,J){let X=$,Q=!0;while(Q){Q=!1;let Y=X.match(/@switch\s*\(/);if(!Y||Y.index===void 0)break;let G=Y.index,z=N5(X,G);if(!z)break;try{let q;if(B0(z.expression))q=H0(z.expression,Object.keys(Z))(...Object.values(Z));else q=Z0(z.expression,Z);let K="",W=!1;for(let U of z.cases)if(U.type==="default"){if(!W)K=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=Z0(U.value,Z);if(q===H){K=U.content.trim(),W=!0;break}}catch{continue}X=X.substring(0,G)+K+X.substring(z.end),Q=!0}catch(q){let K=q instanceof Error?q.message:String(q),W=G0("Switch",`Error evaluating @switch expression: ${K}`,Q0.EVALUATION_ERROR);X=X.substring(0,G)+W+X.substring(z.end);break}}return X}function fX($){let Z=[];return{masked:$.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(X)=>{return Z.push(X),`\x00stx-script-${Z.length-1}\x00`}),scripts:Z}}function xX($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(J,X)=>Z[Number(X)]??J)}function $1($,Z,J){let{masked:X,scripts:Q}=fX($);return xX(gX(X,Z,J),Q)}function gX($,Z,J){let X=$;X=vX(X,Z,J);{let Y=!0;while(Y){Y=!1;let G=X.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=K1(X,z+7);if(!q)break;let K=q.endPos,W=O1(X,"unless","endunless",K);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(K,W),H=q.expression,j=-1;{let V=0,F=/@(?:if|unless)\s*\(/g,L=/@(?:endif|endunless)(?![a-z])/g,O=/@else(?![a-z])/g,_=[],w;while((w=F.exec(U))!==null)_.push({pos:w.index,type:"open"});while((w=L.exec(U))!==null)_.push({pos:w.index,type:"close"});while((w=O.exec(U))!==null)_.push({pos:w.index,type:"else"});_.sort((R,N)=>R.pos-N.pos);for(let R of _)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),F=U.slice(j+5);B=`@if (${H})${F}@else ${V}@endif`}else B=`@if (!(${H}))${U}@endif`;X=X.substring(0,z)+B+X.substring(W+10),Y=!0}}X=A5(X,Z,J),X=M5(X,Z,J),X=D5(X,Z);let Q=()=>{let Y=V2(X);if(Y.length===0)return!1;let G=Array(Y.length);for(let K=Y.length-1;K>=0;K--){let W=Y[K];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=Z0(j.condition,Z);if(B)U=j.content,H=!0}catch(B){U=G0(j.type==="if"?"If":"Elseif",`Error in @${j.type}(${j.condition}): ${B instanceof Error?B.message:String(B)}`,Q0.EVALUATION_ERROR),H=!0}}G[K]=U}catch(U){let H=U instanceof Error?U.message:String(U);G[K]=G0("If",`Error processing @if block: ${H}`,Q0.EVALUATION_ERROR)}}let z=Array(Y.length*2+1),q=0;for(let K=0;K<Y.length;K++){let W=Y[K];z[K*2]=X.slice(q,W.start),z[K*2+1]=G[K],q=W.end}return z[Y.length*2]=X.slice(q),X=z.join(""),!0};while(!0){let Y=X;if(!Q())break;if(X===Y)break}return X}function g7($){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 Q=$[Z];if(Q==="\\"&&Z+1<$.length){X.push($[Z+1]),Z+=2;continue}if(Q===J){Z++;break}X.push(Q),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:X.join(""),consumed:Z}}function D5($,Z){let J=$;function X(z,q,K,W){let U=1,H=W,j=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${K}(?![a-z])`,"g");while(H<z.length&&U>0){j.lastIndex=H,B.lastIndex=H;let V=j.exec(z),F=B.exec(z),L=V?V.index:1/0,O=F?F.index:1/0;if(L<O)U++,H=L+V[0].length;else if(O<1/0){if(U--,U===0)return O;H=O+F[0].length}else break}return-1}function Q(z,q,K){let W=0,U=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${K}(?![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((F,L)=>F.pos-L.pos);for(let F of B)if(F.type==="open")W++;else if(F.type==="close")W--;else if(F.type==="else"&&W===0)return F.pos;return-1}{let z=!0;while(z){z=!1;let q=J.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,W,U,H=J.slice(K+5),j=g7(H);if(j)W=j.value,U=K+5+j.consumed;else U=K+5;let B=X(J,"auth","endauth",U);if(B===-1){console.warn(`[stx] @auth directive at position ${K} has no matching @endauth \u2014 the block was skipped.`);break}let V=J.slice(U,B),F=Q(V,"auth","endauth"),L;if(!Z.auth)L=!1;else L=W?q1(`auth?.check && auth?.user?.[${W}]`,Z):q1("auth?.check",Z);let O;if(F!==-1){let _=V.slice(0,F),w=V.slice(F+5);O=L?_:w}else O=L?V:"";J=J.substring(0,K)+O+J.substring(B+8),z=!0}}{let z=!0;while(z){z=!1;let q=J.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,W,U,H=J.slice(K+6),j=g7(H);if(j)W=j.value,U=K+6+j.consumed;else U=K+6;let B=X(J,"guest","endguest",U);if(B===-1){console.warn(`[stx] @guest directive at position ${K} has no matching @endguest \u2014 the block was skipped.`);break}let V=J.slice(U,B),F=Q(V,"guest","endguest"),L;if(!Z.auth)L=!0;else L=W?q1(`!auth?.check || !auth?.user?.[${W}]`,Z):q1("!auth?.check",Z);let O;if(F!==-1){let _=V.slice(0,F),w=V.slice(F+5);O=L?_:w}else O=L?V:"";J=J.substring(0,K)+O+J.substring(B+9),z=!0}}function Y(z,q,K){if(Z.userCan&&typeof Z.userCan[z]==="boolean")return Z.userCan[z];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let W=[z];if(q)W.push(q);if(K){let U=q1(K,Z);W.push(U)}return Z.permissions.check(...W)}catch{return!1}return!1}function G(z){let q=z.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!q)return null;return{ability:q[1],type:q[2],id:q[3]?.trim(),paramsEnd:q[0].length}}for(let z of["can","cannot"]){let q=`end${z}`,K=z==="can"?"elsecan":"elsecannot",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,F=X(J,z,q,V);if(F===-1){console.warn(`[stx] @${z} directive at position ${H} has no matching @${q} \u2014 the block was skipped.`);break}let L=J.slice(V,F),O=[],_=0,w=new RegExp(`@${z}\\s*\\(`,"g"),R=new RegExp(`@${q}(?![a-z])`,"g"),N=new RegExp(`@${K}\\s*\\(`,"g"),A=/@else(?![a-z])/g,k=[],D;while((D=w.exec(L))!==null)k.push({pos:D.index,type:"open"});while((D=R.exec(L))!==null)k.push({pos:D.index,type:"close"});while((D=N.exec(L))!==null)k.push({pos:D.index,type:"elseDirective"});while((D=A.exec(L))!==null)k.push({pos:D.index,type:"else"});k.sort((y,b)=>y.pos-b.pos);for(let y of k){if(y.type==="open"){_++;continue}if(y.type==="close"){_--;continue}if(_===0)O.push(y)}let I=[],T=0;for(let y=0;y<O.length;y++){let b=O[y];if(I.push({content:L.slice(T,b.pos),ability:void 0}),b.type==="elseDirective"){let P=L.slice(b.pos+`@${K}`.length),g=G(P);if(g){I[I.length-1]={content:L.slice(T,b.pos)},T=b.pos+`@${K}`.length+g.paramsEnd,I.push({content:"",ability:g.ability,type:g.type,id:g.id}),I.pop();let c=O[y+1],l=c?c.pos:L.length;I.push({content:L.slice(T,l),ability:g.ability,type:g.type,id:g.id}),T=l}}else T=b.pos+5}if(T<L.length){let y=I[I.length-1];if(O.length>0&&O[O.length-1].type==="else")I.push({content:L.slice(T),isFinalElse:!0});else if(I.length===0)I.push({content:L.slice(T)})}let M=Y(B.ability,B.type,B.id),E=z==="can"?M:!M,C="";if(E)C=I[0]?.content||"";else{let y=!1;for(let b=1;b<I.length;b++){let P=I[b];if(P.isFinalElse){C=P.content,y=!0;break}if(P.ability){let g=Y(P.ability,P.type,P.id);if(z==="can"?g:!g){C=P.content,y=!0;break}}}if(!y&&I.length>0){let b=I[I.length-1];if(b.isFinalElse)C=b.content}}J=J.substring(0,H)+C+J.substring(F+`@${q}`.length),W=!0}}return J}function A5($,Z,J){let X=$;function Q(Y,G,z,q,K){let W=!0;while(W){W=!1;let U=new RegExp(`@${G}\\s*\\(`),H=Y.match(U);if(!H||H.index===void 0)break;let j=H.index,B=K1(Y,j+`@${G}`.length);if(!B)break;let V=B.endPos,F=O1(Y,G,z,V);if(F===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${z} \u2014 the block was skipped.`);break}let L=Y.slice(V,F),O=B.expression,_=-1,w=0,R=0;while(R<L.length){let N=L.indexOf("@",R);if(N===-1)break;let A=L.substring(N);if(/^@(?:if|unless|isset|empty)\s*\(/.test(A)){w++,R=N+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(A)){w--,R=N+1;continue}if(w===0&&/^@else(?![a-z])/.test(A)){_=N;break}R=N+1}try{let N=q(O.trim()),A;if(_!==-1){let k=L.slice(0,_),D=L.slice(_+5);A=N?k:D}else A=N?L:"";Y=Y.substring(0,j)+A+Y.substring(F+`@${z}`.length),W=!0}catch(N){let A=N instanceof Error?N.message:String(N),k=G0(K,`Error processing @${G} directive: ${A}`,Q0.EVALUATION_ERROR);Y=Y.substring(0,j)+k+Y.substring(F+`@${z}`.length);break}}return Y}return X=Q(X,"isset","endisset",(Y)=>{let G=q1(Y,Z);return G!==void 0&&G!==null},"Isset"),X=Q(X,"empty","endempty",(Y)=>{let G=q1(Y,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 M5($,Z,J){let X=$,Q="development";function Y(G,z,q,K){let W=new RegExp(`@${z}(?![a-z])`,"g"),U=new RegExp(`@${q}(?![a-z])`,"g"),H=new RegExp(`^@${z}(?![a-z])`),j=new RegExp(`^@${q}(?![a-z])`),B=G,V=!0;while(V){V=!1,W.lastIndex=0;let F=W.exec(B);if(!F)break;let L=F.index,O=L+F[0].length;if(z==="env"){let M=B.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!M)break;O+=M[0].length,K=Q===M[2]}let _=1,w=O,R=-1;while(_>0&&w<B.length){W.lastIndex=w,U.lastIndex=w;let M=W.exec(B),E=U.exec(B),C=M?M.index:1/0,y=E?E.index:1/0;if(C<y)_++,w=C+M[0].length;else if(y<1/0){if(_--,_===0){R=y;break}w=y+E[0].length}else break}if(R===-1){console.warn(`[stx] @${z} directive at position ${L} has no matching @${q} \u2014 the block was skipped.`);break}let N=B.substring(O,R),A=-1,k=0,D=0;while(D<N.length){let M=N.indexOf("@",D);if(M===-1)break;let E=N.substring(M);if(H.test(E)){k++,D=M+1;continue}if(j.test(E)){k--,D=M+1;continue}if(k===0&&/^@else(?![a-z])/.test(E)){A=M;break}D=M+1}let I;if(A!==-1){let M=N.slice(0,A),E=N.slice(A+5);I=K?M:E}else I=K?N:"";let T=`@${q}`.length;B=B.substring(0,L)+I+B.substring(R+T),V=!0}return B}return X=Y(X,"env","endenv",!1),X=Y(X,"production","endproduction",Q==="production"),X=Y(X,"development","enddevelopment",Q==="development"),X=Y(X,"staging","endstaging",Q==="staging"),X=Y(X,"testing","endtesting",Q==="testing"),X}var I5=new WeakMap;function h7($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function F1($,Z){if(!$)return Z?.nonceGenerator?.()??h7();let J=I5.get($);if(!J)J=Z?.nonceGenerator?.()??h7(),I5.set($,J);return J}function $U($){I5.delete($)}function u7($,Z){let J=[];for(let[X,Q]of Object.entries($)){if(Q===void 0||Q===null)continue;if(typeof Q==="boolean"){if(Q)J.push(X);continue}if(Array.isArray(Q)){let Y=[...Q];if(Z&&(X==="script-src"||X==="style-src"))Y=Y.filter((G)=>!G.startsWith("'nonce-")),Y.push(`'nonce-${Z}'`);if(Y.length>0)J.push(`${X} ${Y.join(" ")}`)}}return J.join("; ")}function T5($,Z){return`<meta http-equiv="Content-Security-Policy" content="${u7($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var hX={"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},k5={"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},uX={"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'"]},dX={"default-src":["'none'"],"frame-ancestors":["'none'"]};function ZU($){return{enabled:!0,directives:{strict:hX,moderate:k5,relaxed:uX,api:dX}[$]||k5,useNonce:$==="strict",addMetaTag:!0}}function JU($,Z){let J={...$};for(let[X,Q]of Object.entries(Z)){let Y=X,G=J[Y];if(Q===void 0||Q===null)continue;if(typeof Q==="boolean")J[Y]=G||Q;else if(Array.isArray(Q)){let z=Array.isArray(G)?G:[],q=[...new Set([...z,...Q])];J[Y]=q}}return J}function d7($,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?F1(J,Z):void 0,Q=T5(Z.directives,X);return $.replace(/<head([^>]*)>/,`<head$1>
3225
+ ${Q}`)}function m7($,Z){let J=$;return J=J.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(X,Q)=>{if(Q.includes("nonce="))return X;return`<script nonce="${Z}"${Q}>`}),J=J.replace(/<style([^>]*)>/gi,(X,Q)=>{if(Q.includes("nonce="))return X;return`<style nonce="${Z}"${Q}>`}),J}function l7($,Z,J,X){let Q=$,Y=X.csp;if(Q=Q.replace(/@csp\b/g,()=>{if(!Y?.enabled||!Y.directives)return"<!-- CSP not configured -->";let G=Y.useNonce?F1(Z,Y):void 0;return T5(Y.directives,G)}),Q=Q.replace(/@cspNonce\b/g,()=>{if(!Y?.enabled||!Y.useNonce)return"";return F1(Z,Y)}),Y?.enabled&&Y.useNonce)Z.cspNonce=F1(Z,Y);return Q}var mX={name:"csp",handler:($,Z,J,X)=>{let Y=J.__stx_options?.csp;if(!Y?.enabled||!Y.directives)return"<!-- CSP not configured -->";let G=Y.useNonce?F1(J,Y):void 0;return T5(Y.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},lX={name:"cspNonce",handler:($,Z,J,X)=>{let Y=J.__stx_options?.csp;if(!Y?.enabled||!Y.useNonce)return"";return F1(J,Y)},hasEndTag:!1,description:"Output the current CSP nonce value"};function XU(){return[mX,lX]}function YU($){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 cX($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function QU($,Z){if(!$.enabled)return{};let J=$.useNonce?F1(Z,$):void 0,X=u7($.directives,J);return{[cX($.reportOnly)]:X}}var GU={enabled:!1,reportOnly:!1,directives:k5,useNonce:!1,addMetaTag:!0};import pX from"crypto";var iX=40,c7="_token",E5=null;function nX($=iX){let Z=pX.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return E5=Z,Z}function sX(){if(!E5)nX();return E5}function oX($=c7){let Z=sX();return`<input type="hidden" name="${$}" value="${Z}">`}function p7($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,J,X)=>{return oX(X||c7)})}async function i7($,Z,J,X){if(!X.customDirectives||X.customDirectives.length===0)return $;let Q=$;for(let Y of X.customDirectives){if(!Y.name||typeof Y.handler!=="function"){if(X.debug)console.warn("Invalid custom directive:",Y);continue}if(Y.hasEndTag)Q=await rX(Q,Y,Z,J,X);else Q=await aX(Q,Y,Z,J,X)}return Q}async function rX($,Z,J,X,Q){let{name:Y,handler:G}=Z,z=`@${Y}`,q=`@end${Y}`,K=$,W=f1(`${z}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${q}`,"g"),U=[],H=W.exec(K);while(H!==null){let[j,B="",V=""]=H,F=H.index||0;try{let L=B?n7(B):[],O=V.trim(),_=await G(O,L,J,X);U.push({original:j,processed:_,startIndex:F})}catch(L){let O=L instanceof Error?L.message:String(L);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,L);U.push({original:j,processed:G0("CustomDirective",`Error in @${Y}${B?`(${B})`:""}: ${O}`,Q0.EVALUATION_ERROR),startIndex:F})}H=W.exec(K)}for(let j=U.length-1;j>=0;j--){let{original:B,processed:V}=U[j];K=K.replace(B,V)}return K}async function aX($,Z,J,X,Q){let{name:Y,handler:G}=Z,z=$,q=f1(`@${Y}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),K=[],W=q.exec(z);while(W!==null){let[j,B=""]=W,V=W.index||0;try{let F=n7(B),L=await G("",F,J,X);K.push({original:j,processed:L,startIndex:V})}catch(F){let L=F instanceof Error?F.message:String(F);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,F);K.push({original:j,processed:G0("CustomDirective",`Error in @${Y}(${B}): ${L}`,Q0.EVALUATION_ERROR),startIndex:V})}W=q.exec(z)}let U=f1(`@${Y}(?!\\w)(?!\\s*\\()`,"g"),H=U.exec(z);while(H!==null){let[j]=H,B=H.index||0;try{let V=await G("",[],J,X);K.push({original:j,processed:V,startIndex:B})}catch(V){let F=V instanceof Error?V.message:String(V);if(Q.debug)console.error(`Error processing custom directive @${Y}:`,V);K.push({original:j,processed:G0("CustomDirective",`Error in @${Y}: ${F}`,Q0.EVALUATION_ERROR),startIndex:B})}H=U.exec(z)}for(let j=K.length-1;j>=0;j--){let{original:B,processed:V}=K[j];z=z.replace(B,V)}return z}function n7($){if(!$.trim())return[];let Z=[],J="",X=!1,Q="";for(let Y=0;Y<$.length;Y++){let G=$[Y];if((G==='"'||G==="'")&&(Y===0||$[Y-1]!=="\\"))if(!X)X=!0,Q=G;else if(G===Q)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((Y)=>{let G=Y.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var s7=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,o7=/^[A-Za-z_$][\w$]*$/,tX=new Set(["light","dark","system"]);function w1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function eX($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,J=Z.appearance,X=Z.colorMode;if(w1(Z.storageKey,"storageKey"),!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap appearance must be an object");if(!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap colorMode must be an object");if(w1(J.key,"appearance.key"),w1(J.attribute,"appearance.attribute"),w1(J.default,"appearance.default"),w1(X.key,"colorMode.key"),w1(X.attribute,"colorMode.attribute"),w1(X.default,"colorMode.default"),!o7.test(J.key)||!o7.test(X.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!s7.test(J.attribute)||!s7.test(X.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(J.allowed)||J.allowed.length===0||J.allowed.some((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");if(!tX.has(X.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:J.key,attribute:J.attribute,allowed:[...new Set(J.allowed)],default:J.default},colorMode:{key:X.key,attribute:X.attribute,default:X.default}}}function $Y($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ZY($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${$Y($)};const root=document.documentElement;const MODES=["light","dark","system"];function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);const parsed=raw?JSON.parse(raw):{};if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed))stored=parsed}catch{}return stored}function write(stored){try{localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();return{appearance:config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default,colorMode:MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default}}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return store(config.appearance.key,config.appearance.allowed,name)},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function JY($,Z){let J=1,X=null,Q=!1;for(let Y=Z+1;Y<$.length;Y++){let G=$[Y];if(Q){Q=!1;continue}if(X){if(G==="\\")Q=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Y}return-1}function r7($,Z){let J=$,X=/@appearanceBootstrap\s*\(/g,Q;while((Q=X.exec(J))!==null){let Y=Q.index+Q[0].length-1,G=JY(J,Y);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let z=J.slice(Y+1,G).trim(),q=Z0(`(${z})`,Z),K=ZY(eX(q));J=J.slice(0,Q.index)+K+J.slice(G+1),X.lastIndex=Q.index+K.length}return J}import XY from"crypto";function R0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var y5={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function YY($){return{...y5,...$.forms?.classes}}function G9($,Z,J,X){let Q=$||Z;return J?`${Q} ${X}`:Q}function u0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function x1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${R0(Z)}"`}function b5($,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="${R0(`${u0($)}-error`)}"`;return X}function QY(){return XY.randomUUID()}function LU($,Z,J,X){let Q=YY(X),Y=$;return Y=zY(Y,Z),Y=O2(Y,Z),Y=C5(Y,Z,Q),Y=S5(Y,Z,Q),Y}function O2($,Z){let J=$;return J=J.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let X=QY();Z.csrf={token:X}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${R0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),J=J.replace(/@method\(['"]([^'"]+)['"]\)/g,(X,Q)=>{let Y=Q.toUpperCase();if(Q&&!["GET","POST"].includes(Y))return`<input type="hidden" name="_method" value="${R0(Y)}">`;return X}),J}function C5($,Z,J=y5){let X=$;return X=X.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Q,Y,G,z,q,K="")=>{let W=Y||G||"POST",U=z||q||"",H=W1(K),j=W.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",V=`<form method="${R0(B)}" action="${R0(U)}"${H?` ${H}`:""}>`;if(V+=`
3226
3226
  ${O2("@csrf",Z)}`,!["GET","POST"].includes(j))V+=`
3227
- ${O2(`@method('${j}')`,Z)}`;return V}),X=X.replace(/@endform/g,"</form>"),X=X.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Q,Y,G,z,q,K="")=>{let W=Y||G||"",U=z||q||"",H=W1(K),j=_2(W,Z),B=j!==void 0&&j!==null?j:U||"",V=H.match(/type=['"]([^'"]+)['"]/i),F=V?V[1]:"text",L=L2(W,Z),O=H.match(/class=['"]([^'"]+)['"]/i),_=G9(O?O[1]:"",J.input,L,J.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${R0(F)}" name="${R0(W)}"${x1(H,u0(W))} value="${R0(B)}" class="${_}"${b5(W,L,H)}${w?` ${w}`:""}>`}),X=X.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Q,Y,G="",z="")=>{let q=W1(G),K=_2(Y,Z)||z.trim(),W=L2(Y,Z),U=q.match(/class=['"]([^'"]+)['"]/i),H=G9(U?U[1]:"",J.input,W,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${R0(Y)}"${x1(q,u0(Y))} class="${H}"${b5(Y,W,q)}${j?` ${j}`:""}>${R0(K)}</textarea>`}),X=X.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Q,Y,G="",z)=>{let q=W1(G),K=_2(Y,Z),W=L2(Y,Z),U=q.match(/class=['"]([^'"]+)['"]/i),H=G9(U?U[1]:"",J.input,W,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,""),B=z;if(K!==void 0)B=z.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(V,F,L)=>{if((Array.isArray(K)?K.some((_)=>String(_)===L):String(K)===L)&&!F.includes("selected"))return F.replace(/(<option)/,"$1 selected");return V});return`<select name="${R0(Y)}"${x1(q,u0(Y))} class="${H}"${b5(Y,W,q)}${j?` ${j}`:""}>${B}</select>`}),X=X.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Q,Y,G,z="")=>{let q=G===void 0?"1":G,K=G===void 0?u0(Y):`${u0(Y)}-${u0(q)}`,W=W1(z),U=_2(Y,Z),H=U!==void 0&&(Array.isArray(U)?U.some((F)=>String(F)===q):U===!0||String(U)===q),j=W.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:J.checkInput,V=W.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${R0(Y)}"${x1(W,K)} value="${R0(q)}" class="${B}"${H?" checked":""}${V?` ${V}`:""}>`}),X=X.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Q,Y,G,z="")=>{let q=W1(z),K=_2(Y,Z),W=K!==void 0&&K===G,U=q.match(/class=['"]([^'"]+)['"]/i),H=U?U[1]:J.checkInput,j=q.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${R0(Y)}"${x1(q,`${u0(Y)}-${u0(G)}`)} value="${R0(G)}" class="${H}"${W?" checked":""}${j?` ${j}`:""}>`}),X=X.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Q,Y,G="")=>{let z=W1(G),q=z.match(/accept=['"]([^'"]+)['"]/i),K=q?q[1]:"",W=z.includes("multiple"),U=L2(Y,Z),H=z.match(/class=['"]([^'"]+)['"]/i),j=G9(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="${R0(Y)}"${x1(z,u0(Y))}`,`class="${j}"`];if(K)V.push(`accept="${R0(K)}"`);if(W)V.push("multiple");if(B)V.push(B);return`${V.join(" ")}>`}),X=X.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Q,Y,G="",z)=>{let q=W1(G),K=q.match(/class=['"]([^'"]+)['"]/i),W=K?K[1]:J.label,U=q.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${R0(u0(Y))}" class="${W}"${U?` ${U}`:""}>${z}</label>`}),X}function S5($,Z,J=y5){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(X,Q,Y)=>{try{if(L2(Q,Z)){let G=Y.replace(/\{\{([^}]+)\}\}/g,(z,q)=>{try{if(q.trim()==="$message"||q.trim()==="message")return a7(Q,Z);if(q.trim().includes("errors.first")||q.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Q);return a7(Q,Z)}let K=q.trim();if(B0(K)){let W=Z0(K,Z);return W!==void 0?String(W):K}return K}catch{return q}});return`<div id="${R0(`${u0(Q)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),X}})}function L2($,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 a7($,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 _2($,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,Q;while((Q=X.exec(J))!==null){let[,Y,,G]=Q;Z.push(`${Y}="${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($),Q=new Date(Z[0]);if(X>=Q)return`The ${J} field must be before ${Z[0]}.`;return null},after:($,Z,J)=>{if(!$)return null;let X=new Date($),Q=new Date(Z[0]);if(X<=Q)return`The ${J} field must be after ${Z[0]}.`;return null}};function LU($,Z){t7[$]=Z}function P5($){let[Z,...J]=$.split(":"),X=J.length>0?J.join(":").split(","):[];return{name:Z.trim(),params:X}}function QY($,Z,J,X={}){let Q=[],Y=J.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Y){let z=P5(G),q=t7[z.name];if(!q){console.warn(`Unknown validation rule: ${z.name}`);continue}if(z.name==="confirmed"){let W=`${$}_confirmation`;z.params=[X[W]]}let K=q(Z,z.params||[],$);if(K)Q.push(z.message||K)}return{field:$,valid:Q.length===0,errors:Q}}function OU($,Z){let J={};for(let[X,Q]of Object.entries(Z)){let Y=QY(X,$[X],Q,$);if(!Y.valid)J[X]=Y.errors}return J}function GY($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(J,X,Q,Y)=>{let G=Q.split("|").map((q)=>q.trim()),z=[];for(let q of G){let K=P5(q);switch(K.name){case"required":z.push("required");break;case"email":z.push('type="email"');break;case"url":z.push('type="url"');break;case"numeric":case"integer":if(z.push('type="number"'),K.name==="integer")z.push('step="1"');break;case"min":if(K.params?.[0])z.push(`minlength="${K.params[0]}"`);break;case"max":if(K.params?.[0])z.push(`maxlength="${K.params[0]}"`);break;case"regex":if(K.params?.[0])z.push(`pattern="${K.params[0]}"`);break}}return`<!-- @validate:${X}:${Q} -->${z.length>0?`<!-- attrs:${z.join(" ")} -->`:""}`})}var e7={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 Q of X)if(Q.endsWith("_confirmation")&&J[Q]===$)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 FU($){e7[$.name]=$}function zY($,Z,J={}){let X=[],Q=Z.split("|").map((Y)=>Y.trim());for(let Y of Q){let G=P5(Y),z=e7[G.name];if(!z){console.warn(`Unknown validation rule: ${G.name}`);continue}let q=z.validate($,G.params||[],J);if(q!==!0)X.push(q)}return{valid:X.length===0,errors:X}}function wU($,Z){let J={},X=!0;for(let[Q,Y]of Object.entries(Z)){let G=zY($[Q],Y,$);if(!G.valid)X=!1,J[Q]=G.errors}return{valid:X,errors:J}}function RU($,Z){let J=JSON.stringify(Z);return`
3227
+ ${O2(`@method('${j}')`,Z)}`;return V}),X=X.replace(/@endform/g,"</form>"),X=X.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Q,Y,G,z,q,K="")=>{let W=Y||G||"",U=z||q||"",H=W1(K),j=_2(W,Z),B=j!==void 0&&j!==null?j:U||"",V=H.match(/type=['"]([^'"]+)['"]/i),F=V?V[1]:"text",L=L2(W,Z),O=H.match(/class=['"]([^'"]+)['"]/i),_=G9(O?O[1]:"",J.input,L,J.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${R0(F)}" name="${R0(W)}"${x1(H,u0(W))} value="${R0(B)}" class="${_}"${b5(W,L,H)}${w?` ${w}`:""}>`}),X=X.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Q,Y,G="",z="")=>{let q=W1(G),K=_2(Y,Z)||z.trim(),W=L2(Y,Z),U=q.match(/class=['"]([^'"]+)['"]/i),H=G9(U?U[1]:"",J.input,W,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${R0(Y)}"${x1(q,u0(Y))} class="${H}"${b5(Y,W,q)}${j?` ${j}`:""}>${R0(K)}</textarea>`}),X=X.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Q,Y,G="",z)=>{let q=W1(G),K=_2(Y,Z),W=L2(Y,Z),U=q.match(/class=['"]([^'"]+)['"]/i),H=G9(U?U[1]:"",J.input,W,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,""),B=z;if(K!==void 0)B=z.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(V,F,L)=>{if((Array.isArray(K)?K.some((_)=>String(_)===L):String(K)===L)&&!F.includes("selected"))return F.replace(/(<option)/,"$1 selected");return V});return`<select name="${R0(Y)}"${x1(q,u0(Y))} class="${H}"${b5(Y,W,q)}${j?` ${j}`:""}>${B}</select>`}),X=X.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Q,Y,G,z="")=>{let q=G===void 0?"1":G,K=G===void 0?u0(Y):`${u0(Y)}-${u0(q)}`,W=W1(z),U=_2(Y,Z),H=U!==void 0&&(Array.isArray(U)?U.some((F)=>String(F)===q):U===!0||String(U)===q),j=W.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:J.checkInput,V=W.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${R0(Y)}"${x1(W,K)} value="${R0(q)}" class="${B}"${H?" checked":""}${V?` ${V}`:""}>`}),X=X.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Q,Y,G,z="")=>{let q=W1(z),K=_2(Y,Z),W=K!==void 0&&K===G,U=q.match(/class=['"]([^'"]+)['"]/i),H=U?U[1]:J.checkInput,j=q.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${R0(Y)}"${x1(q,`${u0(Y)}-${u0(G)}`)} value="${R0(G)}" class="${H}"${W?" checked":""}${j?` ${j}`:""}>`}),X=X.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Q,Y,G="")=>{let z=W1(G),q=z.match(/accept=['"]([^'"]+)['"]/i),K=q?q[1]:"",W=z.includes("multiple"),U=L2(Y,Z),H=z.match(/class=['"]([^'"]+)['"]/i),j=G9(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="${R0(Y)}"${x1(z,u0(Y))}`,`class="${j}"`];if(K)V.push(`accept="${R0(K)}"`);if(W)V.push("multiple");if(B)V.push(B);return`${V.join(" ")}>`}),X=X.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Q,Y,G="",z)=>{let q=W1(G),K=q.match(/class=['"]([^'"]+)['"]/i),W=K?K[1]:J.label,U=q.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${R0(u0(Y))}" class="${W}"${U?` ${U}`:""}>${z}</label>`}),X}function S5($,Z,J=y5){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(X,Q,Y)=>{try{if(L2(Q,Z)){let G=Y.replace(/\{\{([^}]+)\}\}/g,(z,q)=>{try{if(q.trim()==="$message"||q.trim()==="message")return a7(Q,Z);if(q.trim().includes("errors.first")||q.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Q);return a7(Q,Z)}let K=q.trim();if(B0(K)){let W=Z0(K,Z);return W!==void 0?String(W):K}return K}catch{return q}});return`<div id="${R0(`${u0(Q)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),X}})}function L2($,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 a7($,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 _2($,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,Q;while((Q=X.exec(J))!==null){let[,Y,,G]=Q;Z.push(`${Y}="${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($),Q=new Date(Z[0]);if(X>=Q)return`The ${J} field must be before ${Z[0]}.`;return null},after:($,Z,J)=>{if(!$)return null;let X=new Date($),Q=new Date(Z[0]);if(X<=Q)return`The ${J} field must be after ${Z[0]}.`;return null}};function OU($,Z){t7[$]=Z}function P5($){let[Z,...J]=$.split(":"),X=J.length>0?J.join(":").split(","):[];return{name:Z.trim(),params:X}}function GY($,Z,J,X={}){let Q=[],Y=J.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Y){let z=P5(G),q=t7[z.name];if(!q){console.warn(`Unknown validation rule: ${z.name}`);continue}if(z.name==="confirmed"){let W=`${$}_confirmation`;z.params=[X[W]]}let K=q(Z,z.params||[],$);if(K)Q.push(z.message||K)}return{field:$,valid:Q.length===0,errors:Q}}function FU($,Z){let J={};for(let[X,Q]of Object.entries(Z)){let Y=GY(X,$[X],Q,$);if(!Y.valid)J[X]=Y.errors}return J}function zY($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(J,X,Q,Y)=>{let G=Q.split("|").map((q)=>q.trim()),z=[];for(let q of G){let K=P5(q);switch(K.name){case"required":z.push("required");break;case"email":z.push('type="email"');break;case"url":z.push('type="url"');break;case"numeric":case"integer":if(z.push('type="number"'),K.name==="integer")z.push('step="1"');break;case"min":if(K.params?.[0])z.push(`minlength="${K.params[0]}"`);break;case"max":if(K.params?.[0])z.push(`maxlength="${K.params[0]}"`);break;case"regex":if(K.params?.[0])z.push(`pattern="${K.params[0]}"`);break}}return`<!-- @validate:${X}:${Q} -->${z.length>0?`<!-- attrs:${z.join(" ")} -->`:""}`})}var e7={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 Q of X)if(Q.endsWith("_confirmation")&&J[Q]===$)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 wU($){e7[$.name]=$}function qY($,Z,J={}){let X=[],Q=Z.split("|").map((Y)=>Y.trim());for(let Y of Q){let G=P5(Y),z=e7[G.name];if(!z){console.warn(`Unknown validation rule: ${G.name}`);continue}let q=z.validate($,G.params||[],J);if(q!==!0)X.push(q)}return{valid:X.length===0,errors:X}}function RU($,Z){let J={},X=!0;for(let[Q,Y]of Object.entries(Z)){let G=qY($[Q],Y,$);if(!G.valid)X=!1,J[Q]=G.errors}return{valid:X,errors:J}}function NU($,Z){let J=JSON.stringify(Z);return`
3228
3228
  <script>
3229
3229
  (function() {
3230
3230
  const form = document.getElementById('${$}');
@@ -3276,19 +3276,19 @@ catch { return 'Please enter a valid URL'; } },
3276
3276
  }
3277
3277
  });
3278
3278
  })();
3279
- </script>`.trim()}var F2=/<\/?template\b[^>]*>/gi,qY=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function KY($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return qY.test(Z)}function z9($){F2.lastIndex=0;let Z;while((Z=F2.exec($))!==null){if(Z[0].startsWith("</")||KY(Z[0]))continue;let J=Z.index,X=F2.lastIndex,Q=1,Y;while((Y=F2.exec($))!==null)if(Y[0].startsWith("</")){if(Q--,Q===0){let G=Y.index;return{start:J,openEnd:X,closeStart:G,end:F2.lastIndex,content:$.slice(X,G)}}}else Q++;return null}return null}import q0 from"path";import{existsSync as lY}from"fs";import q9 from"fs";import V0 from"path";var $4=new Map;function Z4($,Z=!0){let J=$4.get($);if(Z&&J)return J;let X=new Map,Q=[V0.join($,"src"),V0.join($,"dist"),$];function Y(G,z){if(z>6)return;let q;try{q=q9.readdirSync(G,{withFileTypes:!0})}catch{return}for(let K of q){let W=V0.join(G,K.name);if(K.isDirectory()){if(K.name==="node_modules"||K.name.startsWith("."))continue;Y(W,z+1)}else if(K.isFile()&&K.name.endsWith(".stx")){let U=K.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 Q)if(Y(G,0),X.size>0)break;if(Z)$4.set($,X);return X}function J4($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let J=Z;while(!0){let X=V0.join(J,"node_modules",$);try{if(q9.statSync(X).isDirectory())return X}catch{}let Q=V0.dirname(J);if(Q===J)return null;J=Q}}function X4($,Z,J={}){return[V0.resolve(V0.dirname(Z),`${$}.stx`),V0.resolve(V0.dirname(Z),$),V0.resolve(J.componentsDir||"components",`${$}.stx`),V0.resolve(J.componentsDir||"components",$),$.endsWith(".stx")?$:`${$}.stx`]}function Y4($){let Z=$.endsWith(".stx")?$.slice(0,-4):$,J=Z.split("-").map((Q)=>Q.charAt(0).toUpperCase()+Q.slice(1)).join(""),X=Z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return[Z,J,X]}function v5($,Z){let[J,X,Q]=Y4($);for(let Y of[J,J.toLowerCase(),X,Q]){let G=Z?.__importedComponents?.get(Y);if(G!==void 0)return G}}function*f5($,Z,J={},X){let Q=Y4($);if(Q[0].startsWith("./")||Q[0].startsWith("../")){yield V0.resolve(V0.dirname(Z),`${Q[0]}.stx`);return}let Y=[...new Set(Q.map((q)=>`${q}.stx`))],G=J.projectRoot||process.cwd(),z=[...X?.__originalFilePath?[V0.join(V0.dirname(X.__originalFilePath),"components")]:[],...J.componentsDir?[J.componentsDir]:[],V0.join(V0.dirname(Z),"components"),V0.resolve(G,"src/components"),V0.resolve(G,"components"),...import.meta.dir?[V0.resolve(import.meta.dir,"components")]:[]];for(let q of new Set(z)){for(let K of Y)yield V0.join(q,K);try{for(let K of q9.readdirSync(q,{withFileTypes:!0}))if(K.isDirectory())for(let W of Y)yield V0.join(q,K.name,W)}catch{}}}function IU($,Z,J={},X){let Q=v5($,X);if(Q!==void 0)return Q;for(let Y of f5($,Z,J,X))try{if(q9.statSync(Y,{throwIfNoEntry:!1})?.isFile())return Y}catch{}return null}class Q4{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 Q=v5($,X);if(Q!==void 0)return Q;for(let Y of f5($,Z,J,X))if(await e(Y))return Y;return null}}var g1=new Q4;function M0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var R1="\x00stx-boolean-attribute";function x5($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function h1($,Z){let J=[];for(let[X,Q]of Object.entries($.static)){if(Z.has(X))continue;let Y=$.staticNames?.[X]??X;if(typeof Q==="boolean"){if(Q)J.push(M0(Y));continue}if(Q===R1){J.push(M0(Y));continue}J.push(`${M0(Y)}="${M0(x5(String(Q)))}"`)}return J}function u1($,Z){let J=[];for(let[X,Q]of Object.entries($.serverDynamic??{})){if(Z.has(X))continue;if(Q===null||Q===void 0||Q===!1)continue;let Y=$.serverDynamicNames?.[X]??X;if(Q===!0){J.push(M0(Y));continue}if(typeof Q==="object")continue;J.push(`${M0(Y)}="${M0(x5(String(Q)))}"`)}return J}function d1($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function WY($){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 g5={name:"StxLink",aliases:["stx-link"],render($,Z,J){let X=WY($),Q=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Y=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",z=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${d1(X.value)}"`);else q.push(`href="${d1(X.value)}"`);if(Q)q.push(`class="${d1(Q)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${d1(Y)}"`),q.push(`data-stx-exact-active-class="${d1(G)}"`),z)q.push("data-stx-prefetch");let K=typeof $.static.activeMatch==="string"?$.static.activeMatch.trim():"";if(K)q.push(`data-stx-active-match="${d1(K)}"`);let W=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return q.push(...h1($,W)),q.push(...u1($,W)),`<a ${q.join(" ")}>${Z}</a>`}};import m1 from"fs";import h5 from"path";var UY=new Set([".jpg",".jpeg",".png",".webp",".avif"]),o0=new Map,N1=!1;function u5($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return o0.get(Z)}function mU(){return N1}function lU(){o0.clear(),N1=!1}function cU($,Z){o0.set($,Z),N1=!0}function HY($){for(let Z=3;Z<$.length;Z+=4)if($[Z]<255)return!0;return!1}function jY($){let Z=0,J=0,X=0,Q=0;for(let G=0;G<$.length;G+=4)Z+=$[G],J+=$[G+1],X+=$[G+2],Q++;if(Q===0)return"#e5e7eb";let Y=(G)=>Math.round(G/Q).toString(16).padStart(2,"0");return`#${Y(Z)}${Y(J)}${Y(X)}`}function BY($,Z,J,X=4,Q=3){let Y=[];for(let G=0;G<Q;G++)for(let z=0;z<X;z++){let q=Math.floor(z*Z/X),K=Math.max(q+1,Math.floor((z+1)*Z/X)),W=Math.floor(G*J/Q),U=Math.max(W+1,Math.floor((G+1)*J/Q)),H=0,j=0,B=0,V=0;for(let L=W;L<U;L++)for(let O=q;O<K;O++){let _=(L*Z+O)*4;H+=$[_],j+=$[_+1],B+=$[_+2],V++}let F=(L)=>Math.round(L/V).toString(16).padStart(2,"0");Y.push(`<rect x="${z}" y="${G}" width="1" height="1" fill="#${F(H)}${F(j)}${F(B)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${X} ${Q}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${Y.join("")}</g></svg>`}function VY($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function _Y($){try{return JSON.parse(m1.readFileSync($,"utf8"))}catch{return{}}}function LY($,Z){try{m1.mkdirSync(h5.dirname($),{recursive:!0}),m1.writeFileSync($,JSON.stringify(Z))}catch{}}function K4($,Z,J=[]){let X;try{X=m1.readdirSync($,{withFileTypes:!0})}catch{return J}for(let Q of X){let Y=h5.join($,Q.name);if(Q.isDirectory()){K4(Y,`${Z}/${Q.name}`,J);continue}if(!UY.has(h5.extname(Q.name).toLowerCase()))continue;J.push([`${Z}/${Q.name}`,Y])}return J}async function pU($,Z={}){let{cachePath:J,maxBytes:X=33554432,limit:Q=2000,offThread:Y}=Z;if(!$||!m1.existsSync($))return N1=!0,o0.size;if(Y){let H=await q4("placeholders",{publicDir:$,options:{cachePath:J,maxBytes:X,limit:Q}});if(H!==z4){for(let[j,B]of H.placeholders)o0.set(j,B);return N1=!0,o0.size}}let G;try{G=await import("ts-images")}catch{return N1=!0,o0.size}let z=J?_Y(J):{},q=!1,K=K4($,"").slice(0,Q),W=8,U=async([H,j])=>{let B;try{B=m1.statSync(j)}catch{return}if(B.size>X)return;let V=z[H];if(V&&V.mtimeMs===B.mtimeMs&&V.size===B.size){let F=V.transparent;if(typeof F!=="boolean"&&G4(j)==="none")F=!1,z[H]={...V,transparent:F},q=!0;if(typeof F==="boolean"){o0.set(H,{dataUrl:V.dataUrl,color:V.color,transparent:F});return}}try{let{hash:F}=await G.generateThumbHash(j);if(!F)return;let{rgba:L,w:O,h:_}=G.thumbHashToRGBA(F),w={dataUrl:VY(BY(L,O,_)),color:jY(L),transparent:HY(L)};o0.set(H,w),z[H]={mtimeMs:B.mtimeMs,size:B.size,...w},q=!0}catch{}};for(let H=0;H<K.length;H+=W)await Promise.all(K.slice(H,H+W).map(U));if(J&&q)LY(J,z);return N1=!0,o0.size}var OY={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},d5=[320,640,768,1024,1280,1536,1920];function L0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function k0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function K9($,Z,J=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let Q=$.static[Z];if(Q!==void 0)return Q!=="false"&&Q!==!1;return J}function FY($){let Z=(X)=>$.variants.filter((Q)=>Q.format===X).reduce((Q,Y)=>Q+Y.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,Q)=>X.bytes-Q.bytes).map(({format:X,srcset:Q})=>({format:X,srcset:Q}))}function m5($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),J=[];for(let X of Z)if(X.includes(":")){let[Q,Y]=X.split(":"),G=OY[Q];if(G)J.push(`(max-width: ${G}px) ${Y}`);else{let z=Number.parseInt(Q);if(!Number.isNaN(z))J.push(`(max-width: ${z}px) ${Y}`)}}else J.push(X);return J.join(", ")}function l5($,Z,J,X){return Z.map((Q)=>`${w2($,Q,void 0,J,X)} ${Q}w`).join(", ")}function wY($,Z,J,X,Q){return Z.map((Y)=>{let G=J?J*Y:void 0;return`${w2($,G,void 0,X,Q)} ${Y}x`}).join(", ")}function w2($,Z,J,X,Q){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Y=[];if(Z)Y.push(`w_${Z}`);if(J)Y.push(`h_${J}`);if(Q)Y.push(`f_${Q}`);Y.push("q_auto");let G=Y.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Y=new URLSearchParams;if(Z)Y.set("w",String(Z));if(J)Y.set("h",String(J));if(Q)Y.set("fm",Q);Y.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Y.toString()}`}if(X==="bunny"){let Y=new URLSearchParams;if(Z)Y.set("width",String(Z));if(J)Y.set("height",String(J));if(Q)Y.set("format",Q);let G=$.includes("?")?"&":"?";return`${$}${G}${Y.toString()}`}return $}function RY($){return`var s=this.style;${$.map((Z)=>`s.${Z}=''`).join(";")}`}function NY($,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 c5={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,J){let X=k0($,"src")||"",Q=W4(X),Y=k0($,"alt")||"",G=k0($,"width")||(Q?String(Q.source.width):void 0),z=k0($,"height")||(Q?String(Q.source.height):void 0),q=k0($,"sizes"),K=k0($,"srcset"),W=k0($,"densities"),U=k0($,"format"),H=U4(X)||u5(X)?.transparent===!0,j=k0($,"placeholder")||(Q&&!H?"thumbhash":void 0),B=k0($,"placeholderColor")||"#e5e7eb",V=k0($,"provider"),F=k0($,"class")||k0($,"className")||"",L=k0($,"style")||"",O=k0($,"quality"),_=K9($,"lazy",!0),w=K9($,"preload",!1),R=K9($,"priority",!1),N=k0($,"loading"),A=k0($,"decoding")||"async",k=!!Q||K9($,"picture",!1)||!!U,D=G?Number.parseInt(G):void 0,I=z?Number.parseInt(z):void 0,T=K||"",M="";if(Q)T=Q.sources[Q.fallback.format]||"",M=q?m5(q):"100vw";else if(!T&&q&&V&&V!=="local"&&V!=="static")T=l5(X,d5,V,U),M=m5(q);else if(!T&&W){let s=W.split(/\s+/).map((u)=>Number.parseFloat(u.replace("x","")));T=wY(X,s,D,V,U)}else if(q)M=m5(q);let E=[];if(L)E.push(L);if(D&&I)E.push(`aspect-ratio:${D}/${I}`);let C=[],y=j==="blur"||j==="color"||j==="thumbhash";if(y&&!H){let s=Q?.placeholder?{dataUrl:Q.placeholder.dataUrl,color:B}:u5(X);if(s&&j==="color")E.push(`background-color:${s.color}`),C.push("backgroundColor");else if(s)E.push(`background-color:${s.color}`),E.push(`background-image:url(${s.dataUrl})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundColor","backgroundImage");else{let u=NY(D||16,I||9,B);E.push(`background-image:url(${u})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage")}}else if(!y&&j&&j!=="empty"&&j!=="none")E.push(`background-image:url(${L0(j)})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage");let b=Q?.fallback.url||w2(X,D,I,V,U),P=[];if(P.push(`src="${L0(b)}"`),P.push(`alt="${L0(Y)}"`),G)P.push(`width="${L0(G)}"`);if(z)P.push(`height="${L0(z)}"`);let g=N||(R||w?"eager":_?"lazy":"");if(g)P.push(`loading="${L0(g)}"`);if(R)P.push('fetchpriority="high"');if(P.push(`decoding="${L0(A)}"`),F)P.push(`class="${L0(F)}"`);if(E.length>0)P.push(`style="${L0(E.join(";"))}"`);if(T)P.push(`srcset="${L0(T)}"`);if(M)P.push(`sizes="${L0(M)}"`);let c=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(C.length>0){let s=typeof $.static.onload==="string"?$.static.onload:"",u=RY(C)+(s?`;${s}`:"");P.push(`onload="${L0(u)}"`),c.add("onload")}P.push(...h1($,c)),P.push(...u1($,c));let l=`<img ${P.join(" ")} />`,h="";if(w){let u=U==="webp"?"image/webp":U==="avif"?"image/avif":"";h=`<link rel="preload" as="image" href="${L0(b)}"${u?` type="${u}"`:""}${T?` imagesrcset="${L0(T)}"`:""}${M?` imagesizes="${L0(M)}"`:""} />
3280
- `}if(k){let s=[];if(Q)for(let u of FY(Q))s.push(`<source type="image/${u.format}" srcset="${L0(u.srcset)}"${M?` sizes="${L0(M)}"`:""} />`);if(!Q&&(U==="avif"||U==="auto")){let u=w2(X,D,I,V,"avif"),z0=T?l5(X,d5,V,"avif"):`${u}`;s.push(`<source type="image/avif" srcset="${L0(z0)}"${M?` sizes="${L0(M)}"`:""} />`)}if(!Q&&(U==="webp"||U==="auto")){let u=w2(X,D,I,V,"webp"),z0=T?l5(X,d5,V,"webp"):`${u}`;s.push(`<source type="image/webp" srcset="${L0(z0)}"${M?` sizes="${L0(M)}"`:""} />`)}return`${h}<picture>
3279
+ </script>`.trim()}var F2=/<\/?template\b[^>]*>/gi,KY=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function WY($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return KY.test(Z)}function z9($){F2.lastIndex=0;let Z;while((Z=F2.exec($))!==null){if(Z[0].startsWith("</")||WY(Z[0]))continue;let J=Z.index,X=F2.lastIndex,Q=1,Y;while((Y=F2.exec($))!==null)if(Y[0].startsWith("</")){if(Q--,Q===0){let G=Y.index;return{start:J,openEnd:X,closeStart:G,end:F2.lastIndex,content:$.slice(X,G)}}}else Q++;return null}return null}import q0 from"path";import{existsSync as cY}from"fs";import q9 from"fs";import V0 from"path";var $4=new Map;function Z4($,Z=!0){let J=$4.get($);if(Z&&J)return J;let X=new Map,Q=[V0.join($,"src"),V0.join($,"dist"),$];function Y(G,z){if(z>6)return;let q;try{q=q9.readdirSync(G,{withFileTypes:!0})}catch{return}for(let K of q){let W=V0.join(G,K.name);if(K.isDirectory()){if(K.name==="node_modules"||K.name.startsWith("."))continue;Y(W,z+1)}else if(K.isFile()&&K.name.endsWith(".stx")){let U=K.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 Q)if(Y(G,0),X.size>0)break;if(Z)$4.set($,X);return X}function J4($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let J=Z;while(!0){let X=V0.join(J,"node_modules",$);try{if(q9.statSync(X).isDirectory())return X}catch{}let Q=V0.dirname(J);if(Q===J)return null;J=Q}}function X4($,Z,J={}){return[V0.resolve(V0.dirname(Z),`${$}.stx`),V0.resolve(V0.dirname(Z),$),V0.resolve(J.componentsDir||"components",`${$}.stx`),V0.resolve(J.componentsDir||"components",$),$.endsWith(".stx")?$:`${$}.stx`]}function Y4($){let Z=$.endsWith(".stx")?$.slice(0,-4):$,J=Z.split("-").map((Q)=>Q.charAt(0).toUpperCase()+Q.slice(1)).join(""),X=Z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return[Z,J,X]}function v5($,Z){let[J,X,Q]=Y4($);for(let Y of[J,J.toLowerCase(),X,Q]){let G=Z?.__importedComponents?.get(Y);if(G!==void 0)return G}}function*f5($,Z,J={},X){let Q=Y4($);if(Q[0].startsWith("./")||Q[0].startsWith("../")){yield V0.resolve(V0.dirname(Z),`${Q[0]}.stx`);return}let Y=[...new Set(Q.map((q)=>`${q}.stx`))],G=J.projectRoot||process.cwd(),z=[...X?.__originalFilePath?[V0.join(V0.dirname(X.__originalFilePath),"components")]:[],...J.componentsDir?[J.componentsDir]:[],V0.join(V0.dirname(Z),"components"),V0.resolve(G,"src/components"),V0.resolve(G,"components"),...import.meta.dir?[V0.resolve(import.meta.dir,"components")]:[]];for(let q of new Set(z)){for(let K of Y)yield V0.join(q,K);try{for(let K of q9.readdirSync(q,{withFileTypes:!0}))if(K.isDirectory())for(let W of Y)yield V0.join(q,K.name,W)}catch{}}}function kU($,Z,J={},X){let Q=v5($,X);if(Q!==void 0)return Q;for(let Y of f5($,Z,J,X))try{if(q9.statSync(Y,{throwIfNoEntry:!1})?.isFile())return Y}catch{}return null}class Q4{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 Q=v5($,X);if(Q!==void 0)return Q;for(let Y of f5($,Z,J,X))if(await e(Y))return Y;return null}}var g1=new Q4;function M0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var R1="\x00stx-boolean-attribute";function x5($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function h1($,Z){let J=[];for(let[X,Q]of Object.entries($.static)){if(Z.has(X))continue;let Y=$.staticNames?.[X]??X;if(typeof Q==="boolean"){if(Q)J.push(M0(Y));continue}if(Q===R1){J.push(M0(Y));continue}J.push(`${M0(Y)}="${M0(x5(String(Q)))}"`)}return J}function u1($,Z){let J=[];for(let[X,Q]of Object.entries($.serverDynamic??{})){if(Z.has(X))continue;if(Q===null||Q===void 0||Q===!1)continue;let Y=$.serverDynamicNames?.[X]??X;if(Q===!0){J.push(M0(Y));continue}if(typeof Q==="object")continue;J.push(`${M0(Y)}="${M0(x5(String(Q)))}"`)}return J}function d1($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function UY($){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 g5={name:"StxLink",aliases:["stx-link"],render($,Z,J){let X=UY($),Q=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Y=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",z=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${d1(X.value)}"`);else q.push(`href="${d1(X.value)}"`);if(Q)q.push(`class="${d1(Q)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${d1(Y)}"`),q.push(`data-stx-exact-active-class="${d1(G)}"`),z)q.push("data-stx-prefetch");let K=typeof $.static.activeMatch==="string"?$.static.activeMatch.trim():"";if(K)q.push(`data-stx-active-match="${d1(K)}"`);let W=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return q.push(...h1($,W)),q.push(...u1($,W)),`<a ${q.join(" ")}>${Z}</a>`}};import m1 from"fs";import h5 from"path";var HY=new Set([".jpg",".jpeg",".png",".webp",".avif"]),o0=new Map,N1=!1;function u5($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return o0.get(Z)}function lU(){return N1}function cU(){o0.clear(),N1=!1}function pU($,Z){o0.set($,Z),N1=!0}function jY($){for(let Z=3;Z<$.length;Z+=4)if($[Z]<255)return!0;return!1}function BY($){let Z=0,J=0,X=0,Q=0;for(let G=0;G<$.length;G+=4)Z+=$[G],J+=$[G+1],X+=$[G+2],Q++;if(Q===0)return"#e5e7eb";let Y=(G)=>Math.round(G/Q).toString(16).padStart(2,"0");return`#${Y(Z)}${Y(J)}${Y(X)}`}function VY($,Z,J,X=4,Q=3){let Y=[];for(let G=0;G<Q;G++)for(let z=0;z<X;z++){let q=Math.floor(z*Z/X),K=Math.max(q+1,Math.floor((z+1)*Z/X)),W=Math.floor(G*J/Q),U=Math.max(W+1,Math.floor((G+1)*J/Q)),H=0,j=0,B=0,V=0;for(let L=W;L<U;L++)for(let O=q;O<K;O++){let _=(L*Z+O)*4;H+=$[_],j+=$[_+1],B+=$[_+2],V++}let F=(L)=>Math.round(L/V).toString(16).padStart(2,"0");Y.push(`<rect x="${z}" y="${G}" width="1" height="1" fill="#${F(H)}${F(j)}${F(B)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${X} ${Q}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${Y.join("")}</g></svg>`}function _Y($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function LY($){try{return JSON.parse(m1.readFileSync($,"utf8"))}catch{return{}}}function OY($,Z){try{m1.mkdirSync(h5.dirname($),{recursive:!0}),m1.writeFileSync($,JSON.stringify(Z))}catch{}}function K4($,Z,J=[]){let X;try{X=m1.readdirSync($,{withFileTypes:!0})}catch{return J}for(let Q of X){let Y=h5.join($,Q.name);if(Q.isDirectory()){K4(Y,`${Z}/${Q.name}`,J);continue}if(!HY.has(h5.extname(Q.name).toLowerCase()))continue;J.push([`${Z}/${Q.name}`,Y])}return J}async function iU($,Z={}){let{cachePath:J,maxBytes:X=33554432,limit:Q=2000,offThread:Y}=Z;if(!$||!m1.existsSync($))return N1=!0,o0.size;if(Y){let H=await q4("placeholders",{publicDir:$,options:{cachePath:J,maxBytes:X,limit:Q}});if(H!==z4){for(let[j,B]of H.placeholders)o0.set(j,B);return N1=!0,o0.size}}let G;try{G=await import("ts-images")}catch{return N1=!0,o0.size}let z=J?LY(J):{},q=!1,K=K4($,"").slice(0,Q),W=8,U=async([H,j])=>{let B;try{B=m1.statSync(j)}catch{return}if(B.size>X)return;let V=z[H];if(V&&V.mtimeMs===B.mtimeMs&&V.size===B.size){let F=V.transparent;if(typeof F!=="boolean"&&G4(j)==="none")F=!1,z[H]={...V,transparent:F},q=!0;if(typeof F==="boolean"){o0.set(H,{dataUrl:V.dataUrl,color:V.color,transparent:F});return}}try{let{hash:F}=await G.generateThumbHash(j);if(!F)return;let{rgba:L,w:O,h:_}=G.thumbHashToRGBA(F),w={dataUrl:_Y(VY(L,O,_)),color:BY(L),transparent:jY(L)};o0.set(H,w),z[H]={mtimeMs:B.mtimeMs,size:B.size,...w},q=!0}catch{}};for(let H=0;H<K.length;H+=W)await Promise.all(K.slice(H,H+W).map(U));if(J&&q)OY(J,z);return N1=!0,o0.size}var FY={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},d5=[320,640,768,1024,1280,1536,1920];function L0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function k0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function K9($,Z,J=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let Q=$.static[Z];if(Q!==void 0)return Q!=="false"&&Q!==!1;return J}function wY($){let Z=(X)=>$.variants.filter((Q)=>Q.format===X).reduce((Q,Y)=>Q+Y.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,Q)=>X.bytes-Q.bytes).map(({format:X,srcset:Q})=>({format:X,srcset:Q}))}function m5($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),J=[];for(let X of Z)if(X.includes(":")){let[Q,Y]=X.split(":"),G=FY[Q];if(G)J.push(`(max-width: ${G}px) ${Y}`);else{let z=Number.parseInt(Q);if(!Number.isNaN(z))J.push(`(max-width: ${z}px) ${Y}`)}}else J.push(X);return J.join(", ")}function l5($,Z,J,X){return Z.map((Q)=>`${w2($,Q,void 0,J,X)} ${Q}w`).join(", ")}function RY($,Z,J,X,Q){return Z.map((Y)=>{let G=J?J*Y:void 0;return`${w2($,G,void 0,X,Q)} ${Y}x`}).join(", ")}function w2($,Z,J,X,Q){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Y=[];if(Z)Y.push(`w_${Z}`);if(J)Y.push(`h_${J}`);if(Q)Y.push(`f_${Q}`);Y.push("q_auto");let G=Y.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Y=new URLSearchParams;if(Z)Y.set("w",String(Z));if(J)Y.set("h",String(J));if(Q)Y.set("fm",Q);Y.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Y.toString()}`}if(X==="bunny"){let Y=new URLSearchParams;if(Z)Y.set("width",String(Z));if(J)Y.set("height",String(J));if(Q)Y.set("format",Q);let G=$.includes("?")?"&":"?";return`${$}${G}${Y.toString()}`}return $}function NY($){return`var s=this.style;${$.map((Z)=>`s.${Z}=''`).join(";")}`}function DY($,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 c5={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,J){let X=k0($,"src")||"",Q=W4(X),Y=k0($,"alt")||"",G=k0($,"width")||(Q?String(Q.source.width):void 0),z=k0($,"height")||(Q?String(Q.source.height):void 0),q=k0($,"sizes"),K=k0($,"srcset"),W=k0($,"densities"),U=k0($,"format"),H=U4(X)||u5(X)?.transparent===!0,j=k0($,"placeholder")||(Q&&!H?"thumbhash":void 0),B=k0($,"placeholderColor")||"#e5e7eb",V=k0($,"provider"),F=k0($,"class")||k0($,"className")||"",L=k0($,"style")||"",O=k0($,"quality"),_=K9($,"lazy",!0),w=K9($,"preload",!1),R=K9($,"priority",!1),N=k0($,"loading"),A=k0($,"decoding")||"async",k=!!Q||K9($,"picture",!1)||!!U,D=G?Number.parseInt(G):void 0,I=z?Number.parseInt(z):void 0,T=K||"",M="";if(Q)T=Q.sources[Q.fallback.format]||"",M=q?m5(q):"100vw";else if(!T&&q&&V&&V!=="local"&&V!=="static")T=l5(X,d5,V,U),M=m5(q);else if(!T&&W){let s=W.split(/\s+/).map((u)=>Number.parseFloat(u.replace("x","")));T=RY(X,s,D,V,U)}else if(q)M=m5(q);let E=[];if(L)E.push(L);if(D&&I)E.push(`aspect-ratio:${D}/${I}`);let C=[],y=j==="blur"||j==="color"||j==="thumbhash";if(y&&!H){let s=Q?.placeholder?{dataUrl:Q.placeholder.dataUrl,color:B}:u5(X);if(s&&j==="color")E.push(`background-color:${s.color}`),C.push("backgroundColor");else if(s)E.push(`background-color:${s.color}`),E.push(`background-image:url(${s.dataUrl})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundColor","backgroundImage");else{let u=DY(D||16,I||9,B);E.push(`background-image:url(${u})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage")}}else if(!y&&j&&j!=="empty"&&j!=="none")E.push(`background-image:url(${L0(j)})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage");let b=Q?.fallback.url||w2(X,D,I,V,U),P=[];if(P.push(`src="${L0(b)}"`),P.push(`alt="${L0(Y)}"`),G)P.push(`width="${L0(G)}"`);if(z)P.push(`height="${L0(z)}"`);let g=N||(R||w?"eager":_?"lazy":"");if(g)P.push(`loading="${L0(g)}"`);if(R)P.push('fetchpriority="high"');if(P.push(`decoding="${L0(A)}"`),F)P.push(`class="${L0(F)}"`);if(E.length>0)P.push(`style="${L0(E.join(";"))}"`);if(T)P.push(`srcset="${L0(T)}"`);if(M)P.push(`sizes="${L0(M)}"`);let c=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(C.length>0){let s=typeof $.static.onload==="string"?$.static.onload:"",u=NY(C)+(s?`;${s}`:"");P.push(`onload="${L0(u)}"`),c.add("onload")}P.push(...h1($,c)),P.push(...u1($,c));let l=`<img ${P.join(" ")} />`,h="";if(w){let u=U==="webp"?"image/webp":U==="avif"?"image/avif":"";h=`<link rel="preload" as="image" href="${L0(b)}"${u?` type="${u}"`:""}${T?` imagesrcset="${L0(T)}"`:""}${M?` imagesizes="${L0(M)}"`:""} />
3280
+ `}if(k){let s=[];if(Q)for(let u of wY(Q))s.push(`<source type="image/${u.format}" srcset="${L0(u.srcset)}"${M?` sizes="${L0(M)}"`:""} />`);if(!Q&&(U==="avif"||U==="auto")){let u=w2(X,D,I,V,"avif"),z0=T?l5(X,d5,V,"avif"):`${u}`;s.push(`<source type="image/avif" srcset="${L0(z0)}"${M?` sizes="${L0(M)}"`:""} />`)}if(!Q&&(U==="webp"||U==="auto")){let u=w2(X,D,I,V,"webp"),z0=T?l5(X,d5,V,"webp"):`${u}`;s.push(`<source type="image/webp" srcset="${L0(z0)}"${M?` sizes="${L0(M)}"`:""} />`)}return`${h}<picture>
3281
3281
  ${s.join(`
3282
3282
  `)}
3283
3283
  ${l}
3284
- </picture>`}return`${h}${l}`}};var H4="/images/safe-image-default.svg";function R2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}var DY=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${H4}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,p5={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,J){let X=l1($,"src")||"",Q=l1($,"alt")||"",Y=l1($,"fallback")||H4,G=l1($,"class")||l1($,"className")||"",z=l1($,"fallbackClassName")||"",q=[];if(q.push(`src="${R2(X)}"`),q.push(`alt="${R2(Q)}"`),G)q.push(`class="${R2(G)}"`);if(q.push(`data-fallback="${R2(Y)}"`),z)q.push(`data-fallback-class="${R2(z)}"`);q.push('onerror="window.__stxSafeImageHandler(this)"');let K=new Set(["src","alt","fallback","class","className","fallbackClassName"]);q.push(...h1($,K)),q.push(...u1($,K));let W=`<img ${q.join(" ")} />`,U=J.context;if(!U.__safeImageHandlerEmitted)return U.__safeImageHandlerEmitted=!0,`${DY}${W}`;return W}};function i5($){return $.replace(/[;{}()]/g,"").replace(/url/gi,"")}function N2($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function W9($,Z,J){let X=N2($,Z);if(X!==void 0){let Q=Number.parseInt(X,10);if(!Number.isNaN(Q))return Q}return J}var n5={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,J){let X=i5(N2($,"color")||"#6366f1"),Q=i5(N2($,"initialColor")||N2($,"initial-color")||""),Y=i5(N2($,"height")||"3px"),G=W9($,"duration",2000),z=W9($,"throttle",200),q=W9($,"zIndex",999999)||W9($,"z-index",999999),K=Q?`linear-gradient(to right, ${Q}, ${X})`:X;return`
3284
+ </picture>`}return`${h}${l}`}};var H4="/images/safe-image-default.svg";function R2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}var AY=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${H4}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,p5={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,J){let X=l1($,"src")||"",Q=l1($,"alt")||"",Y=l1($,"fallback")||H4,G=l1($,"class")||l1($,"className")||"",z=l1($,"fallbackClassName")||"",q=[];if(q.push(`src="${R2(X)}"`),q.push(`alt="${R2(Q)}"`),G)q.push(`class="${R2(G)}"`);if(q.push(`data-fallback="${R2(Y)}"`),z)q.push(`data-fallback-class="${R2(z)}"`);q.push('onerror="window.__stxSafeImageHandler(this)"');let K=new Set(["src","alt","fallback","class","className","fallbackClassName"]);q.push(...h1($,K)),q.push(...u1($,K));let W=`<img ${q.join(" ")} />`,U=J.context;if(!U.__safeImageHandlerEmitted)return U.__safeImageHandlerEmitted=!0,`${AY}${W}`;return W}};function i5($){return $.replace(/[;{}()]/g,"").replace(/url/gi,"")}function N2($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function W9($,Z,J){let X=N2($,Z);if(X!==void 0){let Q=Number.parseInt(X,10);if(!Number.isNaN(Q))return Q}return J}var n5={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,J){let X=i5(N2($,"color")||"#6366f1"),Q=i5(N2($,"initialColor")||N2($,"initial-color")||""),Y=i5(N2($,"height")||"3px"),G=W9($,"duration",2000),z=W9($,"throttle",200),q=W9($,"zIndex",999999)||W9($,"z-index",999999),K=Q?`linear-gradient(to right, ${Q}, ${X})`:X;return`
3285
3285
  <div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${Y};background:${K};z-index:${q};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
3286
3286
  <div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
3287
3287
  </div>
3288
3288
  <style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
3289
3289
  <script>
3290
3290
  (function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${z})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
3291
- </script>`}};function B4($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function AY($,Z,J){let X=B4($,Z);if(X!==void 0){let Q=Number.parseInt(X,10);if(!Number.isNaN(Q))return Q}return J}var j4={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},s5={name:"StxToast",aliases:["stx-toast"],render($,Z,J){let X=M0(B4($,"position")||"top-right"),Q=AY($,"max",5),Y=j4[X]||j4["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${X}" data-stx-toast-max="${Q}" style="position:fixed;${Y};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
3291
+ </script>`}};function B4($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function MY($,Z,J){let X=B4($,Z);if(X!==void 0){let Q=Number.parseInt(X,10);if(!Number.isNaN(Q))return Q}return J}var j4={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},s5={name:"StxToast",aliases:["stx-toast"],render($,Z,J){let X=M0(B4($,"position")||"top-right"),Q=MY($,"max",5),Y=j4[X]||j4["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${X}" data-stx-toast-max="${Q}" style="position:fixed;${Y};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
3292
3292
  <style>
3293
3293
  @keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
3294
3294
  @keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
@@ -3314,7 +3314,7 @@ ${l}
3314
3314
  @media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
3315
3315
  .stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
3316
3316
  .stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
3317
- </style>`}};import{existsSync as MY,readFileSync as IY}from"fs";var D1=new Map,L4=new Set;function O4($){if(L4.has($))return;L4.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function F4($){let Z=process.cwd();for(let J of[`${Z}/node_modules/@iconify-json/${$}/icons.json`,`${Z}/pantry/@iconify-json/${$}/icons.json`,`${Z}/node_modules/@iconify/json/json/${$}.json`,`${Z}/pantry/@iconify/json/json/${$}.json`])if(MY(J))return J;for(let J of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return f.resolve(J)}catch{}return null}function kY($){if(D1.has($))return D1.get($);let Z=F4($);if(!Z)return O4($),null;try{let J=JSON.parse(IY(Z,"utf8"));return D1.set($,J.icons),J.icons}catch{return null}}async function TY($,Z=!1){if(D1.has($))return D1.get($);let J=F4($);if(!J){if(!Z)O4($);return null}try{let X=await Bun.file(J).json();return D1.set($,X.icons),X.icons}catch{return null}}function p1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);if($.static[Z]!==void 0)return String($.static[Z]);if($.clientReactive[Z]!==void 0)return $.clientReactive[Z];return}var a5={name:"Icon",aliases:["icon","stx-icon"],render($,Z,J){let X=p1($,"name")??p1($,"icon");if(!X)return"<!-- Icon: missing name/icon prop -->";let Q="lucide",Y=X;if(X.includes(":")){let O=X.split(":");Q=O[0],Y=O[1]}let G=M0(p1($,"size")||"24"),z=M0(p1($,"color")||"currentColor"),q=M0(p1($,"class")||""),K=M0(p1($,"style")||""),W=D1.get(Q)??kY(Q);if(!W)return`<!-- Icon: collection "${Q}" not loaded -->`;let U=W[Y];if(!U)return`<!-- Icon: "${Y}" not found in ${Q} -->`;let H=U.width||24,j=U.height||24,B=`0 0 ${H} ${j}`,V=U.body;if(z!=="currentColor")V=V.replace(/currentColor/g,z);let F=q?` class="${q}"`:"",L=K?` style="${K}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${B}" fill="none"${F}${L}>${V}</svg>`}};async function EY($="lucide",Z={}){await TY($,Z.speculative??!0)}function t5(){return`
3317
+ </style>`}};import{existsSync as IY,readFileSync as kY}from"fs";var D1=new Map,L4=new Set;function O4($){if(L4.has($))return;L4.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function F4($){let Z=process.cwd();for(let J of[`${Z}/node_modules/@iconify-json/${$}/icons.json`,`${Z}/pantry/@iconify-json/${$}/icons.json`,`${Z}/node_modules/@iconify/json/json/${$}.json`,`${Z}/pantry/@iconify/json/json/${$}.json`])if(IY(J))return J;for(let J of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return f.resolve(J)}catch{}return null}function TY($){if(D1.has($))return D1.get($);let Z=F4($);if(!Z)return O4($),null;try{let J=JSON.parse(kY(Z,"utf8"));return D1.set($,J.icons),J.icons}catch{return null}}async function EY($,Z=!1){if(D1.has($))return D1.get($);let J=F4($);if(!J){if(!Z)O4($);return null}try{let X=await Bun.file(J).json();return D1.set($,X.icons),X.icons}catch{return null}}function p1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);if($.static[Z]!==void 0)return String($.static[Z]);if($.clientReactive[Z]!==void 0)return $.clientReactive[Z];return}var a5={name:"Icon",aliases:["icon","stx-icon"],render($,Z,J){let X=p1($,"name")??p1($,"icon");if(!X)return"<!-- Icon: missing name/icon prop -->";let Q="lucide",Y=X;if(X.includes(":")){let O=X.split(":");Q=O[0],Y=O[1]}let G=M0(p1($,"size")||"24"),z=M0(p1($,"color")||"currentColor"),q=M0(p1($,"class")||""),K=M0(p1($,"style")||""),W=D1.get(Q)??TY(Q);if(!W)return`<!-- Icon: collection "${Q}" not loaded -->`;let U=W[Y];if(!U)return`<!-- Icon: "${Y}" not found in ${Q} -->`;let H=U.width||24,j=U.height||24,B=`0 0 ${H} ${j}`,V=U.body;if(z!=="currentColor")V=V.replace(/currentColor/g,z);let F=q?` class="${q}"`:"",L=K?` style="${K}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${B}" fill="none"${F}${L}>${V}</svg>`}};async function bY($="lucide",Z={}){await EY($,Z.speculative??!0)}function t5(){return`
3318
3318
  (function(){
3319
3319
  var tip=null,hideTimer=null,currentEl=null;
3320
3320
 
@@ -3417,9 +3417,9 @@ document.addEventListener("focusout",function(e){
3417
3417
  if(el) hideTip();
3418
3418
  });
3419
3419
  })();
3420
- `}function w4($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}function R4($,Z){let J=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${Z}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),X=$.match(J);if(!X)return{region:null,rest:$};return{region:X[2],rest:$.replace(X[0],"")}}var e5={name:"Suspense",aliases:["suspense"],render($,Z,J){let X=R4(Z,"fallback"),Q=X.rest,Y=R4(Q,"error"),G=Y.rest,z=X.region??w4($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',q=Y.region??w4($,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${z}</div><div data-stx-suspense-error hidden>${q}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function H9($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}var $$={name:"TransitionGroup",aliases:["transition-group"],render($,Z,J){let X=(H9($,"name")||"v").replace(/["'<>]/g,""),Q=(H9($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Y=H9($,"class"),G=H9($,"id"),z=[`data-stx-transition-group="${X}"`,Y?`class="${Y}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Q} ${z}>${Z}</${Q}>`}};function N4($=g1){$.registerBuiltin(g5),$.registerBuiltin(c5),$.registerBuiltin(p5),$.registerBuiltin(n5),$.registerBuiltin(s5),$.registerBuiltin(o5),$.registerBuiltin(r5),$.registerBuiltin(a5),$.registerBuiltin(e5),$.registerBuiltin($$)}function j9($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var D4=new Map;function bY($){let Z=D4.get($.source);if(!Z)Z=new RegExp(`(${$.source})(?![\\w.:-])`,"y"),D4.set($.source,Z);return Z}var A4=new WeakMap;function M4($){let Z=A4.get($);if(!Z)Z=new Set([...$].map((X)=>X.toLowerCase())),A4.set($,Z);let J=Z;return(X)=>!/[a-z]/.test(X)&&J.has(X.toLowerCase())}function I4($,Z,J){let X=[],Q=0,Y=typeof J==="function"?J:J?(G)=>J.has(G.toLowerCase()):void 0;while(Q<$.length){let G=$.indexOf("<",Q);if(G===-1)break;let z=bY(Z);z.lastIndex=G+1;let q=z.exec($);if(!q){Q=G+1;continue}let K=q[1];if(Y&&Y(K)){let F=G+1+K.length;while(F<$.length&&$[F]!==">")F++;Q=F+1;continue}let W=G+1+K.length,U=null,H=W,j=-1,B=!1;while(W<$.length){let F=$[W];if(U){if(F==="\\"&&W+1<$.length){W+=2;continue}if(F===U)U=null;W++;continue}if(F==='"'||F==="'"){U=F,W++;continue}if(F==="/"&&W+1<$.length&&$[W+1]===">"){j=W+2,B=!0;break}if(F===">"){j=W+1;break}W++}if(j===-1){Q=G+1;continue}let V=$.slice(H,B?j-2:j-1).trim();if(B)X.push({fullMatch:$.slice(G,j),tagName:K,attributes:V,content:"",startIndex:G,endIndex:j,isSelfClosing:!0}),Q=j;else{let F=`<${K}`,L=`</${K}>`,O=1,_=j,w=-1;while(O>0&&_<$.length){let A=$.indexOf(F,_),k=$.indexOf(L,_);if(k===-1)break;if(A!==-1&&A<k){let D=$[A+F.length];if(D===" "||D===">"||D==="/"||D===`
3421
- `||D==="\t")O++;_=A+F.length}else{if(O--,O===0){w=k;break}_=k+L.length}}if(w===-1){Q=j;continue}let R=$.slice(j,w),N=w+L.length;X.push({fullMatch:$.slice(G,N),tagName:K,attributes:V,content:R,startIndex:G,endIndex:N,isSelfClosing:!1}),Q=N}}return X}function k4($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function T4($,Z){try{let J=Buffer.from($,"base64").toString("utf8");return JSON.parse(J)}catch{}try{let J=$.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return JSON.parse(J)}catch(J){if(Z?.debug)console.error("Error decoding __stx_ prop:",J);return $}}function Z$($,Z){let J=0,X="",Q=Z;while(Q<$.length){let Y=$[Q];if(X){if(Y==="\\")Q++;else if(Y===X)X=""}else if(Y==='"'||Y==="'"||Y==="`")X=Y;else if(Y==="{")J++;else if(Y==="}"){if(J--,J===0)return $.slice(Z,Q+1)}Q++}return $.slice(Z)}function E4($){let Z=$.trim();if(!Z.startsWith("{")||!Z.endsWith("}"))return null;if(Z$(Z,0).length!==Z.length)return null;return Z.slice(1,-1).trim()}var yY=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),CY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J$($){let Z=[],J=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,X;while((X=J.exec($))!==null){let Q=X[2]||"";if(!/(?:^|\s)(?::for|x-for|v-for|@for)\s*=/.test(Q))continue;let Y=X.index,G=Y+X[0].length,z=X[1].toLowerCase();if(X[0].endsWith("/>")||CY.has(z)){Z.push([Y,G]);continue}let q=z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`<\\/?${q}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");K.lastIndex=G;let W=1,U=G,H;while((H=K.exec($))!==null)if(H[0].startsWith("</")){if(W--,W===0){U=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))W++;Z.push([Y,U])}return Z}function y4($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>y4(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function C4($,Z){if(!/:[\w-]+=/.test($))return $;let J=$,X=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,Q=[],Y;while((Y=X.exec($))!==null)Q.push([Y.index,Y.index+Y[0].length]);Q.push(...J$($));function G(U){return Q.some(([H,j])=>U>=H&&U<j)}let z=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,q=[],K=new Map,W=256;while((Y=z.exec(J))!==null){if(G(Y.index))continue;let U=Y[0],H=Y[2];if(!H||!H.includes(":"))continue;let j=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,B,V=H,F=!1;while((B=j.exec(H))!==null){let L=B[1],O=B[2];if(b4(L))continue;if(O.includes("()")&&!O.includes(".get(")||O.includes("$store")||O.includes("$ref"))continue;try{let _=Object.keys(Z),w=Object.values(Z),R=O.match(/^([a-zA-Z_$][\w$]*)/);if(R&&!_.includes(R[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(R[1]))continue;let N=JSON.stringify([_,O]),A=K.get(N);if(!A){if(A=Function(..._,`return (${O})`),K.size>=W)K.clear();K.set(N,A)}let k=A(...w);if(L==="class"){let D=y4(k);if(D){let I=V.match(/\sclass="([^"]*)"/);if(I)V=V.replace(I[0],` class="${I[1]} ${D}"`);else V=V.replace(B[0],` class="${D}"`)}else V=V.replace(B[0],"");F=!0;continue}if(yY.has(L)){if(k)V=V.replace(B[0],` ${L}`);else V=V.replace(B[0],"");F=!0;continue}if(k===null||k===void 0||k===!1)V=V.replace(B[0],"");else{let D=String(k).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");V=V.replace(B[0],` ${L}="${D}"`)}F=!0}catch{continue}}if(F){let L=U.endsWith("/>")?" /":"",_=`<${Y[1]}${V}${L}>`;q.push({start:Y.index,end:Y.index+U.length,replacement:_})}}if(q.length>0){let U=Array(q.length*2+1),H=0;for(let j=0;j<q.length;j++){let{start:B,end:V,replacement:F}=q[j];U[j*2]=J.slice(H,B),U[j*2+1]=F,H=V}U[q.length*2]=J.slice(H),J=U.join("")}return J}import S4 from"fs";import P4 from"path";var D2=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function X$($){if($.includes("-")||$==="component")return!1;if(/^[A-Z]/.test($))return!/[a-z]/.test($)&&[...D2].some((Z)=>Z.toLowerCase()===$.toLowerCase());return D2.has($)||/[A-Z]/.test($)}var v4=!1;function SY($,Z,J,X=!1){let Q={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},Y=new Set(Array.isArray(Z.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),G=(W)=>{if(Y.size===0)return!1;let U=g0(W),H=U.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(H&&Y.has(H))return!0;for(let j of Y){let B=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${B}\\s*\\(`).test(U))return!0}return!1},z=new Set(g4),q=(W)=>{if(!W.includes("-")||W.startsWith("@")||W.startsWith(":")||W.startsWith("x-")||W.startsWith("__"))return W;if(W.startsWith("aria-")||W.startsWith("data-"))return W;return W.replace(/-([a-z0-9])/g,(U,H)=>H.toUpperCase())},K=(W,U)=>{let H=q(W);if(Q.static[H]=U,H!==W)Q.staticNames[H]=W};for(let[W,U]of Object.entries($)){let H=W.startsWith("x-")&&!z.has(W)&&!W.startsWith("x-bind:")&&!W.startsWith("x-on:")?`:${W.slice(2)}`:W;if(H.startsWith("@")){Q.events[H]=U;continue}if(H.startsWith("__stx_")){let j=q(H.slice(6));Q.serverDynamic[j]=T4(U,J);continue}if(H.startsWith(":")){let j=q(H.slice(1)),B=U===R1?j:U;if(j==="if"||j==="for"||j==="show"){Q.clientReactive[j]=B;continue}if(X){Q.clientReactive[j]=B;continue}if(G(B)){Q.clientReactive[j]=B;continue}try{if(!B0(B)){if(J.debug)console.error(`Unsafe expression in :${j} binding: ${B}`);Q.clientReactive[j]=B;continue}let V=Object.keys(Z),L=H0(B,V)(...Object.values(Z));if(L===void 0){let O=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(V9(B).some((w)=>!O.has(w)&&!V.includes(w))){Q.clientReactive[j]=B;continue}}if(Q.serverDynamic[j]=L,j!==H.slice(1)&&Q.serverDynamicNames)Q.serverDynamicNames[j]=H.slice(1)}catch{Q.clientReactive[j]=B}continue}if(typeof U==="string"&&U.includes("{{")&&U.includes("}}")){let j=U.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(j)try{let B=j[1];if(B0(B)){let F=H0(B,Object.keys(Z))(...Object.values(Z));K(H,F!=null?String(F):"")}else{if(J.debug)console.error(`Unsafe expression in ${H}: ${B}`);K(H,U)}}catch(B){if(J.debug)console.error(`Error evaluating expression for ${H}:`,B);K(H,U)}else{let B=U,V=/\{\{\s*([\s\S]+?)\s*\}\}/g,F;while((F=V.exec(U))!==null)try{let L=F[1];if(!B0(L)){if(J.debug)console.error(`Unsafe expression in ${H}: ${L}`);continue}let _=H0(L,Object.keys(Z))(...Object.values(Z));B=B.replace(F[0],String(_??""))}catch(L){if(J.debug)console.error(`Error evaluating expression in ${H}:`,L)}K(H,B)}continue}K(H,U===R1?"true":k4(U))}return Q}var PY=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function vY($,Z,J){if(!$.includes("@"))return $;if(!PY.some(([Q,Y])=>Q.test($)&&$.includes(Y)))return $;try{return $1($,Z,J)}catch{return $}}function fY($){let Z={},J=0,X=$.length;while(J<X){while(J<X&&/\s/.test($[J]))J++;if(J>=X)break;let Q="";while(J<X&&!/[\s=]/.test($[J]))Q+=$[J],J++;if(!Q)break;while(J<X&&/\s/.test($[J]))J++;if(J<X&&$[J]==="="){J++;while(J<X&&/\s/.test($[J]))J++;let Y="";if(J<X&&($[J]==='"'||$[J]==="'")){let G=$[J];J++;while(J<X){let z=$[J];if(z==="\\"&&J+1<X){J++,Y+=$[J],J++;continue}if(z===G){J++;break}Y+=z,J++}}else if($[J]==="{"){Y=Z$($,J),J+=Y.length;let G=E4(Y);if(G!==null){Z[`:${Q}`]=G;continue}}else while(J<X&&!/\s/.test($[J]))Y+=$[J],J++;Z[Q]=Y}else Z[Q]=R1}return Z}function f4($){return Object.entries($).map(([Z,J])=>J===R1?Z:`${Z}="${xY(J)}"`).join(" ")}function xY($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function gY($){let Z=new Set,J=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,X;while((X=J.exec($))!==null){let Q=X[1];if(g1.isBuiltin(Q))Z.add(Q)}return[...Z].sort()}async function hY($,Z,J,X,Q){if(!/import\s/.test($))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Y=Z.__importedComponents,G=P4.dirname(J),z=[],q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let U of $.matchAll(q)){let[H,j,B]=U,V=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,F=B,L,O=[];while((L=V.exec(B))!==null){let[_,w,R,N]=L,A=null,k=null;if(N.startsWith(".")||N.startsWith("/")){let T=P4.resolve(G,N);if(T.endsWith(".stx"))k=T;else{let M=`${T}.stx`;try{if(S4.statSync(M).isFile())k=M}catch{try{if(S4.statSync(T).isDirectory())A=T}catch{}}}}else A=J4(N,G);if(!A&&!k)continue;let D=!1,I=(T,M)=>{Y.set(T,M),Y.set(T.toLowerCase(),M);let E=T.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();Y.set(E,M),Q.add(M)};if(R&&k)I(R,k),D=!0;else if(w){let T=w.slice(1,-1).split(",").map((E)=>E.trim()).filter(Boolean).map((E)=>{let C=E.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(C)return{source:C[1],local:C[2]};return{source:E,local:E}}),M=A?Z4(A):null;for(let{source:E,local:C}of T){let y=null;if(k)y=k;else if(M)y=M.get(E)??M.get(E.toLowerCase())??M.get(E.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(y)I(C,y),D=!0}}if(D)O.push({start:L.index,end:L.index+_.length})}if(O.length===0)continue;for(let _=O.length-1;_>=0;_--)F=F.slice(0,O[_].start)+F.slice(O[_].end);z.push({start:U.index,end:U.index+H.length,value:`<script${j}>${F}</script>`})}if(z.length===0)return $;let K=[],W=0;for(let U of z)K.push($.slice(W,U.start),U.value),W=U.end;return K.push($.slice(W)),K.join("")}async function uY($,Z,J,X,Q){let Y=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,z=/@import\s*\(\s*([^)]+)\s*\)/g,q;while((q=z.exec(Y))!==null){let[K,W]=q,U=W.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of U){let j=H.split("/"),V=j[j.length-1].replace(/\.stx$/,""),F=V.includes("-")?V.split("-").map((_)=>_.charAt(0).toUpperCase()+_.slice(1)).join(""):V.charAt(0).toUpperCase()+V.slice(1),L=null,O=X4(H,J,X);for(let _ of O)try{if(await Bun.file(_).exists()){L=_;break}}catch{}if(L){G.set(F,L),G.set(V,L),G.set(V.toLowerCase(),L);let _=F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(G.set(_,L),Q.add(L),X.debug)console.log(`Imported component: ${F} -> ${L}`)}else if(X.debug)console.warn(`Could not resolve imported component: ${H}`)}Y=Y.replace(K,""),z.lastIndex=0}return Y}async function dY($,Z,J,X,Q){let Y=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=/@component\s*\(/g,K;while((K=q.exec(Y))!==null){let W=K.index,U=W+K[0].length-1,H=1,j=U+1;while(j<Y.length&&H>0){if(Y[j]==="(")H++;else if(Y[j]===")"){if(H--,H===0)break}j++}if(H!==0)break;let B=Y.substring(U+1,j),V=j+1,F=B.match(/^\s*['"]([^'"]+)['"]/);if(!F){q.lastIndex=0;continue}let L=F[1],O,_=B.slice(F[0].length),w=_.match(/^\s*,\s*/);if(w)O=_.slice(w[0].length).trim();let R={};if(O)try{R=b0(O,Z)}catch(T){let M=T instanceof Error?T.message:String(T);Y=Y.replace(Y.substring(W,V),`[Error parsing component props: ${M}]`);continue}let N="",A=V,D=Y.substring(V).match(/^([\s\S]*?)@endcomponent/);if(D)N=D[1].trim(),A=V+D[0].length;let I=await A1(L,R,N,G,Z,J,X,z,Q);Y=Y.substring(0,W)+I+Y.substring(A),q.lastIndex=0}return Y}async function mY($,Z,J,X,Q){if(!$)return $;let Y=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=n0(Y);Y=q.output;let K=J$(Y);return Y=await j(Y,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),Y=await j(Y,/[A-Z][a-zA-Z0-9]*/,!0,M4(D2)),Y=await j(Y,/[a-z][a-z0-9]*/,!1,D2),Y=q.restore(Y),Y;async function j(B,V,F,L){if(!B)return B;let O=B,_=I4(O,V,L),w=new Map;for(let A=_.length-1;A>=0;A--){let k=_[A],D=F?j9(k.tagName):k.tagName,I=fY(vY(k.attributes,Z,J)),T=K.some(([g,c])=>k.startIndex>=g&&k.startIndex<c),M=SY(I,Z,X,T),E=g1.getBuiltin(k.tagName),C=E?await B9(D,G,Z,J,X):!1;if(E&&!C){let g={context:Z,filePath:J,options:X,dependencies:Q},c=E.render(M,k.content,g);if(Object.keys(M.events).length>0){let l=f4(M.events);c=c.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${l}`)}if(Object.keys(M.clientReactive).length>0)c=x4(c,M.clientReactive);w.set(A,c);continue}if(!F&&k.tagName.includes("-")&&!await B9(D,G,Z,J,X))continue;let y={};for(let[g,c]of Object.entries(M.static))y[g]=c;for(let[g,c]of Object.entries(M.serverDynamic))y[g]=c;let P=await A1(D,y,q.restore(k.content),G,Z,J,X,z,Q);if(Object.keys(M.events).length>0){let g=h4(P);if(g){let c=f4(M.events),l=Object.keys(M.events).map((h)=>h.replace(/^@/,"").split(".")[0]).join(" ");P=P.substring(0,g.insertPos)+` data-stx-parent-events="${l}" ${c}`+P.substring(g.insertPos)}}if(Object.keys(M.clientReactive).length>0)P=x4(P,M.clientReactive);w.set(A,P)}if(w.size===0)return O;let R="",N=0;for(let A=0;A<_.length;A++){let k=w.get(A);if(k===void 0)continue;R+=O.slice(N,_[A].startIndex),R+=k,N=_[A].endIndex}return R+=O.slice(N),R}}function x4($,Z){let J=new Set(["if","for"]),X=new Set(["show"]),Q=Object.entries(Z).filter(([W])=>!J.has(W)),Y=Q.filter(([W])=>!X.has(W)).map(([W])=>j9(W)).join(" "),G=$,z=Q.length>0?h4(G):null;if(z){let W=Q.map(([H,j])=>`:${j9(H)}="${j.replace(/"/g,"&quot;")}"`).join(" "),U=Y?` data-stx-parent-bindings="${Y}"`:"";G=G.substring(0,z.insertPos)+`${U} ${W}`+G.substring(z.insertPos)}let q=Z.if;if(q)G=`<template :if="${q.replace(/"/g,"&quot;")}">${G}</template>`;let K=Z.for;if(K)G=`<template :for="${K.replace(/"/g,"&quot;")}">${G}</template>`;return G}function h4($){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec($);if(Z)return{insertPos:Z.index+1+Z[1].length};let J=0;while(J<$.length){let X=$.slice(J),Q=X.match(/^\s+/);if(Q){J+=Q[0].length;continue}if(X.startsWith("<!--")){let z=$.indexOf("-->",J+4);if(z===-1)return null;J=z+3;continue}let Y=X.match(/^<(script|style)\b[^>]*>/i);if(Y){let z=`</${Y[1].toLowerCase()}>`,q=$.toLowerCase().indexOf(z,J+Y[0].length);if(q===-1)return null;J=q+z.length;continue}let G=X.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!G)return null;return{insertPos:J+1+G[1].length}}return null}async function Y$($,Z,J,X,Q){if(!v4)N4(g1),v4=!0;let Y=await hY($,Z,J,X,Q);Y=await uY(Y,Z,J,X,Q),Y=await dY(Y,Z,J,X,Q);let G=[];for(let z=0;z<3;z++){let q=G.length,K=B1(Y,_9,(U,H)=>`\x00STX_COMPONENT_COMMENT_${q+H}\x00`,`STX_COMPONENT_COMMENT:${q}`);G.push(...K.tokens);let W=Y;if(Y=await mY(K.output,Z,J,X,Q),Y===W)break}if(G.length>0)Y=Y.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(z,q)=>G[Number(q)]??"");if(X.debug){let z=gY(Y);if(z.length>0)console.warn(`[stx] ${J}: unresolved component tag(s) after render passes: ${z.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return Y}function Q$($,Z){let J=0;for(let X=Z;X<$.length;X++){let Q=$[X];if(Q==="("||Q==="["||Q==="{")J++;else if(Q===")"||Q==="]"||Q==="}")J--;else if(Q===","&&J===0)return X}return-1}function cY($,Z,J){let X=$,Q=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),Y=Q.exec(X);while(Y){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")")q--;K++}if(q!==0)break;let W=X.substring(z+1,K-1),U=`${J}(${W})`;X=X.substring(0,G)+U+X.substring(K),Q.lastIndex=G+U.length,Y=Q.exec(X)}return X}function pY($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function l4($){let Z=$,J=[],X=new Set,Q=0,Y=0,G=Z.length,z=(U)=>{Y++;while(Y<G){if(Z[Y]==="\\"){Y+=2;continue}if(Z[Y]===U){Y++;return}Y++}},q=()=>{Y++;while(Y<G){if(Z[Y]==="\\"){Y+=2;continue}if(Z[Y]==="`"){Y++;return}if(Z[Y]==="$"&&Z[Y+1]==="{"){Y+=2;let U=1;while(Y<G&&U>0)if(Z[Y]==="{")U++,Y++;else if(Z[Y]==="}")U--,Y++;else if(Z[Y]==="'"||Z[Y]==='"')z(Z[Y]);else if(Z[Y]==="`")q();else Y++;continue}Y++}},K=()=>{if(Z[Y]==="/"&&Z[Y+1]==="/"){while(Y<G&&Z[Y]!==`
3422
- `)Y++;return!0}if(Z[Y]==="/"&&Z[Y+1]==="*"){Y+=2;while(Y<G-1&&!(Z[Y]==="*"&&Z[Y+1]==="/"))Y++;return Y+=2,!0}return!1},W=()=>{if(Q!==0)return;let U=Z.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(U){let B=U[2];if(!X.has(B))J.push(B),X.add(B);return}let H=Z.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!X.has(B))J.push(B),X.add(B);return}let j=Z.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!X.has(B))J.push(B),X.add(B)}};while(Y<G){if(K())continue;if(Z[Y]==="'"||Z[Y]==='"'){z(Z[Y]);continue}if(Z[Y]==="`"){q();continue}if(Z[Y]==="{"){Q++,Y++;continue}if(Z[Y]==="}"){Q--,Y++;continue}if(Q===0&&/[a-z]/i.test(Z[Y])&&(Y===0||/\s|[;{}()]/.test(Z[Y-1])))W();Y++}return J.join(", ")}function iY($,Z=""){let J=l4($).split(",").map((X)=>X.trim()).filter(Boolean);return`
3420
+ `}function w4($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}function R4($,Z){let J=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${Z}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),X=$.match(J);if(!X)return{region:null,rest:$};return{region:X[2],rest:$.replace(X[0],"")}}var e5={name:"Suspense",aliases:["suspense"],render($,Z,J){let X=R4(Z,"fallback"),Q=X.rest,Y=R4(Q,"error"),G=Y.rest,z=X.region??w4($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',q=Y.region??w4($,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${z}</div><div data-stx-suspense-error hidden>${q}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function H9($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}var $$={name:"TransitionGroup",aliases:["transition-group"],render($,Z,J){let X=(H9($,"name")||"v").replace(/["'<>]/g,""),Q=(H9($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Y=H9($,"class"),G=H9($,"id"),z=[`data-stx-transition-group="${X}"`,Y?`class="${Y}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Q} ${z}>${Z}</${Q}>`}};function N4($=g1){$.registerBuiltin(g5),$.registerBuiltin(c5),$.registerBuiltin(p5),$.registerBuiltin(n5),$.registerBuiltin(s5),$.registerBuiltin(o5),$.registerBuiltin(r5),$.registerBuiltin(a5),$.registerBuiltin(e5),$.registerBuiltin($$)}function j9($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var D4=new Map;function yY($){let Z=D4.get($.source);if(!Z)Z=new RegExp(`(${$.source})(?![\\w.:-])`,"y"),D4.set($.source,Z);return Z}var A4=new WeakMap;function M4($){let Z=A4.get($);if(!Z)Z=new Set([...$].map((X)=>X.toLowerCase())),A4.set($,Z);let J=Z;return(X)=>!/[a-z]/.test(X)&&J.has(X.toLowerCase())}function I4($,Z,J){let X=[],Q=0,Y=typeof J==="function"?J:J?(G)=>J.has(G.toLowerCase()):void 0;while(Q<$.length){let G=$.indexOf("<",Q);if(G===-1)break;let z=yY(Z);z.lastIndex=G+1;let q=z.exec($);if(!q){Q=G+1;continue}let K=q[1];if(Y&&Y(K)){let F=G+1+K.length;while(F<$.length&&$[F]!==">")F++;Q=F+1;continue}let W=G+1+K.length,U=null,H=W,j=-1,B=!1;while(W<$.length){let F=$[W];if(U){if(F==="\\"&&W+1<$.length){W+=2;continue}if(F===U)U=null;W++;continue}if(F==='"'||F==="'"){U=F,W++;continue}if(F==="/"&&W+1<$.length&&$[W+1]===">"){j=W+2,B=!0;break}if(F===">"){j=W+1;break}W++}if(j===-1){Q=G+1;continue}let V=$.slice(H,B?j-2:j-1).trim();if(B)X.push({fullMatch:$.slice(G,j),tagName:K,attributes:V,content:"",startIndex:G,endIndex:j,isSelfClosing:!0}),Q=j;else{let F=`<${K}`,L=`</${K}>`,O=1,_=j,w=-1;while(O>0&&_<$.length){let A=$.indexOf(F,_),k=$.indexOf(L,_);if(k===-1)break;if(A!==-1&&A<k){let D=$[A+F.length];if(D===" "||D===">"||D==="/"||D===`
3421
+ `||D==="\t")O++;_=A+F.length}else{if(O--,O===0){w=k;break}_=k+L.length}}if(w===-1){Q=j;continue}let R=$.slice(j,w),N=w+L.length;X.push({fullMatch:$.slice(G,N),tagName:K,attributes:V,content:R,startIndex:G,endIndex:N,isSelfClosing:!1}),Q=N}}return X}function k4($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function T4($,Z){try{let J=Buffer.from($,"base64").toString("utf8");return JSON.parse(J)}catch{}try{let J=$.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return JSON.parse(J)}catch(J){if(Z?.debug)console.error("Error decoding __stx_ prop:",J);return $}}function Z$($,Z){let J=0,X="",Q=Z;while(Q<$.length){let Y=$[Q];if(X){if(Y==="\\")Q++;else if(Y===X)X=""}else if(Y==='"'||Y==="'"||Y==="`")X=Y;else if(Y==="{")J++;else if(Y==="}"){if(J--,J===0)return $.slice(Z,Q+1)}Q++}return $.slice(Z)}function E4($){let Z=$.trim();if(!Z.startsWith("{")||!Z.endsWith("}"))return null;if(Z$(Z,0).length!==Z.length)return null;return Z.slice(1,-1).trim()}var CY=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),SY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J$($){let Z=[],J=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,X;while((X=J.exec($))!==null){let Q=X[2]||"";if(!/(?:^|\s)(?::for|x-for|v-for|@for)\s*=/.test(Q))continue;let Y=X.index,G=Y+X[0].length,z=X[1].toLowerCase();if(X[0].endsWith("/>")||SY.has(z)){Z.push([Y,G]);continue}let q=z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`<\\/?${q}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");K.lastIndex=G;let W=1,U=G,H;while((H=K.exec($))!==null)if(H[0].startsWith("</")){if(W--,W===0){U=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))W++;Z.push([Y,U])}return Z}function y4($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>y4(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function C4($,Z){if(!/:[\w-]+=/.test($))return $;let J=$,X=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,Q=[],Y;while((Y=X.exec($))!==null)Q.push([Y.index,Y.index+Y[0].length]);Q.push(...J$($));function G(U){return Q.some(([H,j])=>U>=H&&U<j)}let z=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,q=[],K=new Map,W=256;while((Y=z.exec(J))!==null){if(G(Y.index))continue;let U=Y[0],H=Y[2];if(!H||!H.includes(":"))continue;let j=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,B,V=H,F=!1;while((B=j.exec(H))!==null){let L=B[1],O=B[2];if(b4(L))continue;if(O.includes("()")&&!O.includes(".get(")||O.includes("$store")||O.includes("$ref"))continue;try{let _=Object.keys(Z),w=Object.values(Z),R=O.match(/^([a-zA-Z_$][\w$]*)/);if(R&&!_.includes(R[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(R[1]))continue;let N=JSON.stringify([_,O]),A=K.get(N);if(!A){if(A=Function(..._,`return (${O})`),K.size>=W)K.clear();K.set(N,A)}let k=A(...w);if(L==="class"){let D=y4(k);if(D){let I=V.match(/\sclass="([^"]*)"/);if(I)V=V.replace(I[0],` class="${I[1]} ${D}"`);else V=V.replace(B[0],` class="${D}"`)}else V=V.replace(B[0],"");F=!0;continue}if(CY.has(L)){if(k)V=V.replace(B[0],` ${L}`);else V=V.replace(B[0],"");F=!0;continue}if(k===null||k===void 0||k===!1)V=V.replace(B[0],"");else{let D=String(k).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");V=V.replace(B[0],` ${L}="${D}"`)}F=!0}catch{continue}}if(F){let L=U.endsWith("/>")?" /":"",_=`<${Y[1]}${V}${L}>`;q.push({start:Y.index,end:Y.index+U.length,replacement:_})}}if(q.length>0){let U=Array(q.length*2+1),H=0;for(let j=0;j<q.length;j++){let{start:B,end:V,replacement:F}=q[j];U[j*2]=J.slice(H,B),U[j*2+1]=F,H=V}U[q.length*2]=J.slice(H),J=U.join("")}return J}import S4 from"fs";import P4 from"path";var D2=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function X$($){if($.includes("-")||$==="component")return!1;if(/^[A-Z]/.test($))return!/[a-z]/.test($)&&[...D2].some((Z)=>Z.toLowerCase()===$.toLowerCase());return D2.has($)||/[A-Z]/.test($)}var v4=!1;function PY($,Z,J,X=!1){let Q={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},Y=new Set(Array.isArray(Z.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),G=(W)=>{if(Y.size===0)return!1;let U=g0(W),H=U.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(H&&Y.has(H))return!0;for(let j of Y){let B=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${B}\\s*\\(`).test(U))return!0}return!1},z=new Set(g4),q=(W)=>{if(!W.includes("-")||W.startsWith("@")||W.startsWith(":")||W.startsWith("x-")||W.startsWith("__"))return W;if(W.startsWith("aria-")||W.startsWith("data-"))return W;return W.replace(/-([a-z0-9])/g,(U,H)=>H.toUpperCase())},K=(W,U)=>{let H=q(W);if(Q.static[H]=U,H!==W)Q.staticNames[H]=W};for(let[W,U]of Object.entries($)){let H=W.startsWith("x-")&&!z.has(W)&&!W.startsWith("x-bind:")&&!W.startsWith("x-on:")?`:${W.slice(2)}`:W;if(H.startsWith("@")){Q.events[H]=U;continue}if(H.startsWith("__stx_")){let j=q(H.slice(6));Q.serverDynamic[j]=T4(U,J);continue}if(H.startsWith(":")){let j=q(H.slice(1)),B=U===R1?j:U;if(j==="if"||j==="for"||j==="show"){Q.clientReactive[j]=B;continue}if(X){Q.clientReactive[j]=B;continue}if(G(B)){Q.clientReactive[j]=B;continue}try{if(!B0(B)){if(J.debug)console.error(`Unsafe expression in :${j} binding: ${B}`);Q.clientReactive[j]=B;continue}let V=Object.keys(Z),L=H0(B,V)(...Object.values(Z));if(L===void 0){let O=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(V9(B).some((w)=>!O.has(w)&&!V.includes(w))){Q.clientReactive[j]=B;continue}}if(Q.serverDynamic[j]=L,j!==H.slice(1)&&Q.serverDynamicNames)Q.serverDynamicNames[j]=H.slice(1)}catch{Q.clientReactive[j]=B}continue}if(typeof U==="string"&&U.includes("{{")&&U.includes("}}")){let j=U.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(j)try{let B=j[1];if(B0(B)){let F=H0(B,Object.keys(Z))(...Object.values(Z));K(H,F!=null?String(F):"")}else{if(J.debug)console.error(`Unsafe expression in ${H}: ${B}`);K(H,U)}}catch(B){if(J.debug)console.error(`Error evaluating expression for ${H}:`,B);K(H,U)}else{let B=U,V=/\{\{\s*([\s\S]+?)\s*\}\}/g,F;while((F=V.exec(U))!==null)try{let L=F[1];if(!B0(L)){if(J.debug)console.error(`Unsafe expression in ${H}: ${L}`);continue}let _=H0(L,Object.keys(Z))(...Object.values(Z));B=B.replace(F[0],String(_??""))}catch(L){if(J.debug)console.error(`Error evaluating expression in ${H}:`,L)}K(H,B)}continue}K(H,U===R1?"true":k4(U))}return Q}var vY=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function fY($,Z,J){if(!$.includes("@"))return $;if(!vY.some(([Q,Y])=>Q.test($)&&$.includes(Y)))return $;try{return $1($,Z,J)}catch{return $}}function xY($){let Z={},J=0,X=$.length;while(J<X){while(J<X&&/\s/.test($[J]))J++;if(J>=X)break;let Q="";while(J<X&&!/[\s=]/.test($[J]))Q+=$[J],J++;if(!Q)break;while(J<X&&/\s/.test($[J]))J++;if(J<X&&$[J]==="="){J++;while(J<X&&/\s/.test($[J]))J++;let Y="";if(J<X&&($[J]==='"'||$[J]==="'")){let G=$[J];J++;while(J<X){let z=$[J];if(z==="\\"&&J+1<X){J++,Y+=$[J],J++;continue}if(z===G){J++;break}Y+=z,J++}}else if($[J]==="{"){Y=Z$($,J),J+=Y.length;let G=E4(Y);if(G!==null){Z[`:${Q}`]=G;continue}}else while(J<X&&!/\s/.test($[J]))Y+=$[J],J++;Z[Q]=Y}else Z[Q]=R1}return Z}function f4($){return Object.entries($).map(([Z,J])=>J===R1?Z:`${Z}="${gY(J)}"`).join(" ")}function gY($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function hY($){let Z=new Set,J=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,X;while((X=J.exec($))!==null){let Q=X[1];if(g1.isBuiltin(Q))Z.add(Q)}return[...Z].sort()}async function uY($,Z,J,X,Q){if(!/import\s/.test($))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Y=Z.__importedComponents,G=P4.dirname(J),z=[],q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let U of $.matchAll(q)){let[H,j,B]=U,V=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,F=B,L,O=[];while((L=V.exec(B))!==null){let[_,w,R,N]=L,A=null,k=null;if(N.startsWith(".")||N.startsWith("/")){let T=P4.resolve(G,N);if(T.endsWith(".stx"))k=T;else{let M=`${T}.stx`;try{if(S4.statSync(M).isFile())k=M}catch{try{if(S4.statSync(T).isDirectory())A=T}catch{}}}}else A=J4(N,G);if(!A&&!k)continue;let D=!1,I=(T,M)=>{Y.set(T,M),Y.set(T.toLowerCase(),M);let E=T.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();Y.set(E,M),Q.add(M)};if(R&&k)I(R,k),D=!0;else if(w){let T=w.slice(1,-1).split(",").map((E)=>E.trim()).filter(Boolean).map((E)=>{let C=E.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(C)return{source:C[1],local:C[2]};return{source:E,local:E}}),M=A?Z4(A):null;for(let{source:E,local:C}of T){let y=null;if(k)y=k;else if(M)y=M.get(E)??M.get(E.toLowerCase())??M.get(E.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(y)I(C,y),D=!0}}if(D)O.push({start:L.index,end:L.index+_.length})}if(O.length===0)continue;for(let _=O.length-1;_>=0;_--)F=F.slice(0,O[_].start)+F.slice(O[_].end);z.push({start:U.index,end:U.index+H.length,value:`<script${j}>${F}</script>`})}if(z.length===0)return $;let K=[],W=0;for(let U of z)K.push($.slice(W,U.start),U.value),W=U.end;return K.push($.slice(W)),K.join("")}async function dY($,Z,J,X,Q){let Y=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,z=/@import\s*\(\s*([^)]+)\s*\)/g,q;while((q=z.exec(Y))!==null){let[K,W]=q,U=W.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of U){let j=H.split("/"),V=j[j.length-1].replace(/\.stx$/,""),F=V.includes("-")?V.split("-").map((_)=>_.charAt(0).toUpperCase()+_.slice(1)).join(""):V.charAt(0).toUpperCase()+V.slice(1),L=null,O=X4(H,J,X);for(let _ of O)try{if(await Bun.file(_).exists()){L=_;break}}catch{}if(L){G.set(F,L),G.set(V,L),G.set(V.toLowerCase(),L);let _=F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(G.set(_,L),Q.add(L),X.debug)console.log(`Imported component: ${F} -> ${L}`)}else if(X.debug)console.warn(`Could not resolve imported component: ${H}`)}Y=Y.replace(K,""),z.lastIndex=0}return Y}async function mY($,Z,J,X,Q){let Y=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=/@component\s*\(/g,K;while((K=q.exec(Y))!==null){let W=K.index,U=W+K[0].length-1,H=1,j=U+1;while(j<Y.length&&H>0){if(Y[j]==="(")H++;else if(Y[j]===")"){if(H--,H===0)break}j++}if(H!==0)break;let B=Y.substring(U+1,j),V=j+1,F=B.match(/^\s*['"]([^'"]+)['"]/);if(!F){q.lastIndex=0;continue}let L=F[1],O,_=B.slice(F[0].length),w=_.match(/^\s*,\s*/);if(w)O=_.slice(w[0].length).trim();let R={};if(O)try{R=b0(O,Z)}catch(T){let M=T instanceof Error?T.message:String(T);Y=Y.replace(Y.substring(W,V),`[Error parsing component props: ${M}]`);continue}let N="",A=V,D=Y.substring(V).match(/^([\s\S]*?)@endcomponent/);if(D)N=D[1].trim(),A=V+D[0].length;let I=await A1(L,R,N,G,Z,J,X,z,Q);Y=Y.substring(0,W)+I+Y.substring(A),q.lastIndex=0}return Y}async function lY($,Z,J,X,Q){if(!$)return $;let Y=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=n0(Y);Y=q.output;let K=J$(Y);return Y=await j(Y,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),Y=await j(Y,/[A-Z][a-zA-Z0-9]*/,!0,M4(D2)),Y=await j(Y,/[a-z][a-z0-9]*/,!1,D2),Y=q.restore(Y),Y;async function j(B,V,F,L){if(!B)return B;let O=B,_=I4(O,V,L),w=new Map;for(let A=_.length-1;A>=0;A--){let k=_[A],D=F?j9(k.tagName):k.tagName,I=xY(fY(k.attributes,Z,J)),T=K.some(([g,c])=>k.startIndex>=g&&k.startIndex<c),M=PY(I,Z,X,T),E=g1.getBuiltin(k.tagName),C=E?await B9(D,G,Z,J,X):!1;if(E&&!C){let g={context:Z,filePath:J,options:X,dependencies:Q},c=E.render(M,k.content,g);if(Object.keys(M.events).length>0){let l=f4(M.events);c=c.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${l}`)}if(Object.keys(M.clientReactive).length>0)c=x4(c,M.clientReactive);w.set(A,c);continue}if(!F&&k.tagName.includes("-")&&!await B9(D,G,Z,J,X))continue;let y={};for(let[g,c]of Object.entries(M.static))y[g]=c;for(let[g,c]of Object.entries(M.serverDynamic))y[g]=c;let P=await A1(D,y,q.restore(k.content),G,Z,J,X,z,Q);if(Object.keys(M.events).length>0){let g=h4(P);if(g){let c=f4(M.events),l=Object.keys(M.events).map((h)=>h.replace(/^@/,"").split(".")[0]).join(" ");P=P.substring(0,g.insertPos)+` data-stx-parent-events="${l}" ${c}`+P.substring(g.insertPos)}}if(Object.keys(M.clientReactive).length>0)P=x4(P,M.clientReactive);w.set(A,P)}if(w.size===0)return O;let R="",N=0;for(let A=0;A<_.length;A++){let k=w.get(A);if(k===void 0)continue;R+=O.slice(N,_[A].startIndex),R+=k,N=_[A].endIndex}return R+=O.slice(N),R}}function x4($,Z){let J=new Set(["if","for"]),X=new Set(["show"]),Q=Object.entries(Z).filter(([W])=>!J.has(W)),Y=Q.filter(([W])=>!X.has(W)).map(([W])=>j9(W)).join(" "),G=$,z=Q.length>0?h4(G):null;if(z){let W=Q.map(([H,j])=>`:${j9(H)}="${j.replace(/"/g,"&quot;")}"`).join(" "),U=Y?` data-stx-parent-bindings="${Y}"`:"";G=G.substring(0,z.insertPos)+`${U} ${W}`+G.substring(z.insertPos)}let q=Z.if;if(q)G=`<template :if="${q.replace(/"/g,"&quot;")}">${G}</template>`;let K=Z.for;if(K)G=`<template :for="${K.replace(/"/g,"&quot;")}">${G}</template>`;return G}function h4($){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec($);if(Z)return{insertPos:Z.index+1+Z[1].length};let J=0;while(J<$.length){let X=$.slice(J),Q=X.match(/^\s+/);if(Q){J+=Q[0].length;continue}if(X.startsWith("<!--")){let z=$.indexOf("-->",J+4);if(z===-1)return null;J=z+3;continue}let Y=X.match(/^<(script|style)\b[^>]*>/i);if(Y){let z=`</${Y[1].toLowerCase()}>`,q=$.toLowerCase().indexOf(z,J+Y[0].length);if(q===-1)return null;J=q+z.length;continue}let G=X.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!G)return null;return{insertPos:J+1+G[1].length}}return null}async function Y$($,Z,J,X,Q){if(!v4)N4(g1),v4=!0;let Y=await uY($,Z,J,X,Q);Y=await dY(Y,Z,J,X,Q),Y=await mY(Y,Z,J,X,Q);let G=[];for(let z=0;z<3;z++){let q=G.length,K=B1(Y,_9,(U,H)=>`\x00STX_COMPONENT_COMMENT_${q+H}\x00`,`STX_COMPONENT_COMMENT:${q}`);G.push(...K.tokens);let W=Y;if(Y=await lY(K.output,Z,J,X,Q),Y===W)break}if(G.length>0)Y=Y.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(z,q)=>G[Number(q)]??"");if(X.debug){let z=hY(Y);if(z.length>0)console.warn(`[stx] ${J}: unresolved component tag(s) after render passes: ${z.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return Y}function Q$($,Z){let J=0;for(let X=Z;X<$.length;X++){let Q=$[X];if(Q==="("||Q==="["||Q==="{")J++;else if(Q===")"||Q==="]"||Q==="}")J--;else if(Q===","&&J===0)return X}return-1}function pY($,Z,J){let X=$,Q=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),Y=Q.exec(X);while(Y){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")")q--;K++}if(q!==0)break;let W=X.substring(z+1,K-1),U=`${J}(${W})`;X=X.substring(0,G)+U+X.substring(K),Q.lastIndex=G+U.length,Y=Q.exec(X)}return X}function iY($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function l4($){let Z=$,J=[],X=new Set,Q=0,Y=0,G=Z.length,z=(U)=>{Y++;while(Y<G){if(Z[Y]==="\\"){Y+=2;continue}if(Z[Y]===U){Y++;return}Y++}},q=()=>{Y++;while(Y<G){if(Z[Y]==="\\"){Y+=2;continue}if(Z[Y]==="`"){Y++;return}if(Z[Y]==="$"&&Z[Y+1]==="{"){Y+=2;let U=1;while(Y<G&&U>0)if(Z[Y]==="{")U++,Y++;else if(Z[Y]==="}")U--,Y++;else if(Z[Y]==="'"||Z[Y]==='"')z(Z[Y]);else if(Z[Y]==="`")q();else Y++;continue}Y++}},K=()=>{if(Z[Y]==="/"&&Z[Y+1]==="/"){while(Y<G&&Z[Y]!==`
3422
+ `)Y++;return!0}if(Z[Y]==="/"&&Z[Y+1]==="*"){Y+=2;while(Y<G-1&&!(Z[Y]==="*"&&Z[Y+1]==="/"))Y++;return Y+=2,!0}return!1},W=()=>{if(Q!==0)return;let U=Z.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(U){let B=U[2];if(!X.has(B))J.push(B),X.add(B);return}let H=Z.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!X.has(B))J.push(B),X.add(B);return}let j=Z.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!X.has(B))J.push(B),X.add(B)}};while(Y<G){if(K())continue;if(Z[Y]==="'"||Z[Y]==='"'){z(Z[Y]);continue}if(Z[Y]==="`"){q();continue}if(Z[Y]==="{"){Q++,Y++;continue}if(Z[Y]==="}"){Q--,Y++;continue}if(Q===0&&/[a-z]/i.test(Z[Y])&&(Y===0||/\s|[;{}()]/.test(Z[Y-1])))W();Y++}return J.join(", ")}function nY($,Z=""){let J=l4($).split(",").map((X)=>X.trim()).filter(Boolean);return`
3423
3423
  (function() {
3424
3424
  ${i1("var",J)}
3425
3425
  var __destroyHooks = [];
@@ -3428,7 +3428,7 @@ document.addEventListener("focusout",function(e){
3428
3428
 
3429
3429
  ${$}
3430
3430
  ${Z}})();
3431
- `}function nY($,Z){let Q=l4($).split(",").map((Y)=>Y.trim()).filter(Boolean).map((Y)=>` try { __scopeRegistration[${JSON.stringify(Y)}] = ${Y}; } catch (e) { /* not actually top-level */ }`).join(`
3431
+ `}function sY($,Z){let Q=l4($).split(",").map((Y)=>Y.trim()).filter(Boolean).map((Y)=>` try { __scopeRegistration[${JSON.stringify(Y)}] = ${Y}; } catch (e) { /* not actually top-level */ }`).join(`
3432
3432
  `);return`
3433
3433
  // Register scope variables for STX runtime
3434
3434
  if (!window.stx._scopes) window.stx._scopes = {};
@@ -3440,7 +3440,7 @@ ${Q}
3440
3440
  // shadowing import. __stxScopeRenames is emitted by bundleClientScript.
3441
3441
  try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
3442
3442
  window.stx._scopes['${Z}'] = __scopeRegistration;
3443
- `}function sY($,Z){return $.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(J,X)=>X===Z?J:'<script data-stx-scoped data-stx-run="always"')}function u4($,Z){let J=nY($,Z);return oY(iY($,J),Z)}function oY($,Z){let J=`
3443
+ `}function oY($,Z){return $.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(J,X)=>X===Z?J:'<script data-stx-scoped data-stx-run="always"')}function u4($,Z){let J=sY($,Z);return rY(nY($,J),Z)}function rY($,Z){let J=`
3444
3444
  (function() {
3445
3445
  var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${Z}"]') : null;
3446
3446
  var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
@@ -3457,25 +3457,25 @@ ${Q}
3457
3457
  } finally {
3458
3458
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3459
3459
  }
3460
- })();`}function rY($,Z){if(s0($)){let Q=s0($).tag.match(/data-stx-scope="([^"]*)"/);if(Q)return{html:$,mergedIntoExisting:Q[1],stamped:!0,root:"body"};return{html:C1($,(Y,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],Q=J[2].slice(1),Y=X.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0,root:Q};let G=J[1],z=J[2],q=J[3];return{html:`${G}${z} data-stx-scope="${Z}"${q}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0,root:Q}}return{html:$,mergedIntoExisting:null,stamped:!1,root:null}}var d4=0,G$=new Set;function Rj(){G$.clear()}function m4($){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test($)}var Nj=new n1(500),c4=new Set;function Dj(){c4.clear()}function aY($){if($.__onceStore instanceof Set)return $.__onceStore;return c4}async function z$($,Z,J,X,Q,Y=new Set){let G=X.partialsDir||q0.join(q0.dirname(J),"partials");if(G&&!q0.isAbsolute(G))G=q0.resolve(process.cwd(),G);let z=cY($,"@partial","@include"),q=aY(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,L)=>{let O=F.trim(),_=`${J}:${O}`;if(q.has(_))return"";return q.add(_),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")")_--;w++}if(_!==0)break;let R=z.substring(O+1,w-1),N=R.match(/^\s*['"]([^'"]+)['"]/);if(!N){V.lastIndex=w;continue}let A=N[1],k=K(A,G,J),D="";if(k&&await Bun.file(k).exists())Q.add(k),D=`@include(${R})`;z=z.substring(0,L)+D+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let L=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=L.exec(z))!==null){let _=O.index,w=_+O[0].length-1,R=1,N=w+1;while(N<z.length&&R>0){if(z[N]==="(")R++;else if(z[N]===")")R--;N++}if(R!==0)break;let A=z.substring(w+1,N-1),k=Q$(A,0);if(k===-1){L.lastIndex=N;continue}let D=A.substring(0,k).trim(),I=A.substring(k+1).trim(),T=I.match(/^\s*['"]([^'"]+)['"]/);if(!T){L.lastIndex=N;continue}let M=T[1],E=I.substring(T[0].length),C,y=Q$(E,0);if(y!==-1)C=E.substring(y+1).trim();try{let b=`Boolean(${D})`,P;if(B0(b)){let l=H0(b,Object.keys(Z));P=Boolean(l(...Object.values(Z)))}else P=Boolean(Z0(b,Z));let g=F?!P:P,c="";if(g){let l=K(M,G,J);if(l&&await Bun.file(l).exists())Q.add(l);c=`@include('${M}'${C?`, ${C}`:""})`}z=z.substring(0,_)+c+z.substring(N),L.lastIndex=0}catch(b){let P=b instanceof Error?b.message:String(b),g=_0("Include",`Error evaluating ${V} condition: ${P}`,J,$,_);z=z.substring(0,_)+g+z.substring(N),L.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let[,k,D,I,T]=A;try{let M,E=D.trim();if(B0(E))M=H0(E,Object.keys(Z))(...Object.values(Z));else M=Z0(E,Z);let C="";if(Array.isArray(M)&&M.length>0)for(let y of M){let b={...Z,[I]:y},P=await H(k,b,$,L);C+=P}else if(T)C=await H(T,{},$,L);z=z.substring(0,L)+C+z.substring(w+1),V.lastIndex=0}catch(M){let E=M instanceof Error?M.message:String(M);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,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*(\[[^\]]+\])/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let k=A[1],D=R.slice(A[0].length),I,T=D.match(/^\s*,\s*\{/);if(T){D=D.slice(T[0].length-1);let C=1,y=1;while(y<D.length&&C>0){if(D[y]==="{")C++;else if(D[y]==="}"){if(C--,C===0)break}y++}I=D.substring(0,y+1),D=D.slice(y+1)}let M,E=D.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(E)M=E[1];try{let C=JSON.parse(k.replace(/'/g,'"')),y={};if(I)try{y=b0(I,Z)}catch(P){let g=P instanceof Error?P.message:String(P);if(X.debug){let c=_0("Include",`Error parsing includeFirst variables: ${g}`,J,$,L,N);z=z.replace(N,()=>c)}else z=z.replace(N,()=>M||"");continue}let b=!1;for(let P of C){let g=K(P,G,J);if(!g)continue;if(await e(g)){let c=await H(P,y,$,L);z=z.replace(N,()=>c),b=!0;break}}if(!b)if(M!==void 0)z=z.replace(N,()=>M);else if(X.debug){let P=_0("Include",`None of the includeFirst paths exist: ${k}`,J,$,L,N);z=z.replace(N,()=>P)}else z=z.replace(N,"")}catch(C){let y=C instanceof Error?C.message:String(C),b=_0("Include",`Error processing @includeFirst: ${y}`,J,$,L,N);z=z.replace(N,()=>b)}V.lastIndex=0}}function K(V,F,L){try{let O=V;if(!V.endsWith(".stx"))O=`${V}.stx`;let _=q0.resolve(F),w=q0.resolve(q0.dirname(L)),R;if(!O.startsWith("./")&&!O.startsWith("../")){for(let T of X._layerPartialDirs??[]){let M=q0.resolve(T,O);if(M.startsWith(`${q0.resolve(T)}${q0.sep}`)&&lY(M))return M}R=q0.resolve(F,O)}else R=q0.resolve(w,O);let N=q0.normalize(R),A=N.startsWith(_+q0.sep)||N===_,k=N.startsWith(w+q0.sep)||N===w,D=!1,I=q0.dirname(w);if(N.startsWith(I+q0.sep)){if(!q0.relative(I,N).split(q0.sep).some((C)=>C.startsWith(".")&&C!=="."&&C!==".."))D=!0}if(!A&&!k&&!D)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${N}`),console.error(` Allowed dirs: ${_}, ${w}`),null;return N}catch(O){return console.error(`Error resolving path ${V}: ${O}`),null}}let W=q0.resolve(J);Y.add(W);function U(V,F,L,O){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),_0("Include",F,J,L,O)}async function H(V,F={},L,O){let _=K(V,G,J);if(!_)return U(V,`Could not resolve path for include: ${V}`,L,O);let w=q0.resolve(_);if(Y.has(w)){let R=[...Y,w].map((N)=>q0.basename(N)).join(" -> ");return U(V,`Circular include detected: ${R}`,L,O)}try{Q.add(_);let R;if(!R)try{R=await Bun.file(_).text()}catch(h){let s=h instanceof Error?h.message:String(h);return U(V,`Error loading include file ${V}: ${s}`,L,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-v26qp1p5.js");R=h(R,Z)}if(R&&(X.debug||!L9()&&!O9()))try{let{warnUnbalancedTags:h}=await import("./chunk-wf9cmyj7.js");h(R,_)}catch{}let N=R;try{let{processESImports:h}=await import("./chunk-tt0n1ycm.js");await h(R,Z,_,X,Q)}catch(h){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${_}:`,h instanceof Error?h.message:h)}let A=z9(N);if(A)N=A.content.trim();let D=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),I="";if(D)I=`<style${D[1]}>${D[2]}</style>`;let T=[];N=N.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(h,s,u)=>{if(!m4(s))return"";return T.push({attrs:s,body:u}),`__STX_DATA_BLOCK_${T.length-1}__`}),N=N.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let M={...Z};M.__stx_signals_gate=Y1(R,_);for(let[h,s]of Object.entries(F))M[h]=s;let E=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,C=[...R.matchAll(E)],y="",b=null,P=!1;for(let h of C){let s=h[1]||"",u=h[2]||"";if(m4(s))continue;let z0=s.includes("server"),d0=M1(s);if(!z0&&u.trim()){let{interpolateScriptExpressions:J0}=await import("./chunk-x887namm.js");u=J0(u,M)}let x0="";try{let{extractAndStripCssImports:J0,renderVendorStyleTags:j0}=await import("./chunk-q0s18twx.js"),p=J0(u,{filePath:_,projectRoot:process.cwd()});u=p.code,x0=j0(p.styles)}catch(J0){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${_}:`,J0 instanceof Error?J0.message:J0)}if(d0&&u.trim())u=I1(u);if(!z0){try{let{injectBrowserCoreAutoImports:j0}=await import("./chunk-q0s18twx.js");u=j0(u).code;let{hasUserImports:p,bundleClientScript:i}=await import("./chunk-j3m3ydzv.js");if(p(u))u=await i(u,_,{projectRoot:process.cwd()})}catch(j0){if(X.debug)console.warn(`[stx] bundler skipped for ${_}:`,j0 instanceof Error?j0.message:j0)}let{stripStxRuntimeImports:J0}=await import("./chunk-z7jx68nh.js");u=J0(u)}let m0=pY(u);if(m0&&!z0){P=!0,b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let J0=Z1(u),j0=u4(J0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}">${j0}</script>
3461
- `;continue}if(z0)try{let{extractVariables:J0}=await import("./chunk-fsef8xw9.js");await J0(u,M,_)}catch(J0){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${_}:`,J0)}if(!z0&&!m0){let J0=s.replace(/\bclient\b/i,"").trim();b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let j0=Z1(u),p=u4(j0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}"${J0?` ${J0}`:""}>${p}</script>
3462
- `}}if(T.length>0){let{interpolateScriptExpressions:h}=await import("./chunk-x887namm.js");N=N.replace(/__STX_DATA_BLOCK_(\d+)__/g,(s,u)=>{let z0=T[Number(u)];return`<script${z0.attrs}>${h(z0.body,M)}</script>`})}if(b){let h=rY(N,b);if(N=h.html,h.mergedIntoExisting){let u=b,z0=h.mergedIntoExisting;y=y.split(`'${u}'`).join(`'${z0}'`).split(`"${u}"`).join(`"${z0}"`),b=z0}else if(!h.stamped&&P&&!G$.has(_))G$.add(_),console.warn(`[stx] ${q0.relative(process.cwd(),_)} 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 s=h.stamped&&h.root!==null&&X$(h.root);y=sY(y,s?b:null)}if(N.includes("@include")||N.includes("@partial"))N=await z$(N,M,_,X,Q,Y);let{processLoops:g,reportDeferredLoopWarnings:c}=await import("./chunk-v9rtg3q7.js"),l=g(N,M,_,void 0,!0);if(l=$1(l,M,_),l=c(l),l=V1(l,M,_),I)l+=`
3460
+ })();`}function aY($,Z){if(s0($)){let Q=s0($).tag.match(/data-stx-scope="([^"]*)"/);if(Q)return{html:$,mergedIntoExisting:Q[1],stamped:!0,root:"body"};return{html:C1($,(Y,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],Q=J[2].slice(1),Y=X.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0,root:Q};let G=J[1],z=J[2],q=J[3];return{html:`${G}${z} data-stx-scope="${Z}"${q}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0,root:Q}}return{html:$,mergedIntoExisting:null,stamped:!1,root:null}}var d4=0,G$=new Set;function Nj(){G$.clear()}function m4($){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test($)}var Dj=new n1(500),c4=new Set;function Aj(){c4.clear()}function tY($){if($.__onceStore instanceof Set)return $.__onceStore;return c4}async function z$($,Z,J,X,Q,Y=new Set){let G=X.partialsDir||q0.join(q0.dirname(J),"partials");if(G&&!q0.isAbsolute(G))G=q0.resolve(process.cwd(),G);let z=pY($,"@partial","@include"),q=tY(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,L)=>{let O=F.trim(),_=`${J}:${O}`;if(q.has(_))return"";return q.add(_),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")")_--;w++}if(_!==0)break;let R=z.substring(O+1,w-1),N=R.match(/^\s*['"]([^'"]+)['"]/);if(!N){V.lastIndex=w;continue}let A=N[1],k=K(A,G,J),D="";if(k&&await Bun.file(k).exists())Q.add(k),D=`@include(${R})`;z=z.substring(0,L)+D+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let L=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=L.exec(z))!==null){let _=O.index,w=_+O[0].length-1,R=1,N=w+1;while(N<z.length&&R>0){if(z[N]==="(")R++;else if(z[N]===")")R--;N++}if(R!==0)break;let A=z.substring(w+1,N-1),k=Q$(A,0);if(k===-1){L.lastIndex=N;continue}let D=A.substring(0,k).trim(),I=A.substring(k+1).trim(),T=I.match(/^\s*['"]([^'"]+)['"]/);if(!T){L.lastIndex=N;continue}let M=T[1],E=I.substring(T[0].length),C,y=Q$(E,0);if(y!==-1)C=E.substring(y+1).trim();try{let b=`Boolean(${D})`,P;if(B0(b)){let l=H0(b,Object.keys(Z));P=Boolean(l(...Object.values(Z)))}else P=Boolean(Z0(b,Z));let g=F?!P:P,c="";if(g){let l=K(M,G,J);if(l&&await Bun.file(l).exists())Q.add(l);c=`@include('${M}'${C?`, ${C}`:""})`}z=z.substring(0,_)+c+z.substring(N),L.lastIndex=0}catch(b){let P=b instanceof Error?b.message:String(b),g=_0("Include",`Error evaluating ${V} condition: ${P}`,J,$,_);z=z.substring(0,_)+g+z.substring(N),L.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let[,k,D,I,T]=A;try{let M,E=D.trim();if(B0(E))M=H0(E,Object.keys(Z))(...Object.values(Z));else M=Z0(E,Z);let C="";if(Array.isArray(M)&&M.length>0)for(let y of M){let b={...Z,[I]:y},P=await H(k,b,$,L);C+=P}else if(T)C=await H(T,{},$,L);z=z.substring(0,L)+C+z.substring(w+1),V.lastIndex=0}catch(M){let E=M instanceof Error?M.message:String(M);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,F;while((F=V.exec(z))!==null){let L=F.index,O=L+F[0].length-1,_=1,w=O+1;while(w<z.length&&_>0){if(z[w]==="(")_++;else if(z[w]===")"){if(_--,_===0)break}w++}if(_!==0)break;let R=z.substring(O+1,w),N=z.substring(L,w+1),A=R.match(/^\s*(\[[^\]]+\])/);if(!A){V.lastIndex=0,z=z.replace(N,"");continue}let k=A[1],D=R.slice(A[0].length),I,T=D.match(/^\s*,\s*\{/);if(T){D=D.slice(T[0].length-1);let C=1,y=1;while(y<D.length&&C>0){if(D[y]==="{")C++;else if(D[y]==="}"){if(C--,C===0)break}y++}I=D.substring(0,y+1),D=D.slice(y+1)}let M,E=D.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(E)M=E[1];try{let C=JSON.parse(k.replace(/'/g,'"')),y={};if(I)try{y=b0(I,Z)}catch(P){let g=P instanceof Error?P.message:String(P);if(X.debug){let c=_0("Include",`Error parsing includeFirst variables: ${g}`,J,$,L,N);z=z.replace(N,()=>c)}else z=z.replace(N,()=>M||"");continue}let b=!1;for(let P of C){let g=K(P,G,J);if(!g)continue;if(await e(g)){let c=await H(P,y,$,L);z=z.replace(N,()=>c),b=!0;break}}if(!b)if(M!==void 0)z=z.replace(N,()=>M);else if(X.debug){let P=_0("Include",`None of the includeFirst paths exist: ${k}`,J,$,L,N);z=z.replace(N,()=>P)}else z=z.replace(N,"")}catch(C){let y=C instanceof Error?C.message:String(C),b=_0("Include",`Error processing @includeFirst: ${y}`,J,$,L,N);z=z.replace(N,()=>b)}V.lastIndex=0}}function K(V,F,L){try{let O=V;if(!V.endsWith(".stx"))O=`${V}.stx`;let _=q0.resolve(F),w=q0.resolve(q0.dirname(L)),R;if(!O.startsWith("./")&&!O.startsWith("../")){for(let T of X._layerPartialDirs??[]){let M=q0.resolve(T,O);if(M.startsWith(`${q0.resolve(T)}${q0.sep}`)&&cY(M))return M}R=q0.resolve(F,O)}else R=q0.resolve(w,O);let N=q0.normalize(R),A=N.startsWith(_+q0.sep)||N===_,k=N.startsWith(w+q0.sep)||N===w,D=!1,I=q0.dirname(w);if(N.startsWith(I+q0.sep)){if(!q0.relative(I,N).split(q0.sep).some((C)=>C.startsWith(".")&&C!=="."&&C!==".."))D=!0}if(!A&&!k&&!D)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${N}`),console.error(` Allowed dirs: ${_}, ${w}`),null;return N}catch(O){return console.error(`Error resolving path ${V}: ${O}`),null}}let W=q0.resolve(J);Y.add(W);function U(V,F,L,O){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),_0("Include",F,J,L,O)}async function H(V,F={},L,O){let _=K(V,G,J);if(!_)return U(V,`Could not resolve path for include: ${V}`,L,O);let w=q0.resolve(_);if(Y.has(w)){let R=[...Y,w].map((N)=>q0.basename(N)).join(" -> ");return U(V,`Circular include detected: ${R}`,L,O)}try{Q.add(_);let R;if(!R)try{R=await Bun.file(_).text()}catch(h){let s=h instanceof Error?h.message:String(h);return U(V,`Error loading include file ${V}: ${s}`,L,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-pkbj0aht.js");R=h(R,Z)}if(R&&(X.debug||!L9()&&!O9()))try{let{warnUnbalancedTags:h}=await import("./chunk-20e4pcq1.js");h(R,_)}catch{}let N=R;try{let{processESImports:h}=await import("./chunk-8n96ck39.js");await h(R,Z,_,X,Q)}catch(h){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${_}:`,h instanceof Error?h.message:h)}let A=z9(N);if(A)N=A.content.trim();let D=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),I="";if(D)I=`<style${D[1]}>${D[2]}</style>`;let T=[];N=N.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(h,s,u)=>{if(!m4(s))return"";return T.push({attrs:s,body:u}),`__STX_DATA_BLOCK_${T.length-1}__`}),N=N.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let M={...Z};M.__stx_signals_gate=Y1(R,_);for(let[h,s]of Object.entries(F))M[h]=s;let E=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,C=[...R.matchAll(E)],y="",b=null,P=!1;for(let h of C){let s=h[1]||"",u=h[2]||"";if(m4(s))continue;let z0=s.includes("server"),d0=M1(s);if(!z0&&u.trim()){let{interpolateScriptExpressions:J0}=await import("./chunk-yns8ygvd.js");u=J0(u,M)}let x0="";try{let{extractAndStripCssImports:J0,renderVendorStyleTags:j0}=await import("./chunk-4mb08201.js"),p=J0(u,{filePath:_,projectRoot:process.cwd()});u=p.code,x0=j0(p.styles)}catch(J0){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${_}:`,J0 instanceof Error?J0.message:J0)}if(d0&&u.trim())u=I1(u);if(!z0){try{let{injectBrowserCoreAutoImports:j0}=await import("./chunk-4mb08201.js");u=j0(u).code;let{hasUserImports:p,bundleClientScript:i}=await import("./chunk-858xqty6.js");if(p(u))u=await i(u,_,{projectRoot:process.cwd()})}catch(j0){if(X.debug)console.warn(`[stx] bundler skipped for ${_}:`,j0 instanceof Error?j0.message:j0)}let{stripStxRuntimeImports:J0}=await import("./chunk-5pvfm908.js");u=J0(u)}let m0=iY(u);if(m0&&!z0){P=!0,b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let J0=Z1(u),j0=u4(J0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}">${j0}</script>
3461
+ `;continue}if(z0)try{let{extractVariables:J0}=await import("./chunk-d3mdskgy.js");await J0(u,M,_)}catch(J0){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${_}:`,J0)}if(!z0&&!m0){let J0=s.replace(/\bclient\b/i,"").trim();b=`stx_scope_${q0.basename(_,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++d4}`;let j0=Z1(u),p=u4(j0,b);y+=`${x0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${b}"${J0?` ${J0}`:""}>${p}</script>
3462
+ `}}if(T.length>0){let{interpolateScriptExpressions:h}=await import("./chunk-yns8ygvd.js");N=N.replace(/__STX_DATA_BLOCK_(\d+)__/g,(s,u)=>{let z0=T[Number(u)];return`<script${z0.attrs}>${h(z0.body,M)}</script>`})}if(b){let h=aY(N,b);if(N=h.html,h.mergedIntoExisting){let u=b,z0=h.mergedIntoExisting;y=y.split(`'${u}'`).join(`'${z0}'`).split(`"${u}"`).join(`"${z0}"`),b=z0}else if(!h.stamped&&P&&!G$.has(_))G$.add(_),console.warn(`[stx] ${q0.relative(process.cwd(),_)} 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 s=h.stamped&&h.root!==null&&X$(h.root);y=oY(y,s?b:null)}if(N.includes("@include")||N.includes("@partial"))N=await z$(N,M,_,X,Q,Y);let{processLoops:g,reportDeferredLoopWarnings:c}=await import("./chunk-c24ykq78.js"),l=g(N,M,_,void 0,!0);if(l=$1(l,M,_),l=c(l),l=V1(l,M,_),I)l+=`
3463
3463
  `+I;if(y)l+=`
3464
3464
  `+y;return l}catch(R){let N=R instanceof Error?R.message:String(R);return U(V,`Error processing include ${V}: ${N}`,L,O)}}let j=/@include\s*\(/g,B;while((B=j.exec(z))!==null){let V=B.index,F=V+B[0].length-1,L=1,O=F+1;while(O<z.length&&L>0){if(z[O]==="(")L++;else if(z[O]===")")L--;O++}if(L!==0)break;let _=z.substring(V,O),w=z.substring(F+1,O-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){j.lastIndex=O;continue}let N=R[1],A,k=w.substring(R[0].length),D=Q$(k,0);if(D!==-1)A=k.substring(D+1).trim();let I={};if(A)try{I=b0(A,Z)}catch(M){let E=M instanceof Error?M.message:String(M);z=z.replace(_,_0("Include",`Error parsing include variables for ${N}: ${E}`,J,$,V)),j.lastIndex=0;continue}let T=await H(N,I,$,V);z=z.substring(0,V)+T+z.substring(O),j.lastIndex=0}return z}function q$($,Z){let J=$;function X(Q,Y,G,z){let q=Q,K=!0;while(K){K=!1;let W=new RegExp(`@${Y}\\(['"]([^'"]+)['"]\\)`),U=q.match(W);if(!U||U.index===void 0)break;let H=U.index,j=U[1],B=H+U[0].length,V=new RegExp(`@${Y}\\(`),F=new RegExp(`@${G}(?![a-z])`),L=1,O=B,_=-1;while(L>0&&O<q.length){let R=q.slice(O),N=R.match(V),A=R.match(F),k=N?O+N.index:1/0,D=A?O+A.index:1/0;if(k<D)L++,O=k+(N[0].length||1);else if(D<1/0){if(L--,L===0){_=D;break}O=D+G.length+1}else break}if(_===-1)break;let w=q.slice(B,_);if(!Z[j])Z[j]=[];if(z)Z[j].unshift(w);else Z[j].push(w);q=q.substring(0,H)+q.substring(_+`@${G}`.length),K=!0}return q}return J=X(J,"push","endpush",!1),J=X(J,"prepend","endprepend",!0),J}function K$($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(J,X)=>{if(!Z[X]||Z[X].length===0)return"";return Z[X].join(`
3465
3465
  `)})}import*as W$ from"path";async function p4($,Z,J=""){if(W$.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 n4($,Z,J,"@js","@endjs")}async function i4($,Z,J=""){if(W$.basename(J)==="ts-directive.stx"){if(Z.users&&Array.isArray(Z.users))Z.processedUsers=Z.users.map((Y)=>({...Y,displayName:`User ${Y.id}: ${Y.name}`})),Z.processedOutput=JSON.stringify(Z.processedUsers);return $.replace(/@ts[\s\S]*?@endts/g,"")}return n4($,Z,J,"@ts","@endts")}async function n4($,Z,J,X,Q){let Y=$,G=f1(`${X}([\\s\\S]*?)${Q}`,"g"),z=[],q;while((q=G.exec($))!==null)z.push({fullMatch:q[0],content:q[1]||"",index:q.index});for(let{fullMatch:K,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((N)=>N.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),O=L.length>0?`return { ${L.join(", ")} };`:"return {};",_=`
3466
3466
  ${V}
3467
3467
  ${O}
3468
- `,R=Function(...j,_)(...B);if(R&&typeof R==="object")Object.assign(Z,R);Y=Y.replace(K,"")}catch(H){console.error(`Error executing ${X} code block in ${J}:`,H);let j=H instanceof Error?H.message:String(H),B=_0(`${X} Directive`,`Error executing code: ${j}`,J,$,U,K);console.error(B),Y=Y.replace(K,"")}return Y}var tY=1000,eY=!1;function $Q($,Z){let J=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,X="",Q=0,Y;while((Y=J.exec($))!==null){let G=Y.index+Y[0].length,z=Y.index+Y[0].indexOf("("),q=w0($,"(",")",z);if(q===-1)continue;let K=$.slice(G,q).trim();if(!K)continue;if(!Object.keys(Z).some((H)=>new RegExp(`(?:^|[^\\w$.])${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(K)))continue;let U;try{let H=b0(K,Z);if(!H||typeof H!=="object")continue;U=JSON.stringify(H)}catch{continue}X+=$.slice(Q,G)+U,Q=q,J.lastIndex=q}return Q===0?$:X+$.slice(Q)}function ZQ($,Z){let J=/@component\s*\(/g,X=$,Q,Y=[];while((Q=J.exec(X))!==null){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)continue;let W=X.substring(z+1,K),U=K+1,H=W.match(/^\s*['"]([^'"]+)['"]/);if(!H)continue;let j=H[1],B=W.slice(H[0].length),V=B.match(/^\s*,\s*/);if(!V)continue;let F=B.slice(V[0].length).trim();if(!F)continue;try{let L=b0(F,Z),O=JSON.stringify(L),_=`@component('${j}', ${O})`;Y.push({start:G,end:U,replacement:_})}catch{continue}}for(let G=Y.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Y[G];X=X.substring(0,z)+K+X.substring(q)}return X}function w9($,Z,J){let X=$,Q=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),Y;while((Y=Q.exec(X))!==null){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1,W=null,U=!1;while(K<X.length&&q>0){let B=X[K];if(U){U=!1,K++;continue}if(B==="\\"&&W){U=!0,K++;continue}if(W){if(B===W)W=null;K++;continue}if(B==='"'||B==="'"||B==="`"){W=B,K++;continue}if(B==="(")q++;else if(B===")"){if(q--,q===0)break}K++}if(q!==0)break;let H=X.substring(z+1,K),j=J(H);X=X.substring(0,G)+j+X.substring(K+1)}return X}function JQ($,Z){let J=$;return J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(X,Q)=>{if(Q in Z)return`:${Q}="${Q}"`;return X}),J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(X,Q,Y)=>{try{let G=Object.keys(Z),z=Object.values(Z);a4(Y);let K=H0(Y,G)(...z),W=JSON.stringify(K);if(W===void 0){if(!V9(Y).some((j)=>!(j in Z)))return"";return X}let U=Buffer.from(W,"utf8").toString("base64");return`__stx_${Q}="${U}"`}catch(G){return X}}),J}var R9="<!--__STX_BREAK__-->",N9="<!--__STX_CONTINUE__-->";function XQ($,Z){let J=$;return J=w9(J,"@break",(X)=>{try{let Y=`!!(${X.trim()})`,G;if(B0(Y)){let z=H0(Y,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(Z0(Y,Z));return G?R9:""}catch{return""}}),J=w9(J,"@continue",(X)=>{try{let Y=`!!(${X.trim()})`,G;if(B0(Y)){let z=H0(Y,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(Z0(Y,Z));return G?N9:""}catch{return""}}),J}function YQ($){let Z=$;return Z=Z.replace(/@break(?!\()/g,R9),Z=Z.replace(/@continue(?!\()/g,N9),Z}function s4($){let Z=$.includes(R9),J=Z?$.substring(0,$.indexOf(R9)):$;return{hasBreak:Z,content:J}}function o4($){let Z=$.includes(N9),J=Z?$.substring(0,$.indexOf(N9)):$;return{hasContinue:Z,content:J}}function t4($){let Z=$;return Z=w9(Z,"@break",(J)=>{let X=J.trim();if(!F9(X))return"";return`\`; if (${X}) { break; } result += \``}),Z=w9(Z,"@continue",(J)=>{let X=J.trim();if(!F9(X))return"";return`\`; if (${X}) { continue; } result += \``}),Z=Z.replace(/@break(?!\()/g,"`; break; result += `"),Z=Z.replace(/@continue(?!\()/g,"`; continue; result += `"),Z}function QQ($){let Z=/@forelse\s*\(/g,J,X=[],Q=/@foreach\s*\(/g,Y=/@endforeach/g,G;while((G=Q.exec($))!==null)X.push({pos:G.index,delta:1});while((G=Y.exec($))!==null)X.push({pos:G.index,delta:-1});X.sort((W,U)=>W.pos-U.pos);let z=[],q=0;for(let W of X)q+=W.delta,z.push({pos:W.pos,depth:q});function K(W){let U=0,H=z.length-1,j=0;while(U<=H){let B=U+H>>1;if(z[B].pos<=W)j=z[B].depth,U=B+1;else H=B-1}return j}while((J=Z.exec($))!==null){if(K(J.index)>0)continue;let W=J.index,U=J.index+J[0].length-1,H=1,j=U+1,B=-1;while(j<$.length&&H>0){if($[j]==="(")H++;else if($[j]===")"){if(H--,H===0){B=j;break}}j++}if(B===-1)continue;let V=$.substring(U+1,B),F=e4(V);if(!F)continue;let{arrayExpr:L,itemVar:O}=F,_=B+1,w=1,R=_,N=/@forelse\s*\(/g,A=/@endforelse/g,k=-1;while(w>0&&R<$.length){N.lastIndex=R,A.lastIndex=R;let C=N.exec($),y=A.exec($);if(!y)break;if(C&&C.index<y.index)w++,R=C.index+C[0].length;else{if(w--,w===0){k=y.index;break}R=y.index+11}}if(k===-1)continue;let D=$.substring(_,k),I=k+11,T=-1,M=0,E=0;while(E<D.length){let C=D.indexOf("@",E);if(C===-1)break;let y=D.substring(C);if(/^@forelse\s*\(/.test(y))M++,E=C+1;else if(y.startsWith("@endforelse"))M--,E=C+11;else if(M===0&&y.startsWith("@empty")){if(D.length<=C+6||!/[a-z]/i.test(D[C+6])){T=C;break}E=C+1}else E=C+1}if(T===-1)continue;return{start:W,end:I,arrayExpr:L,itemVar:O,foreachContent:D.substring(0,T),emptyContent:D.substring(T+6)}}return null}function r4($,Z){let J=$;while(!0){let X=QQ(J);if(!X)break;let{start:Q,end:Y,arrayExpr:G,itemVar:z,foreachContent:q,emptyContent:K}=X;try{let W;if(B0(G))W=H0(G,Object.keys(Z))(...Object.values(Z));else W=Z0(G,Z);let U;if(!Array.isArray(W)||W.length===0)U=K;else U=`@foreach (${G} as ${z})${q}@endforeach`;J=J.substring(0,Q)+U+J.substring(Y)}catch(W){let U=W instanceof Error?W.message:String(W),H=G0("Forelse",`Error in @forelse(${G} as ${z}): ${U}`,Q0.EVALUATION_ERROR);J=J.substring(0,Q)+H+J.substring(Y)}}return J}function e4($){let Z=$.indexOf(" as ");if(Z!==-1){let Y=$.slice(0,Z).trim(),G=$.slice(Z+4).trim();return Y&&G?{arrayExpr:Y,itemVar:G}:null}let J=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec($);if(!J)return null;let X=J[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),Q=J[2].trim();return X&&Q?{arrayExpr:Q,itemVar:X}:null}var $6="<!--stx:foreach-not-iterable:",GQ=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function zQ($,Z){return`${$6}${encodeURIComponent($)}|${encodeURIComponent(Z)}-->`}function qQ($,Z){console.warn(`[stx] @foreach(${$}) in ${Z}: ${$} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function U$($){if(!$.includes($6))return $;return $.replace(GQ,(Z,J,X)=>{return qQ(decodeURIComponent(J),decodeURIComponent(X)),""})}function Z6($,Z,J,X,Q=!1){let Y=$;Y=r4(Y,Z);function G(K){let W=/@foreach\s*\(/g,U;while((U=W.exec(K))!==null){let H=U.index,j=U.index+U[0].length-1,B=1,V=j+1,F=-1;while(V<K.length&&B>0){if(K[V]==="(")B++;else if(K[V]===")"){if(B--,B===0){F=V;break}}V++}if(F===-1)continue;let L=K.substring(j+1,F),O=e4(L);if(!O)continue;let _=H,{arrayExpr:w,itemVar:R}=O,N=F+1,A=1,k=N,D=/@foreach\s*\(/g,I=/@endforeach/g;while(A>0&&k<K.length){D.lastIndex=k,I.lastIndex=k;let T=D.exec(K),M=I.exec(K);if(!M)break;if(T&&T.index<M.index)A++,k=T.index+T[0].length;else{if(A--,A===0){let E=K.substring(N,M.index),C=M.index+11;return{start:_,end:C,arrayExpr:w,itemVar:R,content:E}}k=M.index+11}}}return null}function z(K,W){let U=K;while(!0){let H=G(U);if(!H)break;let{start:j,end:B,arrayExpr:V,itemVar:F,content:L}=H;try{let O=V.trim(),_;if(B0(O))_=H0(O,Object.keys(W))(...Object.values(W));else _=Z0(O,W);let w=!1;if(!Array.isArray(_))if(_ instanceof Map)_=Array.from(_),w=!0;else if(_ instanceof Set)_=Array.from(_);else if(typeof _==="string")_=Array.from(_);else if(_&&typeof _==="object"&&!(_ instanceof Date)&&!(_ instanceof RegExp))_=Object.entries(_),w=!0;else{let M=zQ(O,J)+G0("Foreach",`Error in @foreach: ${O} is not iterable`,Q0.TYPE_ERROR);U=U.substring(0,j)+M+U.substring(B);continue}let R=X?.loops?.useAltLoopVariable??eY,N=F.trim(),A=null,k,D=!1;if(N.includes("=>")){let M=N.split("=>").map((E)=>E.trim());if(M.length===2&&M[0]&&M[1])A=M[0],k=M[1];else k=N}else if(!N.startsWith("[")&&!N.startsWith("{")&&N.includes(",")){let M=N.split(",").map((E)=>E.trim());if(M.length===2&&M[0]&&M[1])k=M[0],A=M[1],D=!0;else k=N}else k=N;let I="",T=_;for(let M=0;M<T.length;M++){let E=T[M],C={index:M,iteration:M+1,first:M===0,last:M===T.length-1,count:T.length},y={...W,loop:C,$loop:C};if(k.startsWith("[")&&k.endsWith("]")){let c=k.slice(1,-1).split(",").map((l)=>l.trim());if(Array.isArray(E))c.forEach((l,h)=>{if(l)y[l]=E[h]});else y[k]=E}else y[k]=E;if(A)if(!D&&w&&Array.isArray(E)&&E.length===2)y[A]=E[0],y[k]=E[1];else y[A]=M;let b=XQ(L,y),P=o4(b);if(P.hasContinue){I+=P.content;continue}let g=s4(b);if(g.hasBreak){I+=g.content;break}if(b=r4(b,y),b=z(b,y),b=$1(b,y,J),b=YQ(b),g=s4(b),g.hasBreak){I+=g.content;break}if(P=o4(b),P.hasContinue){I+=P.content;continue}b=V1(b,y,J),b=JQ(b,y),b=ZQ(b,y),b=$Q(b,y),I+=b}U=U.substring(0,j)+I+U.substring(B)}catch(O){let _=G0("Foreach",`Error in @foreach(${V.trim()} as ${F.trim()}): ${O instanceof Error?O.message:String(O)}`,Q0.EVALUATION_ERROR);U=U.substring(0,j)+_+U.substring(B)}}return U}Y=z(Y,Z),Y=X6(Y,Z,J,X);let q=X?.loops?.maxWhileIterations??tY;return Y=UQ(Y,Z,q),Q?Y:U$(Y)}function J6($){return F9($)}function X6($,Z,J,X){let Q=$,Y=!0;while(Y){Y=!1;let G=Q.match(/@for\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=z+G[0].length-1,K=w0(Q,"(",")",q);if(K===-1)break;let W=Q.slice(q+1,K),U=K+1,H=Q9(Q.slice(z),"for","endfor");if(H.length===0)break;let j=H[0].content,B=z+H[0].end;if(!J6(W)){let V=G0("For",`Unsafe expression in @for: ${W}`,Q0.UNSAFE_EXPRESSION);Q=Q.substring(0,z)+V+Q.substring(B),Y=!0;continue}try{let V=KQ(W),F=/@(?:for|foreach|if|unless)\s*\(/.test(j);if(V.length>0&&F){let N=WQ({forExpr:W,content:j,iterVarNames:V,context:Z,filePath:J,options:X});Q=Q.substring(0,z)+N+Q.substring(B),Y=!0;continue}let L=Object.keys(Z),O=Object.values(Z),_=j.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(N,A)=>{return`\${${A}}`});_=t4(_);let R=Function(...L,`
3468
+ `,R=Function(...j,_)(...B);if(R&&typeof R==="object")Object.assign(Z,R);Y=Y.replace(K,"")}catch(H){console.error(`Error executing ${X} code block in ${J}:`,H);let j=H instanceof Error?H.message:String(H),B=_0(`${X} Directive`,`Error executing code: ${j}`,J,$,U,K);console.error(B),Y=Y.replace(K,"")}return Y}var eY=1000,$Q=!1;function ZQ($,Z){let J=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,X="",Q=0,Y;while((Y=J.exec($))!==null){let G=Y.index+Y[0].length,z=Y.index+Y[0].indexOf("("),q=w0($,"(",")",z);if(q===-1)continue;let K=$.slice(G,q).trim();if(!K)continue;if(!Object.keys(Z).some((H)=>new RegExp(`(?:^|[^\\w$.])${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(K)))continue;let U;try{let H=b0(K,Z);if(!H||typeof H!=="object")continue;U=JSON.stringify(H)}catch{continue}X+=$.slice(Q,G)+U,Q=q,J.lastIndex=q}return Q===0?$:X+$.slice(Q)}function JQ($,Z){let J=/@component\s*\(/g,X=$,Q,Y=[];while((Q=J.exec(X))!==null){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)continue;let W=X.substring(z+1,K),U=K+1,H=W.match(/^\s*['"]([^'"]+)['"]/);if(!H)continue;let j=H[1],B=W.slice(H[0].length),V=B.match(/^\s*,\s*/);if(!V)continue;let F=B.slice(V[0].length).trim();if(!F)continue;try{let L=b0(F,Z),O=JSON.stringify(L),_=`@component('${j}', ${O})`;Y.push({start:G,end:U,replacement:_})}catch{continue}}for(let G=Y.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Y[G];X=X.substring(0,z)+K+X.substring(q)}return X}function w9($,Z,J){let X=$,Q=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),Y;while((Y=Q.exec(X))!==null){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1,W=null,U=!1;while(K<X.length&&q>0){let B=X[K];if(U){U=!1,K++;continue}if(B==="\\"&&W){U=!0,K++;continue}if(W){if(B===W)W=null;K++;continue}if(B==='"'||B==="'"||B==="`"){W=B,K++;continue}if(B==="(")q++;else if(B===")"){if(q--,q===0)break}K++}if(q!==0)break;let H=X.substring(z+1,K),j=J(H);X=X.substring(0,G)+j+X.substring(K+1)}return X}function XQ($,Z){let J=$;return J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(X,Q)=>{if(Q in Z)return`:${Q}="${Q}"`;return X}),J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(X,Q,Y)=>{try{let G=Object.keys(Z),z=Object.values(Z);a4(Y);let K=H0(Y,G)(...z),W=JSON.stringify(K);if(W===void 0){if(!V9(Y).some((j)=>!(j in Z)))return"";return X}let U=Buffer.from(W,"utf8").toString("base64");return`__stx_${Q}="${U}"`}catch(G){return X}}),J}var R9="<!--__STX_BREAK__-->",N9="<!--__STX_CONTINUE__-->";function YQ($,Z){let J=$;return J=w9(J,"@break",(X)=>{try{let Y=`!!(${X.trim()})`,G;if(B0(Y)){let z=H0(Y,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(Z0(Y,Z));return G?R9:""}catch{return""}}),J=w9(J,"@continue",(X)=>{try{let Y=`!!(${X.trim()})`,G;if(B0(Y)){let z=H0(Y,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(Z0(Y,Z));return G?N9:""}catch{return""}}),J}function QQ($){let Z=$;return Z=Z.replace(/@break(?!\()/g,R9),Z=Z.replace(/@continue(?!\()/g,N9),Z}function s4($){let Z=$.includes(R9),J=Z?$.substring(0,$.indexOf(R9)):$;return{hasBreak:Z,content:J}}function o4($){let Z=$.includes(N9),J=Z?$.substring(0,$.indexOf(N9)):$;return{hasContinue:Z,content:J}}function t4($){let Z=$;return Z=w9(Z,"@break",(J)=>{let X=J.trim();if(!F9(X))return"";return`\`; if (${X}) { break; } result += \``}),Z=w9(Z,"@continue",(J)=>{let X=J.trim();if(!F9(X))return"";return`\`; if (${X}) { continue; } result += \``}),Z=Z.replace(/@break(?!\()/g,"`; break; result += `"),Z=Z.replace(/@continue(?!\()/g,"`; continue; result += `"),Z}function GQ($){let Z=/@forelse\s*\(/g,J,X=[],Q=/@foreach\s*\(/g,Y=/@endforeach/g,G;while((G=Q.exec($))!==null)X.push({pos:G.index,delta:1});while((G=Y.exec($))!==null)X.push({pos:G.index,delta:-1});X.sort((W,U)=>W.pos-U.pos);let z=[],q=0;for(let W of X)q+=W.delta,z.push({pos:W.pos,depth:q});function K(W){let U=0,H=z.length-1,j=0;while(U<=H){let B=U+H>>1;if(z[B].pos<=W)j=z[B].depth,U=B+1;else H=B-1}return j}while((J=Z.exec($))!==null){if(K(J.index)>0)continue;let W=J.index,U=J.index+J[0].length-1,H=1,j=U+1,B=-1;while(j<$.length&&H>0){if($[j]==="(")H++;else if($[j]===")"){if(H--,H===0){B=j;break}}j++}if(B===-1)continue;let V=$.substring(U+1,B),F=e4(V);if(!F)continue;let{arrayExpr:L,itemVar:O}=F,_=B+1,w=1,R=_,N=/@forelse\s*\(/g,A=/@endforelse/g,k=-1;while(w>0&&R<$.length){N.lastIndex=R,A.lastIndex=R;let C=N.exec($),y=A.exec($);if(!y)break;if(C&&C.index<y.index)w++,R=C.index+C[0].length;else{if(w--,w===0){k=y.index;break}R=y.index+11}}if(k===-1)continue;let D=$.substring(_,k),I=k+11,T=-1,M=0,E=0;while(E<D.length){let C=D.indexOf("@",E);if(C===-1)break;let y=D.substring(C);if(/^@forelse\s*\(/.test(y))M++,E=C+1;else if(y.startsWith("@endforelse"))M--,E=C+11;else if(M===0&&y.startsWith("@empty")){if(D.length<=C+6||!/[a-z]/i.test(D[C+6])){T=C;break}E=C+1}else E=C+1}if(T===-1)continue;return{start:W,end:I,arrayExpr:L,itemVar:O,foreachContent:D.substring(0,T),emptyContent:D.substring(T+6)}}return null}function r4($,Z){let J=$;while(!0){let X=GQ(J);if(!X)break;let{start:Q,end:Y,arrayExpr:G,itemVar:z,foreachContent:q,emptyContent:K}=X;try{let W;if(B0(G))W=H0(G,Object.keys(Z))(...Object.values(Z));else W=Z0(G,Z);let U;if(!Array.isArray(W)||W.length===0)U=K;else U=`@foreach (${G} as ${z})${q}@endforeach`;J=J.substring(0,Q)+U+J.substring(Y)}catch(W){let U=W instanceof Error?W.message:String(W),H=G0("Forelse",`Error in @forelse(${G} as ${z}): ${U}`,Q0.EVALUATION_ERROR);J=J.substring(0,Q)+H+J.substring(Y)}}return J}function e4($){let Z=$.indexOf(" as ");if(Z!==-1){let Y=$.slice(0,Z).trim(),G=$.slice(Z+4).trim();return Y&&G?{arrayExpr:Y,itemVar:G}:null}let J=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec($);if(!J)return null;let X=J[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),Q=J[2].trim();return X&&Q?{arrayExpr:Q,itemVar:X}:null}var $6="<!--stx:foreach-not-iterable:",zQ=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function qQ($,Z){return`${$6}${encodeURIComponent($)}|${encodeURIComponent(Z)}-->`}function KQ($,Z){console.warn(`[stx] @foreach(${$}) in ${Z}: ${$} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function U$($){if(!$.includes($6))return $;return $.replace(zQ,(Z,J,X)=>{return KQ(decodeURIComponent(J),decodeURIComponent(X)),""})}function Z6($,Z,J,X,Q=!1){let Y=$;Y=r4(Y,Z);function G(K){let W=/@foreach\s*\(/g,U;while((U=W.exec(K))!==null){let H=U.index,j=U.index+U[0].length-1,B=1,V=j+1,F=-1;while(V<K.length&&B>0){if(K[V]==="(")B++;else if(K[V]===")"){if(B--,B===0){F=V;break}}V++}if(F===-1)continue;let L=K.substring(j+1,F),O=e4(L);if(!O)continue;let _=H,{arrayExpr:w,itemVar:R}=O,N=F+1,A=1,k=N,D=/@foreach\s*\(/g,I=/@endforeach/g;while(A>0&&k<K.length){D.lastIndex=k,I.lastIndex=k;let T=D.exec(K),M=I.exec(K);if(!M)break;if(T&&T.index<M.index)A++,k=T.index+T[0].length;else{if(A--,A===0){let E=K.substring(N,M.index),C=M.index+11;return{start:_,end:C,arrayExpr:w,itemVar:R,content:E}}k=M.index+11}}}return null}function z(K,W){let U=K;while(!0){let H=G(U);if(!H)break;let{start:j,end:B,arrayExpr:V,itemVar:F,content:L}=H;try{let O=V.trim(),_;if(B0(O))_=H0(O,Object.keys(W))(...Object.values(W));else _=Z0(O,W);let w=!1;if(!Array.isArray(_))if(_ instanceof Map)_=Array.from(_),w=!0;else if(_ instanceof Set)_=Array.from(_);else if(typeof _==="string")_=Array.from(_);else if(_&&typeof _==="object"&&!(_ instanceof Date)&&!(_ instanceof RegExp))_=Object.entries(_),w=!0;else{let M=qQ(O,J)+G0("Foreach",`Error in @foreach: ${O} is not iterable`,Q0.TYPE_ERROR);U=U.substring(0,j)+M+U.substring(B);continue}let R=X?.loops?.useAltLoopVariable??$Q,N=F.trim(),A=null,k,D=!1;if(N.includes("=>")){let M=N.split("=>").map((E)=>E.trim());if(M.length===2&&M[0]&&M[1])A=M[0],k=M[1];else k=N}else if(!N.startsWith("[")&&!N.startsWith("{")&&N.includes(",")){let M=N.split(",").map((E)=>E.trim());if(M.length===2&&M[0]&&M[1])k=M[0],A=M[1],D=!0;else k=N}else k=N;let I="",T=_;for(let M=0;M<T.length;M++){let E=T[M],C={index:M,iteration:M+1,first:M===0,last:M===T.length-1,count:T.length},y={...W,loop:C,$loop:C};if(k.startsWith("[")&&k.endsWith("]")){let c=k.slice(1,-1).split(",").map((l)=>l.trim());if(Array.isArray(E))c.forEach((l,h)=>{if(l)y[l]=E[h]});else y[k]=E}else y[k]=E;if(A)if(!D&&w&&Array.isArray(E)&&E.length===2)y[A]=E[0],y[k]=E[1];else y[A]=M;let b=YQ(L,y),P=o4(b);if(P.hasContinue){I+=P.content;continue}let g=s4(b);if(g.hasBreak){I+=g.content;break}if(b=r4(b,y),b=z(b,y),b=$1(b,y,J),b=QQ(b),g=s4(b),g.hasBreak){I+=g.content;break}if(P=o4(b),P.hasContinue){I+=P.content;continue}b=V1(b,y,J),b=XQ(b,y),b=JQ(b,y),b=ZQ(b,y),I+=b}U=U.substring(0,j)+I+U.substring(B)}catch(O){let _=G0("Foreach",`Error in @foreach(${V.trim()} as ${F.trim()}): ${O instanceof Error?O.message:String(O)}`,Q0.EVALUATION_ERROR);U=U.substring(0,j)+_+U.substring(B)}}return U}Y=z(Y,Z),Y=X6(Y,Z,J,X);let q=X?.loops?.maxWhileIterations??eY;return Y=HQ(Y,Z,q),Q?Y:U$(Y)}function J6($){return F9($)}function X6($,Z,J,X){let Q=$,Y=!0;while(Y){Y=!1;let G=Q.match(/@for\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=z+G[0].length-1,K=w0(Q,"(",")",q);if(K===-1)break;let W=Q.slice(q+1,K),U=K+1,H=Q9(Q.slice(z),"for","endfor");if(H.length===0)break;let j=H[0].content,B=z+H[0].end;if(!J6(W)){let V=G0("For",`Unsafe expression in @for: ${W}`,Q0.UNSAFE_EXPRESSION);Q=Q.substring(0,z)+V+Q.substring(B),Y=!0;continue}try{let V=WQ(W),F=/@(?:for|foreach|if|unless)\s*\(/.test(j);if(V.length>0&&F){let N=UQ({forExpr:W,content:j,iterVarNames:V,context:Z,filePath:J,options:X});Q=Q.substring(0,z)+N+Q.substring(B),Y=!0;continue}let L=Object.keys(Z),O=Object.values(Z),_=j.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(N,A)=>{return`\${${A}}`});_=t4(_);let R=Function(...L,`
3469
3469
  let result = '';
3470
3470
  for (${W}) {
3471
3471
  result += \`${_}\`;
3472
3472
  }
3473
3473
  return result;
3474
- `)(...O);Q=Q.substring(0,z)+R+Q.substring(B),Y=!0}catch(V){let F=G0("For",`Error in @for(${W}): ${V instanceof Error?V.message:String(V)}`,Q0.EVALUATION_ERROR);Q=Q.substring(0,z)+F+Q.substring(B),Y=!0}}return Q}function KQ($){let Z=$.trim(),J=Z.match(/^(?:const|let|var)\s+(\[[^\]]+\]|\{[^}]+\})\s+(?:of|in)\s+/);if(J){let Y=J[1];return Y.slice(1,-1).split(",").map((z)=>{let q=z.trim();if(!q)return"";let K=q.indexOf(":");if(K>=0&&Y.startsWith("{")){let H=q.slice(K+1).trim(),j=H.indexOf("=");return(j>=0?H.slice(0,j):H).trim()}let W=q.indexOf("="),U=(W>=0?q.slice(0,W):q).trim();return/^[A-Za-z_$][\w$]*$/.test(U)?U:""}).filter(Boolean)}let X=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s+(?:of|in)\s+/);if(X)return[X[1]];let Q=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*;/);if(Q)return[Q[1]];return[]}function WQ($){let{forExpr:Z,content:J,iterVarNames:X,context:Q,filePath:Y,options:G}=$,z=Object.keys(Q),q=Object.values(Q),K=Function(...z,"__pushIter",`
3474
+ `)(...O);Q=Q.substring(0,z)+R+Q.substring(B),Y=!0}catch(V){let F=G0("For",`Error in @for(${W}): ${V instanceof Error?V.message:String(V)}`,Q0.EVALUATION_ERROR);Q=Q.substring(0,z)+F+Q.substring(B),Y=!0}}return Q}function WQ($){let Z=$.trim(),J=Z.match(/^(?:const|let|var)\s+(\[[^\]]+\]|\{[^}]+\})\s+(?:of|in)\s+/);if(J){let Y=J[1];return Y.slice(1,-1).split(",").map((z)=>{let q=z.trim();if(!q)return"";let K=q.indexOf(":");if(K>=0&&Y.startsWith("{")){let H=q.slice(K+1).trim(),j=H.indexOf("=");return(j>=0?H.slice(0,j):H).trim()}let W=q.indexOf("="),U=(W>=0?q.slice(0,W):q).trim();return/^[A-Za-z_$][\w$]*$/.test(U)?U:""}).filter(Boolean)}let X=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s+(?:of|in)\s+/);if(X)return[X[1]];let Q=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*;/);if(Q)return[Q[1]];return[]}function UQ($){let{forExpr:Z,content:J,iterVarNames:X,context:Q,filePath:Y,options:G}=$,z=Object.keys(Q),q=Object.values(Q),K=Function(...z,"__pushIter",`
3475
3475
  for (${Z}) {
3476
3476
  __pushIter([${X.join(", ")}])
3477
3477
  }
3478
- `),W=[];K(...q,(j)=>{W.push(j)});let U=Y??"inline.stx",H="";for(let j of W){let B={...Q};X.forEach((F,L)=>{B[F]=j[L]});let V=X6(J,B,Y,G);V=$1(V,B,U),V=V1(V,B,U),H+=V}return H}function UQ($,Z,J){let X=$,Q=!0;while(Q){Q=!1;let Y=X.match(/@while\s*\(/);if(!Y||Y.index===void 0)break;let G=Y.index,z=G+Y[0].length-1,q=w0(X,"(",")",z);if(q===-1)break;let K=X.slice(z+1,q),W=Q9(X.slice(G),"while","endwhile");if(W.length===0)break;let U=W[0].content,H=G+W[0].end;if(!J6(K)){let j=G0("While",`Unsafe expression in @while: ${K}`,Q0.UNSAFE_EXPRESSION);X=X.substring(0,G)+j+X.substring(H),Q=!0;continue}try{let j=Object.keys(Z),B=Object.values(Z),V=U.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(O,_)=>{return`\${${_}}`});V=t4(V);let L=Function(...j,`
3478
+ `),W=[];K(...q,(j)=>{W.push(j)});let U=Y??"inline.stx",H="";for(let j of W){let B={...Q};X.forEach((F,L)=>{B[F]=j[L]});let V=X6(J,B,Y,G);V=$1(V,B,U),V=V1(V,B,U),H+=V}return H}function HQ($,Z,J){let X=$,Q=!0;while(Q){Q=!1;let Y=X.match(/@while\s*\(/);if(!Y||Y.index===void 0)break;let G=Y.index,z=G+Y[0].length-1,q=w0(X,"(",")",z);if(q===-1)break;let K=X.slice(z+1,q),W=Q9(X.slice(G),"while","endwhile");if(W.length===0)break;let U=W[0].content,H=G+W[0].end;if(!J6(K)){let j=G0("While",`Unsafe expression in @while: ${K}`,Q0.UNSAFE_EXPRESSION);X=X.substring(0,G)+j+X.substring(H),Q=!0;continue}try{let j=Object.keys(Z),B=Object.values(Z),V=U.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(O,_)=>{return`\${${_}}`});V=t4(V);let L=Function(...j,`
3479
3479
  let result = '';
3480
3480
  let maxIterations = ${J}; // Configurable safety limit
3481
3481
  let counter = 0;
@@ -3487,25 +3487,25 @@ ${Q}
3487
3487
  result += '<!-- [While Error [1104]]: Maximum iterations (${J}) exceeded in while loop. Configure via options.loops.maxWhileIterations -->';
3488
3488
  }
3489
3489
  return result;
3490
- `)(...B);X=X.substring(0,G)+L+X.substring(H),Q=!0}catch(j){let B=G0("While",`Error in @while(${K}): ${j instanceof Error?j.message:String(j)}`,Q0.EVALUATION_ERROR);X=X.substring(0,G)+B+X.substring(H),Q=!0}}return X}function HQ($,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,Q,Y)=>{return HQ(X,Y||"_method")})}async function Q6($,Z,J,X,Q){if(!X.middleware||X.middleware.length===0)return $;let Y=$,G=X.middleware.filter((z)=>z.timing===Q);if(G.length===0)return Y;for(let z of G){if(!z.name||typeof z.handler!=="function"){if(X.debug)console.warn("Invalid middleware:",z);continue}try{let q=await z.handler(Y,Z,J,X);if(typeof q==="string")Y=q;else if(X.debug)console.warn(`Middleware ${z.name} did not return a string`)}catch(q){if(X.debug)console.error(`Error in middleware ${z.name}:`,q);if(X.debug){let K=_0("Middleware",`Error in middleware '${z.name}': ${q instanceof Error?q.message:String(q)}`,J,$);Y=Y.replace(/<body[^>]*>/,`$&
3490
+ `)(...B);X=X.substring(0,G)+L+X.substring(H),Q=!0}catch(j){let B=G0("While",`Error in @while(${K}): ${j instanceof Error?j.message:String(j)}`,Q0.EVALUATION_ERROR);X=X.substring(0,G)+B+X.substring(H),Q=!0}}return X}function jQ($,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,Q,Y)=>{return jQ(X,Y||"_method")})}async function Q6($,Z,J,X,Q){if(!X.middleware||X.middleware.length===0)return $;let Y=$,G=X.middleware.filter((z)=>z.timing===Q);if(G.length===0)return Y;for(let z of G){if(!z.name||typeof z.handler!=="function"){if(X.debug)console.warn("Invalid middleware:",z);continue}try{let q=await z.handler(Y,Z,J,X);if(typeof q==="string")Y=q;else if(X.debug)console.warn(`Middleware ${z.name} did not return a string`)}catch(q){if(X.debug)console.error(`Error in middleware ${z.name}:`,q);if(X.debug){let K=_0("Middleware",`Error in middleware '${z.name}': ${q instanceof Error?q.message:String(q)}`,J,$);Y=Y.replace(/<body[^>]*>/,`$&
3491
3491
  <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${c9(K)}</div>
3492
- `)}}}return Y}async function G6($,Z,J,X){return Q6($,Z,J,X,"before")}async function z6($,Z,J,X){return Q6($,Z,J,X,"after")}K2();K2();function q6($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,J,X,Q,Y)=>{try{let G=Q?b0(Q,{}):{};return H$(X,G,Y==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var i0={patterns:[],exact:{}};function ij($,Z){if(!i0.exact[$])i0.exact[$]=[];i0.exact[$].push(Z)}function nj($,Z){let J=typeof $==="string"?new RegExp($):$;i0.patterns.push({pattern:J,callback:Z})}async function K6($,Z){let J=$.split("/").pop()?.split(".")[0]||"";if(i0.exact[$])for(let X of i0.exact[$])await Promise.resolve(X(Z,$));if(i0.exact[J])for(let X of i0.exact[J])await Promise.resolve(X(Z,$));for(let{pattern:X,callback:Q}of i0.patterns)if(X.test($)||X.test(J))await Promise.resolve(Q(Z,$))}function sj(){i0.patterns=[],i0.exact={}}var jQ=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),BQ=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 T1($,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 Q=/\/\s*>$/.test(X[0])||X[1]===X[1].toLowerCase()&&jQ.has(X[1]),Y=Q?X[2].replace(/\/\s*$/,""):X[2];return{full:X[0],tag:X[1],attrs:Y,selfClosing:Q,start:X.index,end:X.index+X[0].length}}function VQ($,Z,J){let X=1,Q=J,Y=new RegExp(`<${Z}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),G=new RegExp(`</${Z}\\s*>`,"gi");while(X>0&&Q<$.length){Y.lastIndex=Q,G.lastIndex=Q;let z=Y.exec($),q=G.exec($);if(!q)return-1;if(z&&z.index<q.index)X++,Q=z.index+z[0].length;else{if(X--,X===0)return q.index+q[0].length;Q=q.index+q[0].length}}return-1}function k1($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let J=VQ($,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 W6($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function A2($,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 s1($,Z,J){let X=Z.selfClosing?" /":"",Q=`<${Z.tag}${J}${X}>`;return $.slice(0,Z.start)+Q+$.slice(Z.end)}function _Q($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function LQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-for");if(Q===null){J=X.end;continue}let Y=Q.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!Y){J=X.end;continue}let G=Y[1].trim(),z=Y[2].trim(),q;if(G.includes(",")){let F=G.split(",").map((_)=>_.trim()),L=F[0],O=F[1];q=`${z} as ${O} => ${L}`}else q=`${z} as ${G}`;let K=U1(X.attrs,"v-for"),W=U1(K,":key").replace(/\s*v-bind:key="[^"]*"/g,""),U=k1(Z,X),H=Z.slice(U.outerStart,U.outerEnd),j=s1(H,{...X,start:0,end:X.end-X.start},W),B=`@foreach(${q})
3492
+ `)}}}return Y}async function G6($,Z,J,X){return Q6($,Z,J,X,"before")}async function z6($,Z,J,X){return Q6($,Z,J,X,"after")}K2();K2();function q6($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,J,X,Q,Y)=>{try{let G=Q?b0(Q,{}):{};return H$(X,G,Y==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var i0={patterns:[],exact:{}};function nj($,Z){if(!i0.exact[$])i0.exact[$]=[];i0.exact[$].push(Z)}function sj($,Z){let J=typeof $==="string"?new RegExp($):$;i0.patterns.push({pattern:J,callback:Z})}async function K6($,Z){let J=$.split("/").pop()?.split(".")[0]||"";if(i0.exact[$])for(let X of i0.exact[$])await Promise.resolve(X(Z,$));if(i0.exact[J])for(let X of i0.exact[J])await Promise.resolve(X(Z,$));for(let{pattern:X,callback:Q}of i0.patterns)if(X.test($)||X.test(J))await Promise.resolve(Q(Z,$))}function oj(){i0.patterns=[],i0.exact={}}var BQ=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),VQ=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 T1($,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 Q=/\/\s*>$/.test(X[0])||X[1]===X[1].toLowerCase()&&BQ.has(X[1]),Y=Q?X[2].replace(/\/\s*$/,""):X[2];return{full:X[0],tag:X[1],attrs:Y,selfClosing:Q,start:X.index,end:X.index+X[0].length}}function _Q($,Z,J){let X=1,Q=J,Y=new RegExp(`<${Z}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),G=new RegExp(`</${Z}\\s*>`,"gi");while(X>0&&Q<$.length){Y.lastIndex=Q,G.lastIndex=Q;let z=Y.exec($),q=G.exec($);if(!q)return-1;if(z&&z.index<q.index)X++,Q=z.index+z[0].length;else{if(X--,X===0)return q.index+q[0].length;Q=q.index+q[0].length}}return-1}function k1($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let J=_Q($,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 W6($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function A2($,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 s1($,Z,J){let X=Z.selfClosing?" /":"",Q=`<${Z.tag}${J}${X}>`;return $.slice(0,Z.start)+Q+$.slice(Z.end)}function LQ($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function OQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-for");if(Q===null){J=X.end;continue}let Y=Q.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!Y){J=X.end;continue}let G=Y[1].trim(),z=Y[2].trim(),q;if(G.includes(",")){let F=G.split(",").map((_)=>_.trim()),L=F[0],O=F[1];q=`${z} as ${O} => ${L}`}else q=`${z} as ${G}`;let K=U1(X.attrs,"v-for"),W=U1(K,":key").replace(/\s*v-bind:key="[^"]*"/g,""),U=k1(Z,X),H=Z.slice(U.outerStart,U.outerEnd),j=s1(H,{...X,start:0,end:X.end-X.start},W),B=`@foreach(${q})
3493
3493
  `,V=`${B}${j}
3494
- @endforeach`;Z=Z.slice(0,U.outerStart)+V+Z.slice(U.outerEnd),J=U.outerStart+B.length}return Z}function OQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-if");if(Q===null){J=X.end;continue}let Y=[],G=k1(Z,X),z=U1(X.attrs,"v-if"),q=s1(Z.slice(G.outerStart,G.outerEnd),{...X,start:0,end:X.end-X.start},z);Y.push({type:"if",expr:Q,outerStart:G.outerStart,outerEnd:G.outerEnd,element:q,parsedTag:X});let K=G.outerEnd,W=!0;while(W){let V=Z.slice(K).match(/^\s*/),F=V?V[0].length:0,L=T1(Z,K+F);if(!L){W=!1;break}let O=A2(L.attrs,"v-else-if"),_=W6(L.attrs,"v-else");if(O!==null){let w=k1(Z,L),R=U1(L.attrs,"v-else-if"),N=s1(Z.slice(w.outerStart,w.outerEnd),{...L,start:0,end:L.end-L.start},R);Y.push({type:"else-if",expr:O,outerStart:K,outerEnd:w.outerEnd,element:N,parsedTag:L}),K=w.outerEnd}else if(_){let w=k1(Z,L),R=U1(L.attrs,"v-else"),N=s1(Z.slice(w.outerStart,w.outerEnd),{...L,start:0,end:L.end-L.start},R);Y.push({type:"else",outerStart:K,outerEnd:w.outerEnd,element:N,parsedTag:L}),W=!1}else W=!1}let U=[];for(let V of Y)if(V.type==="if")U.push(`@if(${V.expr})
3494
+ @endforeach`;Z=Z.slice(0,U.outerStart)+V+Z.slice(U.outerEnd),J=U.outerStart+B.length}return Z}function FQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-if");if(Q===null){J=X.end;continue}let Y=[],G=k1(Z,X),z=U1(X.attrs,"v-if"),q=s1(Z.slice(G.outerStart,G.outerEnd),{...X,start:0,end:X.end-X.start},z);Y.push({type:"if",expr:Q,outerStart:G.outerStart,outerEnd:G.outerEnd,element:q,parsedTag:X});let K=G.outerEnd,W=!0;while(W){let V=Z.slice(K).match(/^\s*/),F=V?V[0].length:0,L=T1(Z,K+F);if(!L){W=!1;break}let O=A2(L.attrs,"v-else-if"),_=W6(L.attrs,"v-else");if(O!==null){let w=k1(Z,L),R=U1(L.attrs,"v-else-if"),N=s1(Z.slice(w.outerStart,w.outerEnd),{...L,start:0,end:L.end-L.start},R);Y.push({type:"else-if",expr:O,outerStart:K,outerEnd:w.outerEnd,element:N,parsedTag:L}),K=w.outerEnd}else if(_){let w=k1(Z,L),R=U1(L.attrs,"v-else"),N=s1(Z.slice(w.outerStart,w.outerEnd),{...L,start:0,end:L.end-L.start},R);Y.push({type:"else",outerStart:K,outerEnd:w.outerEnd,element:N,parsedTag:L}),W=!1}else W=!1}let U=[];for(let V of Y)if(V.type==="if")U.push(`@if(${V.expr})
3495
3495
  ${V.element}`);else if(V.type==="else-if")U.push(`@elseif(${V.expr})
3496
3496
  ${V.element}`);else U.push(`@else
3497
3497
  ${V.element}`);U.push("@endif");let H=U.join(`
3498
- `),j=Y[0].outerStart,B=Y[Y.length-1].outerEnd;Z=Z.slice(0,j)+H+Z.slice(B),J=j+H.length}return Z}function FQ($){return $.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function wQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=BQ.has(X.tag),Y=X.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(z,q,K)=>{let W=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(q);if(!W||!K||!/^["']/.test(K))return z;let U=W[1]||"modelValue",H=W[2];if(Q&&!W[1])return`@model${H}=${K}`;let j=K[0],B=K.slice(1,-1),V=`:${U}=${K} @update:${U}=${j}${B} = $event${j}`;if(H){let F=W[1]?`${U}Modifiers`:"modelModifiers",L=H.slice(1).split(".").map((O)=>`${O}: true`).join(", ");V+=` :${F}="{ ${L} }"`}return V});if(Y===X.attrs){J=X.end;continue}let G=s1(X.full,{...X,start:0,end:X.full.length},Y);Z=Z.slice(0,X.start)+G+Z.slice(X.end),J=X.start+G.length}return Z}function RQ($){return $.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function NQ($){return $.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function DQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-html");if(Q===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Y=k1(Z,X),G=U1(X.attrs,"v-html"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{!! ${Q} !!}</${X.tag}>`;Z=Z.slice(0,Y.outerStart)+q+Z.slice(Y.outerEnd),J=Y.outerStart+q.length}return Z}function AQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-text");if(Q===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Y=k1(Z,X),G=U1(X.attrs,"v-text"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{{ ${Q} }}</${X.tag}>`;Z=Z.slice(0,Y.outerStart)+q+Z.slice(Y.outerEnd),J=Y.outerStart+q.length}return Z}function MQ($){return $.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function IQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;if(!W6(X.attrs,"v-once")){J=X.end;continue}let Q=U1(X.attrs,"v-once"),Y=k1(Z,X),G=Z.slice(Y.outerStart,Y.outerEnd),q=`@once
3498
+ `),j=Y[0].outerStart,B=Y[Y.length-1].outerEnd;Z=Z.slice(0,j)+H+Z.slice(B),J=j+H.length}return Z}function wQ($){return $.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function RQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=VQ.has(X.tag),Y=X.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(z,q,K)=>{let W=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(q);if(!W||!K||!/^["']/.test(K))return z;let U=W[1]||"modelValue",H=W[2];if(Q&&!W[1])return`@model${H}=${K}`;let j=K[0],B=K.slice(1,-1),V=`:${U}=${K} @update:${U}=${j}${B} = $event${j}`;if(H){let F=W[1]?`${U}Modifiers`:"modelModifiers",L=H.slice(1).split(".").map((O)=>`${O}: true`).join(", ");V+=` :${F}="{ ${L} }"`}return V});if(Y===X.attrs){J=X.end;continue}let G=s1(X.full,{...X,start:0,end:X.full.length},Y);Z=Z.slice(0,X.start)+G+Z.slice(X.end),J=X.start+G.length}return Z}function NQ($){return $.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function DQ($){return $.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function AQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-html");if(Q===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Y=k1(Z,X),G=U1(X.attrs,"v-html"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{!! ${Q} !!}</${X.tag}>`;Z=Z.slice(0,Y.outerStart)+q+Z.slice(Y.outerEnd),J=Y.outerStart+q.length}return Z}function MQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;let Q=A2(X.attrs,"v-text");if(Q===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Y=k1(Z,X),G=U1(X.attrs,"v-text"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{{ ${Q} }}</${X.tag}>`;Z=Z.slice(0,Y.outerStart)+q+Z.slice(Y.outerEnd),J=Y.outerStart+q.length}return Z}function IQ($){return $.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function kQ($){let Z=$,J=0;while(J<Z.length){let X=T1(Z,J);if(!X)break;if(!W6(X.attrs,"v-once")){J=X.end;continue}let Q=U1(X.attrs,"v-once"),Y=k1(Z,X),G=Z.slice(Y.outerStart,Y.outerEnd),q=`@once
3499
3499
  ${s1(G,{...X,start:0,end:X.end-X.start},Q)}
3500
- @endonce`;Z=Z.slice(0,Y.outerStart)+q+Z.slice(Y.outerEnd),J=Y.outerStart+q.length}return Z}function kQ($){return $.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function TQ($){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 U6($){if(!_Q($))return $;let Z=$;return Z=LQ(Z),Z=OQ(Z),Z=IQ(Z),Z=RQ(Z),Z=NQ(Z),Z=wQ(Z),Z=FQ(Z),Z=TQ(Z),Z=DQ(Z),Z=AQ(Z),Z=MQ(Z),Z=kQ(Z),Z}function D9($){return $.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var j$=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"]),EQ=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function H6($,Z){let J=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($),X=J?J[1]:$,Q=Z0(X,Z);if(Q&&typeof Q==="string")return Q;let Y=X.trim();return j$.has(Y)?Y:null}function j6($){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($);return Z?Z[1]:$}function B6($,Z,J){let X=Z.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),Q=X?`<${$} ${X}>`:`<${$}>`;if(EQ.has($))return X?`<${$} ${X}>`:`<${$}>`;return`${Q}${J}</${$}>`}async function V6($,Z,J,X,Q){let Y=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,z=[],q;while((q=G.exec(Y))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],slotContent:q[3],index:q.index});for(let K=z.length-1;K>=0;K--){let W=z[K];try{let U=H6(W.expr,Z);if(!U||typeof U!=="string"){let O=`<!-- dynamic component: could not resolve "${D9(j6(W.expr))}" -->`;Y=Y.slice(0,W.index)+O+Y.slice(W.index+W.full.length);continue}if(j$.has(U)){let O=B6(U,W.attrs,W.slotContent);Y=Y.slice(0,W.index)+O+Y.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 O=V[1]||V[2],_=V[3];if(V[1])try{j[O]=Z0(_,Z)}catch{j[O]=_}else j[O]=_}let F=X.componentsDir||"components",L=await A1(U,j,W.slotContent,F,Z,J,X,new Set,Q??new Set);Y=Y.slice(0,W.index)+L+Y.slice(W.index+W.full.length)}catch(U){let H=U instanceof Error?U.message:String(U),j=`<!-- dynamic component error: ${D9(H)} -->`;Y=Y.slice(0,W.index)+j+Y.slice(W.index+W.full.length)}}return Y=await bQ(Y,Z,J,X,Q),Y}async function bQ($,Z,J,X,Q){let Y=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,z=[],q;while((q=G.exec(Y))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],index:q.index});for(let K=z.length-1;K>=0;K--){let W=z[K];try{let U=H6(W.expr,Z);if(!U||typeof U!=="string"){let B=`<!-- dynamic component: could not resolve "${D9(j6(W.expr))}" -->`;Y=Y.slice(0,W.index)+B+Y.slice(W.index+W.full.length);continue}if(j$.has(U)){let B=B6(U,W.attrs,"");Y=Y.slice(0,W.index)+B+Y.slice(W.index+W.full.length);continue}let H=X.componentsDir||"components",j=await A1(U,{},"",H,Z,J,X,new Set,Q??new Set);Y=Y.slice(0,W.index)+j+Y.slice(W.index+W.full.length)}catch(U){let H=U instanceof Error?U.message:String(U),j=`<!-- dynamic component error: ${D9(H)} -->`;Y=Y.slice(0,W.index)+j+Y.slice(W.index+W.full.length)}}return Y}function B$(){return{afterOpen:[],beforeClose:[]}}function yQ($){return $.afterOpen.length>0||$.beforeClose.length>0}function L6($,Z){if(!yQ(Z))return $;let J=Z.afterOpen.join(""),X=Z.beforeClose.join(""),Q=$.lastIndexOf("</head>"),Y=J?M2($):null,G=X&&Q!==-1?Q:null;if(Y===null&&G===null)return $;if(Y!==null&&G!==null)return`${$.slice(0,Y)}${J}${$.slice(Y,G)}${X}${$.slice(G)}`;if(Y!==null)return`${$.slice(0,Y)}${J}${$.slice(Y)}`;return`${$.slice(0,G)}${X}${$.slice(G)}`}var _6=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function M2($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let J=Z.index+Z[0].length;_6.lastIndex=J;let X=_6.exec($);return X?J+X[0].length:J}var _$="data-stx-color-mode-boot",CQ="__STX_COLOR_MODE__",SQ=new Set(["light","dark","auto","system"]),PQ=new Set(["auto","system"]),vQ=/^[a-z][\w:-]*$/i,fQ=/^[\w-]+$/;function xQ($){let Z=$.storageKey??"stx-color-mode",J=$.initialMode??"auto",X=$.darkClass===void 0?"dark":$.darkClass,Q=$.attribute??null,Y=$.autoValue??null;if(typeof Z!=="string"||Z.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!SQ.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"||!fQ.test(X)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(X)}`);if(Q!==null&&(typeof Q!=="string"||!vQ.test(Q)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Q)}`);if(Y!==null&&!PQ.has(Y))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(Y)}`);if(X===null&&Q===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:Z,initialMode:J==="system"?"auto":J,darkClass:X,attribute:Q,autoValue:Y}}function gQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function L$($={}){let Z=xQ($),X=`(function(){"use strict";var c=${gQ(Z)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.${CQ}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`;return`<script ${_$}>${X}</script>`}function w6($,Z={}){if($.includes(_$))return $;let J=V$($);if(J===null)return $;let X=L$(Z);return`${$.slice(0,J)}
3501
- ${X}${$.slice(J)}`}var V$=M2,hQ=new RegExp(`<script\\b[^>]*\\b${_$}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),O6=/<meta\b[^>]*\bcharset\b[^>]*>/gi,F6=/<\/head>/gi;function uQ($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let J=Z.index+Z[0].length;F6.lastIndex=J;let X=F6.exec($),Q=X?X.index:$.length;O6.lastIndex=J;let Y=O6.exec($);if(!Y||Y.index>=Q)return $;if($.slice(J,Y.index).trim()==="")return $;let G=Y.index+Y[0].length;return`${$.slice(0,J)}
3502
- ${Y[0]}${$.slice(J,Y.index)}${$.slice(G,Q)}${$.slice(Q)}`}function R6($){return dQ(uQ($))}function dQ($){let Z=hQ.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),Q=V$(X);if(Q===null)return $;return`${X.slice(0,Q)}
3503
- ${Z[0]}${X.slice(Q)}`}var YB="stx-build",QB="X-STX-Build",I2=Symbol.for("stx.buildId");function N6(){let $=globalThis;if(!$[I2])$[I2]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return $[I2]}function GB($){let Z=globalThis;if($===null)delete Z[I2];else Z[I2]=$}function zB($,Z=N6()){let J=O$($,Z);if(J===null)return $;let X=/<head\b[^>]*>/i.exec($),Q=X.index+X[0].length;return`${$.slice(0,Q)}${J}${$.slice(Q)}`}function O$($,Z=N6()){if($.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test($))return null;return`
3504
- <meta name="stx-build" content="${Z}">`}import{AsyncLocalStorage as mQ}from"async_hooks";var D6=new mQ;function F$($){return $.__stx_server_data??={pending:new Map,values:new Map}}function A6($,Z){return D6.run(F$($),Z)}async function M6($,Z){let J=D6.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 Q=Promise.resolve().then(Z).then((Y)=>{let G=JSON.stringify(Y,(q,K)=>{if(K===void 0||typeof K==="function"||typeof K==="symbol"||typeof K==="bigint"||typeof K==="number"&&!Number.isFinite(K))throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);if(K&&typeof K==="object"&&!Array.isArray(K)&&Object.getPrototypeOf(K)!==Object.prototype&&Object.getPrototypeOf(K)!==null)throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);return K}),z=JSON.parse(G);return J.values.set($,z),z}).catch((Y)=>{throw J.pending.delete($),Y});return J.pending.set($,Q),Q}function I6($){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 E6="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",A9="data-stx-html-attrs",M9="data-stx-html-class",b6=/^[A-Za-z_:][\w:.-]*$/;function J1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function lQ($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function r1($){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 o1($,Z){return Object.entries($).filter(([J])=>!Z?.(J)).map(([J,X])=>`${J}="${J1(String(X))}"`).join(" ")}function cQ($={},Z="en"){let J=[],X=[],Q="",Y=Z;for(let[z,q]of Object.entries($||{})){if(q==null)continue;let K=z.trim();if(!b6.test(K))continue;let W=K.toLowerCase();if(W==="lang"){Y=String(q);continue}if(W==="class"){Q=String(q).trim();continue}J.push(` ${K}="${J1(String(q))}"`),X.push(K)}let G=` lang="${J1(Y)}"`;if(Q)G+=` class="${J1(Q)}"`;if(G+=J.join(""),Q)G+=` ${M9}="${J1(Q)}"`;if(X.length)G+=` ${A9}="${J1(X.join(" "))}"`;return G}function y6($={},Z={}){let J={...$,...Z};if($.class&&Z.class){let X=$.class.split(/\s+/).filter(Boolean);for(let Q of Z.class.split(/\s+/).filter(Boolean))if(!X.includes(Q))X.push(Q);J.class=X.join(" ")}return J}function C6($,Z={}){if(!Z||Object.keys(Z).length===0)return $;let J=$.match(/<html\b([^>]*)>/i);if(!J)return $;let X={},Q=[],Y=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,G;while((G=Y.exec(J[1]))!==null){let W=G[1];if(!(W in X))Q.push(W);X[W]=G[2]??G[3]??G[4]??""}let z=[],q=[];for(let[W,U]of Object.entries(Z)){if(U==null)continue;let H=W.trim();if(!b6.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))Q.push("class");X.class=B.join(" ");continue}if(!(H in X))Q.push(H);if(X[H]=String(U),j!=="lang")q.push(H)}if(z.length){if(!(M9 in X))Q.push(M9);X[M9]=z.join(" ")}if(q.length){if(!(A9 in X))Q.push(A9);X[A9]=q.join(" ")}let K=Q.map((W)=>` ${W}="${J1(X[W])}"`).join("");return $.replace(J[0],()=>`<html${K}>`)}function HB($){let Z=N$($);if(Z===null)return $;let J=$.lastIndexOf("</head>");return`${$.slice(0,J)}${Z}${$.slice(J)}`}function N$($){if($.includes("data-stx-cloak"))return null;if($.lastIndexOf("</head>")===-1)return null;return`${E6}
3505
- `}function pQ($){let Z=[],J=0;while(J<$.length){let Y=$.slice(J),G=Y.match(/^\s+/);if(G){J+=G[0].length;continue}if(Y.startsWith("<!--")){let U=$.indexOf("-->",J);if(U===-1)break;J=U+3;continue}let z=Y.match(/^<script\b[^>]*>/i);if(z){let U=$.toLowerCase().indexOf("</script>",J+z[0].length);if(U===-1)break;J=U+9;continue}let q=Y.match(/^<link\b[^>]*>/i);if(q){Z.push(q[0]),J+=q[0].length;continue}let K=Y.match(/^<meta\b[^>]*>/i);if(K){Z.push(K[0]),J+=K[0].length;continue}let W=Y.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="",Q=0;while(Q<$.length&&Q<J){let Y=$.slice(Q),G=Y.match(/^<link\b[^>]*>/i);if(G&&Z.includes(G[0])){Q+=G[0].length;continue}let z=Y.match(/^<meta\b[^>]*>/i);if(z&&Z.includes(z[0])){Q+=z[0].length;continue}let q=Y.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(q&&Z.includes(q[0])){Q+=q[0].length;continue}X+=$[Q],Q++}return X+=$.slice(J),{body:X,hoisted:Z}}function iQ($,Z={},J={}){let{title:X="stx App",lang:Q="en",meta:Y=[],link:G=[],script:z=[],headRaw:q="",htmlAttrs:K={},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(Y.map(r1).filter(Boolean)),F=[...j.filter((I)=>!B.has(r1(I))),...Y].map((I)=>{return` <meta ${o1(I)}>`}).join(`
3500
+ @endonce`;Z=Z.slice(0,Y.outerStart)+q+Z.slice(Y.outerEnd),J=Y.outerStart+q.length}return Z}function TQ($){return $.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function EQ($){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 U6($){if(!LQ($))return $;let Z=$;return Z=OQ(Z),Z=FQ(Z),Z=kQ(Z),Z=NQ(Z),Z=DQ(Z),Z=RQ(Z),Z=wQ(Z),Z=EQ(Z),Z=AQ(Z),Z=MQ(Z),Z=IQ(Z),Z=TQ(Z),Z}function D9($){return $.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var j$=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"]),bQ=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function H6($,Z){let J=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($),X=J?J[1]:$,Q=Z0(X,Z);if(Q&&typeof Q==="string")return Q;let Y=X.trim();return j$.has(Y)?Y:null}function j6($){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($);return Z?Z[1]:$}function B6($,Z,J){let X=Z.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),Q=X?`<${$} ${X}>`:`<${$}>`;if(bQ.has($))return X?`<${$} ${X}>`:`<${$}>`;return`${Q}${J}</${$}>`}async function V6($,Z,J,X,Q){let Y=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,z=[],q;while((q=G.exec(Y))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],slotContent:q[3],index:q.index});for(let K=z.length-1;K>=0;K--){let W=z[K];try{let U=H6(W.expr,Z);if(!U||typeof U!=="string"){let O=`<!-- dynamic component: could not resolve "${D9(j6(W.expr))}" -->`;Y=Y.slice(0,W.index)+O+Y.slice(W.index+W.full.length);continue}if(j$.has(U)){let O=B6(U,W.attrs,W.slotContent);Y=Y.slice(0,W.index)+O+Y.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 O=V[1]||V[2],_=V[3];if(V[1])try{j[O]=Z0(_,Z)}catch{j[O]=_}else j[O]=_}let F=X.componentsDir||"components",L=await A1(U,j,W.slotContent,F,Z,J,X,new Set,Q??new Set);Y=Y.slice(0,W.index)+L+Y.slice(W.index+W.full.length)}catch(U){let H=U instanceof Error?U.message:String(U),j=`<!-- dynamic component error: ${D9(H)} -->`;Y=Y.slice(0,W.index)+j+Y.slice(W.index+W.full.length)}}return Y=await yQ(Y,Z,J,X,Q),Y}async function yQ($,Z,J,X,Q){let Y=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,z=[],q;while((q=G.exec(Y))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],index:q.index});for(let K=z.length-1;K>=0;K--){let W=z[K];try{let U=H6(W.expr,Z);if(!U||typeof U!=="string"){let B=`<!-- dynamic component: could not resolve "${D9(j6(W.expr))}" -->`;Y=Y.slice(0,W.index)+B+Y.slice(W.index+W.full.length);continue}if(j$.has(U)){let B=B6(U,W.attrs,"");Y=Y.slice(0,W.index)+B+Y.slice(W.index+W.full.length);continue}let H=X.componentsDir||"components",j=await A1(U,{},"",H,Z,J,X,new Set,Q??new Set);Y=Y.slice(0,W.index)+j+Y.slice(W.index+W.full.length)}catch(U){let H=U instanceof Error?U.message:String(U),j=`<!-- dynamic component error: ${D9(H)} -->`;Y=Y.slice(0,W.index)+j+Y.slice(W.index+W.full.length)}}return Y}function B$(){return{afterOpen:[],beforeClose:[]}}function CQ($){return $.afterOpen.length>0||$.beforeClose.length>0}function L6($,Z){if(!CQ(Z))return $;let J=Z.afterOpen.join(""),X=Z.beforeClose.join(""),Q=$.lastIndexOf("</head>"),Y=J?M2($):null,G=X&&Q!==-1?Q:null;if(Y===null&&G===null)return $;if(Y!==null&&G!==null)return`${$.slice(0,Y)}${J}${$.slice(Y,G)}${X}${$.slice(G)}`;if(Y!==null)return`${$.slice(0,Y)}${J}${$.slice(Y)}`;return`${$.slice(0,G)}${X}${$.slice(G)}`}var _6=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function M2($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let J=Z.index+Z[0].length;_6.lastIndex=J;let X=_6.exec($);return X?J+X[0].length:J}var _$="data-stx-color-mode-boot",SQ="__STX_COLOR_MODE__",PQ=new Set(["light","dark","auto","system"]),vQ=new Set(["auto","system"]),fQ=/^[a-z][\w:-]*$/i,xQ=/^[\w-]+$/;function gQ($){let Z=$.storageKey??"stx-color-mode",J=$.initialMode??"auto",X=$.darkClass===void 0?"dark":$.darkClass,Q=$.attribute??null,Y=$.autoValue??null;if(typeof Z!=="string"||Z.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!PQ.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"||!xQ.test(X)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(X)}`);if(Q!==null&&(typeof Q!=="string"||!fQ.test(Q)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Q)}`);if(Y!==null&&!vQ.has(Y))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(Y)}`);if(X===null&&Q===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:Z,initialMode:J==="system"?"auto":J,darkClass:X,attribute:Q,autoValue:Y}}function hQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function L$($={}){let Z=gQ($),X=`(function(){"use strict";var c=${hQ(Z)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.${SQ}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`;return`<script ${_$}>${X}</script>`}function w6($,Z={}){if($.includes(_$))return $;let J=V$($);if(J===null)return $;let X=L$(Z);return`${$.slice(0,J)}
3501
+ ${X}${$.slice(J)}`}var V$=M2,uQ=new RegExp(`<script\\b[^>]*\\b${_$}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),O6=/<meta\b[^>]*\bcharset\b[^>]*>/gi,F6=/<\/head>/gi;function dQ($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let J=Z.index+Z[0].length;F6.lastIndex=J;let X=F6.exec($),Q=X?X.index:$.length;O6.lastIndex=J;let Y=O6.exec($);if(!Y||Y.index>=Q)return $;if($.slice(J,Y.index).trim()==="")return $;let G=Y.index+Y[0].length;return`${$.slice(0,J)}
3502
+ ${Y[0]}${$.slice(J,Y.index)}${$.slice(G,Q)}${$.slice(Q)}`}function R6($){return mQ(dQ($))}function mQ($){let Z=uQ.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),Q=V$(X);if(Q===null)return $;return`${X.slice(0,Q)}
3503
+ ${Z[0]}${X.slice(Q)}`}var QB="stx-build",GB="X-STX-Build",I2=Symbol.for("stx.buildId");function N6(){let $=globalThis;if(!$[I2])$[I2]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return $[I2]}function zB($){let Z=globalThis;if($===null)delete Z[I2];else Z[I2]=$}function qB($,Z=N6()){let J=O$($,Z);if(J===null)return $;let X=/<head\b[^>]*>/i.exec($),Q=X.index+X[0].length;return`${$.slice(0,Q)}${J}${$.slice(Q)}`}function O$($,Z=N6()){if($.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test($))return null;return`
3504
+ <meta name="stx-build" content="${Z}">`}import{AsyncLocalStorage as lQ}from"async_hooks";var D6=new lQ;function F$($){return $.__stx_server_data??={pending:new Map,values:new Map}}function A6($,Z){return D6.run(F$($),Z)}async function M6($,Z){let J=D6.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 Q=Promise.resolve().then(Z).then((Y)=>{let G=JSON.stringify(Y,(q,K)=>{if(K===void 0||typeof K==="function"||typeof K==="symbol"||typeof K==="bigint"||typeof K==="number"&&!Number.isFinite(K))throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);if(K&&typeof K==="object"&&!Array.isArray(K)&&Object.getPrototypeOf(K)!==Object.prototype&&Object.getPrototypeOf(K)!==null)throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);return K}),z=JSON.parse(G);return J.values.set($,z),z}).catch((Y)=>{throw J.pending.delete($),Y});return J.pending.set($,Q),Q}function I6($){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 E6="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",A9="data-stx-html-attrs",M9="data-stx-html-class",b6=/^[A-Za-z_:][\w:.-]*$/;function J1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function cQ($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function r1($){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 o1($,Z){return Object.entries($).filter(([J])=>!Z?.(J)).map(([J,X])=>`${J}="${J1(String(X))}"`).join(" ")}function pQ($={},Z="en"){let J=[],X=[],Q="",Y=Z;for(let[z,q]of Object.entries($||{})){if(q==null)continue;let K=z.trim();if(!b6.test(K))continue;let W=K.toLowerCase();if(W==="lang"){Y=String(q);continue}if(W==="class"){Q=String(q).trim();continue}J.push(` ${K}="${J1(String(q))}"`),X.push(K)}let G=` lang="${J1(Y)}"`;if(Q)G+=` class="${J1(Q)}"`;if(G+=J.join(""),Q)G+=` ${M9}="${J1(Q)}"`;if(X.length)G+=` ${A9}="${J1(X.join(" "))}"`;return G}function y6($={},Z={}){let J={...$,...Z};if($.class&&Z.class){let X=$.class.split(/\s+/).filter(Boolean);for(let Q of Z.class.split(/\s+/).filter(Boolean))if(!X.includes(Q))X.push(Q);J.class=X.join(" ")}return J}function C6($,Z={}){if(!Z||Object.keys(Z).length===0)return $;let J=$.match(/<html\b([^>]*)>/i);if(!J)return $;let X={},Q=[],Y=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,G;while((G=Y.exec(J[1]))!==null){let W=G[1];if(!(W in X))Q.push(W);X[W]=G[2]??G[3]??G[4]??""}let z=[],q=[];for(let[W,U]of Object.entries(Z)){if(U==null)continue;let H=W.trim();if(!b6.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))Q.push("class");X.class=B.join(" ");continue}if(!(H in X))Q.push(H);if(X[H]=String(U),j!=="lang")q.push(H)}if(z.length){if(!(M9 in X))Q.push(M9);X[M9]=z.join(" ")}if(q.length){if(!(A9 in X))Q.push(A9);X[A9]=q.join(" ")}let K=Q.map((W)=>` ${W}="${J1(X[W])}"`).join("");return $.replace(J[0],()=>`<html${K}>`)}function jB($){let Z=N$($);if(Z===null)return $;let J=$.lastIndexOf("</head>");return`${$.slice(0,J)}${Z}${$.slice(J)}`}function N$($){if($.includes("data-stx-cloak"))return null;if($.lastIndexOf("</head>")===-1)return null;return`${E6}
3505
+ `}function iQ($){let Z=[],J=0;while(J<$.length){let Y=$.slice(J),G=Y.match(/^\s+/);if(G){J+=G[0].length;continue}if(Y.startsWith("<!--")){let U=$.indexOf("-->",J);if(U===-1)break;J=U+3;continue}let z=Y.match(/^<script\b[^>]*>/i);if(z){let U=$.toLowerCase().indexOf("</script>",J+z[0].length);if(U===-1)break;J=U+9;continue}let q=Y.match(/^<link\b[^>]*>/i);if(q){Z.push(q[0]),J+=q[0].length;continue}let K=Y.match(/^<meta\b[^>]*>/i);if(K){Z.push(K[0]),J+=K[0].length;continue}let W=Y.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="",Q=0;while(Q<$.length&&Q<J){let Y=$.slice(Q),G=Y.match(/^<link\b[^>]*>/i);if(G&&Z.includes(G[0])){Q+=G[0].length;continue}let z=Y.match(/^<meta\b[^>]*>/i);if(z&&Z.includes(z[0])){Q+=z[0].length;continue}let q=Y.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(q&&Z.includes(q[0])){Q+=q[0].length;continue}X+=$[Q],Q++}return X+=$.slice(J),{body:X,hoisted:Z}}function nQ($,Z={},J={}){let{title:X="stx App",lang:Q="en",meta:Y=[],link:G=[],script:z=[],headRaw:q="",htmlAttrs:K={},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(Y.map(r1).filter(Boolean)),F=[...j.filter((I)=>!B.has(r1(I))),...Y].map((I)=>{return` <meta ${o1(I)}>`}).join(`
3506
3506
  `),L=G.map((I)=>{return` <link ${o1(I)}>`}).join(`
3507
3507
  `),O=z.map((I)=>{if(I.src)return` <script ${o1(I,(T)=>T==="content")}></script>`;if(I.content)return` <script>${I.content}</script>`;return""}).filter(Boolean).join(`
3508
- `),_=cQ(K,Q),w=Object.entries(U).map(([I,T])=>` ${I}="${J1(String(T))}"`).join(""),R=W?` class="${J1(W)}"`:"",{body:N,hoisted:A}=pQ($),k=[F,J.colorMode?` ${L$(J.colorMode)}`:"",` <title>${J.titleIsHtml?H:lQ(H)}</title>`,` ${E6}`,L,O,q?` ${q}`:"",...(J.styles||[]).map((I)=>` ${I}`),...A.map((I)=>` ${I}`),...(J.headScripts||[]).map((I)=>` ${I}`),J.headStack||""].filter(Boolean),D=[N,...(J.bodyScripts||[]).map((I)=>I),J.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3508
+ `),_=pQ(K,Q),w=Object.entries(U).map(([I,T])=>` ${I}="${J1(String(T))}"`).join(""),R=W?` class="${J1(W)}"`:"",{body:N,hoisted:A}=iQ($),k=[F,J.colorMode?` ${L$(J.colorMode)}`:"",` <title>${J.titleIsHtml?H:cQ(H)}</title>`,` ${E6}`,L,O,q?` ${q}`:"",...(J.styles||[]).map((I)=>` ${I}`),...A.map((I)=>` ${I}`),...(J.headScripts||[]).map((I)=>` ${I}`),J.headStack||""].filter(Boolean),D=[N,...(J.bodyScripts||[]).map((I)=>I),J.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3509
3509
  <html${_}>
3510
3510
  <head>
3511
3511
  ${k.join(`
@@ -3515,24 +3515,24 @@ ${k.join(`
3515
3515
  ${D.join(`
3516
3516
  `)}
3517
3517
  </body>
3518
- </html>`}var w$=/\s+/y,R$=/<(script|style)\b[^>]*>/iy,nQ=/<\/script>/gi,sQ=/<\/style>/gi,k6=/<!DOCTYPE\b/iy,T6=/<html[\s>]/iy;function D$($){let Z=0;while(Z<$.length){if(w$.lastIndex=Z,w$.exec($)){Z=w$.lastIndex;continue}if($.startsWith("<!--",Z)){let Q=$.indexOf("-->",Z);if(Q===-1)return!1;Z=Q+3;continue}R$.lastIndex=Z;let X=R$.exec($);if(X){let Q=X[1].toLowerCase()==="script"?nQ:sQ;Q.lastIndex=R$.lastIndex;let Y=Q.exec($);if(Y===null)return!1;Z=Y.index+Y[0].length;continue}if(k6.lastIndex=Z,k6.test($))return!0;return T6.lastIndex=Z,T6.test($)}return!1}function A$($){return D$($)}function S6($,Z={}){let J=$.lastIndexOf("</head>");if(J===-1)return $;let{meta:X=[],link:Q=[],script:Y=[],headRaw:G=""}=Z,z=$.slice(0,J),q=[];for(let K of X){let W=r1(K);if(W&&z.includes(W))continue;q.push(` <meta ${o1(K)}>`)}for(let K of Q){if(K.href&&z.includes(`href="${K.href}"`))continue;q.push(` <link ${o1(K)}>`)}for(let K of Y)if(K.src){if(z.includes(`src="${K.src}"`))continue;q.push(` <script ${o1(K,(W)=>W==="content")}></script>`)}else if(K.content){if(z.includes(K.content))continue;q.push(` <script>${K.content}</script>`)}if(G&&!z.includes(G))q.push(` ${G}`);if(q.length===0)return $;return`${$.slice(0,J)}${q.join(`
3518
+ </html>`}var w$=/\s+/y,R$=/<(script|style)\b[^>]*>/iy,sQ=/<\/script>/gi,oQ=/<\/style>/gi,k6=/<!DOCTYPE\b/iy,T6=/<html[\s>]/iy;function D$($){let Z=0;while(Z<$.length){if(w$.lastIndex=Z,w$.exec($)){Z=w$.lastIndex;continue}if($.startsWith("<!--",Z)){let Q=$.indexOf("-->",Z);if(Q===-1)return!1;Z=Q+3;continue}R$.lastIndex=Z;let X=R$.exec($);if(X){let Q=X[1].toLowerCase()==="script"?sQ:oQ;Q.lastIndex=R$.lastIndex;let Y=Q.exec($);if(Y===null)return!1;Z=Y.index+Y[0].length;continue}if(k6.lastIndex=Z,k6.test($))return!0;return T6.lastIndex=Z,T6.test($)}return!1}function A$($){return D$($)}function S6($,Z={}){let J=$.lastIndexOf("</head>");if(J===-1)return $;let{meta:X=[],link:Q=[],script:Y=[],headRaw:G=""}=Z,z=$.slice(0,J),q=[];for(let K of X){let W=r1(K);if(W&&z.includes(W))continue;q.push(` <meta ${o1(K)}>`)}for(let K of Q){if(K.href&&z.includes(`href="${K.href}"`))continue;q.push(` <link ${o1(K)}>`)}for(let K of Y)if(K.src){if(z.includes(`src="${K.src}"`))continue;q.push(` <script ${o1(K,(W)=>W==="content")}></script>`)}else if(K.content){if(z.includes(K.content))continue;q.push(` <script>${K.content}</script>`)}if(G&&!z.includes(G))q.push(` ${G}`);if(q.length===0)return $;return`${$.slice(0,J)}${q.join(`
3519
3519
  `)}
3520
- ${$.slice(J)}`}function P6($,Z={},J={},X){if(X??A$($))return $;return iQ($,Z,J)}var oQ=/<\/(script)/gi;function a1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(oQ,"<\\/$1")}var k2=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useDocumentVisibility","useIntervalFn","useObjectUrl","useTimeoutFn"];import x6 from"path";K2();K2();function f6($,Z={}){return new v6($,Z).routes}function RB($,Z){let J=M$($,Z);return J?J.params:null}var g6=new Map;async function h6($,Z){let J=$,X=Z;if(!J||!X)try{let z=await O5();J||=z?.pagesDir||"pages",X||=z?.root||"."}catch{J||="pages",X||="."}let Q=x6.isAbsolute(J)?J:x6.join(X,J),Y=g6.get(Q);if(Y)return Y;let G=[];try{G=f6(".",{pagesDir:Q,emit:!1}).map((z)=>z.regex.source).filter(Boolean)}catch{G=[]}return g6.set(Q,G),G}function rQ($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function u6($){return rQ(JSON.stringify($))}function d6($){return $.includes("data-stx-runtime")}function m6($){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=z2($),X=$.search(/<!doctype\b/i);if(J!==-1&&(X===-1||J>X))return $.slice(0,J)+Z+`
3520
+ ${$.slice(J)}`}function P6($,Z={},J={},X){if(X??A$($))return $;return nQ($,Z,J)}var rQ=/<\/(script)/gi;function a1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(rQ,"<\\/$1")}var k2=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useDocumentVisibility","useIntervalFn","useObjectUrl","useTimeoutFn"];import x6 from"path";K2();K2();function f6($,Z={}){return new v6($,Z).routes}function NB($,Z){let J=M$($,Z);return J?J.params:null}var g6=new Map;async function h6($,Z){let J=$,X=Z;if(!J||!X)try{let z=await O5();J||=z?.pagesDir||"pages",X||=z?.root||"."}catch{J||="pages",X||="."}let Q=x6.isAbsolute(J)?J:x6.join(X,J),Y=g6.get(Q);if(Y)return Y;let G=[];try{G=f6(".",{pagesDir:Q,emit:!1}).map((z)=>z.regex.source).filter(Boolean)}catch{G=[]}return g6.set(Q,G),G}function aQ($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function u6($){return aQ(JSON.stringify($))}function d6($){return $.includes("data-stx-runtime")}function m6($){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=z2($),X=$.search(/<!doctype\b/i);if(J!==-1&&(X===-1||J>X))return $.slice(0,J)+Z+`
3521
3521
  `+$.slice(J);let Q=M2($);if(Q!==null)return`${$.slice(0,Q)}
3522
3522
  ${Z}${$.slice(Q)}`;if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3523
3523
  `+$.slice(G)}if(s0($))return C1($,(G)=>`${G}
3524
3524
  ${Z}`);return`${Z}
3525
- ${$}`}async function I9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve"){let{getServeClientAsset:Q}=await import("./chunk-9yzs3bs7.js"),{url:Y}=await Q("runtime",Z.debug===!0);return I$($,`<script data-stx-runtime src="${Y}"></script>`)}if(Z.buildMode==="compile")return I$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-9yzs3bs7.js"),X=await J(Z.debug);return I$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function aQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function l6($){if($.includes("data-stx-tooltip-runtime")||!aQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${t5()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3525
+ ${$}`}async function I9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve"){let{getServeClientAsset:Q}=await import("./chunk-denfdjdr.js"),{url:Y}=await Q("runtime",Z.debug===!0);return I$($,`<script data-stx-runtime src="${Y}"></script>`)}if(Z.buildMode==="compile")return I$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-denfdjdr.js"),X=await J(Z.debug);return I$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function tQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function l6($){if($.includes("data-stx-tooltip-runtime")||!tQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${t5()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3526
3526
  ${Z}`;return`${$.slice(0,J)}${Z}
3527
- ${$.slice(J)}`}var tQ=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function eQ($){return tQ.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function $G($,Z){if(!$.includes("</body>"))return $;if(eQ($))return $;let J=Z?.router,X="";{let q={};if(J){if(J.container)q.container=J.container;if(J.interceptAllLinks!==void 0)q.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)q.progress=J.progress;if(J.viewTransitions!==void 0)q.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)q.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)q.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)q.scrollToTop=J.scrollToTop;if(J.prefetch!==void 0)q.prefetch=J.prefetch;if(J.cache!==void 0)q.cache=J.cache;if(J.progressColor!==void 0)q.progressColor=J.progressColor;if(J.progressHeight!==void 0)q.progressHeight=J.progressHeight}try{let K=await h6(Z?.pagesDir,Z?.root);if(K.length>0)q.ownedRoutes=K}catch{}if(Object.keys(q).length>0)X=`<script>window.__stxRouterConfig=${u6(q)};</script>
3528
- `}let{getCachedRouterScript:Q,getServeClientAsset:Y}=await import("./chunk-9yzs3bs7.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 Y("router")).url}"></script>`:`<script data-stx-router>${await Q()}</script>`,z=$.lastIndexOf("</body>");return $.slice(0,z)+X+G+`
3529
- </body>`+$.slice(z+7)}var c6=Symbol.for("stx.lazy-module-promises");function ZG(){let $=globalThis;return $[c6]??=new Map,$[c6]}function a($,Z){let J=ZG(),X=`${import.meta.url}\x00${$}`,Q=J.get(X);if(Q)return Q;let Y=Z();return J.set(X,Y),Y.catch(()=>{if(J.get(X)===Y)J.delete(X)}),Y}var k$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,e6=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,JG=65536,XG=4,T9=new Map;function oB(){T9.clear()}function YG($){let Z=[];for(let J of T2($,Q2)){let X=J.token.match(/^<script\b([^>]*)>/i),Q=J.token.match(/<\/script\s*>$/i);if(!X||!Q)continue;let Y=X[0].length,G=J.token.length-Q[0].length;Z.push(Object.freeze({fullMatch:J.token,attrs:X[1],body:J.token.slice(Y,G),start:J.start,end:J.end}))}return Z}function QG($,Z={}){let J=$.length>=JG,X=J?T9.get($):void 0;if(X===void 0){if(X=YG($),J)t6(T9,XG),T9.set($,X)}let Q=Z.skipAttrs;if(!Q)return X.slice();let Y=[];for(let G of X)if(Q.lastIndex=0,!Q.test(G.attrs))Y.push(G);return Y}function $8($){let Z=$.trim(),J=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(J){let Q=J[1].trim(),Y=J[2].trim(),{itemVar:G,indexVar:z}=p6(Y);if(G)return{style:"as",iterable:Q,itemVar:G,indexVar:z}}let X=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(X){let Q=X[1].trim(),Y=X[2].trim(),{itemVar:G,indexVar:z}=p6(Q);if(G)return{style:"in",iterable:Y,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function p6($){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 Q=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:Q[2]};let Y=Z.match(/^(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:null};return{itemVar:null,indexVar:null}}function b$($,Z){return a6($,Z)}function GG($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,J=0,X;while((X=Z.exec($))!==null){let Q=X[1];if(Q.startsWith("if"))J++;else if(Q==="endif")J--;else if(J===0)return!0}return!1}function zG($){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,Q;while((Q=J.exec($))!==null){let Y=Q[1],G;while((G=X.exec(Y))!==null)Z.add(G[1])}return Z}function qG($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${k$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=T2($,(Y,G)=>{Z.lastIndex=G;let z=Z.exec(Y);if(!z||z.index!==G||!J.test(z[2]))return-1;return Z.lastIndex}),Q=[];for(let Y of X){Z.lastIndex=0;let G=Z.exec(Y.token);if(!G)continue;let z=G[2].match(J),q=$8(z?.[1]??z?.[2]??""),K=[q.itemVar,q.indexVar].filter(Boolean);if(K.length===0)continue;let W=G[1],H=/\/\s*>$/.test(Y.token)||E9.has(W.toLowerCase())?Y.end:J8($,Y.start,W,Y.end);if(H!==-1)Q.push({start:Y.start,end:H,vars:new Set(K)})}return Q}var i6=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 KG($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function n6($,Z,J,X){if(!$)return!1;let Q=KG($),Y=!1,G=!1,z=!1,q=/([a-zA-Z_$][\w$]*)/g,K;while((K=q.exec(Q))!==null){let j=K[1];if(Q.slice(0,K.index).trimEnd().endsWith("."))continue;if(i6.has(j))continue;if(Z.has(j)||X?.has(j))Y=!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(Q))!==null){let j=U[1];if(Q.slice(0,U.index).trimEnd().endsWith("."))continue;if(i6.has(j)||J&&j in J)continue;z=!0}return(Y||z)&&!G}function k9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,"&quot;")}"`,Q=$.trim(),Y=Q.match(e6);if(Y&&WG(Y[3],Y[1])){let[,G,z,q]=Y;return`<${G}${z}${X}>${q}</${G}>`}return`<template${X}>${Q}</template>`}function WG($,Z){let J=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),X=0,Q;while((Q=J.exec($))!==null)if(Q[1]){if(X--,X<0)return!1}else X++;return!0}function Z8($,Z){let J=zG($);function X(Q){let Y=Q,G=qG(Q),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},q=/@if\s*\(/g,K,W=[];while((K=q.exec(Y))!==null){let U=K.index,H=U+K[0].length,j=1,B=H;while(B<Y.length&&j>0){if(Y[B]==="(")j++;else if(Y[B]===")")j--;B++}if(j!==0)continue;let V=Y.substring(H,B-1).trim(),F=B,L=1,O=F,_=/@(if\s*\(|endif)/g;_.lastIndex=F;let w;while((w=_.exec(Y))!==null)if(w[1].startsWith("if"))L++;else if(w[1]==="endif"){if(L--,L===0){O=w.index+w[0].length;break}}if(L!==0)continue;let R=Y.substring(F,O-6).trim(),N;if(GG(R)){let A=V2(Y.substring(U,O));if(A.length===0)continue;let k=A[0].branches.filter((M)=>M.type!=="else"),D=z(U);if(!(k.length>0&&k.every((M)=>n6(M.condition,J,Z,D))))continue;N=A[0].branches.map((M)=>{let E=X(M.content);if(M.type==="elseif")return k9(E,"@else-if",M.condition??"");if(M.type==="else")return k9(E,"@else");return k9(E,"@if",M.condition??"")}).join(`
3530
- `)}else{if(!n6(V,J,Z,z(U)))continue;N=k9(X(R),"@if",V)}W.push({start:U,end:O,replacement:N}),q.lastIndex=O}for(let U=W.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=W[U];Y=Y.substring(0,H)+B+Y.substring(j)}return Y}return X($)}function UG($){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 Q=Number(Z);return Q!==0&&!Number.isNaN(Q)}let J=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(J)return J[1].length>0;let X=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(X)return X[1].length>0;return}var E9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),s6=/<(script|style)\b/iy,HG=/<\/script/gi,jG=/<\/style/gi;function J8($,Z,J,X){if(E9.has(J.toLowerCase()))return X;let Q=J.toLowerCase(),Y=$.length,G=1,z=X;while(z<Y){let q=$.indexOf("<",z);if(q===-1)return-1;if(z=q,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}s6.lastIndex=z;let K=s6.exec($);if(K){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=K[1].toLowerCase()==="script"?HG:jG;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()===Q){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()===Q){let H=$.slice(z,U+1);if(!(/\/\s*>$/.test(H)||E9.has(Q)))G++}z=U+1}return-1}var BG=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function VG($,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 Q=$.indexOf(">",J);if(Q===-1)return!1;let Y=$.slice(J,Q+1);return BG.test(Y)}function X8($){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 Q=(U)=>Z.some(([H,j])=>U>=H&&U<j),Y=/<([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=Y.exec($))!==null){if(Q(z.index))continue;let[U,H,j,B,V,F,L]=z,O=UG(V);if(O===void 0)continue;let _=z.index,w=_+U.length,A=!!L||/\/\s*>$/.test(U)||E9.has(H.toLowerCase())?w:J8($,_,H,w);if(A===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&VG($,A)){Y.lastIndex=w;continue}if(O===!0){let D=`<${H}${j}${F}${L}>`;G.push({start:_,end:w,replacement:D});continue}G.push({start:_,end:A,replacement:""}),Y.lastIndex=A}if(G.length===0)return $;G.sort((U,H)=>U.start-H.start);let q=[],K=-1;for(let U of G){if(U.start<K)continue;q.push(U),K=U.end}let W=$;for(let U=q.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=q[U];W=W.substring(0,H)+B+W.substring(j)}return W}function y$($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Q,Y=[],G=[];while((Q=X.exec(J))!==null){let z=Q[1],q=Q.index,K=q+Q[0].length,W=1,U=K;while(U<J.length&&W>0){if(J[U]==="(")W++;else if(J[U]===")")W--;U++}if(W!==0)continue;let H=J.substring(K,U-1).trim(),j=U,B=$8(H),V=z==="for"?"@endfor":"@endforeach",F=1,L=j,O=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");O.lastIndex=j;let _;while((_=O.exec(J))!==null)if(_[1].startsWith(z))F++;else if(F--,F===0){L=_.index+_[0].length;break}if(F!==0)continue;let w=()=>{let I=[B.itemVar,B.indexVar].filter(Boolean);if(I.length)G.push({start:q,end:L,vars:I})};if(B.iterable){let I=B.iterable.trim();if(I.startsWith("[")||I.startsWith("{")||I.startsWith("'")||I.startsWith('"')||I.startsWith("`")||/^-?\d/.test(I)){w();continue}let T=I.split(/[.[(]/)[0].trim(),M=Z?T in Z:!1,E=G.some((C)=>q>C.start&&q<C.end&&C.vars.includes(T));if(T&&(M||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(),N=Z?{...Z}:{};if(B.itemVar)delete N[B.itemVar];if(B.indexVar)delete N[B.indexVar];let A=y$(R,N),k=A.match(e6),D;if(k){let[,I,T,M]=k;D=`<${I}${T} @for="${H}">${M}</${I}>`}else D=`<template @for="${H}">${A}</template>`;Y.push({start:q,end:L,replacement:D}),X.lastIndex=L}for(let z=Y.length-1;z>=0;z--){let{start:q,end:K,replacement:W}=Y[z];J=J.substring(0,q)+W+J.substring(K)}return J}function _G($){let Z=new Set,J=[],X=0,Q=0,Y=$.length,G=(W)=>{let U=X+1;while(U<Y){let H=$[U];if(H==="\\"){U+=2;continue}if(H===W)return U+1;U++}return Y},z=()=>{let W=X+2;while(W<Y&&$[W]!==`
3527
+ ${$.slice(J)}`}var eQ=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function $G($){return eQ.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function ZG($,Z){if(!$.includes("</body>"))return $;if($G($))return $;let J=Z?.router,X="";{let q={};if(J){if(J.container)q.container=J.container;if(J.interceptAllLinks!==void 0)q.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)q.progress=J.progress;if(J.viewTransitions!==void 0)q.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)q.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)q.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)q.scrollToTop=J.scrollToTop;if(J.prefetch!==void 0)q.prefetch=J.prefetch;if(J.cache!==void 0)q.cache=J.cache;if(J.progressColor!==void 0)q.progressColor=J.progressColor;if(J.progressHeight!==void 0)q.progressHeight=J.progressHeight}try{let K=await h6(Z?.pagesDir,Z?.root);if(K.length>0)q.ownedRoutes=K}catch{}if(Object.keys(q).length>0)X=`<script>window.__stxRouterConfig=${u6(q)};</script>
3528
+ `}let{getCachedRouterScript:Q,getServeClientAsset:Y}=await import("./chunk-denfdjdr.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 Y("router")).url}"></script>`:`<script data-stx-router>${await Q()}</script>`,z=$.lastIndexOf("</body>");return $.slice(0,z)+X+G+`
3529
+ </body>`+$.slice(z+7)}var c6=Symbol.for("stx.lazy-module-promises");function JG(){let $=globalThis;return $[c6]??=new Map,$[c6]}function a($,Z){let J=JG(),X=`${import.meta.url}\x00${$}`,Q=J.get(X);if(Q)return Q;let Y=Z();return J.set(X,Y),Y.catch(()=>{if(J.get(X)===Y)J.delete(X)}),Y}var k$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,e6=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,XG=65536,YG=4,T9=new Map;function rB(){T9.clear()}function QG($){let Z=[];for(let J of T2($,Q2)){let X=J.token.match(/^<script\b([^>]*)>/i),Q=J.token.match(/<\/script\s*>$/i);if(!X||!Q)continue;let Y=X[0].length,G=J.token.length-Q[0].length;Z.push(Object.freeze({fullMatch:J.token,attrs:X[1],body:J.token.slice(Y,G),start:J.start,end:J.end}))}return Z}function GG($,Z={}){let J=$.length>=XG,X=J?T9.get($):void 0;if(X===void 0){if(X=QG($),J)t6(T9,YG),T9.set($,X)}let Q=Z.skipAttrs;if(!Q)return X.slice();let Y=[];for(let G of X)if(Q.lastIndex=0,!Q.test(G.attrs))Y.push(G);return Y}function $8($){let Z=$.trim(),J=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(J){let Q=J[1].trim(),Y=J[2].trim(),{itemVar:G,indexVar:z}=p6(Y);if(G)return{style:"as",iterable:Q,itemVar:G,indexVar:z}}let X=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(X){let Q=X[1].trim(),Y=X[2].trim(),{itemVar:G,indexVar:z}=p6(Q);if(G)return{style:"in",iterable:Y,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function p6($){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 Q=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:Q[2]};let Y=Z.match(/^(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:null};return{itemVar:null,indexVar:null}}function b$($,Z){return a6($,Z)}function zG($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,J=0,X;while((X=Z.exec($))!==null){let Q=X[1];if(Q.startsWith("if"))J++;else if(Q==="endif")J--;else if(J===0)return!0}return!1}function qG($){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,Q;while((Q=J.exec($))!==null){let Y=Q[1],G;while((G=X.exec(Y))!==null)Z.add(G[1])}return Z}function KG($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${k$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=T2($,(Y,G)=>{Z.lastIndex=G;let z=Z.exec(Y);if(!z||z.index!==G||!J.test(z[2]))return-1;return Z.lastIndex}),Q=[];for(let Y of X){Z.lastIndex=0;let G=Z.exec(Y.token);if(!G)continue;let z=G[2].match(J),q=$8(z?.[1]??z?.[2]??""),K=[q.itemVar,q.indexVar].filter(Boolean);if(K.length===0)continue;let W=G[1],H=/\/\s*>$/.test(Y.token)||E9.has(W.toLowerCase())?Y.end:J8($,Y.start,W,Y.end);if(H!==-1)Q.push({start:Y.start,end:H,vars:new Set(K)})}return Q}var i6=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 WG($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function n6($,Z,J,X){if(!$)return!1;let Q=WG($),Y=!1,G=!1,z=!1,q=/([a-zA-Z_$][\w$]*)/g,K;while((K=q.exec(Q))!==null){let j=K[1];if(Q.slice(0,K.index).trimEnd().endsWith("."))continue;if(i6.has(j))continue;if(Z.has(j)||X?.has(j))Y=!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(Q))!==null){let j=U[1];if(Q.slice(0,U.index).trimEnd().endsWith("."))continue;if(i6.has(j)||J&&j in J)continue;z=!0}return(Y||z)&&!G}function k9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,"&quot;")}"`,Q=$.trim(),Y=Q.match(e6);if(Y&&UG(Y[3],Y[1])){let[,G,z,q]=Y;return`<${G}${z}${X}>${q}</${G}>`}return`<template${X}>${Q}</template>`}function UG($,Z){let J=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),X=0,Q;while((Q=J.exec($))!==null)if(Q[1]){if(X--,X<0)return!1}else X++;return!0}function Z8($,Z){let J=qG($);function X(Q){let Y=Q,G=KG(Q),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},q=/@if\s*\(/g,K,W=[];while((K=q.exec(Y))!==null){let U=K.index,H=U+K[0].length,j=1,B=H;while(B<Y.length&&j>0){if(Y[B]==="(")j++;else if(Y[B]===")")j--;B++}if(j!==0)continue;let V=Y.substring(H,B-1).trim(),F=B,L=1,O=F,_=/@(if\s*\(|endif)/g;_.lastIndex=F;let w;while((w=_.exec(Y))!==null)if(w[1].startsWith("if"))L++;else if(w[1]==="endif"){if(L--,L===0){O=w.index+w[0].length;break}}if(L!==0)continue;let R=Y.substring(F,O-6).trim(),N;if(zG(R)){let A=V2(Y.substring(U,O));if(A.length===0)continue;let k=A[0].branches.filter((M)=>M.type!=="else"),D=z(U);if(!(k.length>0&&k.every((M)=>n6(M.condition,J,Z,D))))continue;N=A[0].branches.map((M)=>{let E=X(M.content);if(M.type==="elseif")return k9(E,"@else-if",M.condition??"");if(M.type==="else")return k9(E,"@else");return k9(E,"@if",M.condition??"")}).join(`
3530
+ `)}else{if(!n6(V,J,Z,z(U)))continue;N=k9(X(R),"@if",V)}W.push({start:U,end:O,replacement:N}),q.lastIndex=O}for(let U=W.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=W[U];Y=Y.substring(0,H)+B+Y.substring(j)}return Y}return X($)}function HG($){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 Q=Number(Z);return Q!==0&&!Number.isNaN(Q)}let J=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(J)return J[1].length>0;let X=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(X)return X[1].length>0;return}var E9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),s6=/<(script|style)\b/iy,jG=/<\/script/gi,BG=/<\/style/gi;function J8($,Z,J,X){if(E9.has(J.toLowerCase()))return X;let Q=J.toLowerCase(),Y=$.length,G=1,z=X;while(z<Y){let q=$.indexOf("<",z);if(q===-1)return-1;if(z=q,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}s6.lastIndex=z;let K=s6.exec($);if(K){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=K[1].toLowerCase()==="script"?jG:BG;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()===Q){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()===Q){let H=$.slice(z,U+1);if(!(/\/\s*>$/.test(H)||E9.has(Q)))G++}z=U+1}return-1}var VG=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function _G($,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 Q=$.indexOf(">",J);if(Q===-1)return!1;let Y=$.slice(J,Q+1);return VG.test(Y)}function X8($){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 Q=(U)=>Z.some(([H,j])=>U>=H&&U<j),Y=/<([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=Y.exec($))!==null){if(Q(z.index))continue;let[U,H,j,B,V,F,L]=z,O=HG(V);if(O===void 0)continue;let _=z.index,w=_+U.length,A=!!L||/\/\s*>$/.test(U)||E9.has(H.toLowerCase())?w:J8($,_,H,w);if(A===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&_G($,A)){Y.lastIndex=w;continue}if(O===!0){let D=`<${H}${j}${F}${L}>`;G.push({start:_,end:w,replacement:D});continue}G.push({start:_,end:A,replacement:""}),Y.lastIndex=A}if(G.length===0)return $;G.sort((U,H)=>U.start-H.start);let q=[],K=-1;for(let U of G){if(U.start<K)continue;q.push(U),K=U.end}let W=$;for(let U=q.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=q[U];W=W.substring(0,H)+B+W.substring(j)}return W}function y$($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Q,Y=[],G=[];while((Q=X.exec(J))!==null){let z=Q[1],q=Q.index,K=q+Q[0].length,W=1,U=K;while(U<J.length&&W>0){if(J[U]==="(")W++;else if(J[U]===")")W--;U++}if(W!==0)continue;let H=J.substring(K,U-1).trim(),j=U,B=$8(H),V=z==="for"?"@endfor":"@endforeach",F=1,L=j,O=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");O.lastIndex=j;let _;while((_=O.exec(J))!==null)if(_[1].startsWith(z))F++;else if(F--,F===0){L=_.index+_[0].length;break}if(F!==0)continue;let w=()=>{let I=[B.itemVar,B.indexVar].filter(Boolean);if(I.length)G.push({start:q,end:L,vars:I})};if(B.iterable){let I=B.iterable.trim();if(I.startsWith("[")||I.startsWith("{")||I.startsWith("'")||I.startsWith('"')||I.startsWith("`")||/^-?\d/.test(I)){w();continue}let T=I.split(/[.[(]/)[0].trim(),M=Z?T in Z:!1,E=G.some((C)=>q>C.start&&q<C.end&&C.vars.includes(T));if(T&&(M||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(),N=Z?{...Z}:{};if(B.itemVar)delete N[B.itemVar];if(B.indexVar)delete N[B.indexVar];let A=y$(R,N),k=A.match(e6),D;if(k){let[,I,T,M]=k;D=`<${I}${T} @for="${H}">${M}</${I}>`}else D=`<template @for="${H}">${A}</template>`;Y.push({start:q,end:L,replacement:D}),X.lastIndex=L}for(let z=Y.length-1;z>=0;z--){let{start:q,end:K,replacement:W}=Y[z];J=J.substring(0,q)+W+J.substring(K)}return J}function LG($){let Z=new Set,J=[],X=0,Q=0,Y=$.length,G=(W)=>{let U=X+1;while(U<Y){let H=$[U];if(H==="\\"){U+=2;continue}if(H===W)return U+1;U++}return Y},z=()=>{let W=X+2;while(W<Y&&$[W]!==`
3531
3531
  `)W++;return W},q=()=>{let W=X+2;while(W<Y-1){if($[W]==="*"&&$[W+1]==="/")return W+2;W++}return Y},K=(W)=>{let U=W,H=0;while(U<Y){let j=$[U];if(j==="/"&&$[U+1]==="/"){let B=U+2;while(B<Y&&$[B]!==`
3532
- `)B++;U=B;continue}if(j==="/"&&$[U+1]==="*"){let B=U+2;while(B<Y-1&&!($[B]==="*"&&$[B+1]==="/"))B++;U=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=U+1;while(B<Y){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 Y};while(X<Y){let W=$[X];if(W==="/"&&$[X+1]==="/"){let U=z();J.push($.slice(X,U)),X=U;continue}if(W==="/"&&$[X+1]==="*"){let U=q();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==="{"){Q++,J.push(W),X++;continue}if(W==="}"){Q--,J.push(W),X++;continue}if(Q===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=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(W),X++}return J.join("")}var LG=new Set(["script","style","html","head","meta","link","title","!doctype"]);function T$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function OG($,Z,J){let X=0;while(X<$.length){let Q=$.indexOf(Z,X);if(Q===-1)return!1;if(!T$(Q,Q+Z.length,J))return!0;X=Q+Z.length}return!1}function FG($,Z){if(OG($,"<body",Z)){let Q=new RegExp(`<body(${k$})>`,"g"),Y;while((Y=Q.exec($))!==null)if(!T$(Y.index,Y.index+Y[0].length,Z))return Y.index+Y[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${k$})>`,"gi"),X;while((X=J.exec($))!==null){if(T$(X.index,X.index+X[0].length,Z))continue;if(LG.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function wG($,Z,J,X){let Q=[],Y=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Q.push($.slice(G,J),Y,$.slice(J,K)),z=!0;else Q.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Q.join("")}async function RG($,Z,J){let X=QG($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Q=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|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*\(/,Y=[],{hasUserImports:G,bundleClientScript:z}=await a("stx/client-script-bundler",()=>import("./chunk-j3m3ydzv.js"));for(let O of X){let _=O.body;if(M1(O.attrs))_=I1(_);if(Q.test(_)){Y.push({content:_,start:O.start,end:O.end});continue}if(!G(_))continue;try{let w=await z(t1(_).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Q.test(w))Y.push({content:_,start:O.start,end:O.end})}catch{}}if(Y.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Y.map((O)=>O.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,W=[];for(let O=0;O<Y.length;O++){let _=Y[O].bundled??t1(Y[O].content).code;if(!Y[O].bundled&&G(_))_=await z(_,Z||"",{projectRoot:process.cwd()});_=MG(_);let w=Z1(_);W.push(`// \u2500\u2500 merged signal script #${O+1} \u2500\u2500
3532
+ `)B++;U=B;continue}if(j==="/"&&$[U+1]==="*"){let B=U+2;while(B<Y-1&&!($[B]==="*"&&$[B+1]==="/"))B++;U=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=U+1;while(B<Y){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 Y};while(X<Y){let W=$[X];if(W==="/"&&$[X+1]==="/"){let U=z();J.push($.slice(X,U)),X=U;continue}if(W==="/"&&$[X+1]==="*"){let U=q();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==="{"){Q++,J.push(W),X++;continue}if(W==="}"){Q--,J.push(W),X++;continue}if(Q===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=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(W),X++}return J.join("")}var OG=new Set(["script","style","html","head","meta","link","title","!doctype"]);function T$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function FG($,Z,J){let X=0;while(X<$.length){let Q=$.indexOf(Z,X);if(Q===-1)return!1;if(!T$(Q,Q+Z.length,J))return!0;X=Q+Z.length}return!1}function wG($,Z){if(FG($,"<body",Z)){let Q=new RegExp(`<body(${k$})>`,"g"),Y;while((Y=Q.exec($))!==null)if(!T$(Y.index,Y.index+Y[0].length,Z))return Y.index+Y[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${k$})>`,"gi"),X;while((X=J.exec($))!==null){if(T$(X.index,X.index+X[0].length,Z))continue;if(OG.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function RG($,Z,J,X){let Q=[],Y=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Q.push($.slice(G,J),Y,$.slice(J,K)),z=!0;else Q.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Q.join("")}async function NG($,Z,J){let X=GG($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Q=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|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*\(/,Y=[],{hasUserImports:G,bundleClientScript:z}=await a("stx/client-script-bundler",()=>import("./chunk-858xqty6.js"));for(let O of X){let _=O.body;if(M1(O.attrs))_=I1(_);if(Q.test(_)){Y.push({content:_,start:O.start,end:O.end});continue}if(!G(_))continue;try{let w=await z(t1(_).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Q.test(w))Y.push({content:_,start:O.start,end:O.end})}catch{}}if(Y.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Y.map((O)=>O.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,W=[];for(let O=0;O<Y.length;O++){let _=Y[O].bundled??t1(Y[O].content).code;if(!Y[O].bundled&&G(_))_=await z(_,Z||"",{projectRoot:process.cwd()});_=IG(_);let w=Z1(_);W.push(`// \u2500\u2500 merged signal script #${O+1} \u2500\u2500
3533
3533
  ${w}`)}let U=W.join(`
3534
3534
 
3535
- `);U=_G(U);let H=NG(U),j=H.split(",").map((O)=>O.trim()).filter(Boolean),B=E$(U,J),V=`
3535
+ `);U=LG(U);let H=DG(U),j=H.split(",").map((O)=>O.trim()).filter(Boolean),B=E$(U,J),V=`
3536
3536
  <script data-stx-scoped>
3537
3537
  function ${K}() {
3538
3538
  ${i1("const",j)}
@@ -3541,19 +3541,19 @@ ${a1(`${B}${U}`)}
3541
3541
  }
3542
3542
  window.__stx_latestSetup=${K};
3543
3543
  if(window.stx)window.stx._latestSetup=${K};
3544
- </script>`,F=FG($,Y);return{output:wG($,Y,F,K),setupCode:V}}function NG($){let Z=$,J=[],X=new Set,Q=0,Y=0,G=Z.length,z="",q=()=>{Y++;let B=!1;while(Y<G){let V=Z[Y];if(V==="\\"){Y+=2;continue}if(V==="["&&!B){B=!0,Y++;continue}if(V==="]"&&B){B=!1,Y++;continue}if(V==="/"&&!B){Y++;while(Y<G&&/[gimsuyd]/.test(Z[Y]))Y++;return}if(V===`
3544
+ </script>`,F=wG($,Y);return{output:RG($,Y,F,K),setupCode:V}}function DG($){let Z=$,J=[],X=new Set,Q=0,Y=0,G=Z.length,z="",q=()=>{Y++;let B=!1;while(Y<G){let V=Z[Y];if(V==="\\"){Y+=2;continue}if(V==="["&&!B){B=!0,Y++;continue}if(V==="]"&&B){B=!1,Y++;continue}if(V==="/"&&!B){Y++;while(Y<G&&/[gimsuyd]/.test(Z[Y]))Y++;return}if(V===`
3545
3545
  `)return;Y++}},K=()=>{if(!z)return!0;if(/[\w)\]]/.test(z))return!1;return!0},W=(B)=>{Y++;while(Y<G){if(Z[Y]==="\\"){Y+=2;continue}if(Z[Y]===B){Y++;return}Y++}},U=()=>{Y++;while(Y<G){if(Z[Y]==="\\"){Y+=2;continue}if(Z[Y]==="`"){Y++;return}if(Z[Y]==="$"&&Z[Y+1]==="{"){Y+=2;let B=1;while(Y<G&&B>0)if(Z[Y]==="{")B++,Y++;else if(Z[Y]==="}")B--,Y++;else if(Z[Y]==="'"||Z[Y]==='"')W(Z[Y]);else if(Z[Y]==="`")U();else Y++;continue}Y++}},H=()=>{if(Z[Y]==="/"&&Z[Y+1]==="/"){while(Y<G&&Z[Y]!==`
3546
- `)Y++;return!0}if(Z[Y]==="/"&&Z[Y+1]==="*"){Y+=2;while(Y<G-1&&!(Z[Y]==="*"&&Z[Y+1]==="/"))Y++;return Y+=2,!0}return!1},j=()=>{if(Q!==0)return;let B=Z.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(B){let _=B[2];if(!X.has(_))J.push(_),X.add(_);return}let V=Z.slice(Y).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(V){V[1].split(",").forEach((_)=>{let w=_.trim();if(!w)return;let R=w.indexOf(":"),A=(R>=0?w.slice(R+1).trim():w).split(/[\s=]/)[0];if(A&&!X.has(A))J.push(A),X.add(A)});return}let F=Z.slice(Y).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(F){F[1].split(",").forEach((_)=>{let w=_.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(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let _=L[1];if(!X.has(_))J.push(_),X.add(_);return}let O=Z.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let _=O[1];if(!X.has(_))J.push(_),X.add(_)}};while(Y<G){if(H())continue;if(Z[Y]==="'"||Z[Y]==='"'){W(Z[Y]),z=Z[Y-1];continue}if(Z[Y]==="`"){U(),z="`";continue}if(Z[Y]==="/"&&Z[Y+1]!=="/"&&Z[Y+1]!=="*"&&K()){q(),z="/";continue}if(Z[Y]==="{"){Q++,z="{",Y++;continue}if(Z[Y]==="}"){Q--,z="}",Y++;continue}if(Q===0&&/[a-z]/i.test(Z[Y])&&(Y===0||/\s|[;{}()]/.test(Z[Y-1])))j();if(!/\s/.test(Z[Y]))z=Z[Y];Y++}return J.join(", ")}async function Y8($,Z,J,X){if(!b$($,J))return $;let Q=$;if(Z.skipSignalsRuntime)return Q;let{output:Y,setupCode:G}=await RG(Q,J,X);if(Q=Y,!G){let z=s0(Q);if(z&&!/data-stx/.test(z.attrs)&&!/data-stx-auto/.test(z.attrs)){let q=z.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");Q=Q.slice(0,z.index)+q+Q.slice(z.index+z.tag.length)}}if(Q=await I9(Q,Z),G){let z=o6(Q,/<\/head>/i),q=z===-1?o6(Q,/<body[^>]*>/i):-1;if(z!==-1)Q=`${Q.slice(0,z)}${G}
3546
+ `)Y++;return!0}if(Z[Y]==="/"&&Z[Y+1]==="*"){Y+=2;while(Y<G-1&&!(Z[Y]==="*"&&Z[Y+1]==="/"))Y++;return Y+=2,!0}return!1},j=()=>{if(Q!==0)return;let B=Z.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(B){let _=B[2];if(!X.has(_))J.push(_),X.add(_);return}let V=Z.slice(Y).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(V){V[1].split(",").forEach((_)=>{let w=_.trim();if(!w)return;let R=w.indexOf(":"),A=(R>=0?w.slice(R+1).trim():w).split(/[\s=]/)[0];if(A&&!X.has(A))J.push(A),X.add(A)});return}let F=Z.slice(Y).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(F){F[1].split(",").forEach((_)=>{let w=_.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(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let _=L[1];if(!X.has(_))J.push(_),X.add(_);return}let O=Z.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let _=O[1];if(!X.has(_))J.push(_),X.add(_)}};while(Y<G){if(H())continue;if(Z[Y]==="'"||Z[Y]==='"'){W(Z[Y]),z=Z[Y-1];continue}if(Z[Y]==="`"){U(),z="`";continue}if(Z[Y]==="/"&&Z[Y+1]!=="/"&&Z[Y+1]!=="*"&&K()){q(),z="/";continue}if(Z[Y]==="{"){Q++,z="{",Y++;continue}if(Z[Y]==="}"){Q--,z="}",Y++;continue}if(Q===0&&/[a-z]/i.test(Z[Y])&&(Y===0||/\s|[;{}()]/.test(Z[Y-1])))j();if(!/\s/.test(Z[Y]))z=Z[Y];Y++}return J.join(", ")}async function Y8($,Z,J,X){if(!b$($,J))return $;let Q=$;if(Z.skipSignalsRuntime)return Q;let{output:Y,setupCode:G}=await NG(Q,J,X);if(Q=Y,!G){let z=s0(Q);if(z&&!/data-stx/.test(z.attrs)&&!/data-stx-auto/.test(z.attrs)){let q=z.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");Q=Q.slice(0,z.index)+q+Q.slice(z.index+z.tag.length)}}if(Q=await I9(Q,Z),G){let z=o6(Q,/<\/head>/i),q=z===-1?o6(Q,/<body[^>]*>/i):-1;if(z!==-1)Q=`${Q.slice(0,z)}${G}
3547
3547
  ${Q.slice(z)}`;else if(q!==-1){let K=/<body[^>]*>/i.exec(Q.slice(q))[0],W=q+K.length;Q=`${Q.slice(0,W)}
3548
3548
  ${G}${Q.slice(W)}`}else Q=`${Q}
3549
- ${G}`}return Q}function o6($,Z){let J=/<(script|style)\b[\s\S]*?<\/\1>/gi,X=[],Q;while((Q=J.exec($))!==null)X.push([Q.index,Q.index+Q[0].length]);let Y=new RegExp(Z.source,Z.flags.replace(/[gy]/g,"")),G=0;while(G<$.length){let z=Y.exec($.slice(G));if(!z)return-1;let q=G+z.index;if(!X.some(([W,U])=>q>=W&&q<U))return q;G=q+Math.max(z[0].length,1)}return-1}var r6="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function DG($){let Z=[];for(let J of $.split(",")){let X=J.trim();if(!X||X.startsWith("type "))continue;let Q=X.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(Q&&Q[1]!==Q[2])Z.push(`${Q[2]} = ${Q[1]}`)}if(Z.length===0)return r6;return`var ${Z.join(", ")}; ${r6}`}var AG=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function MG($){return $.replace(AG,(Z,J)=>DG(J))}import $2 from"path";import Q8 from"process";function e1($="STX_PUBLIC_"){let Z={},J={};for(let[X,Q]of Object.entries(Q8.env)){if(!X.startsWith($)||Q===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(Q),J[X]=Q}return Z["import.meta.env"]=JSON.stringify(J),Z}function tB($="STX_PUBLIC_"){let Z={};for(let[J,X]of Object.entries(Q8.env))if(J.startsWith($)&&X!==void 0)Z[J]=X;return Z}function G8($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function z8($,Z,J){try{let X;if($.startsWith("/")){let Q=Z;for(let Y=0;Y<5;Y++){let G=$2.join(Q,$);if(await Bun.file(G).exists())return G;Q=$2.dirname(Q)}X=$2.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))X=$2.resolve(Z,$);else X=$2.resolve(Z,$);if(await Bun.file(X).exists())return X;return null}catch{return null}}var q8=Symbol.for("stx.inline-assets.import-meta");function IG($,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.
3550
- `+" `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[q8]=!0,J}async function K8($,Z,J){let X=$,Q=$2.dirname(Z),Y=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Y.exec(X))!==null){let[K,W,U,H]=G;if(G8(U))continue;let j=await z8(U,Q,Z);if(j)try{let B=await Bun.file(j).text();if(J.add(j),U.endsWith(".ts")||U.endsWith(".tsx")){let F=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:e1()});if(F.outputs.length>0)B=await F.outputs[0].text(),IG(B,U)}let V=`<script>
3549
+ ${G}`}return Q}function o6($,Z){let J=/<(script|style)\b[\s\S]*?<\/\1>/gi,X=[],Q;while((Q=J.exec($))!==null)X.push([Q.index,Q.index+Q[0].length]);let Y=new RegExp(Z.source,Z.flags.replace(/[gy]/g,"")),G=0;while(G<$.length){let z=Y.exec($.slice(G));if(!z)return-1;let q=G+z.index;if(!X.some(([W,U])=>q>=W&&q<U))return q;G=q+Math.max(z[0].length,1)}return-1}var r6="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function AG($){let Z=[];for(let J of $.split(",")){let X=J.trim();if(!X||X.startsWith("type "))continue;let Q=X.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(Q&&Q[1]!==Q[2])Z.push(`${Q[2]} = ${Q[1]}`)}if(Z.length===0)return r6;return`var ${Z.join(", ")}; ${r6}`}var MG=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function IG($){return $.replace(MG,(Z,J)=>AG(J))}import $2 from"path";import Q8 from"process";function e1($="STX_PUBLIC_"){let Z={},J={};for(let[X,Q]of Object.entries(Q8.env)){if(!X.startsWith($)||Q===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(Q),J[X]=Q}return Z["import.meta.env"]=JSON.stringify(J),Z}function eB($="STX_PUBLIC_"){let Z={};for(let[J,X]of Object.entries(Q8.env))if(J.startsWith($)&&X!==void 0)Z[J]=X;return Z}function G8($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function z8($,Z,J){try{let X;if($.startsWith("/")){let Q=Z;for(let Y=0;Y<5;Y++){let G=$2.join(Q,$);if(await Bun.file(G).exists())return G;Q=$2.dirname(Q)}X=$2.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))X=$2.resolve(Z,$);else X=$2.resolve(Z,$);if(await Bun.file(X).exists())return X;return null}catch{return null}}var q8=Symbol.for("stx.inline-assets.import-meta");function kG($,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.
3550
+ `+" `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[q8]=!0,J}async function K8($,Z,J){let X=$,Q=$2.dirname(Z),Y=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Y.exec(X))!==null){let[K,W,U,H]=G;if(G8(U))continue;let j=await z8(U,Q,Z);if(j)try{let B=await Bun.file(j).text();if(J.add(j),U.endsWith(".ts")||U.endsWith(".tsx")){let F=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:e1()});if(F.outputs.length>0)B=await F.outputs[0].text(),kG(B,U)}let V=`<script>
3551
3551
  // Source: ${U}
3552
3552
  ${B}
3553
3553
  </script>`;X=X.replace(K,V),Y.lastIndex=0}catch(B){if(B?.[q8])throw B}}let z=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,q;while((q=z.exec(X))!==null){let[K,W,U,H]=q,j=W+H;if(G8(U))continue;if(/rel=["']stylesheet["']/.test(j)||U.endsWith(".css")){let V=await z8(U,Q,Z);if(V)try{let F=await Bun.file(V).text();J.add(V);let L=`<style>
3554
3554
  /* Source: ${U} */
3555
3555
  ${F}
3556
- </style>`;X=X.replace(K,L),z.lastIndex=0}catch(F){}}}return X}function C$($,Z){let J=$,X=/@json\s*\(/g,Q;while((Q=X.exec(J))!==null){let Y=Q.index,G=Y+Q[0].length-1,z=1,q=G+1,K=null,W=!1;while(q<J.length&&z>0){let _=J[q];if(W){W=!1,q++;continue}if(_==="\\"&&K){W=!0,q++;continue}if(K){if(_===K)K=null;q++;continue}if(_==='"'||_==="'"||_==="`"){K=_,q++;continue}if(_==="(")z++;else if(_===")"){if(z--,z===0)break}q++}if(z!==0)break;let U=J.substring(G+1,q).trim(),H=J.substring(Y,q+1),j=-1,B=0,V=null,F=!1;for(let _=0;_<U.length;_++){let w=U[_];if(F){F=!1;continue}if(w==="\\"&&V){F=!0;continue}if(V){if(w===V)V=null;continue}if(w==='"'||w==="'"||w==="`"){V=w;continue}if(w==="("||w==="["||w==="{")B++;else if(w===")"||w==="]"||w==="}")B--;if(w===","&&B===0){j=_;break}}let L=j>=0?U.substring(0,j).trim():U,O=j>=0?U.substring(j+1).trim():void 0;try{let _=L.trim(),w;if(B0(_))w=H0(_,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(O==="true")R=JSON.stringify(w,null,2);else R=JSON.stringify(w);let N=R.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");J=J.substring(0,Y)+N+J.substring(q+1),X.lastIndex=Y+N.length}catch(_){r0.log(_ instanceof Error?_:Error(String(_)),{directive:"@json"},"error"),X.lastIndex=Y+H.length}}return J}function S$($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function H8($){let Z=$,J=/@memo\s*\(/g,X,Q=[];while((X=J.exec(Z))!==null){let Y=X.index,G=Y+X[0].length,z=1,q=G;while(q<Z.length&&z>0){if(Z[q]==="(")z++;else if(Z[q]===")")z--;q++}if(z!==0)continue;let K=Z.slice(G,q-1).trim(),W=q,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*)*)/),F=V?V[0].length:0,L=j.slice(F),O=j.match(/(\s*)$/),_=O?O[0].length:0,w=L.slice(0,L.length-_),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),N;if(R){let[A,k,D="",I]=R,T=`<${k}${D} data-stx-memo="${K}"${I}>`;N=j.slice(0,F)+T+w.slice(A.length)+j.slice(F+w.length)}else N=`${j.slice(0,F)}<div data-stx-memo="${K}">${w}</div>${j.slice(F+w.length)}`;Q.push({start:Y,end:B,replacement:N}),J.lastIndex=B}for(let Y=Q.length-1;Y>=0;Y--){let G=Q[Y];Z=Z.slice(0,G.start)+G.replacement+Z.slice(G.end)}return Z.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function P$($){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 j8($,Z){if(!/\bref\s*=/.test($))return $;let J=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,X=T2($,(q,K)=>{J.lastIndex=K;let W=J.exec(q);if(!W||/^(?:script|style)$/i.test(W[1]))return-1;return J.lastIndex}),Q=[],Y=0,G=0,z=[];for(let{start:q,end:K,token:W}of X){let U=/^<\/?([\w-]+)/.exec(W)[1].toLowerCase();if(W.startsWith("</")){let j;while(j=Q.pop()){if(j.scoped)Y--;if(j.name===U)break}continue}let H=/\sdata-stx-scope\s*=/.test(W);if(!Y&&!H&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(W)&&!/\sdata-stx-ref-caller\s*=/.test(W))z.push($.slice(G,q),W.replace(/\s*\/?>$/,(j)=>` data-stx-ref-caller="${Z}"${j}`)),G=K;if(!B8.has(U)&&!/\/>$/.test(W)){if(Q.push({name:U,scoped:H}),H)Y++}}return z.push($.slice(G)),z.join("")}var B8=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),V8=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,W8=/<\/?\s*([a-z][\w-]*)/iy,kG=/\s/;function TG($,Z){let J=Z-1;while(J>=0&&kG.test($[J]))J--;return J>=0&&$[J]==="/"}function EG($,Z){let J=!1,X=!1;for(let Q=Z;Q<$.length;Q++){let Y=$[Q];if(J){if(Y==="'")J=!1}else if(X){if(Y==='"')X=!1}else if(Y==="'")J=!0;else if(Y==='"')X=!0;else if(Y===">")return Q}return-1}function bG($,Z){if($.indexOf("{",Z)===-1||$.indexOf("}",Z)===-1)return!1;let J=0,X=Z,Q=!1,Y=!1,G=!1;while(X<$.length){let z=$.indexOf("<",X),q=z===-1?$.length:z;if(q>X){if(J===0)while(X<q){let U=$.indexOf(Y?"}":"{",X);if(U===-1||U>=q){if(Y)G=!1;else Q=!1;break}if(U>X)if(Y)G=!1;else Q=!1;if(Y){if(G)return!0;G=!0}else if(Q)Y=!0,G=!1;else Q=!0;X=U+1}X=q;continue}if($.startsWith("<!--",X)){let U=$.indexOf("-->",X);X=U===-1?$.length:U+3;continue}let K=EG($,X);if(K===-1)break;W8.lastIndex=X;let W=W8.exec($)?.[1]?.toLowerCase()??"";if($[X+1]==="/"){if(J===0)break;J--}else if(!TG($,K)&&!B8.has(W))J++;X=K+1}return!1}function _8($){if($.length>=32768&&!U8($))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="",Q=0,Y;while((Y=J.exec($))!==null){let G=Y.index,z=G+Y[0].length,q=!1,K=!1,W=-1;while(z<$.length){let H=$[z];if(q){if(H==="'")q=!1}else if(K){if(H==='"')K=!1}else if(H==="'")q=!0;else if(H==='"')K=!0;else if(H===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(G,W+1);if(V8.test(U))continue;if(U.includes("x-cloak"))continue;if(bG($,W+1))X+=$.slice(Q,W)+" x-cloak>",Q=W+1}return X+=$.slice(Q),X}var yG=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,CG=/<\/script>/gi,SG=/<\/style>/gi;function L8($){let Z=/<[a-z][\w-]*/gi,J="",X=0,Q;while((Q=Z.exec($))!==null){let Y=Q.index,G=Q[0].slice(1).toLowerCase();if(G==="script"||G==="style"){let B=G==="script"?CG:SG;B.lastIndex=Y;let V=B.exec($);if(V!==null)Z.lastIndex=V.index+V[0].length;continue}let z=Y+Q[0].length,q=!1,K=!1,W=-1;while(z<$.length){let B=$[z];if(q){if(B==="'")q=!1}else if(K){if(B==='"')K=!1}else if(B==="'")q=!0;else if(B==='"')K=!0;else if(B===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(Y+Q[0].length,W);if(V8.test(U))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(U))continue;if(!yG.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 v$=E1(256),PG=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}];function f$($,Z,J,X){let Q=typeof J==="boolean"?{enabled:J,failOnViolation:J}:J??{enabled:!1};if(!Q.enabled)return;let Y=H1($,Z,X,JSON.stringify(Q)),G=v$.get(Y);if(G!==void 0){if(G&&Q.failOnViolation)throw Error(G);return}let z=Q.allowPatterns??[],q=[],K=g0($.replace(/\{\{--[\s\S]*?--\}\}/g,(j)=>j.replace(/[^\n]/g," ")));for(let{pattern:j,message:B,suggestion:V}of PG){if(z.some((L)=>/\w/.test(L)&&B.includes(L)))continue;j.lastIndex=0;let F=K.match(j);if(F&&F.length>0){let L=K.split(`
3556
+ </style>`;X=X.replace(K,L),z.lastIndex=0}catch(F){}}}return X}function C$($,Z){let J=$,X=/@json\s*\(/g,Q;while((Q=X.exec(J))!==null){let Y=Q.index,G=Y+Q[0].length-1,z=1,q=G+1,K=null,W=!1;while(q<J.length&&z>0){let _=J[q];if(W){W=!1,q++;continue}if(_==="\\"&&K){W=!0,q++;continue}if(K){if(_===K)K=null;q++;continue}if(_==='"'||_==="'"||_==="`"){K=_,q++;continue}if(_==="(")z++;else if(_===")"){if(z--,z===0)break}q++}if(z!==0)break;let U=J.substring(G+1,q).trim(),H=J.substring(Y,q+1),j=-1,B=0,V=null,F=!1;for(let _=0;_<U.length;_++){let w=U[_];if(F){F=!1;continue}if(w==="\\"&&V){F=!0;continue}if(V){if(w===V)V=null;continue}if(w==='"'||w==="'"||w==="`"){V=w;continue}if(w==="("||w==="["||w==="{")B++;else if(w===")"||w==="]"||w==="}")B--;if(w===","&&B===0){j=_;break}}let L=j>=0?U.substring(0,j).trim():U,O=j>=0?U.substring(j+1).trim():void 0;try{let _=L.trim(),w;if(B0(_))w=H0(_,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(O==="true")R=JSON.stringify(w,null,2);else R=JSON.stringify(w);let N=R.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");J=J.substring(0,Y)+N+J.substring(q+1),X.lastIndex=Y+N.length}catch(_){r0.log(_ instanceof Error?_:Error(String(_)),{directive:"@json"},"error"),X.lastIndex=Y+H.length}}return J}function S$($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function H8($){let Z=$,J=/@memo\s*\(/g,X,Q=[];while((X=J.exec(Z))!==null){let Y=X.index,G=Y+X[0].length,z=1,q=G;while(q<Z.length&&z>0){if(Z[q]==="(")z++;else if(Z[q]===")")z--;q++}if(z!==0)continue;let K=Z.slice(G,q-1).trim(),W=q,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*)*)/),F=V?V[0].length:0,L=j.slice(F),O=j.match(/(\s*)$/),_=O?O[0].length:0,w=L.slice(0,L.length-_),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),N;if(R){let[A,k,D="",I]=R,T=`<${k}${D} data-stx-memo="${K}"${I}>`;N=j.slice(0,F)+T+w.slice(A.length)+j.slice(F+w.length)}else N=`${j.slice(0,F)}<div data-stx-memo="${K}">${w}</div>${j.slice(F+w.length)}`;Q.push({start:Y,end:B,replacement:N}),J.lastIndex=B}for(let Y=Q.length-1;Y>=0;Y--){let G=Q[Y];Z=Z.slice(0,G.start)+G.replacement+Z.slice(G.end)}return Z.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function P$($){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 j8($,Z){if(!/\bref\s*=/.test($))return $;let J=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,X=T2($,(q,K)=>{J.lastIndex=K;let W=J.exec(q);if(!W||/^(?:script|style)$/i.test(W[1]))return-1;return J.lastIndex}),Q=[],Y=0,G=0,z=[];for(let{start:q,end:K,token:W}of X){let U=/^<\/?([\w-]+)/.exec(W)[1].toLowerCase();if(W.startsWith("</")){let j;while(j=Q.pop()){if(j.scoped)Y--;if(j.name===U)break}continue}let H=/\sdata-stx-scope\s*=/.test(W);if(!Y&&!H&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(W)&&!/\sdata-stx-ref-caller\s*=/.test(W))z.push($.slice(G,q),W.replace(/\s*\/?>$/,(j)=>` data-stx-ref-caller="${Z}"${j}`)),G=K;if(!B8.has(U)&&!/\/>$/.test(W)){if(Q.push({name:U,scoped:H}),H)Y++}}return z.push($.slice(G)),z.join("")}var B8=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),V8=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,W8=/<\/?\s*([a-z][\w-]*)/iy,TG=/\s/;function EG($,Z){let J=Z-1;while(J>=0&&TG.test($[J]))J--;return J>=0&&$[J]==="/"}function bG($,Z){let J=!1,X=!1;for(let Q=Z;Q<$.length;Q++){let Y=$[Q];if(J){if(Y==="'")J=!1}else if(X){if(Y==='"')X=!1}else if(Y==="'")J=!0;else if(Y==='"')X=!0;else if(Y===">")return Q}return-1}function yG($,Z){if($.indexOf("{",Z)===-1||$.indexOf("}",Z)===-1)return!1;let J=0,X=Z,Q=!1,Y=!1,G=!1;while(X<$.length){let z=$.indexOf("<",X),q=z===-1?$.length:z;if(q>X){if(J===0)while(X<q){let U=$.indexOf(Y?"}":"{",X);if(U===-1||U>=q){if(Y)G=!1;else Q=!1;break}if(U>X)if(Y)G=!1;else Q=!1;if(Y){if(G)return!0;G=!0}else if(Q)Y=!0,G=!1;else Q=!0;X=U+1}X=q;continue}if($.startsWith("<!--",X)){let U=$.indexOf("-->",X);X=U===-1?$.length:U+3;continue}let K=bG($,X);if(K===-1)break;W8.lastIndex=X;let W=W8.exec($)?.[1]?.toLowerCase()??"";if($[X+1]==="/"){if(J===0)break;J--}else if(!EG($,K)&&!B8.has(W))J++;X=K+1}return!1}function _8($){if($.length>=32768&&!U8($))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="",Q=0,Y;while((Y=J.exec($))!==null){let G=Y.index,z=G+Y[0].length,q=!1,K=!1,W=-1;while(z<$.length){let H=$[z];if(q){if(H==="'")q=!1}else if(K){if(H==='"')K=!1}else if(H==="'")q=!0;else if(H==='"')K=!0;else if(H===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(G,W+1);if(V8.test(U))continue;if(U.includes("x-cloak"))continue;if(yG($,W+1))X+=$.slice(Q,W)+" x-cloak>",Q=W+1}return X+=$.slice(Q),X}var CG=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,SG=/<\/script>/gi,PG=/<\/style>/gi;function L8($){let Z=/<[a-z][\w-]*/gi,J="",X=0,Q;while((Q=Z.exec($))!==null){let Y=Q.index,G=Q[0].slice(1).toLowerCase();if(G==="script"||G==="style"){let B=G==="script"?SG:PG;B.lastIndex=Y;let V=B.exec($);if(V!==null)Z.lastIndex=V.index+V[0].length;continue}let z=Y+Q[0].length,q=!1,K=!1,W=-1;while(z<$.length){let B=$[z];if(q){if(B==="'")q=!1}else if(K){if(B==='"')K=!1}else if(B==="'")q=!0;else if(B==='"')K=!0;else if(B===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(Y+Q[0].length,W);if(V8.test(U))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(U))continue;if(!CG.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 v$=E1(256),vG=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}];function f$($,Z,J,X){let Q=typeof J==="boolean"?{enabled:J,failOnViolation:J}:J??{enabled:!1};if(!Q.enabled)return;let Y=H1($,Z,X,JSON.stringify(Q)),G=v$.get(Y);if(G!==void 0){if(G&&Q.failOnViolation)throw Error(G);return}let z=Q.allowPatterns??[],q=[],K=g0($.replace(/\{\{--[\s\S]*?--\}\}/g,(j)=>j.replace(/[^\n]/g," ")));for(let{pattern:j,message:B,suggestion:V}of vG){if(z.some((L)=>/\w/.test(L)&&B.includes(L)))continue;j.lastIndex=0;let F=K.match(j);if(F&&F.length>0){let L=K.split(`
3557
3557
  `),O=$.split(`
3558
3558
  `),_=[];L.forEach((A,k)=>{if(j.lastIndex=0,j.test(A))_.push(k+1)});let w=_.length>0?` (script line${_.length>1?"s":""} ${_.join(", ")})`:"",R=_.slice(0,3).map((A)=>` ${A} | ${(O[A-1]??"").trim().slice(0,100)}`).join(`
3559
3559
  `),N=R?`
@@ -3561,65 +3561,65 @@ ${R}`:"";q.push(` \u2717 ${B}${w}
3561
3561
  \u2192 ${V}${N}`)}}if(q.length===0){v$.set(Y,"");return}let W=(j)=>{let B=`${process.cwd()}/`;return j.startsWith(B)?j.slice(B.length):j},H=`[STX] DOM API violation in ${X&&X!==Z?`${W(X)} (composed into ${W(Z)})`:W(Z)}:
3562
3562
  ${q.join(`
3563
3563
  `)}
3564
- Tip: prefer useRef(), navigate(), and composables for component code`;if(v$.set(Y,H),Q.failOnViolation)throw Error(H);else console.warn(H)}gG();import x$ from"path";var vG=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,fG=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function xG($,Z){if(!Z||!$.includes("/"))return $;let J=x$.dirname(Z);return $.replace(vG,(X,Q,Y,G)=>{let z=x$.resolve(J,G);return`${Q}${Y}${z.split(x$.sep).join("/")}${Y}`})}function O8($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(fG,(J,X,Q,Y)=>`${X}${xG(Q,Z)}${Y}`)}var b1="<!--PARENT_CONTENT_PLACEHOLDER-->";function F8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function uG($,Z){let J=$.length,X=Z,Q=!0,Y=[],G=(z)=>z+9<=J&&$[z]==="<"&&$[z+1]==="/"&&($[z+2]==="s"||$[z+2]==="S")&&($[z+3]==="c"||$[z+3]==="C")&&($[z+4]==="r"||$[z+4]==="R")&&($[z+5]==="i"||$[z+5]==="I")&&($[z+6]==="p"||$[z+6]==="P")&&($[z+7]==="t"||$[z+7]==="T")&&($[z+8]===">"||/\s/.test($[z+8]));while(X<J){let z=$[X];if(G(X))return X;if(z==="/"&&$[X+1]==="/"){if(X=$.indexOf(`
3564
+ Tip: prefer useRef(), navigate(), and composables for component code`;if(v$.set(Y,H),Q.failOnViolation)throw Error(H);else console.warn(H)}hG();import x$ from"path";var fG=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,xG=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function gG($,Z){if(!Z||!$.includes("/"))return $;let J=x$.dirname(Z);return $.replace(fG,(X,Q,Y,G)=>{let z=x$.resolve(J,G);return`${Q}${Y}${z.split(x$.sep).join("/")}${Y}`})}function O8($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(xG,(J,X,Q,Y)=>`${X}${gG(Q,Z)}${Y}`)}var b1="<!--PARENT_CONTENT_PLACEHOLDER-->";function F8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function dG($,Z){let J=$.length,X=Z,Q=!0,Y=[],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(`
3565
3565
  `,X+2),X===-1)return-1;X+=1,Q=!0;continue}if(z==="/"&&$[X+1]==="*"){let q=$.indexOf("*/",X+2);if(q===-1)return-1;X=q+2,Q=!0;continue}if(z==="/"&&Q){let q=X+1,K=!1;while(q<J){let W=$[q];if(W==="\\"){q+=2;continue}if(W==="[")K=!0;else if(W==="]")K=!1;else if(W==="/"&&!K){q++;break}else if(W===`
3566
3566
  `){q=-1;break}q++}if(q===-1){X++,Q=!1;continue}while(q<J&&/[a-z]/.test($[q]))q++;X=q,Q=!1;continue}if(z==="'"||z==='"'){let q=z;X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]===q){X++;break}if($[X]===`
3567
- `)break;X++}Q=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}if(Y.length===0)Q=!1;continue}if(z==="}"&&Y.length>0){Y.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Q=!1;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Q=!1;else Q=!0;X++}return-1}function P8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Q=X.index+X[0].length,Y=$.indexOf("</script>",Q);if(Y===-1)return null;let G=$.indexOf(">",Y);if(G===-1)return null;return{start:X.index,end:G+1}}async function w8($,Z){try{let{registeredModuleIdsIn:J,buildModuleRegistryScript:X}=await a("stx/client-module-registry",()=>import("./chunk-e27f8tzs.js")),Q=await X(J(...$),{minify:Z.buildMode==="compile"});if(!Q)return null;return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${Q.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function dG($,Z=""){let J=P8($,"data-stx-runtime");if(!J)return $;let X=z2($);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+`
3567
+ `)break;X++}Q=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}if(Y.length===0)Q=!1;continue}if(z==="}"&&Y.length>0){Y.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Q=!1;break}if($[X]==="$"&&$[X+1]==="{"){Y.push(!0),X+=2,Q=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Q=!1;else Q=!0;X++}return-1}function P8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Q=X.index+X[0].length,Y=$.indexOf("</script>",Q);if(Y===-1)return null;let G=$.indexOf(">",Y);if(G===-1)return null;return{start:X.index,end:G+1}}async function w8($,Z){try{let{registeredModuleIdsIn:J,buildModuleRegistryScript:X}=await a("stx/client-module-registry",()=>import("./chunk-cbzb7wa6.js")),Q=await X(J(...$),{minify:Z.buildMode==="compile"});if(!Q)return null;return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${Q.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function mG($,Z=""){let J=P8($,"data-stx-runtime");if(!J)return $;let X=z2($);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+`
3568
3568
  `+$.slice(X,J.start)+$.slice(J.end);let Q=$.slice(J.start,J.end),Y=$.slice(0,J.start)+$.slice(J.end),G=z2(Y);if(G===-1)return Q+Z+`
3569
3569
  `+Y;return Y.slice(0,G)+Q+Z+`
3570
- `+Y.slice(G)}async function h$($,Z,J,X,Q){if(X.ssr===!1&&!X.autoShell&&X.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Y1($,J);let Y=!Z.__stxProcessingDepth;F$(Z);for(let G of X._layerGraph?.configDependencies??[])Q.add(G);if(Y&&X.runtimeConfig)await S9(Z,J,X.runtimeConfig);if(Y)X3(Z),Z.__stx_head_injections=B$(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!L9()&&!O9())&&J&&J.endsWith(".stx"))S8($,J);try{return await E8.timeAsync("template-processing",async()=>{let G=await mG($,Z,J,X,Q);if(Y)G=P$(G);if(Y&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},K=(Z.__stx_runtime_head||null)??C8(),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=K.title||U||j,V=!K.title&&(!!U||!!j),F=K.meta||[],L=new Set(F.map((A)=>r1(A)).filter(Boolean)),O={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((A)=>!L.has(r1(A))),...F],link:[...z.link||[],...K.link||[]],script:[...z.script||[],...K.script||[]],headRaw:[z.headRaw,W].filter(Boolean).join(`
3570
+ `+Y.slice(G)}async function h$($,Z,J,X,Q){if(X.ssr===!1&&!X.autoShell&&X.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Y1($,J);let Y=!Z.__stxProcessingDepth;F$(Z);for(let G of X._layerGraph?.configDependencies??[])Q.add(G);if(Y&&X.runtimeConfig)await S9(Z,J,X.runtimeConfig);if(Y)X3(Z),Z.__stx_head_injections=B$(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!L9()&&!O9())&&J&&J.endsWith(".stx"))S8($,J);try{return await E8.timeAsync("template-processing",async()=>{let G=await lG($,Z,J,X,Q);if(Y)G=P$(G);if(Y&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},K=(Z.__stx_runtime_head||null)??C8(),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=K.title||U||j,V=!K.title&&(!!U||!!j),F=K.meta||[],L=new Set(F.map((A)=>r1(A)).filter(Boolean)),O={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((A)=>!L.has(r1(A))),...F],link:[...z.link||[],...K.link||[]],script:[...z.script||[],...K.script||[]],headRaw:[z.headRaw,W].filter(Boolean).join(`
3571
3571
  `),...K.htmlAttrs&&{htmlAttrs:y6(z.htmlAttrs,K.htmlAttrs)},...K.bodyAttrs&&{bodyAttrs:{...z.bodyAttrs||{},...K.bodyAttrs}}},_=A$(G);if(G=P6(G,O,{...V&&{titleIsHtml:!0},...X.app?.colorMode&&{colorMode:X.app.colorMode}},_),_)G=S6(G,z),G=C6(G,O.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let A=w[1],k=k8(A);G=G.replace(/<head\b[^>]*>/i,(D)=>`${D}
3572
3572
  <meta name="stx-layout" content="${F8(A)}">
3573
- <meta name="stx-layout-group" content="${F8(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),N=R?s0(G):null;if(R&&N&&!/\bdata-stx=/.test(N.tag)){G=C1(G,(k,D)=>`<body${D} data-stx="${R[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(A,"$1")}}if(Y){let z=Z.__stx_head_injections??B$(),q=N$(G);if(q!==null)z.beforeClose.push(q);let K=O$(G);if(K!==null)z.afterOpen.push(K);G=L6(G,z);let W=X.app?.colorMode;if(W)G=w6(G,W)}if(Y)if(P8(G,"data-stx-runtime")){let q=null,K=null,W=null,U=null;try{let{getStoreScript:j}=await a("stx/store-loader",()=>import("./chunk-a1t7gfgf.js")),B=X.storesDir,V=await j(B);if(V)K=`<script data-stx-stores>${V}</script>`}catch{}q=await w8([G,K],X);try{let{getFrameworkComposableScript:j}=await a("stx/framework-composables",()=>import("./chunk-h6akyz4p.js"));U=await j(G)}catch{}try{let{getComposableScript:j}=await a("stx/composable-loader",()=>import("./chunk-q5zxa0vh.js")),B=X.composablesDir,V=[q,K,U].filter((L)=>L!==null),F=await j(X._layerComposableDirs??B,G,V);if(F)W=`<script data-stx-composables>${F}</script>`}catch{}let H=[q,K,W,U].filter((j)=>j!==null).map((j)=>`
3574
- ${j}`).join("");G=dG(G,H)}else{let q=await w8([G],X);if(q){let K=G.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(K!==-1)G=G.slice(0,K)+q+`
3575
- `+G.slice(K)}}if(Y)G=R6(G);if(Y&&Z.__stx_inject_css!==!1)G=await y8(G,void 0,X.buildMode==="serve",!0);else if(Y)G=b8(G);if(G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),Y&&Z.__stx_runtime_config)G=T8(G,Z.__stx_runtime_config);if(Y&&!Z.__stx_defer_server_data){let z=I6(Z);if(z){let q=/<head\b[^>]*>/i.exec(G),K=q?q.index+q[0].length:0;G=G.slice(0,K)+z+G.slice(K)}}return G})}catch(G){if(G instanceof N8)throw G;let z=G instanceof Error?G.message:String(G),q=new E2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(r0.log(q,{filePath:J,context:Z}),A8.logDetailedError(q,{filePath:J,template:$.substring(0,500)}),X.debug)throw q;return D8.createFallbackContent("Template Processing",q)}}async function mG($,Z,J,X,Q){let Y=process.cwd(),G={...X,partialsDir:X.partialsDir&&!T0.isAbsolute(X.partialsDir)?T0.resolve(Y,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!T0.isAbsolute(X.componentsDir)?T0.resolve(Y,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!T0.isAbsolute(X.layoutsDir)?T0.resolve(Y,X.layoutsDir):X.layoutsDir},z=G,q=$;await pG(J,Z),cG(Z,z),q=await b2(()=>G6(q,Z,J,z),q,(_)=>{r0.log(_,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${_.message}`)}),q=q.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=B1(q,_9,(_,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);q=K.output;let W=K.tokens,U=(_)=>W.length===0?_:_.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>W[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";q=q.replace(/@@/g,H),q=q.replace(/@\{\{([\s\S]*?)\}\}/g,(_,w)=>{return`{{ ${w} }}`}),q=U6(q),q=await K8(q,J,Q);let j={};q=q$(q,j);let B={...Z.__sections||{}},V="",F=x3(f3($)),L=/@nolayout\b/.test(q)||F===!1;if(/@nolayout\b/.test(q))q=q.replace(/@nolayout\b\s*/g,"");let O=q.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)V=O[1],q=q.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(V=F,!/@section\s*\(/.test(q))q=`@section('content')
3573
+ <meta name="stx-layout-group" content="${F8(k)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),N=R?s0(G):null;if(R&&N&&!/\bdata-stx=/.test(N.tag)){G=C1(G,(k,D)=>`<body${D} data-stx="${R[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(A,"$1")}}if(Y){let z=Z.__stx_head_injections??B$(),q=N$(G);if(q!==null)z.beforeClose.push(q);let K=O$(G);if(K!==null)z.afterOpen.push(K);G=L6(G,z);let W=X.app?.colorMode;if(W)G=w6(G,W)}if(Y)if(P8(G,"data-stx-runtime")){let q=null,K=null,W=null,U=null;try{let{getStoreScript:j}=await a("stx/store-loader",()=>import("./chunk-tm5rsehg.js")),B=X.storesDir,V=await j(B);if(V)K=`<script data-stx-stores>${V}</script>`}catch{}q=await w8([G,K],X);try{let{getFrameworkComposableScript:j}=await a("stx/framework-composables",()=>import("./chunk-x3p8ardj.js"));U=await j(G)}catch{}try{let{getComposableScript:j}=await a("stx/composable-loader",()=>import("./chunk-xqqfajvm.js")),B=X.composablesDir,V=[q,K,U].filter((L)=>L!==null),F=await j(X._layerComposableDirs??B,G,V);if(F)W=`<script data-stx-composables>${F}</script>`}catch{}let H=[q,K,W,U].filter((j)=>j!==null).map((j)=>`
3574
+ ${j}`).join("");G=mG(G,H)}else{let q=await w8([G],X);if(q){let K=G.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(K!==-1)G=G.slice(0,K)+q+`
3575
+ `+G.slice(K)}}if(Y)G=R6(G);if(Y&&Z.__stx_inject_css!==!1)G=await y8(G,void 0,X.buildMode==="serve",!0);else if(Y)G=b8(G);if(G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),Y&&Z.__stx_runtime_config)G=T8(G,Z.__stx_runtime_config);if(Y&&!Z.__stx_defer_server_data){let z=I6(Z);if(z){let q=/<head\b[^>]*>/i.exec(G),K=q?q.index+q[0].length:0;G=G.slice(0,K)+z+G.slice(K)}}return G})}catch(G){if(G instanceof N8)throw G;let z=G instanceof Error?G.message:String(G),q=new E2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(r0.log(q,{filePath:J,context:Z}),A8.logDetailedError(q,{filePath:J,template:$.substring(0,500)}),X.debug)throw q;return D8.createFallbackContent("Template Processing",q)}}async function lG($,Z,J,X,Q){let Y=process.cwd(),G={...X,partialsDir:X.partialsDir&&!T0.isAbsolute(X.partialsDir)?T0.resolve(Y,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!T0.isAbsolute(X.componentsDir)?T0.resolve(Y,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!T0.isAbsolute(X.layoutsDir)?T0.resolve(Y,X.layoutsDir):X.layoutsDir},z=G,q=$;await iG(J,Z),pG(Z,z),q=await b2(()=>G6(q,Z,J,z),q,(_)=>{r0.log(_,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${_.message}`)}),q=q.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=B1(q,_9,(_,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);q=K.output;let W=K.tokens,U=(_)=>W.length===0?_:_.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>W[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";q=q.replace(/@@/g,H),q=q.replace(/@\{\{([\s\S]*?)\}\}/g,(_,w)=>{return`{{ ${w} }}`}),q=U6(q),q=await K8(q,J,Q);let j={};q=q$(q,j);let B={...Z.__sections||{}},V="",F=x3(f3($)),L=/@nolayout\b/.test(q)||F===!1;if(/@nolayout\b/.test(q))q=q.replace(/@nolayout\b\s*/g,"");let O=q.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)V=O[1],q=q.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(V=F,!/@section\s*\(/.test(q))q=`@section('content')
3576
3576
  ${q.trim()}
3577
3577
  @endsection`}if(!V&&!L&&z.defaultLayout){let _=D$(q),w=/@section\s*\(/.test(q);if(!_||w){let R="",N=T0.dirname(J),A=z.layoutsDir?T0.dirname(z.layoutsDir):process.cwd();for(let k=0;k<20;k++){let D=T0.join(N,"_layout.stx");if(await e(D)){R=D;break}let I=T0.dirname(N);if(I===N||I.length<A.length)break;N=I}if(R)V=R;else if(z.layoutsDir){let k=T0.isAbsolute(z.layoutsDir)?z.layoutsDir:T0.resolve(process.cwd(),z.layoutsDir),D=T0.join(k,`${z.defaultLayout}.stx`);if(await e(D))V=D}if(V&&!w)q=`@section('content')
3578
3578
  ${q.trim()}
3579
- @endsection`}}if(q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(_,w,R)=>{return B[w]=R,""}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(_,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return _;try{let N=Z0(R.trim(),Z);if(N===void 0)return _;return B[w]=String(N??""),""}catch{return _}}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(_,w,R)=>{if(R.includes("@parent"))B[w]=R.replace("@parent",b1);else B[w]=R.trim();return""}),Z.__sections=B,q=q.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(_,w,R)=>{return B[w]||R||""}),!("slot"in Z)||Z.slot===void 0)q=q.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""});if(q=K$(q,j),V){let _=[],w=n0(q),R=B1(w.output,l2,(N,A)=>`\x00STX_ORPHAN_STYLE_${A}\x00`);if(q=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(N,A,k)=>{let D=A==="SCRIPT"?iG(w.scripts[Number(k)],J):R.tokens[Number(k)];if(D)_.push(D);return""}),_.length>0){let N=_.join(`
3579
+ @endsection`}}if(q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(_,w,R)=>{return B[w]=R,""}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(_,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return _;try{let N=Z0(R.trim(),Z);if(N===void 0)return _;return B[w]=String(N??""),""}catch{return _}}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(_,w,R)=>{if(R.includes("@parent"))B[w]=R.replace("@parent",b1);else B[w]=R.trim();return""}),Z.__sections=B,q=q.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(_,w,R)=>{return B[w]||R||""}),!("slot"in Z)||Z.slot===void 0)q=q.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""});if(q=K$(q,j),V){let _=[],w=n0(q),R=B1(w.output,l2,(N,A)=>`\x00STX_ORPHAN_STYLE_${A}\x00`);if(q=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(N,A,k)=>{let D=A==="SCRIPT"?nG(w.scripts[Number(k)],J):R.tokens[Number(k)];if(D)_.push(D);return""}),_.length>0){let N=_.join(`
3580
3580
  `);B.content=B.content?`${B.content}
3581
- ${N}`:N,Z.__sections=B}}if(V)try{let _;if(T0.isAbsolute(V))_=V,Q.add(V);else _=await b2(()=>a2(V,J,G,Q),null,()=>{throw new E2(`Failed to resolve layout path: ${V}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!_){let D=(M)=>{if(!M)return[];try{let E=T0.isAbsolute(M)?M:T0.resolve(process.cwd(),M);return hG.readdirSync(E).filter((C)=>C.endsWith(".stx")).map((C)=>C.replace(/\.stx$/,""))}catch{return[]}},I=[...D(G.layoutsDir),...D(G.fallbackLayoutsDir)].filter((M,E,C)=>C.indexOf(M)===E).sort(),T=`Layout not found: ${V} (referenced from ${J})`+(I.length>0?`. Available layouts: ${I.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(r0.log(Error(T),{layoutPath:V,filePath:J,available:I},"error"),console.error(`[stx] ${T}`),G.debug)throw new E2(T,J);return q}let w=await b2(()=>Bun.file(_).text(),"",()=>{throw new E2(`Failed to read layout file: ${_}`,J,void 0,void 0,"Layout content could not be loaded")});w=O8(w,_);let R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${_}`);let D={},I=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(E,C,y)=>{return D[C]=y.trim(),""});for(let[E,C]of Object.entries(D))if(B[E]&&B[E].includes(b1)){let y=B[E].indexOf(b1);B[E]=B[E].slice(0,y)+C+B[E].slice(y+b1.length)}else if(!B[E])B[E]=C;let T={...Z,__sections:B},M=`@layout('${R[1]}')${I}`;return await h$(M,T,_,G,Q)}let N=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),A=q$(N,j),k={};return A=A.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(D,I,T)=>{return k[I]=T.trim(),`@slot('${I}')`}),A=A.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(D,I,T)=>{if(B[I]){let M=B[I];if(M.includes(b1)){let E=k[I]||"",C=M.indexOf(b1);M=M.slice(0,C)+E+M.slice(C+b1.length)}return M}return T||""}),A=lG(A,B),A=A.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),A=K$(A,j),Z.__originalFilePath=J,q=await R8(A,Z,_,G,Q),q=`<!-- stx-layout: ${V} -->
3582
- ${q}`,U(q)}catch(_){return r0.log(_ instanceof Error?_:Error(String(_)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${_ instanceof Error?_.message:String(_)}]`}return U(await R8(q,Z,J,G,Q))}function lG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Q)=>{let Y=Z[X];if(Y!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Y))return Y}return Q||""})}function cG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Q,Y]of Object.entries(process.env))if(Q.startsWith(J)&&Y!==void 0)X[Q]=Y;$.$env=X}async function pG($,Z){await b2(()=>K6($,Z),void 0,(J)=>{r0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}var g$="data-stx-source";function iG($,Z){if(!$)return $;let J=/^<script\b([^>]*)>/i.exec($);if(!J||!/\bserver\b/.test(J[1])||J[1].includes(g$))return $;return`<script ${g$}="${encodeURIComponent(Z)}"${$.slice(7)}`}function nG($){let Z=new RegExp(`${g$}="([^"]*)"`).exec($);return Z?decodeURIComponent(Z[1]):void 0}async function sG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Q;while((Q=X.exec($))!==null){let Y=Q[1],G=Q[2];if(!/\bserver\b/.test(Y)||!G.trim())continue;let q=nG(Y)??J;try{let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-fsef8xw9.js"));await K(G,Z,q,{preserveExisting:!0})}catch(K){let W=K instanceof Error?K:Error(String(K));r0.log(W,{filePath:q,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${q}: ${W.message}`)}}}async function oG($,Z,J){try{let{interpolateScriptsInTemplate:X}=await a("stx/expressions",()=>import("./chunk-x887namm.js"));return X($,Z,{skipServer:!0})}catch(X){let Q=X instanceof Error?X:Error(String(X));return r0.log(Q,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Q.message}`),$}}async function R8($,Z,J,X,Q){let Y=$,G=X;if(await sG(Y,Z,J),Y=await oG(Y,Z,J),Y=await p4(Y,Z,J),Y=await i4(Y,Z,J),Y=await i7(Y,Z,J,G),Y1(Y))Y=Z8(Y,Z),Y=y$(Y,Z);Y=X8(Y);let{processStreamDirectives:z}=await a("stx/streaming",()=>import("./chunk-v26qp1p5.js"));Y=z(Y,Z),Y=Z6(Y,Z,J,G,!0),Y=await V6(Y,Z,J,G,Q),Y=await Y$(Y,Z,J,G,Q),Y=v3(Y,Z,J,G);let{processDeferDirectives:q}=await a("stx/defer",()=>import("./chunk-vv8yr1a0.js"));Y=q(Y,Z,J);let{processTeleportDirectives:K}=await a("stx/teleport",()=>import("./chunk-wcc30cjt.js"));Y=K(Y,Z,J);let{processTransitionDirectives:W,processTransitionAttributes:U}=await a("stx/transitions",()=>import("./chunk-a7a27x3z.js"));Y=W(Y,Z,J),Y=U(Y);let{processErrorBoundaryDirectives:H}=await a("stx/error-boundaries",()=>import("./chunk-9tg2x4eb.js"));Y=H(Y,Z,J);let{processSuspenseDirectives:j}=await a("stx/suspense",()=>import("./chunk-krjzxnsd.js"));Y=j(Y,Z,J);let{processAsyncDirectives:B}=await a("stx/async-components",()=>import("./chunk-ja7q1r6p.js"));Y=B(Y,Z,J);let{processKeepAliveDirectives:V}=await a("stx/keep-alive",()=>import("./chunk-ap3eff26.js"));Y=V(Y,Z,J);let{processVirtualListDirectives:F,processVirtualGridDirectives:L,processInfiniteListDirectives:O}=await a("stx/virtual-scrolling",()=>import("./chunk-g4yyd077.js"));Y=F(Y,Z,J),Y=L(Y,Z,J),Y=O(Y,Z,J);let{processPartialHydrationDirectives:_,processStaticDirectives:w}=await a("stx/partial-hydration",()=>import("./chunk-sxbp4m27.js"));Y=_(Y,Z,J),Y=w(Y);let{processComputedDirectives:R,processWatchDirectives:N}=await a("stx/computed",()=>import("./chunk-832fs45r.js"));Y=R(Y,Z,J),Y=N(Y,Z,J);let{processFormValidationDirectives:A}=await a("stx/forms-validation",()=>import("./chunk-9r4bsg9f.js"));Y=A(Y,Z,J);let{processHeadDirective:k,processTitleDirective:D,processMetaDirective:I,resetHead:T}=await a("stx/head",()=>import("./chunk-dews384p.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let M=k(Y);if(Y=M.content,M.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${M.headContent}
3581
+ ${N}`:N,Z.__sections=B}}if(V)try{let _;if(T0.isAbsolute(V))_=V,Q.add(V);else _=await b2(()=>a2(V,J,G,Q),null,()=>{throw new E2(`Failed to resolve layout path: ${V}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!_){let D=(M)=>{if(!M)return[];try{let E=T0.isAbsolute(M)?M:T0.resolve(process.cwd(),M);return uG.readdirSync(E).filter((C)=>C.endsWith(".stx")).map((C)=>C.replace(/\.stx$/,""))}catch{return[]}},I=[...D(G.layoutsDir),...D(G.fallbackLayoutsDir)].filter((M,E,C)=>C.indexOf(M)===E).sort(),T=`Layout not found: ${V} (referenced from ${J})`+(I.length>0?`. Available layouts: ${I.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(r0.log(Error(T),{layoutPath:V,filePath:J,available:I},"error"),console.error(`[stx] ${T}`),G.debug)throw new E2(T,J);return q}let w=await b2(()=>Bun.file(_).text(),"",()=>{throw new E2(`Failed to read layout file: ${_}`,J,void 0,void 0,"Layout content could not be loaded")});w=O8(w,_);let R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${_}`);let D={},I=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(E,C,y)=>{return D[C]=y.trim(),""});for(let[E,C]of Object.entries(D))if(B[E]&&B[E].includes(b1)){let y=B[E].indexOf(b1);B[E]=B[E].slice(0,y)+C+B[E].slice(y+b1.length)}else if(!B[E])B[E]=C;let T={...Z,__sections:B},M=`@layout('${R[1]}')${I}`;return await h$(M,T,_,G,Q)}let N=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),A=q$(N,j),k={};return A=A.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(D,I,T)=>{return k[I]=T.trim(),`@slot('${I}')`}),A=A.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(D,I,T)=>{if(B[I]){let M=B[I];if(M.includes(b1)){let E=k[I]||"",C=M.indexOf(b1);M=M.slice(0,C)+E+M.slice(C+b1.length)}return M}return T||""}),A=cG(A,B),A=A.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),A=K$(A,j),Z.__originalFilePath=J,q=await R8(A,Z,_,G,Q),q=`<!-- stx-layout: ${V} -->
3582
+ ${q}`,U(q)}catch(_){return r0.log(_ instanceof Error?_:Error(String(_)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${_ instanceof Error?_.message:String(_)}]`}return U(await R8(q,Z,J,G,Q))}function cG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Q)=>{let Y=Z[X];if(Y!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Y))return Y}return Q||""})}function pG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Q,Y]of Object.entries(process.env))if(Q.startsWith(J)&&Y!==void 0)X[Q]=Y;$.$env=X}async function iG($,Z){await b2(()=>K6($,Z),void 0,(J)=>{r0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}var g$="data-stx-source";function nG($,Z){if(!$)return $;let J=/^<script\b([^>]*)>/i.exec($);if(!J||!/\bserver\b/.test(J[1])||J[1].includes(g$))return $;return`<script ${g$}="${encodeURIComponent(Z)}"${$.slice(7)}`}function sG($){let Z=new RegExp(`${g$}="([^"]*)"`).exec($);return Z?decodeURIComponent(Z[1]):void 0}async function oG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Q;while((Q=X.exec($))!==null){let Y=Q[1],G=Q[2];if(!/\bserver\b/.test(Y)||!G.trim())continue;let q=sG(Y)??J;try{let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-d3mdskgy.js"));await K(G,Z,q,{preserveExisting:!0})}catch(K){let W=K instanceof Error?K:Error(String(K));r0.log(W,{filePath:q,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${q}: ${W.message}`)}}}async function rG($,Z,J){try{let{interpolateScriptsInTemplate:X}=await a("stx/expressions",()=>import("./chunk-yns8ygvd.js"));return X($,Z,{skipServer:!0})}catch(X){let Q=X instanceof Error?X:Error(String(X));return r0.log(Q,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Q.message}`),$}}async function R8($,Z,J,X,Q){let Y=$,G=X;if(await oG(Y,Z,J),Y=await rG(Y,Z,J),Y=await p4(Y,Z,J),Y=await i4(Y,Z,J),Y=await i7(Y,Z,J,G),Y1(Y))Y=Z8(Y,Z),Y=y$(Y,Z);Y=X8(Y);let{processStreamDirectives:z}=await a("stx/streaming",()=>import("./chunk-pkbj0aht.js"));Y=z(Y,Z),Y=Z6(Y,Z,J,G,!0),Y=await V6(Y,Z,J,G,Q),Y=await Y$(Y,Z,J,G,Q),Y=v3(Y,Z,J,G);let{processDeferDirectives:q}=await a("stx/defer",()=>import("./chunk-cn74d92v.js"));Y=q(Y,Z,J);let{processTeleportDirectives:K}=await a("stx/teleport",()=>import("./chunk-ys8sm556.js"));Y=K(Y,Z,J);let{processTransitionDirectives:W,processTransitionAttributes:U}=await a("stx/transitions",()=>import("./chunk-33rznhw1.js"));Y=W(Y,Z,J),Y=U(Y);let{processErrorBoundaryDirectives:H}=await a("stx/error-boundaries",()=>import("./chunk-xgj1jw4p.js"));Y=H(Y,Z,J);let{processSuspenseDirectives:j}=await a("stx/suspense",()=>import("./chunk-77sa9wz4.js"));Y=j(Y,Z,J);let{processAsyncDirectives:B}=await a("stx/async-components",()=>import("./chunk-0w8t922h.js"));Y=B(Y,Z,J);let{processKeepAliveDirectives:V}=await a("stx/keep-alive",()=>import("./chunk-7ds14xsn.js"));Y=V(Y,Z,J);let{processVirtualListDirectives:F,processVirtualGridDirectives:L,processInfiniteListDirectives:O}=await a("stx/virtual-scrolling",()=>import("./chunk-ms2kjpdt.js"));Y=F(Y,Z,J),Y=L(Y,Z,J),Y=O(Y,Z,J);let{processPartialHydrationDirectives:_,processStaticDirectives:w}=await a("stx/partial-hydration",()=>import("./chunk-2jfneptq.js"));Y=_(Y,Z,J),Y=w(Y);let{processComputedDirectives:R,processWatchDirectives:N}=await a("stx/computed",()=>import("./chunk-3n9rvrk1.js"));Y=R(Y,Z,J),Y=N(Y,Z,J);let{processFormValidationDirectives:A}=await a("stx/forms-validation",()=>import("./chunk-70nkn5te.js"));Y=A(Y,Z,J);let{processHeadDirective:k,processTitleDirective:D,processMetaDirective:I,resetHead:T}=await a("stx/head",()=>import("./chunk-meqcxfpr.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let M=k(Y);if(Y=M.content,M.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${M.headContent}
3583
3583
  `;if(Y=D(Y,Z),Y=I(Y,Z),Y=q6(Y),Y=D5(Y,Z),Y=p7(Y),Y=Y6(Y),Y=await z$(Y,Z,J,G,Q),Y=await Y$(Y,Z,J,G,Q),Z.__stxProcessingDepth===1)Y=Y3(Y,Z);if(Y=Y.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Y=P$(Y),Y=$1(Y,Z,J),Y=U$(Y),Y=h3(Y,Z,{filePath:J,buildMode:G.buildMode}),Y=A5(Y,Z),Y=M5(Y,Z),Y=O2(Y,Z),Y=C5(Y,Z),Y=S5(Y,Z),Y=await C7(Y,Z,J,G),Y=await i3(Y,Z,J),Y=await M8(Y,Z,J,G),Y=I8(Y,Z,J,G),Y=V7(Y,Z,J,G),Y=_7(Y,Z,J),Y=L7(Y,Z,J,G),Y=l7(Y,Z,J,G),Y=C$(Y,Z),Y=S$(Y),Y=H8(Y),!G.skipEventDirectives)Y=Z3(Y,Z,J);if(Y=m3(Y,Z,J),G.debug){let p=/\bx-data\s*=/.test(Y),i=b$($);if(p&&i)console.warn(`[stx] ${J}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3584
3584
  Both work on the same page, but they manage separate scopes.
3585
- Prefer signals (state/derived/effect) for new components.`)}Y=C4(Y,Z),Y=await V1(Y,Z,J),Y=_8(Y),Y=L8(Y),Y=k3(Y);let{processXElementDirectives:E}=await a("stx/x-element",()=>import("./chunk-d28gqewj.js"));Y=E(Y);let C=Z.__originalFilePath||J,y=b9(Z);if(Y=await Y8(Y,G,C,y),Y=r7(Y,Z),Y=await z6(Y,Z,J,G),G.media?.image?.autoSiblings){let p=G.publicDir||"public",{rewriteImagesWithSiblings:i}=await a("stx/image-optimization/auto-sibling",()=>import("./chunk-xq95p9y3.js"));Y=await i(Y,{publicDir:p})}if(G.seo?.enabled)Y=O7(Y,Z,G);let b=(p,i,U0=!0)=>{if(!i)return p;let Y0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=p.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(Y0&&O0){if(U0)p=p.replace(O0[0],Y0[0]);if(i=i.replace(Y0[0],"").trim(),!i)return p}if(/<\/head>/i.test(p))return p.replace(/<\/head>/i,`${i}
3585
+ Prefer signals (state/derived/effect) for new components.`)}Y=C4(Y,Z),Y=await V1(Y,Z,J),Y=_8(Y),Y=L8(Y),Y=k3(Y);let{processXElementDirectives:E}=await a("stx/x-element",()=>import("./chunk-dwjcmxez.js"));Y=E(Y);let C=Z.__originalFilePath||J,y=b9(Z);if(Y=await Y8(Y,G,C,y),Y=r7(Y,Z),Y=await z6(Y,Z,J,G),G.media?.image?.autoSiblings){let p=G.publicDir||"public",{rewriteImagesWithSiblings:i}=await a("stx/image-optimization/auto-sibling",()=>import("./chunk-7f16ymjn.js"));Y=await i(Y,{publicDir:p})}if(G.seo?.enabled)Y=O7(Y,Z,G);let b=(p,i,U0=!0)=>{if(!i)return p;let Y0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=p.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(Y0&&O0){if(U0)p=p.replace(O0[0],Y0[0]);if(i=i.replace(Y0[0],"").trim(),!i)return p}if(/<\/head>/i.test(p))return p.replace(/<\/head>/i,`${i}
3586
3586
  </head>`);if(/<head\b[^>]*>/i.test(p))return p.replace(/(<head\b[^>]*>)/i,`$1
3587
3587
  ${i}`);if(/<html\b[^>]*>/i.test(p))return p.replace(/(<html\b[^>]*>)/i,`$1
3588
3588
  <head>
3589
3589
  ${i}
3590
- </head>`);return p},{renderHead:P,getHead:g}=await a("stx/head",()=>import("./chunk-dews384p.js")),l=Z.__stx_runtime_head??g();if(l.title||l.meta?.length||l.link?.length){let p=P(l);if(p)Y=b(Y,p)}if(M.headContent)Y=b(Y,M.headContent,!l.title);if(G.csp?.enabled&&G.csp.addMetaTag)Y=d7(Y,G.csp,Z);if(G.analytics?.enabled)Y=E3(Y,G);if(G.heatmap?.enabled)Y=y3(Y,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:p}=await a("stx/pwa/inject",()=>import("./chunk-6pwwxxxk.js"));Y=p(Y,G)}let h=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Y),s=/\bSTX\.\w+/.test(Y),u=/window\.STX\s*=/.test(Y);if(h&&s&&!u){let i=`<script data-stx-scoped data-stx-run="once">
3590
+ </head>`);return p},{renderHead:P,getHead:g}=await a("stx/head",()=>import("./chunk-meqcxfpr.js")),l=Z.__stx_runtime_head??g();if(l.title||l.meta?.length||l.link?.length){let p=P(l);if(p)Y=b(Y,p)}if(M.headContent)Y=b(Y,M.headContent,!l.title);if(G.csp?.enabled&&G.csp.addMetaTag)Y=d7(Y,G.csp,Z);if(G.analytics?.enabled)Y=E3(Y,G);if(G.heatmap?.enabled)Y=y3(Y,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:p}=await a("stx/pwa/inject",()=>import("./chunk-d9gk60kk.js"));Y=p(Y,G)}let h=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Y),s=/\bSTX\.\w+/.test(Y),u=/window\.STX\s*=/.test(Y);if(h&&s&&!u){let i=`<script data-stx-scoped data-stx-run="once">
3591
3591
  ${A3()}
3592
3592
  </script>`;if(Y.includes("</head>")){let U0=Y.indexOf("</head>"),O0=Y.slice(0,U0).indexOf("<script");if(O0!==-1){let E0=Y.slice(0,O0),j1=Y.slice(O0);Y=E0+i+`
3593
3593
  `+j1}else Y=Y.replace("</head>",`${i}
3594
3594
  </head>`)}else if(Y.includes("<body"))Y=Y.replace(/<body([^>]*)>/,`<body$1>
3595
3595
  ${i}`);else Y=i+`
3596
- `+Y}{let{scanScriptTags:p}=await a("stx/signal-processing",()=>import("./chunk-z7jx68nh.js")),i=[];for(let U0 of p(Y)){if(!/\bserver\b/i.test(U0.attrs))continue;let Y0=U0.start+U0.fullMatch.indexOf(">")+1,O0=uG(Y,Y0);if(O0===-1)continue;let E0=O0+9;while(E0<Y.length&&/\s/.test(Y[E0]))E0++;i.push({start:U0.start,end:E0})}if(i.length>0){let U0=Array(i.length+1),Y0=0;for(let O0=0;O0<i.length;O0++){let{start:E0,end:j1}=i[O0];U0[O0]=Y.slice(Y0,E0),Y0=j1}U0[i.length]=Y.slice(Y0),Y=U0.join("")}}let z0=C9(Y,J);if(z0.hasScoped)Y=z0.html;let d0=Z.__stx_event_bindings||[],x0=!1,m0=[],J0=/\s:[a-z][\w.-]*\s*=/.test(Y),{scanScriptTags:j0}=await a("stx/signal-processing",()=>import("./chunk-z7jx68nh.js"));for(let p of j0(Y,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))m0.push({match:p.fullMatch,attrs:p.attrs,content:p.body});for(let{match:p,attrs:i,content:U0}of m0){x0=!0;let Y0=U0;f$(U0,J,X.strict,Z.__originalFilePath);let O0=await y9(U0,{eventBindings:d0,attrs:i,hasColonDirectives:J0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:y});Y=Y.replace(p,()=>O0)}if(x0)Z.__stx_event_bindings=[];if(!x0&&Z.__stxProcessingDepth===1){let p=Z.__stx_event_bindings||[];if(p.length>0){let i=u9(p);if(i){let U0=Y.lastIndexOf("</body>");Y=U0===-1?Y+i:Y.slice(0,U0)+i+`
3597
- `+Y.slice(U0)}Z.__stx_event_bindings=[]}}if(!d6(Y)&&m6(Y))Y=await I9(Y,G);if(Y=l6(Y),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Y=m7(Y,Z.cspNonce);return Y}var rG=[{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"}],aG=[{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')"}],tG=[{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 eG($){let Z=[],J=[];return $z($,Z),Zz($,Z,J),Jz($,J),Xz($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function $z($,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 Zz($,Z,J){for(let X of rG){let Q=new RegExp(`${X.open}(?:\\s|\\()`,"g"),Y=new RegExp(X.close,"g"),G=($.match(Q)||[]).length,z=($.match(Y)||[]).length;if(X.altClose){let q=new RegExp(X.altClose,"g");z+=($.match(q)||[]).length}if(G>z)Z.push({type:"directive",message:`Unclosed @${X.name} directive: found ${G} opening and ${z} closing`,suggestion:`Add ${G-z} missing ${X.close} tag(s)`});else if(z>G)J.push({type:"directive",message:`Extra ${X.close} found: ${z-G} more closing than opening`,suggestion:`Check for orphaned ${X.close} tags`})}}function Jz($,Z){for(let J of aG)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function Xz($,Z){for(let J of tG)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function Yz($,Z){let J=$.slice(0,Z).split(`
3598
- `);return{line:J.length,column:J[J.length-1].length+1}}function Qz($,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 Gz($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function zz($){let Z=$.matchAll(/@([a-z]+)/gi),J=new Set;for(let X of Z){let Q=X[1].toLowerCase();if(!Q.startsWith("end"))J.add(Q)}return Array.from(J)}import a0 from"path";import Z2 from"process";var o8=["module","exports","require","props","$props","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"],v8=new Set(o8),qz=new Set(["props","$props","defineProps"]),Kz=new Set(["stx","@stacksjs/stx"]),f8=E1(128),x8=E1(64);function Wz($){let Z=[],J=0,X=$.split(`
3599
- `);for(let Q of X){let Y=J,G=null,z=!1;for(let q=0;q<Q.length;q++){let K=Q[q];if(z){z=!1;continue}if(K==="\\"){z=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&q+1<Q.length&&Q[q+1]==="/")break;if(K==="{")J++;else if(K==="}")J--}if(Y===0){let q=Q.match(/(?:const|let|var)\s+(\w+)\s*=/);if(q)Z.push(q[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Q)){let K=Q.match(/(?:const|let|var)\s+(\w+)/);if(K)Z.push(K[1])}else{let K=Q.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(K){let U=K[1].slice(1,-1).split(",").map((H)=>{let j=H.split(":");return(j.length>1?j[1]:j[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...U)}}}}return[...new Set(Z)]}function Uz($){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 Q=[],Y="",G=0,z=0,q=null;for(let K=0;K<X.length;K++){let W=X[K];if(q){if(Y+=W,W===q)q=null;continue}if(W==='"'||W==="'"||W==="`"){q=W,Y+=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){Q.push(Y),Y="";continue}Y+=W}if(Y)Q.push(Y);return Q.map((K)=>{let W=K.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 K;let F=H.substring(0,j).trim().replace(/\?$/,""),L=H.substring(j+1),O=-1,_=0;for(let R=0;R<L.length;R++)if(L[R]==="<")_++;else if(L[R]===">")_--;else if(L[R]==="="&&_===0){O=R;break}let w=U?"...":"";if(O!==-1)return`${w}${F} = ${L.substring(O+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(X,Q,Y)=>{if(!Y.includes(":"))return X;return`${Q}(${J(Y)})`});{let X=/\b(function\s+\w*\s*)\(/g,Q,Y=[];while((Q=X.exec(Z))!==null){let G=Q.index+Q[0].length-1,z=1,q=G+1,K=0,W=null;while(q<Z.length&&z>0){let j=Z[q];if(W){if(j===W)W=null;q++;continue}if(j==='"'||j==="'"||j==="`"){W=j,q++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")z++;else if(j===")")z--}if(z>0)q++}if(z!==0)continue;let U=Z.substring(G+1,q);if(!U.includes(":"))continue;let H=J(U);Y.push({start:G+1,end:q,replacement:H})}for(let G=Y.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Y[G];Z=Z.substring(0,z)+K+Z.substring(q)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(X,Q)=>{if(!Q.includes(":"))return X;if(Q.includes("{")||Q.includes("}"))return X;return`(${Q.split(",").map((G)=>{let[z,...q]=G.split("="),K=z.split(":")[0].trim();if(q.length>0)return`${K} = ${q.join("=").trim()}`;return K}).join(", ")}) =>`}),Z=Z.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
3596
+ `+Y}{let{scanScriptTags:p}=await a("stx/signal-processing",()=>import("./chunk-5pvfm908.js")),i=[];for(let U0 of p(Y)){if(!/\bserver\b/i.test(U0.attrs))continue;let Y0=U0.start+U0.fullMatch.indexOf(">")+1,O0=dG(Y,Y0);if(O0===-1)continue;let E0=O0+9;while(E0<Y.length&&/\s/.test(Y[E0]))E0++;i.push({start:U0.start,end:E0})}if(i.length>0){let U0=Array(i.length+1),Y0=0;for(let O0=0;O0<i.length;O0++){let{start:E0,end:j1}=i[O0];U0[O0]=Y.slice(Y0,E0),Y0=j1}U0[i.length]=Y.slice(Y0),Y=U0.join("")}}let z0=C9(Y,J);if(z0.hasScoped)Y=z0.html;let d0=Z.__stx_event_bindings||[],x0=!1,m0=[],J0=/\s:[a-z][\w.-]*\s*=/.test(Y),{scanScriptTags:j0}=await a("stx/signal-processing",()=>import("./chunk-5pvfm908.js"));for(let p of j0(Y,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))m0.push({match:p.fullMatch,attrs:p.attrs,content:p.body});for(let{match:p,attrs:i,content:U0}of m0){x0=!0;let Y0=U0;f$(U0,J,X.strict,Z.__originalFilePath);let O0=await y9(U0,{eventBindings:d0,attrs:i,hasColonDirectives:J0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:y});Y=Y.replace(p,()=>O0)}if(x0)Z.__stx_event_bindings=[];if(!x0&&Z.__stxProcessingDepth===1){let p=Z.__stx_event_bindings||[];if(p.length>0){let i=u9(p);if(i){let U0=Y.lastIndexOf("</body>");Y=U0===-1?Y+i:Y.slice(0,U0)+i+`
3597
+ `+Y.slice(U0)}Z.__stx_event_bindings=[]}}if(!d6(Y)&&m6(Y))Y=await I9(Y,G);if(Y=l6(Y),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Y=m7(Y,Z.cspNonce);return Y}var aG=[{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"}],tG=[{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')"}],eG=[{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 $z($){let Z=[],J=[];return Zz($,Z),Jz($,Z,J),Xz($,J),Yz($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function Zz($,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 Jz($,Z,J){for(let X of aG){let Q=new RegExp(`${X.open}(?:\\s|\\()`,"g"),Y=new RegExp(X.close,"g"),G=($.match(Q)||[]).length,z=($.match(Y)||[]).length;if(X.altClose){let q=new RegExp(X.altClose,"g");z+=($.match(q)||[]).length}if(G>z)Z.push({type:"directive",message:`Unclosed @${X.name} directive: found ${G} opening and ${z} closing`,suggestion:`Add ${G-z} missing ${X.close} tag(s)`});else if(z>G)J.push({type:"directive",message:`Extra ${X.close} found: ${z-G} more closing than opening`,suggestion:`Check for orphaned ${X.close} tags`})}}function Xz($,Z){for(let J of tG)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function Yz($,Z){for(let J of eG)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function Qz($,Z){let J=$.slice(0,Z).split(`
3598
+ `);return{line:J.length,column:J[J.length-1].length+1}}function Gz($,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 zz($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function qz($){let Z=$.matchAll(/@([a-z]+)/gi),J=new Set;for(let X of Z){let Q=X[1].toLowerCase();if(!Q.startsWith("end"))J.add(Q)}return Array.from(J)}import a0 from"path";import Z2 from"process";var o8=["module","exports","require","props","$props","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"],v8=new Set(o8),Kz=new Set(["props","$props","defineProps"]),Wz=new Set(["stx","@stacksjs/stx"]),f8=E1(128),x8=E1(64);function Uz($){let Z=[],J=0,X=$.split(`
3599
+ `);for(let Q of X){let Y=J,G=null,z=!1;for(let q=0;q<Q.length;q++){let K=Q[q];if(z){z=!1;continue}if(K==="\\"){z=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&q+1<Q.length&&Q[q+1]==="/")break;if(K==="{")J++;else if(K==="}")J--}if(Y===0){let q=Q.match(/(?:const|let|var)\s+(\w+)\s*=/);if(q)Z.push(q[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Q)){let K=Q.match(/(?:const|let|var)\s+(\w+)/);if(K)Z.push(K[1])}else{let K=Q.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(K){let U=K[1].slice(1,-1).split(",").map((H)=>{let j=H.split(":");return(j.length>1?j[1]:j[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...U)}}}}return[...new Set(Z)]}function Hz($){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 Q=[],Y="",G=0,z=0,q=null;for(let K=0;K<X.length;K++){let W=X[K];if(q){if(Y+=W,W===q)q=null;continue}if(W==='"'||W==="'"||W==="`"){q=W,Y+=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){Q.push(Y),Y="";continue}Y+=W}if(Y)Q.push(Y);return Q.map((K)=>{let W=K.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 K;let F=H.substring(0,j).trim().replace(/\?$/,""),L=H.substring(j+1),O=-1,_=0;for(let R=0;R<L.length;R++)if(L[R]==="<")_++;else if(L[R]===">")_--;else if(L[R]==="="&&_===0){O=R;break}let w=U?"...":"";if(O!==-1)return`${w}${F} = ${L.substring(O+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(X,Q,Y)=>{if(!Y.includes(":"))return X;return`${Q}(${J(Y)})`});{let X=/\b(function\s+\w*\s*)\(/g,Q,Y=[];while((Q=X.exec(Z))!==null){let G=Q.index+Q[0].length-1,z=1,q=G+1,K=0,W=null;while(q<Z.length&&z>0){let j=Z[q];if(W){if(j===W)W=null;q++;continue}if(j==='"'||j==="'"||j==="`"){W=j,q++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")z++;else if(j===")")z--}if(z>0)q++}if(z!==0)continue;let U=Z.substring(G+1,q);if(!U.includes(":"))continue;let H=J(U);Y.push({start:G+1,end:q,replacement:H})}for(let G=Y.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Y[G];Z=Z.substring(0,z)+K+Z.substring(q)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(X,Q)=>{if(!Q.includes(":"))return X;if(Q.includes("{")||Q.includes("}"))return X;return`(${Q.split(",").map((G)=>{let[z,...q]=G.split("="),K=z.split(":")[0].trim();if(q.length>0)return`${K} = ${q.join("=").trim()}`;return K}).join(", ")}) =>`}),Z=Z.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
3600
3600
 
3601
- `),Z}function Hz($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function jz($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function Bz($,Z,J,X={}){if(!$.trim())return;let Q=e1(),Y=H1($,JSON.stringify(Q)),G=f8.get(Y);if(G===void 0){try{let S=d$({loader:"ts",target:"browser",define:Q}),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=Uz($)}f8.set(Y,G)}let z={exports:{}},q=z.exports,K=Z2.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(a0.resolve(a0.dirname(J),S));continue}let v=a0.resolve(K,"node_modules",S),o=a0.join(v,"package.json"),X0=JSON.parse(f("fs").readFileSync(o,"utf8")),W0=X0.main||"index.js";if(X0.exports){let N0=typeof X0.exports==="string"?X0.exports:X0.exports["."];if(typeof N0==="string")W0=N0;else if(N0?.bun)W0=N0.bun;else if(N0?.import)W0=N0.import;else if(N0?.default)W0=N0.default}W[S]=await import(a0.resolve(v,W0))}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 f(S)},B=Z.props||{},V=(S)=>{if(!S)return B;let v={};for(let[o,X0]of Object.entries(S)){let W0=B[o];if(W0!==void 0)v[o]=W0;else if(typeof X0==="function")v[o]=X0();else v[o]=X0}return v};for(let[S,v]of Object.entries(B))Object.defineProperty(V,S,{value:v,enumerable:!0,configurable:!0,writable:!0});for(let S of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(B,S))continue;try{Object.defineProperty(V,S,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let F=(S)=>{if(!S)return B;let v={...B};for(let[o,X0]of Object.entries(S)){let W0=X0&&typeof X0==="object"&&!Array.isArray(X0)?X0:{type:X0};if(v[o]===void 0&&W0.default!==void 0)v[o]=typeof W0.default==="function"?W0.default():W0.default}return v},L=()=>Z.slots||{},O=(S,v)=>{let o={...S};for(let[X0,W0]of Object.entries(v))if(o[X0]===void 0)if(typeof W0==="function")o[X0]=W0();else o[X0]=W0;return o},_=(S)=>{let v=()=>S;return v.set=(o)=>{},v.update=(o)=>{},v},w=(S)=>{let v,o=!1;return()=>{if(!o)try{v=S(),o=!0}catch{v=void 0}return v}},R=(S)=>{},N=(S)=>S(),A=(S)=>{},k=(S)=>{},D=g3(Z);function I(S){let v=S||{};if(v.title!==void 0||v.description!==void 0)y({title:v.title,description:v.description})}function T(S){if(!S||typeof S!=="object")return;let v=Z.__stxClientPayload??{};Object.assign(v,S),Z.__stxClientPayload=v}let M=()=>{let S=Z.__stxServeContext,v=Z.__stxServeSearch??S?.search??"",o=S?.path??"",X0=Object.fromEntries(new URLSearchParams(v)),W0=Z.query,N0=Object.keys(X0).length>0?X0:W0??{},l0=v||(Object.keys(N0).length>0?`?${new URLSearchParams(N0).toString()}`:"");return{params:Z.params??{},query:N0,path:o,name:"",fullPath:o+l0,hash:"",matched:[]}},E=()=>({push:(S)=>{},replace:(S)=>{},back:()=>{},forward:()=>{},go:(S)=>{}}),C=(S)=>{let v=Z.__stx_runtime_head||{};Z.__stx_runtime_head=r2(v,S||{})},y=(S)=>{C(s8(S||{}))},b=(S)=>({value:S}),P=(S)=>S,g=(S)=>({value:typeof S==="function"?S():S}),c=(S,v)=>{},l=(S)=>{},h=(S)=>{},s=(S)=>S?S():Promise.resolve(),u=(S)=>(v,...o)=>{},z0=(S)=>{},d0=(S,v)=>{},x0=(S,v)=>v,m0=()=>({value:"light"}),J0=()=>_(!1),j0=(S)=>_(!1),p=()=>_(!1),i=()=>j0("(prefers-color-scheme: dark)"),U0=()=>j0("(prefers-color-scheme: light)"),Y0=()=>j0("(prefers-reduced-motion: reduce)"),O0=()=>j0("(prefers-contrast: more)"),E0={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:{}},j1=new Proxy(E0,{get(S,v){if(v in S)return S[v];return},set(S,v,o){return S[v]=o,!0}}),X2={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},S2=console;try{let S=r8(G,J),v=new Set(Object.keys(B)),o=Object.keys(Z).filter((t)=>!v.has(t)&&!qz.has(t)&&J2(t)),X0=o.map((t)=>Z[t]);if(!o.includes("__stxServeContext"))o.push("__stxServeContext"),X0.push(void 0);let W0=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),N0=[],l0=[];for(let[t,t0]of Object.entries(B)){if(!J2(t))continue;if(W0.has(t))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${t}\\b`).test(S))continue;N0.push(t),l0.push(t0)}let d=Wz(S).map((t)=>`module.exports.${t} = typeof ${t} !== 'undefined' ? ${t} : module.exports.${t};`).join(`
3601
+ `),Z}function jz($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function Bz($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function Vz($,Z,J,X={}){if(!$.trim())return;let Q=e1(),Y=H1($,JSON.stringify(Q)),G=f8.get(Y);if(G===void 0){try{let S=d$({loader:"ts",target:"browser",define:Q}),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=Hz($)}f8.set(Y,G)}let z={exports:{}},q=z.exports,K=Z2.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(a0.resolve(a0.dirname(J),S));continue}let v=a0.resolve(K,"node_modules",S),o=a0.join(v,"package.json"),X0=JSON.parse(f("fs").readFileSync(o,"utf8")),W0=X0.main||"index.js";if(X0.exports){let N0=typeof X0.exports==="string"?X0.exports:X0.exports["."];if(typeof N0==="string")W0=N0;else if(N0?.bun)W0=N0.bun;else if(N0?.import)W0=N0.import;else if(N0?.default)W0=N0.default}W[S]=await import(a0.resolve(v,W0))}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 f(S)},B=Z.props||{},V=(S)=>{if(!S)return B;let v={};for(let[o,X0]of Object.entries(S)){let W0=B[o];if(W0!==void 0)v[o]=W0;else if(typeof X0==="function")v[o]=X0();else v[o]=X0}return v};for(let[S,v]of Object.entries(B))Object.defineProperty(V,S,{value:v,enumerable:!0,configurable:!0,writable:!0});for(let S of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(B,S))continue;try{Object.defineProperty(V,S,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let F=(S)=>{if(!S)return B;let v={...B};for(let[o,X0]of Object.entries(S)){let W0=X0&&typeof X0==="object"&&!Array.isArray(X0)?X0:{type:X0};if(v[o]===void 0&&W0.default!==void 0)v[o]=typeof W0.default==="function"?W0.default():W0.default}return v},L=()=>Z.slots||{},O=(S,v)=>{let o={...S};for(let[X0,W0]of Object.entries(v))if(o[X0]===void 0)if(typeof W0==="function")o[X0]=W0();else o[X0]=W0;return o},_=(S)=>{let v=()=>S;return v.set=(o)=>{},v.update=(o)=>{},v},w=(S)=>{let v,o=!1;return()=>{if(!o)try{v=S(),o=!0}catch{v=void 0}return v}},R=(S)=>{},N=(S)=>S(),A=(S)=>{},k=(S)=>{},D=g3(Z);function I(S){let v=S||{};if(v.title!==void 0||v.description!==void 0)y({title:v.title,description:v.description})}function T(S){if(!S||typeof S!=="object")return;let v=Z.__stxClientPayload??{};Object.assign(v,S),Z.__stxClientPayload=v}let M=()=>{let S=Z.__stxServeContext,v=Z.__stxServeSearch??S?.search??"",o=S?.path??"",X0=Object.fromEntries(new URLSearchParams(v)),W0=Z.query,N0=Object.keys(X0).length>0?X0:W0??{},l0=v||(Object.keys(N0).length>0?`?${new URLSearchParams(N0).toString()}`:"");return{params:Z.params??{},query:N0,path:o,name:"",fullPath:o+l0,hash:"",matched:[]}},E=()=>({push:(S)=>{},replace:(S)=>{},back:()=>{},forward:()=>{},go:(S)=>{}}),C=(S)=>{let v=Z.__stx_runtime_head||{};Z.__stx_runtime_head=r2(v,S||{})},y=(S)=>{C(s8(S||{}))},b=(S)=>({value:S}),P=(S)=>S,g=(S)=>({value:typeof S==="function"?S():S}),c=(S,v)=>{},l=(S)=>{},h=(S)=>{},s=(S)=>S?S():Promise.resolve(),u=(S)=>(v,...o)=>{},z0=(S)=>{},d0=(S,v)=>{},x0=(S,v)=>v,m0=()=>({value:"light"}),J0=()=>_(!1),j0=(S)=>_(!1),p=()=>_(!1),i=()=>j0("(prefers-color-scheme: dark)"),U0=()=>j0("(prefers-color-scheme: light)"),Y0=()=>j0("(prefers-reduced-motion: reduce)"),O0=()=>j0("(prefers-contrast: more)"),E0={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:{}},j1=new Proxy(E0,{get(S,v){if(v in S)return S[v];return},set(S,v,o){return S[v]=o,!0}}),X2={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},S2=console;try{let S=r8(G,J),v=new Set(Object.keys(B)),o=Object.keys(Z).filter((t)=>!v.has(t)&&!Kz.has(t)&&J2(t)),X0=o.map((t)=>Z[t]);if(!o.includes("__stxServeContext"))o.push("__stxServeContext"),X0.push(void 0);let W0=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),N0=[],l0=[];for(let[t,t0]of Object.entries(B)){if(!J2(t))continue;if(W0.has(t))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${t}\\b`).test(S))continue;N0.push(t),l0.push(t0)}let d=Uz(S).map((t)=>`module.exports.${t} = typeof ${t} !== 'undefined' ? ${t} : module.exports.${t};`).join(`
3602
3602
  `),m=Z.params??{},K0=[],r=[];for(let t=0;t<o.length;t++){if(o[t]==="params")continue;K0.push(o[t]),r.push(X0[t])}let F0=[...o8,...N0,...K0],D0=`return (async () => {
3603
3603
  ${S}
3604
3604
  ${d}
3605
3605
  return module.exports
3606
- })()`,P0=H1(D0,F0.join("\x00")),c0=x8.get(P0);if(!c0)c0=Function(...F0,D0),x8.set(P0,c0);let C0=Z.__stx_options?.runtimeConfig;if(C0||/\buse(?:Server)?RuntimeConfig\b/.test(G))await S9(Z,J,C0);let X1=await l8(Z.__stx_runtime_config??c8()??n8(),()=>A6(Z,()=>c0(z,q,j,B,V,F,O,T,M6,i8,p8,_,w,R,N,A,k,I,M,E,C,y,D.setResponseStatus,D.setResponseHeader,D.notFound,b,P,g,c,l,h,s,u,z0,L,d0,x0,m0,J0,j0,p,i,U0,Y0,O0,j1,X2,S2,E0.confirm,E0.alert,E0.fetch,m,...l0,...r)));if(X.preserveExisting){for(let[t,t0]of Object.entries(X1))if(!(t in Z)||Z[t]===void 0)Z[t]=t0}else Object.assign(Z,X1);for(let[t,t0]of Object.entries(B))if(!(t in Z))Z[t]=t0}catch(S){if(Z.__stx_strict_hydration)throw S;let v=S instanceof Error?S.message:String(S);if(Hz(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}`);else if(jz(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}`);else if(Z2.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${J??"<unknown>"} \u2014 falling back to static extraction. Cause: ${v}`);try{await Nz(G,Z,J)}catch(o){if(Z2.env.STX_DEBUG){let X0=o instanceof Error?o.message:String(o);console.warn(`[stx] fallback extraction also failed in ${J??"<unknown>"}: ${X0}`)}}}}function Vz($){let Z=0,J=null,X=!1,Q=!1;for(let Y=0;Y<$.length;Y++){let G=$[Y];if(J){if(G===J){if(J=null,X||Z===0)Q=!0}continue}if(G==="'"||G==='"'||G==="`"){J=G;continue}if(G==="{")Z++;else if(G==="}")Z--;else if($.startsWith("from",Y)&&Z===0)X=!0}return J===null&&Z===0&&Q}var _z=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function r8($,Z){let J=Z?a0.dirname(Z):Z2.cwd(),X=Z2.cwd(),Q=$.split(`
3606
+ })()`,P0=H1(D0,F0.join("\x00")),c0=x8.get(P0);if(!c0)c0=Function(...F0,D0),x8.set(P0,c0);let C0=Z.__stx_options?.runtimeConfig;if(C0||/\buse(?:Server)?RuntimeConfig\b/.test(G))await S9(Z,J,C0);let X1=await l8(Z.__stx_runtime_config??c8()??n8(),()=>A6(Z,()=>c0(z,q,j,B,V,F,O,T,M6,i8,p8,_,w,R,N,A,k,I,M,E,C,y,D.setResponseStatus,D.setResponseHeader,D.notFound,b,P,g,c,l,h,s,u,z0,L,d0,x0,m0,J0,j0,p,i,U0,Y0,O0,j1,X2,S2,E0.confirm,E0.alert,E0.fetch,m,...l0,...r)));if(X.preserveExisting){for(let[t,t0]of Object.entries(X1))if(!(t in Z)||Z[t]===void 0)Z[t]=t0}else Object.assign(Z,X1);for(let[t,t0]of Object.entries(B))if(!(t in Z))Z[t]=t0}catch(S){if(Z.__stx_strict_hydration)throw S;let v=S instanceof Error?S.message:String(S);if(jz(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}`);else if(Bz(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}`);else if(Z2.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${J??"<unknown>"} \u2014 falling back to static extraction. Cause: ${v}`);try{await Dz(G,Z,J)}catch(o){if(Z2.env.STX_DEBUG){let X0=o instanceof Error?o.message:String(o);console.warn(`[stx] fallback extraction also failed in ${J??"<unknown>"}: ${X0}`)}}}}function _z($){let Z=0,J=null,X=!1,Q=!1;for(let Y=0;Y<$.length;Y++){let G=$[Y];if(J){if(G===J){if(J=null,X||Z===0)Q=!0}continue}if(G==="'"||G==='"'||G==="`"){J=G;continue}if(G==="{")Z++;else if(G==="}")Z--;else if($.startsWith("from",Y)&&Z===0)X=!0}return J===null&&Z===0&&Q}var Lz=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function r8($,Z){let J=Z?a0.dirname(Z):Z2.cwd(),X=Z2.cwd(),Q=$.split(`
3607
3607
  `),Y=[],G=0;while(G<Q.length){let z=Q[G].trim();if(z.startsWith("interface ")||z.startsWith("export interface ")||z.startsWith("type ")||z.startsWith("export type ")){if(z.includes("{")&&!z.includes("}")){let q=0;for(;G<Q.length;G++){for(let K of Q[G])if(K==="{")q++;else if(K==="}")q--;if(q<=0)break}}G++;continue}if(z.startsWith("definePageMeta(")){let q=0,K=!1,W=G;for(let j=G;j<Q.length&&!K;j++){let B=null,V=!1,F=Q[j];for(let L=0;L<F.length;L++){let O=F[L];if(V){V=!1;continue}if(O==="\\"){V=!0;continue}if(B){if(O===B)B=null;continue}if(O==='"'||O==="'"||O==="`"){B=O;continue}if(O==="(")q++;else if(O===")"){if(q--,q===0){G=j+1,K=!0;break}}}}if(!K)G=Q.length;let U=Q.slice(W,G).join(`
3608
- `),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)Y.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(z.startsWith("import ")||z==="import"||z.startsWith("import{")){let q=z,K=0;while(!Vz(q)&&G+K+1<Q.length)K++,q=`${q} ${Q[G+K].trim()}`;G+=K;let W=q.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),U=q.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=q.match(/^import\s+['"](.+?)['"]/),j=q,B=(V)=>{if(V.startsWith("."))return a0.resolve(J,V);if(V.startsWith("~/")||V.startsWith("@/"))return a0.resolve(X,V.slice(2));return V};if(W){let[,V,F]=W,L=B(F);Y.push(`const ${V} = (await import('${L}')).default`),Y.push(`module.exports.${V} = ${V};`)}else if(U){let[,V,F]=U,L=B(F),O=[],_=[],w=Kz.has(F);for(let R of V.split(",")){let N=R.trim();if(!N)continue;let A=N.split(/\s+as\s+/);if(A.length===2){let[k,D]=[A[0].trim(),A[1].trim()];if(w&&v8.has(k)){Y.push(`const ${D} = ${k};`);continue}O.push(`${k}: ${D}`),_.push(D)}else{if(w&&v8.has(N))continue;O.push(N),_.push(N)}}if(O.length>0)Y.push(`const { ${O.join(", ")} } = await import('${L}')`);for(let R of _)Y.push(`module.exports.${R} = ${R};`)}else if(H){let V=B(H[1]);Y.push(`await import('${V}')`)}else Y.push(j);G++;continue}if(_z.test(z))Y.push(Q[G]),G++;else if(z.startsWith("export const ")||z.startsWith("export let ")||z.startsWith("export var ")){let q=h8(Q,G),{type:K,name:W,value:U}=q;Y.push(`${K} ${W} = ${U};`),Y.push(`module.exports.${W} = ${W};`),G=q.nextIndex}else if(z.startsWith("export function ")||z.startsWith("export async function ")){let q=u$(Q,G);Y.push(q.functionCode),Y.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("const ")||z.startsWith("let ")||z.startsWith("var ")){let q=h8(Q,G),{type:K,name:W,value:U}=q;Y.push(`${K} ${W} = ${U};`),Y.push(`module.exports.${W} = ${W};`),G=q.nextIndex}else if(z.startsWith("function ")||z.startsWith("async function ")){let q=u$(Q,G);Y.push(q.functionCode),Y.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("export default function ")||z.startsWith("export default async function ")){let q=Q[G].replace(/^(\s*)export\s+default\s+/,"$1"),K=[...Q];K[G]=q;let W=u$(K,G);if(Y.push(W.functionCode),W.name)Y.push(`module.exports.default = ${W.name};`);G=W.nextIndex}else if(z.startsWith("export default ")){let q=z.replace(/^export\s+default\s+/,"").replace(/;$/,"");Y.push(`module.exports.default = ${q};`),G++}else if(z.startsWith("class ")||z.startsWith("export class ")){let q=z.match(/(?:export\s+)?class\s+(\w+)/);if(q){let K=q[1],W=Q[G].replace(/^export\s+/,""),U=0,H=G;for(;H<Q.length;H++){let j=Q[H];for(let B of j)if(B==="{")U++;else if(B==="}")U--;if(H>G)W+=`
3609
- `+j;if(U<=0&&H>=G)break}Y.push(W),Y.push(`module.exports.${K} = ${K};`),G=H+1}else Y.push(z),G++}else if(z.includes("module.exports"))Y.push(z),G++;else if(z.trim()&&!z.startsWith("//"))Y.push(z),G++;else G++}return Lz(Y.join(`
3610
- `),J,X)}function Lz($,Z,J){let X=$.length,Q="",Y=0,G=null,z=!1,q=!1,K=0;while(Y<X){let W=$[Y],U=$[Y+1];if(z){if(Q+=W,W===`
3611
- `)z=!1;Y++;continue}if(q){if(Q+=W,W==="*"&&U==="/"){Q+=U,Y+=2,q=!1;continue}Y++;continue}if(!G&&W==="/"&&U==="/"){z=!0,Q+=W,Y++;continue}if(!G&&W==="/"&&U==="*"){q=!0,Q+=W,Y++;continue}if(G){if(Q+=W,W==="\\"){Q+=U,Y+=2;continue}if(W===G&&G!=="`"){G=null,Y++;continue}if(G==="`"){if(W==="$"&&U==="{"){K++,Q+=U,Y+=2;continue}if(W==="`"){G=null,Y++;continue}}Y++;continue}if(K>0){if(W==="{")K++;else if(W==="}")K--}if(W==='"'||W==="'"||W==="`"){G=W,Q+=W,Y++;continue}if(W==="a"&&$.startsWith("await",Y)){let H=Oz($,Y);if(H){let{quote:j,path:B,end:V}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let F=B.startsWith(".")?a0.resolve(Z,B):a0.resolve(J,B.slice(2));Q+=`await import(${j}${F}${j})`,Y=V;continue}}}Q+=W,Y++}return Q}function Oz($,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 Q=J;while(J<$.length&&$[J]!==X)if($[J]==="\\")J+=2;else J++;if(J>=$.length)return null;let Y=$.slice(Q,J);J++;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!==")")return null;return{quote:X,path:Y,end:J+1}}function a8($,Z){let J=$[Z];if(J!=="{"&&J!=="[")return null;let Q=w0($,J,J==="{"?"}":"]",Z);if(Q===-1)return null;return{pattern:$.slice(Z,Q+1),endPos:Q+1}}function t8($){let Z=[],J=$.slice(1,-1).trim();if(!J)return Z;let X=0,Q=0,Y="";while(X<J.length){let G=J[X];if(G==="{"||G==="["){let z=Q===0?a8(J,X):null;if(z){Z.push(...t8(z.pattern)),X=z.endPos,Y="";continue}Q++}else if(G==="}"||G==="]")Q--;if(Q>0){X++;continue}if(G===","){if(Y.trim())Z.push(Y.trim());Y="",X++;continue}if(G===":"){Y="",X++;continue}if(G==="="){if(Y.trim())Z.push(Y.trim());Y="",X++;while(X<J.length&&J[X]!==","&&Q===0){if(J[X]==="{"||J[X]==="[")Q++;else if(J[X]==="}"||J[X]==="]")Q--;X++}continue}if(/[\w$]/.test(G))Y+=G;X++}if(Y.trim())Z.push(Y.trim());return Z}function Fz($){let Z=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec($);if(!Z)return null;let J=Z[0].length,X=(Q)=>Q===" "||Q==="\t";while(J<$.length&&X($[J]))J++;if($[J]===":"){let Q=0,Y=null;J++;for(;J<$.length;J++){let G=$[J];if(Y){if(G==="\\"){J++;continue}if(G===Y)Y=null;continue}if(G==="'"||G==='"'||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{"||G==="<"){Q++;continue}if(G===")"||G==="]"||G==="}"||G===">"){Q--;continue}if(G==="="&&Q<=0){let z=$[J+1],q=$[J-1];if(z!=="="&&z!==">"&&q!=="="&&q!=="!"&&q!=="<"&&q!==">")break}}if($[J]!=="=")return null}while(J<$.length&&X($[J]))J++;if($[J]!=="=")return null;return{type:Z[1],name:Z[2],value:$.slice(J+1).trim()}}function g8($,Z,J,X){let Q=null,Y=!1;for(let G of $){if(Y){Y=!1;continue}if(G==="\\"){Y=!0;continue}if(Q){if(G===Q)Q=null;continue}if(G==="'"||G==='"'||G==="`"){Q=G;continue}if(G===Z)X++;else if(G===J)X--}return X}function h8($,Z){let J=$[Z].trim(),X=Fz(J),Q=X?[J,X.type,X.name,X.value]:null;if(!Q){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==="{"?"}":"]",F=g8(U,B,V,0),L=U;for(let O=Z+1;O<$.length&&F>0;O++)L+=` ${$[O].trim()}`,H=O,F=g8($[O],B,V,F);if(F>0)L=U,H=Z;U=L}let j=a8(U,0);if(j){let B=W[1],V=j.pattern,F=U.slice(j.endPos).trim();if(F.startsWith("=")){let L=F.slice(1).trim(),O=L,_=Math.max(H,Z);if(u8(L)){let A=d8($,_,L);O=A.value,_=A.nextIndex}else _=_+1;O=O.trim().replace(/;$/,"");let w=t8(V),R=`__stx_src_${Z}`,N=w.map((A)=>`module.exports.${A} = ${A};`).join(`
3608
+ `),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)Y.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(z.startsWith("import ")||z==="import"||z.startsWith("import{")){let q=z,K=0;while(!_z(q)&&G+K+1<Q.length)K++,q=`${q} ${Q[G+K].trim()}`;G+=K;let W=q.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),U=q.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=q.match(/^import\s+['"](.+?)['"]/),j=q,B=(V)=>{if(V.startsWith("."))return a0.resolve(J,V);if(V.startsWith("~/")||V.startsWith("@/"))return a0.resolve(X,V.slice(2));return V};if(W){let[,V,F]=W,L=B(F);Y.push(`const ${V} = (await import('${L}')).default`),Y.push(`module.exports.${V} = ${V};`)}else if(U){let[,V,F]=U,L=B(F),O=[],_=[],w=Wz.has(F);for(let R of V.split(",")){let N=R.trim();if(!N)continue;let A=N.split(/\s+as\s+/);if(A.length===2){let[k,D]=[A[0].trim(),A[1].trim()];if(w&&v8.has(k)){Y.push(`const ${D} = ${k};`);continue}O.push(`${k}: ${D}`),_.push(D)}else{if(w&&v8.has(N))continue;O.push(N),_.push(N)}}if(O.length>0)Y.push(`const { ${O.join(", ")} } = await import('${L}')`);for(let R of _)Y.push(`module.exports.${R} = ${R};`)}else if(H){let V=B(H[1]);Y.push(`await import('${V}')`)}else Y.push(j);G++;continue}if(Lz.test(z))Y.push(Q[G]),G++;else if(z.startsWith("export const ")||z.startsWith("export let ")||z.startsWith("export var ")){let q=h8(Q,G),{type:K,name:W,value:U}=q;Y.push(`${K} ${W} = ${U};`),Y.push(`module.exports.${W} = ${W};`),G=q.nextIndex}else if(z.startsWith("export function ")||z.startsWith("export async function ")){let q=u$(Q,G);Y.push(q.functionCode),Y.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("const ")||z.startsWith("let ")||z.startsWith("var ")){let q=h8(Q,G),{type:K,name:W,value:U}=q;Y.push(`${K} ${W} = ${U};`),Y.push(`module.exports.${W} = ${W};`),G=q.nextIndex}else if(z.startsWith("function ")||z.startsWith("async function ")){let q=u$(Q,G);Y.push(q.functionCode),Y.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("export default function ")||z.startsWith("export default async function ")){let q=Q[G].replace(/^(\s*)export\s+default\s+/,"$1"),K=[...Q];K[G]=q;let W=u$(K,G);if(Y.push(W.functionCode),W.name)Y.push(`module.exports.default = ${W.name};`);G=W.nextIndex}else if(z.startsWith("export default ")){let q=z.replace(/^export\s+default\s+/,"").replace(/;$/,"");Y.push(`module.exports.default = ${q};`),G++}else if(z.startsWith("class ")||z.startsWith("export class ")){let q=z.match(/(?:export\s+)?class\s+(\w+)/);if(q){let K=q[1],W=Q[G].replace(/^export\s+/,""),U=0,H=G;for(;H<Q.length;H++){let j=Q[H];for(let B of j)if(B==="{")U++;else if(B==="}")U--;if(H>G)W+=`
3609
+ `+j;if(U<=0&&H>=G)break}Y.push(W),Y.push(`module.exports.${K} = ${K};`),G=H+1}else Y.push(z),G++}else if(z.includes("module.exports"))Y.push(z),G++;else if(z.trim()&&!z.startsWith("//"))Y.push(z),G++;else G++}return Oz(Y.join(`
3610
+ `),J,X)}function Oz($,Z,J){let X=$.length,Q="",Y=0,G=null,z=!1,q=!1,K=0;while(Y<X){let W=$[Y],U=$[Y+1];if(z){if(Q+=W,W===`
3611
+ `)z=!1;Y++;continue}if(q){if(Q+=W,W==="*"&&U==="/"){Q+=U,Y+=2,q=!1;continue}Y++;continue}if(!G&&W==="/"&&U==="/"){z=!0,Q+=W,Y++;continue}if(!G&&W==="/"&&U==="*"){q=!0,Q+=W,Y++;continue}if(G){if(Q+=W,W==="\\"){Q+=U,Y+=2;continue}if(W===G&&G!=="`"){G=null,Y++;continue}if(G==="`"){if(W==="$"&&U==="{"){K++,Q+=U,Y+=2;continue}if(W==="`"){G=null,Y++;continue}}Y++;continue}if(K>0){if(W==="{")K++;else if(W==="}")K--}if(W==='"'||W==="'"||W==="`"){G=W,Q+=W,Y++;continue}if(W==="a"&&$.startsWith("await",Y)){let H=Fz($,Y);if(H){let{quote:j,path:B,end:V}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let F=B.startsWith(".")?a0.resolve(Z,B):a0.resolve(J,B.slice(2));Q+=`await import(${j}${F}${j})`,Y=V;continue}}}Q+=W,Y++}return Q}function Fz($,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 Q=J;while(J<$.length&&$[J]!==X)if($[J]==="\\")J+=2;else J++;if(J>=$.length)return null;let Y=$.slice(Q,J);J++;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!==")")return null;return{quote:X,path:Y,end:J+1}}function a8($,Z){let J=$[Z];if(J!=="{"&&J!=="[")return null;let Q=w0($,J,J==="{"?"}":"]",Z);if(Q===-1)return null;return{pattern:$.slice(Z,Q+1),endPos:Q+1}}function t8($){let Z=[],J=$.slice(1,-1).trim();if(!J)return Z;let X=0,Q=0,Y="";while(X<J.length){let G=J[X];if(G==="{"||G==="["){let z=Q===0?a8(J,X):null;if(z){Z.push(...t8(z.pattern)),X=z.endPos,Y="";continue}Q++}else if(G==="}"||G==="]")Q--;if(Q>0){X++;continue}if(G===","){if(Y.trim())Z.push(Y.trim());Y="",X++;continue}if(G===":"){Y="",X++;continue}if(G==="="){if(Y.trim())Z.push(Y.trim());Y="",X++;while(X<J.length&&J[X]!==","&&Q===0){if(J[X]==="{"||J[X]==="[")Q++;else if(J[X]==="}"||J[X]==="]")Q--;X++}continue}if(/[\w$]/.test(G))Y+=G;X++}if(Y.trim())Z.push(Y.trim());return Z}function wz($){let Z=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec($);if(!Z)return null;let J=Z[0].length,X=(Q)=>Q===" "||Q==="\t";while(J<$.length&&X($[J]))J++;if($[J]===":"){let Q=0,Y=null;J++;for(;J<$.length;J++){let G=$[J];if(Y){if(G==="\\"){J++;continue}if(G===Y)Y=null;continue}if(G==="'"||G==='"'||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{"||G==="<"){Q++;continue}if(G===")"||G==="]"||G==="}"||G===">"){Q--;continue}if(G==="="&&Q<=0){let z=$[J+1],q=$[J-1];if(z!=="="&&z!==">"&&q!=="="&&q!=="!"&&q!=="<"&&q!==">")break}}if($[J]!=="=")return null}while(J<$.length&&X($[J]))J++;if($[J]!=="=")return null;return{type:Z[1],name:Z[2],value:$.slice(J+1).trim()}}function g8($,Z,J,X){let Q=null,Y=!1;for(let G of $){if(Y){Y=!1;continue}if(G==="\\"){Y=!0;continue}if(Q){if(G===Q)Q=null;continue}if(G==="'"||G==='"'||G==="`"){Q=G;continue}if(G===Z)X++;else if(G===J)X--}return X}function h8($,Z){let J=$[Z].trim(),X=wz(J),Q=X?[J,X.type,X.name,X.value]:null;if(!Q){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==="{"?"}":"]",F=g8(U,B,V,0),L=U;for(let O=Z+1;O<$.length&&F>0;O++)L+=` ${$[O].trim()}`,H=O,F=g8($[O],B,V,F);if(F>0)L=U,H=Z;U=L}let j=a8(U,0);if(j){let B=W[1],V=j.pattern,F=U.slice(j.endPos).trim();if(F.startsWith("=")){let L=F.slice(1).trim(),O=L,_=Math.max(H,Z);if(u8(L)){let A=d8($,_,L);O=A.value,_=A.nextIndex}else _=_+1;O=O.trim().replace(/;$/,"");let w=t8(V),R=`__stx_src_${Z}`,N=w.map((A)=>`module.exports.${A} = ${A};`).join(`
3612
3612
  `);return{type:B,name:R,value:`${O}; ${B} ${V} = ${R};
3613
3613
  ${N}`,nextIndex:_}}}}throw Error(`Failed to parse variable declaration: ${J}`)}let[,Y,G,z]=Q,q=z,K=Z;if(u8(z)){let W=d8($,Z,z);q=W.value,K=W.nextIndex}else K=Z+1;while(K<$.length){let W=$[K].trim();if(W.startsWith(".")||W.startsWith("?."))q+=`
3614
- ${$[K]}`,K++;else break}return q=q.trim().replace(/;$/,""),{type:Y,name:G,value:q,nextIndex:K}}function u$($,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[,Q]=X,Y=J.replace(/^export\s+/,""),G=Z;if(wz(J)){let z=Rz($,Z,Y);Y=z.functionCode,G=z.nextIndex}else G=Z+1;return{name:Q,functionCode:Y,nextIndex:G}}function u8($){let Z=$.trim();if(Z.startsWith("{"))return w0(Z,"{","}",0)===-1;if(Z.startsWith("["))return w0(Z,"[","]",0)===-1;return!e8(Z)}function e8($){let Z={paren:0,bracket:0,brace:0},J=null,X=0;for(let Q=0;Q<$.length;Q++){let Y=$[Q];if((Q>0?$[Q-1]:"")==="\\"&&J)continue;if((Y==='"'||Y==="'")&&!J){J=Y;continue}if(Y===J&&J!=="`"){J=null;continue}if(Y==="`"&&!J){J="`";continue}if(Y==="`"&&J==="`"&&X===0){J=null;continue}if(J==="`"&&Y==="$"&&$[Q+1]==="{"){X++,Q++;continue}if(X>0&&Y==="{"){X++;continue}if(X>0&&Y==="}"){X--;continue}if(J)continue;if(Y==="(")Z.paren++;else if(Y===")")Z.paren--;else if(Y==="[")Z.bracket++;else if(Y==="]")Z.bracket--;else if(Y==="{")Z.brace++;else if(Y==="}")Z.brace--}return Z.paren===0&&Z.bracket===0&&Z.brace===0&&J===null}function $Z($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let J=w0($,"(",")",Z);if(J===-1)return-1;return $.indexOf("{",J)}function wz($){let Z=$Z($);if(Z===-1)return!0;return w0($,"{","}",Z)===-1}function d8($,Z,J){let X=J,Q=Z+1;while(Q<$.length&&!e8(X)){let Y=$[Q];X+=`
3614
+ ${$[K]}`,K++;else break}return q=q.trim().replace(/;$/,""),{type:Y,name:G,value:q,nextIndex:K}}function u$($,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[,Q]=X,Y=J.replace(/^export\s+/,""),G=Z;if(Rz(J)){let z=Nz($,Z,Y);Y=z.functionCode,G=z.nextIndex}else G=Z+1;return{name:Q,functionCode:Y,nextIndex:G}}function u8($){let Z=$.trim();if(Z.startsWith("{"))return w0(Z,"{","}",0)===-1;if(Z.startsWith("["))return w0(Z,"[","]",0)===-1;return!e8(Z)}function e8($){let Z={paren:0,bracket:0,brace:0},J=null,X=0;for(let Q=0;Q<$.length;Q++){let Y=$[Q];if((Q>0?$[Q-1]:"")==="\\"&&J)continue;if((Y==='"'||Y==="'")&&!J){J=Y;continue}if(Y===J&&J!=="`"){J=null;continue}if(Y==="`"&&!J){J="`";continue}if(Y==="`"&&J==="`"&&X===0){J=null;continue}if(J==="`"&&Y==="$"&&$[Q+1]==="{"){X++,Q++;continue}if(X>0&&Y==="{"){X++;continue}if(X>0&&Y==="}"){X--;continue}if(J)continue;if(Y==="(")Z.paren++;else if(Y===")")Z.paren--;else if(Y==="[")Z.bracket++;else if(Y==="]")Z.bracket--;else if(Y==="{")Z.brace++;else if(Y==="}")Z.brace--}return Z.paren===0&&Z.bracket===0&&Z.brace===0&&J===null}function $Z($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let J=w0($,"(",")",Z);if(J===-1)return-1;return $.indexOf("{",J)}function Rz($){let Z=$Z($);if(Z===-1)return!0;return w0($,"{","}",Z)===-1}function d8($,Z,J){let X=J,Q=Z+1;while(Q<$.length&&!e8(X)){let Y=$[Q];X+=`
3615
3615
  ${Y}`,Q++}while(Q<$.length){let Y=$[Q].trim();if(Y.startsWith(".")||Y.startsWith("?."))X+=`
3616
- ${$[Q]}`,Q++;else break}return{value:X,nextIndex:Q}}function Rz($,Z,J){let X=J,Q=Z+1;while(Q<$.length){let Y=$Z(X);if(Y!==-1){if(w0(X,"{","}",Y)!==-1)break}let G=$[Q];X+=`
3617
- ${G}`,Q++}return{functionCode:X,nextIndex:Q}}function m8($,Z){let J=Z0($,Z)??Z0(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...Z2.env}})},Q=Object.keys(X).filter(J2),Y=Q.map((G)=>X[G]);try{return Function(...Q,`'use strict'; return (${$});`)(...Y)}catch{try{return Function(...Q,`'use strict'; return ${$};`)(...Y)}catch{return}}}async function Nz($,Z,J){let X=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Y of X){let[,,G,z]=Y;try{let q=z.trim().replace(/;$/,""),K=m8(q,Z);if(K!==void 0)Z[G]=K}catch(q){console.warn(`Failed to parse export ${G} in fallback:`,q)}}let Q=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Y of Q){let[,,G,z]=Y;if(!(G in Z))try{let q=z.trim().replace(/;$/,""),K=m8(q,Z);if(K!==void 0)Z[G]=K}catch{}}}function Dz($){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 Az($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var y2=new n1(500),v9=new n1(1000),qZ=33554432,l$=qZ;function Mz($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===l$)return;l$=Z,f9.setMaxBytes(Z)}var f9=new n1(2000,{maxBytes:qZ,sizeOf:($)=>$.output.length});function Iz($){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 Q={};for(let Y of Object.keys(X).sort())Q[Y]=J(X[Y]);return Q};return JSON.stringify(J($))}catch{return null}}function ZZ($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kz($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function M1($){return!kz($)}var P9=new Map;function d$($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=P9.get(Z);if(J)return J;if(P9.size>=16)P9.clear();let X=new Bun.Transpiler($);return P9.set(Z,X),X}var JZ=new WeakMap,Tz=256;function I1($){try{let Z=d$({loader:"ts",target:"browser",define:e1()}),J=JZ.get(Z);if(!J)J=new Map,JZ.set(Z,J);let X=J.get($);if(X!==void 0)return X;let Q=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Q=Q.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let Y=[];Q=Q.replace(/\{!![\s\S]*?!!\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`}),Q=Q.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`}),Q=Q.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`});let G=Z.transformSync(Q);for(let z=0;z<Y.length;z++)G=G.replace(`"__STX_EXPR_${z}__"`,Y[z]),G=G.replace(`'__STX_EXPR_${z}__'`,Y[z]);if(J.size>=Tz){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 Ez($){let Z=[],J=new Set,X=0,Q=0,Y=$.length,G=(W)=>{Q++;while(Q<Y){if($[Q]==="\\"){Q+=2;continue}if($[Q]===W){Q++;return}Q++}},z=()=>{Q++;while(Q<Y){if($[Q]==="\\"){Q+=2;continue}if($[Q]==="`"){Q++;return}if($[Q]==="$"&&$[Q+1]==="{"){Q+=2;let W=1;while(Q<Y&&W>0)if($[Q]==="{")W++,Q++;else if($[Q]==="}")W--,Q++;else if($[Q]==="'"||$[Q]==='"')G($[Q]);else if($[Q]==="`")z();else Q++;continue}Q++}},q=()=>{if($[Q]==="/"&&$[Q+1]==="/"){while(Q<Y&&$[Q]!==`
3618
- `)Q++;return!0}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<Y-1&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;return Q+=2,!0}return!1},K=()=>{if(X!==0)return;let W=$.slice(Q).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(W){let B=W[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let U=$.slice(Q).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(Q).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(Q).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(Q<Y){if(q())continue;if($[Q]==="'"||$[Q]==='"'){G($[Q]);continue}if($[Q]==="`"){z();continue}if($[Q]==="{"){X++,Q++;continue}if($[Q]==="}"){X--,Q++;continue}if(X===0&&/[a-z]/i.test($[Q])&&(Q===0||/\s|[;{}()]/.test($[Q-1])))K();Q++}return Z}function bz($){let Z=[],J=0,X=0,Q=null;for(let Y=0;Y<$.length;Y++){let G=$[Y];if(Q){if(G==="\\"){Y++;continue}if(G===Q)Q=null;continue}if(G==='"'||G==="'"||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Y)),X=Y+1}if(X<$.length)Z.push($.slice(X));return Z}function yz($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Q=$[X];if(J){if(Q==="\\"){X++;continue}if(Q===J)J=null;continue}if(Q==='"'||Q==="'"||Q==="`"){J=Q;continue}if(Q==="("||Q==="["||Q==="{")Z++;else if(Q===")"||Q==="]"||Q==="}")Z--;else if(Q==="="&&Z===0){let Y=$[X-1],G=$[X+1];if(Y==="!"||Y==="<"||Y===">"||Y==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function Cz($,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 Q=X,Y=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Y++;else if(q==="{"){if(Y--,Y===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Q);for(let q of bz(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let W=yz(K);if(W===-1)continue;let U=K.slice(0,W).trim();if(!/^[A-Z_$][\w$]*$/i.test(U))continue;if(Z[U]!==void 0)continue;let H=K.slice(W+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(J2),B=Function(...j,`"use strict"; return (${H});`);Z[U]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function B9($,Z,J,X,Q){let Y=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let L of[Y,Y.toLowerCase(),G(Y),z(Y)])if(q.has(L))return!0}let K=[...new Set([`${Y}.stx`,`${G(Y)}.stx`,`${z(Y)}.stx`])],W=typeof Q.root==="string"?x.resolve(Q.root):void 0,U=W??x.dirname(X),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},B=J.__originalFilePath;if(B)j(x.join(x.dirname(B),"components"));if(j(Z),j(Q._rootComponentsDir),j(x.join(x.dirname(X),"components")),j(Q.componentsDir),W)j(x.resolve(W,"resources/views/components")),j(x.resolve(W,"resources/components")),j(x.resolve(W,"src/components")),j(x.resolve(W,"components"));for(let L of Q._layerComponentDirs??[])j(L);let V=Q._pluginComponentDirs;if(Array.isArray(V))for(let L of V)j(typeof L==="string"?L:null);if(j(Q.fallbackComponentsDir),Y.startsWith("./")||Y.startsWith("../"))return e(x.resolve(x.dirname(X),`${Y}.stx`));let F=XZ(x.resolve(import.meta.dir,"components"));for(let L of H){let O=x.isAbsolute(L)?L:x.resolve(U,L);if(XZ(O)===F)continue;for(let _ of K)if(await e(x.join(O,_)))return!0}return!1}function XZ($){try{return zZ.realpathSync($)}catch{return $}}function Sz($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Pz($){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 vz($){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|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Q;while((Q=J.exec(X))!==null)Z.add(Q[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Q,Y,G,z=new Set,q){let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-fsef8xw9.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"&&Sz(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),V=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,L=null,O=Q.__importedComponents;if(O){let d=[F,F.toLowerCase(),B(F),V(F)];for(let m of d)if(O.has(m)){L=O.get(m);break}}let _=[];if(!L){let d=[`${F}.stx`,`${B(F)}.stx`,`${V(F)}.stx`],m=[...new Set(d)],K0=Q.__originalFilePath,r=[];if(r.push(...G._layerComponentDirs??[]),K0){let A0=x.join(x.dirname(K0),"components");r.push(A0)}if(X)r.push(X);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let D0=x.join(x.dirname(Y),"components");if(!r.includes(D0))r.push(D0);if(G.componentsDir&&G.componentsDir!==X&&!r.includes(G.componentsDir))r.push(G.componentsDir);let P0=typeof G.root==="string"?x.resolve(G.root):void 0,c0=P0??x.dirname(Y),C0=[];if(P0)C0.push(x.resolve(P0,"resources/views/components")),C0.push(x.resolve(P0,"resources/components")),C0.push(x.resolve(P0,"src/components")),C0.push(x.resolve(P0,"components"));C0.push(x.resolve(import.meta.dir,"components"));for(let A0 of C0)if(!r.includes(A0))r.push(A0);let X1=G._pluginComponentDirs;if(Array.isArray(X1)){for(let A0 of X1)if(typeof A0==="string"&&!r.includes(A0))r.push(A0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let t=[...new Set(r.map((A0)=>{if(!A0)return A0;return x.isAbsolute(A0)?A0:x.resolve(c0,A0)}))];r.length=0,r.push(...t);let t0=`${F}\x00${Y}\x00${t.join("\x00")}`,P2=v9.get(t0);if(P2)if(await e(P2))L=P2;else v9.delete(t0);if(!L&&(F.startsWith("./")||F.startsWith("../")))L=x.resolve(x.dirname(Y),`${F}.stx`),_.push(L);else if(!L)for(let A0 of r){if(!A0)continue;for(let v2 of m){let f2=x.join(A0,v2);if(_.push(f2),await e(f2)){L=f2;break}}if(L)break;if(!L)try{let v2=await import("fs");if(!v2.statSync(A0,{throwIfNoEntry:!1})?.isDirectory())continue;let FZ=8,x9=[{path:A0,depth:0}];while(x9.length>0&&!L){let x2=x9.pop();if(x2.depth>=FZ)continue;let n$;try{n$=v2.readdirSync(x2.path,{withFileTypes:!0})}catch{continue}for(let g2 of n$){if(!g2.isDirectory())continue;if(g2.name==="node_modules"||g2.name.startsWith("."))continue;let s$=x.join(x2.path,g2.name);for(let wZ of m){let g9=x.join(s$,wZ);if(_.push(g9),await e(g9)){L=g9;break}}if(L)break;x9.push({path:s$,depth:x2.depth+1})}}}catch{}if(L)break}if(L)v9.set(t0,L)}if(!L||!await e(L)){let d=_.length>0?`
3616
+ ${$[Q]}`,Q++;else break}return{value:X,nextIndex:Q}}function Nz($,Z,J){let X=J,Q=Z+1;while(Q<$.length){let Y=$Z(X);if(Y!==-1){if(w0(X,"{","}",Y)!==-1)break}let G=$[Q];X+=`
3617
+ ${G}`,Q++}return{functionCode:X,nextIndex:Q}}function m8($,Z){let J=Z0($,Z)??Z0(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...Z2.env}})},Q=Object.keys(X).filter(J2),Y=Q.map((G)=>X[G]);try{return Function(...Q,`'use strict'; return (${$});`)(...Y)}catch{try{return Function(...Q,`'use strict'; return ${$};`)(...Y)}catch{return}}}async function Dz($,Z,J){let X=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Y of X){let[,,G,z]=Y;try{let q=z.trim().replace(/;$/,""),K=m8(q,Z);if(K!==void 0)Z[G]=K}catch(q){console.warn(`Failed to parse export ${G} in fallback:`,q)}}let Q=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Y of Q){let[,,G,z]=Y;if(!(G in Z))try{let q=z.trim().replace(/;$/,""),K=m8(q,Z);if(K!==void 0)Z[G]=K}catch{}}}function Az($){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 Mz($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var y2=new n1(500),v9=new n1(1000),qZ=33554432,l$=qZ;function Iz($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===l$)return;l$=Z,f9.setMaxBytes(Z)}var f9=new n1(2000,{maxBytes:qZ,sizeOf:($)=>$.output.length});function kz($){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 Q={};for(let Y of Object.keys(X).sort())Q[Y]=J(X[Y]);return Q};return JSON.stringify(J($))}catch{return null}}function ZZ($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Tz($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function M1($){return!Tz($)}var P9=new Map;function d$($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=P9.get(Z);if(J)return J;if(P9.size>=16)P9.clear();let X=new Bun.Transpiler($);return P9.set(Z,X),X}var JZ=new WeakMap,Ez=256;function I1($){try{let Z=d$({loader:"ts",target:"browser",define:e1()}),J=JZ.get(Z);if(!J)J=new Map,JZ.set(Z,J);let X=J.get($);if(X!==void 0)return X;let Q=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Q=Q.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let Y=[];Q=Q.replace(/\{!![\s\S]*?!!\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`}),Q=Q.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`}),Q=Q.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let q=Y.length;return Y.push(z),`"__STX_EXPR_${q}__"`});let G=Z.transformSync(Q);for(let z=0;z<Y.length;z++)G=G.replace(`"__STX_EXPR_${z}__"`,Y[z]),G=G.replace(`'__STX_EXPR_${z}__'`,Y[z]);if(J.size>=Ez){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 bz($){let Z=[],J=new Set,X=0,Q=0,Y=$.length,G=(W)=>{Q++;while(Q<Y){if($[Q]==="\\"){Q+=2;continue}if($[Q]===W){Q++;return}Q++}},z=()=>{Q++;while(Q<Y){if($[Q]==="\\"){Q+=2;continue}if($[Q]==="`"){Q++;return}if($[Q]==="$"&&$[Q+1]==="{"){Q+=2;let W=1;while(Q<Y&&W>0)if($[Q]==="{")W++,Q++;else if($[Q]==="}")W--,Q++;else if($[Q]==="'"||$[Q]==='"')G($[Q]);else if($[Q]==="`")z();else Q++;continue}Q++}},q=()=>{if($[Q]==="/"&&$[Q+1]==="/"){while(Q<Y&&$[Q]!==`
3618
+ `)Q++;return!0}if($[Q]==="/"&&$[Q+1]==="*"){Q+=2;while(Q<Y-1&&!($[Q]==="*"&&$[Q+1]==="/"))Q++;return Q+=2,!0}return!1},K=()=>{if(X!==0)return;let W=$.slice(Q).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(W){let B=W[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let U=$.slice(Q).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(Q).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(Q).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(Q<Y){if(q())continue;if($[Q]==="'"||$[Q]==='"'){G($[Q]);continue}if($[Q]==="`"){z();continue}if($[Q]==="{"){X++,Q++;continue}if($[Q]==="}"){X--,Q++;continue}if(X===0&&/[a-z]/i.test($[Q])&&(Q===0||/\s|[;{}()]/.test($[Q-1])))K();Q++}return Z}function yz($){let Z=[],J=0,X=0,Q=null;for(let Y=0;Y<$.length;Y++){let G=$[Y];if(Q){if(G==="\\"){Y++;continue}if(G===Q)Q=null;continue}if(G==='"'||G==="'"||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Y)),X=Y+1}if(X<$.length)Z.push($.slice(X));return Z}function Cz($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Q=$[X];if(J){if(Q==="\\"){X++;continue}if(Q===J)J=null;continue}if(Q==='"'||Q==="'"||Q==="`"){J=Q;continue}if(Q==="("||Q==="["||Q==="{")Z++;else if(Q===")"||Q==="]"||Q==="}")Z--;else if(Q==="="&&Z===0){let Y=$[X-1],G=$[X+1];if(Y==="!"||Y==="<"||Y===">"||Y==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function Sz($,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 Q=X,Y=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Y++;else if(q==="{"){if(Y--,Y===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Q);for(let q of yz(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let W=Cz(K);if(W===-1)continue;let U=K.slice(0,W).trim();if(!/^[A-Z_$][\w$]*$/i.test(U))continue;if(Z[U]!==void 0)continue;let H=K.slice(W+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(J2),B=Function(...j,`"use strict"; return (${H});`);Z[U]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function B9($,Z,J,X,Q){let Y=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let L of[Y,Y.toLowerCase(),G(Y),z(Y)])if(q.has(L))return!0}let K=[...new Set([`${Y}.stx`,`${G(Y)}.stx`,`${z(Y)}.stx`])],W=typeof Q.root==="string"?x.resolve(Q.root):void 0,U=W??x.dirname(X),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},B=J.__originalFilePath;if(B)j(x.join(x.dirname(B),"components"));if(j(Z),j(Q._rootComponentsDir),j(x.join(x.dirname(X),"components")),j(Q.componentsDir),W)j(x.resolve(W,"resources/views/components")),j(x.resolve(W,"resources/components")),j(x.resolve(W,"src/components")),j(x.resolve(W,"components"));for(let L of Q._layerComponentDirs??[])j(L);let V=Q._pluginComponentDirs;if(Array.isArray(V))for(let L of V)j(typeof L==="string"?L:null);if(j(Q.fallbackComponentsDir),Y.startsWith("./")||Y.startsWith("../"))return e(x.resolve(x.dirname(X),`${Y}.stx`));let F=XZ(x.resolve(import.meta.dir,"components"));for(let L of H){let O=x.isAbsolute(L)?L:x.resolve(U,L);if(XZ(O)===F)continue;for(let _ of K)if(await e(x.join(O,_)))return!0}return!1}function XZ($){try{return zZ.realpathSync($)}catch{return $}}function Pz($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function vz($){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 fz($){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|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Q;while((Q=J.exec(X))!==null)Z.add(Q[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Q,Y,G,z=new Set,q){let{extractVariables:K}=await a("stx/variable-extractor",()=>import("./chunk-d3mdskgy.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"&&Pz(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),V=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,L=null,O=Q.__importedComponents;if(O){let d=[F,F.toLowerCase(),B(F),V(F)];for(let m of d)if(O.has(m)){L=O.get(m);break}}let _=[];if(!L){let d=[`${F}.stx`,`${B(F)}.stx`,`${V(F)}.stx`],m=[...new Set(d)],K0=Q.__originalFilePath,r=[];if(r.push(...G._layerComponentDirs??[]),K0){let A0=x.join(x.dirname(K0),"components");r.push(A0)}if(X)r.push(X);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let D0=x.join(x.dirname(Y),"components");if(!r.includes(D0))r.push(D0);if(G.componentsDir&&G.componentsDir!==X&&!r.includes(G.componentsDir))r.push(G.componentsDir);let P0=typeof G.root==="string"?x.resolve(G.root):void 0,c0=P0??x.dirname(Y),C0=[];if(P0)C0.push(x.resolve(P0,"resources/views/components")),C0.push(x.resolve(P0,"resources/components")),C0.push(x.resolve(P0,"src/components")),C0.push(x.resolve(P0,"components"));C0.push(x.resolve(import.meta.dir,"components"));for(let A0 of C0)if(!r.includes(A0))r.push(A0);let X1=G._pluginComponentDirs;if(Array.isArray(X1)){for(let A0 of X1)if(typeof A0==="string"&&!r.includes(A0))r.push(A0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let t=[...new Set(r.map((A0)=>{if(!A0)return A0;return x.isAbsolute(A0)?A0:x.resolve(c0,A0)}))];r.length=0,r.push(...t);let t0=`${F}\x00${Y}\x00${t.join("\x00")}`,P2=v9.get(t0);if(P2)if(await e(P2))L=P2;else v9.delete(t0);if(!L&&(F.startsWith("./")||F.startsWith("../")))L=x.resolve(x.dirname(Y),`${F}.stx`),_.push(L);else if(!L)for(let A0 of r){if(!A0)continue;for(let v2 of m){let f2=x.join(A0,v2);if(_.push(f2),await e(f2)){L=f2;break}}if(L)break;if(!L)try{let v2=await import("fs");if(!v2.statSync(A0,{throwIfNoEntry:!1})?.isDirectory())continue;let wZ=8,x9=[{path:A0,depth:0}];while(x9.length>0&&!L){let x2=x9.pop();if(x2.depth>=wZ)continue;let n$;try{n$=v2.readdirSync(x2.path,{withFileTypes:!0})}catch{continue}for(let g2 of n$){if(!g2.isDirectory())continue;if(g2.name==="node_modules"||g2.name.startsWith("."))continue;let s$=x.join(x2.path,g2.name);for(let RZ of m){let g9=x.join(s$,RZ);if(_.push(g9),await e(g9)){L=g9;break}}if(L)break;x9.push({path:s$,depth:x2.depth+1})}}}catch{}if(L)break}if(L)v9.set(t0,L)}if(!L||!await e(L)){let d=_.length>0?`
3619
3619
  Searched paths:
3620
3620
  ${_.map((m)=>` - ${m}`).join(`
3621
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(L);let w;if(y2.has(L))w=y2.get(L);else try{w=await Bun.file(L).text(),y2.set(L,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",h2,"__stx_client_signal_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),N={};for(let[d,m]of Object.entries(Q))if(!d.startsWith("__")||R.has(d))N[d]=m;let A=J;if(J.includes("@include")){let{processIncludes:d}=await a("stx/includes",()=>import("./chunk-k38dv15t.js"));A=await d(J,Q,Y,G,q)}let k=n0(A),D=[],I=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let K0=k.scripts[Number(m)]||"",r=K0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),D0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&D0)return D.push(K0),"";return K0}),{extractSlotContent:T}=await a("stx/slots",()=>import("./chunk-gnjfhktx.js")),M=T(I),E={};if(M.defaultSlot?.trim())E.default=M.defaultSlot;for(let[d,m]of M.namedSlots)E[d]=m.content;let C=Q.__stx_scope_seq??={n:0,key:Bun.hash(String(Q.__filename??Y)).toString(36).slice(0,6)},y=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++C.n}_${C.key}`,b={...N,$uid:y,...Z,props:Z,slot:I,$slots:E,__processedComponents:U,__sections:{},__stx_signals_gate:Y1(w)||Pz(J)};Cz(w,b);let P=w,g=z9(P);if(g)P=g.content.trim();let c=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,l=[...w.matchAll(c)],h=[],s=l.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),u=null,z0=null,d0=null,x0=0,m0=null;if(Mz(G),s&&l$>0){let d=Iz({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,layers:G._layerGraph?.layers.map((m)=>m.configFile),uid:y});if(d!==null){u=`${L}\x00${H1(w)}\x00${d}`;let m=f9.get(u);if(m){for(let K0 of m.dependencies)q.add(K0);if(z3(Q,m.clientFactories),C.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let K0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let r of m.preservedClientExpressions)K0.add(r);Q.__stx_preserved_client_expressions=[...K0]}return m.output}z0=new Set(q),d0=Q3(Q),x0=C.n,m0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[])}}for(let d of l){let m=d[1]||"",K0=d[2]||"",r=m.includes("server");if(M1(m)&&K0.trim())K0=I1(K0);if(r&&K0)try{await K(K0,b,L)}catch(D0){}if(!r){let D0=K0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=D0.includes("{{")&&D0.includes("}}"),c0=D0.includes("{!!")&&D0.includes("!!}");if(P0||c0)D0=p9(D0,b);let C0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");h.push(`<script${C0}>${D0}</script>`)}}let J0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),j0=J0?J0[1]:"",p=J0?J0[2]:"",i="",U0=j0&&/\bscoped\b/i.test(j0);if(J0)i=`<style${j0}>${p}</style>`;let Y0=P;if(Y0=Y0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),J0)Y0=Y0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(Y0=Y0.replace(d,(K0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)m.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),Y0=Y0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)i=`${i}${m.join(`
3622
- `)}`}if(J&&Y0.includes("{{ text || slot }}"))Y0=Y0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:O0}=await a("stx/slots",()=>import("./chunk-gnjfhktx.js")),{defaultSlot:E0,namedSlots:j1}=M,X2=h.some((d)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),S2=(d)=>X2?j8(d,y):d,S=new Map([...j1].map(([d,m])=>[d,{...m,content:S2(m.content)}]));Y0=await O0(Y0,S2(E0),S,b);let v=vz(h),o=Array.isArray(b.__stx_client_signal_names)?b.__stx_client_signal_names:[];if(v.length>0||o.length>0)b.__stx_client_signal_names=[...new Set([...o,...v])];let X0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:X2||h.length===0,defaultLayout:void 0};b.__stxProcessingDepth=(Q.__stxProcessingDepth||0)+1;let W0=await h$(Y0,b,L,X0,q),N0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let d of W0.matchAll(/\{\{([\s\S]*?)\}\}/g))N0.add(d[1].trim());if(N0.size>0)Q.__stx_preserved_client_expressions=[...N0];let l0=y,S0=W0;if(X2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${ZZ(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${ZZ(j)}"`:"";S0=`<div data-stx-scope="${l0}"${d}${m}>${W0}</div>`;let K0=await Promise.all(h.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,D0,P0]=F0,{vendorStyleTags:c0,factoryBody:C0}=await gz(P0,L,G.buildMode==="compile"),X1=j?null:d9(Q,C0),t=X1?`window.__stxComponentFactories[${JSON.stringify(X1)}](${JSON.stringify(l0)});`:`(${C0})(${JSON.stringify(l0)});`;if(j)return`${c0}<script type="stx/island" data-stx-island="${l0}" data-stx-scoped data-stx-owner="${l0}"${D0}>${t}</script>`;return`${c0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${l0}"${D0}>${t}</script>`}));if(S0=S0+`
3621
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(L);let w;if(y2.has(L))w=y2.get(L);else try{w=await Bun.file(L).text(),y2.set(L,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",h2,"__stx_client_signal_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),N={};for(let[d,m]of Object.entries(Q))if(!d.startsWith("__")||R.has(d))N[d]=m;let A=J;if(J.includes("@include")){let{processIncludes:d}=await a("stx/includes",()=>import("./chunk-ff5ztp8g.js"));A=await d(J,Q,Y,G,q)}let k=n0(A),D=[],I=k.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let K0=k.scripts[Number(m)]||"",r=K0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),D0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&D0)return D.push(K0),"";return K0}),{extractSlotContent:T}=await a("stx/slots",()=>import("./chunk-m9b8ahkp.js")),M=T(I),E={};if(M.defaultSlot?.trim())E.default=M.defaultSlot;for(let[d,m]of M.namedSlots)E[d]=m.content;let C=Q.__stx_scope_seq??={n:0,key:Bun.hash(String(Q.__filename??Y)).toString(36).slice(0,6)},y=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++C.n}_${C.key}`,b={...N,$uid:y,...Z,props:Z,slot:I,$slots:E,__processedComponents:U,__sections:{},__stx_signals_gate:Y1(w)||vz(J)};Sz(w,b);let P=w,g=z9(P);if(g)P=g.content.trim();let c=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,l=[...w.matchAll(c)],h=[],s=l.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),u=null,z0=null,d0=null,x0=0,m0=null;if(Iz(G),s&&l$>0){let d=kz({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,layers:G._layerGraph?.layers.map((m)=>m.configFile),uid:y});if(d!==null){u=`${L}\x00${H1(w)}\x00${d}`;let m=f9.get(u);if(m){for(let K0 of m.dependencies)q.add(K0);if(z3(Q,m.clientFactories),C.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let K0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let r of m.preservedClientExpressions)K0.add(r);Q.__stx_preserved_client_expressions=[...K0]}return m.output}z0=new Set(q),d0=Q3(Q),x0=C.n,m0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[])}}for(let d of l){let m=d[1]||"",K0=d[2]||"",r=m.includes("server");if(M1(m)&&K0.trim())K0=I1(K0);if(r&&K0)try{await K(K0,b,L)}catch(D0){}if(!r){let D0=K0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=D0.includes("{{")&&D0.includes("}}"),c0=D0.includes("{!!")&&D0.includes("!!}");if(P0||c0)D0=p9(D0,b);let C0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");h.push(`<script${C0}>${D0}</script>`)}}let J0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),j0=J0?J0[1]:"",p=J0?J0[2]:"",i="",U0=j0&&/\bscoped\b/i.test(j0);if(J0)i=`<style${j0}>${p}</style>`;let Y0=P;if(Y0=Y0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),J0)Y0=Y0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(Y0=Y0.replace(d,(K0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)m.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),Y0=Y0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)i=`${i}${m.join(`
3622
+ `)}`}if(J&&Y0.includes("{{ text || slot }}"))Y0=Y0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:O0}=await a("stx/slots",()=>import("./chunk-m9b8ahkp.js")),{defaultSlot:E0,namedSlots:j1}=M,X2=h.some((d)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),S2=(d)=>X2?j8(d,y):d,S=new Map([...j1].map(([d,m])=>[d,{...m,content:S2(m.content)}]));Y0=await O0(Y0,S2(E0),S,b);let v=fz(h),o=Array.isArray(b.__stx_client_signal_names)?b.__stx_client_signal_names:[];if(v.length>0||o.length>0)b.__stx_client_signal_names=[...new Set([...o,...v])];let X0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:X2||h.length===0,defaultLayout:void 0};b.__stxProcessingDepth=(Q.__stxProcessingDepth||0)+1;let W0=await h$(Y0,b,L,X0,q),N0=new Set(Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[]);for(let d of W0.matchAll(/\{\{([\s\S]*?)\}\}/g))N0.add(d[1].trim());if(N0.size>0)Q.__stx_preserved_client_expressions=[...N0];let l0=y,S0=W0;if(X2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${ZZ(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${ZZ(j)}"`:"";S0=`<div data-stx-scope="${l0}"${d}${m}>${W0}</div>`;let K0=await Promise.all(h.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,D0,P0]=F0,{vendorStyleTags:c0,factoryBody:C0}=await hz(P0,L,G.buildMode==="compile"),X1=j?null:d9(Q,C0),t=X1?`window.__stxComponentFactories[${JSON.stringify(X1)}](${JSON.stringify(l0)});`:`(${C0})(${JSON.stringify(l0)});`;if(j)return`${c0}<script type="stx/island" data-stx-island="${l0}" data-stx-scoped data-stx-owner="${l0}"${D0}>${t}</script>`;return`${c0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${l0}"${D0}>${t}</script>`}));if(S0=S0+`
3623
3623
  `+K0.join(`
3624
3624
  `),i)S0+=`
3625
3625
  `+i}else{if(i)S0+=`
@@ -3627,7 +3627,7 @@ ${_.map((m)=>` - ${m}`).join(`
3627
3627
  `+K0.join(`
3628
3628
  `),b.__stx_event_bindings=[]}}if(U0){let d=C9(S0,L);if(d.hasScoped)S0=d.html}if(u&&z0){let d=Array.isArray(Q.__stx_preserved_client_expressions)?Q.__stx_preserved_client_expressions:[];f9.set(u,{output:S0,dependencies:[...q].filter((m)=>!z0.has(m)),clientFactories:d0?G3(Q,d0):[],uidsConsumed:C.n-x0,preservedClientExpressions:m0?d.filter((m)=>!m0.has(m)):[]})}return D.length>0?`${S0}
3629
3629
  ${D.join(`
3630
- `)}`:S0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{W.delete($)}}async function e($){return Bun.file($).exists()}function c$($,Z){let J=x.resolve(Z),X=x.resolve($),Q=J.endsWith(x.sep)?J:J+x.sep;if(X===J||X.startsWith(Q))return X;return null}async function fz($,Z,J,X){let Q=Z.startsWith("layouts/")?Z.slice(8):Z,Y=x.join($,Q);for(let G of Y.endsWith(".stx")?[Y]:[Y,`${Y}.stx`])if(await e(G)){if(X)console.log(`Found layout in ${$}: ${G}`);return J?.add(G),G}return null}async function a2($,Z,J,X){let Q=await xz($,Z,J,X);if(Q===null)return null;let Y=c$(Q,process.cwd());if(Y)return Y;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 q=x.isAbsolute(z)?z:x.resolve(process.cwd(),z);if(c$(Q,q))return x.resolve(Q)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Q} (template: ${$}, from: ${Z})`),null}async function xz($,Z,J,X){if(J.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Q=x.dirname(Z),Y=process.cwd();if($.startsWith("/")){let H=x.join(Y,$),j=c$(H,Y);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 e(j)&&X)X.add(j);return j}let G=x.join(Q,$);if(await e(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 e(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(x.isAbsolute(J.layoutsDir)?J.layoutsDir:x.resolve(process.cwd(),J.layoutsDir));let q=x.resolve(Q),K=process.cwd();for(let H=0;H<10;H++){let j=x.join(q,"layouts"),B=!1;try{B=zZ.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){z.push(j);break}let V=x.dirname(q);if(V===q||V.length<K.length)break;q=V}for(let H of z){let j=await fz(H,$,X,J.debug);if(j)return j}if(J.fallbackLayoutsDir){let H=x.isAbsolute(J.fallbackLayoutsDir)?J.fallbackLayoutsDir:x.resolve(process.cwd(),J.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[x.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let V of B)if(await e(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=x.join(J.partialsDir||Q,"layouts",H[1]);if(await e(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 e(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=x.join(J.partialsDir,"layouts");if(await e(H)){let j=x.join(H,$);if(await e(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 e(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||x.join(process.cwd(),"views"),U=x.join(W,$);if(await e(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 e(H)){if(J.debug)console.log(`Found in views path with extension: ${H}`);if(X)X.add(H);return H}}if(Q.includes("temp")){let H=x.join(x.dirname(Q),"layouts",$);if(await e(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 e(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 KZ($,Z,J){let X=0,Q="",Y="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3630
+ `)}`:S0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{W.delete($)}}async function e($){return Bun.file($).exists()}function c$($,Z){let J=x.resolve(Z),X=x.resolve($),Q=J.endsWith(x.sep)?J:J+x.sep;if(X===J||X.startsWith(Q))return X;return null}async function xz($,Z,J,X){let Q=Z.startsWith("layouts/")?Z.slice(8):Z,Y=x.join($,Q);for(let G of Y.endsWith(".stx")?[Y]:[Y,`${Y}.stx`])if(await e(G)){if(X)console.log(`Found layout in ${$}: ${G}`);return J?.add(G),G}return null}async function a2($,Z,J,X){let Q=await gz($,Z,J,X);if(Q===null)return null;let Y=c$(Q,process.cwd());if(Y)return Y;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 q=x.isAbsolute(z)?z:x.resolve(process.cwd(),z);if(c$(Q,q))return x.resolve(Q)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Q} (template: ${$}, from: ${Z})`),null}async function gz($,Z,J,X){if(J.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Q=x.dirname(Z),Y=process.cwd();if($.startsWith("/")){let H=x.join(Y,$),j=c$(H,Y);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 e(j)&&X)X.add(j);return j}let G=x.join(Q,$);if(await e(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 e(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(x.isAbsolute(J.layoutsDir)?J.layoutsDir:x.resolve(process.cwd(),J.layoutsDir));let q=x.resolve(Q),K=process.cwd();for(let H=0;H<10;H++){let j=x.join(q,"layouts"),B=!1;try{B=zZ.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){z.push(j);break}let V=x.dirname(q);if(V===q||V.length<K.length)break;q=V}for(let H of z){let j=await xz(H,$,X,J.debug);if(j)return j}if(J.fallbackLayoutsDir){let H=x.isAbsolute(J.fallbackLayoutsDir)?J.fallbackLayoutsDir:x.resolve(process.cwd(),J.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[x.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let V of B)if(await e(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=x.join(J.partialsDir||Q,"layouts",H[1]);if(await e(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 e(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=x.join(J.partialsDir,"layouts");if(await e(H)){let j=x.join(H,$);if(await e(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 e(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||x.join(process.cwd(),"views"),U=x.join(W,$);if(await e(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 e(H)){if(J.debug)console.log(`Found in views path with extension: ${H}`);if(X)X.add(H);return H}}if(Q.includes("temp")){let H=x.join(x.dirname(Q),"layouts",$);if(await e(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 e(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 KZ($,Z,J){let X=0,Q="",Y="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3631
3631
  `),z=0;for(let q=0;q<G.length;q++)if(z+=G[q].length+1,z>=Z){X=q+1,Q=G[q].trim();let K=Math.max(0,q-2),W=Math.min(G.length,q+3);Y=G.slice(K,W).map((U,H)=>{let j=K+H+1;return`${j===X?"> ":" "}${j}: ${U}`}).join(`
3632
3632
  `);break}}else if(J){let G=$.indexOf(J);if(G>=0)return KZ($,G)}}catch{}return{lineNumber:X,lineContent:Q,context:Y}}var $0={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,Q,Y){let{lineNumber:G,context:z}=KZ(X,Q,Y),q=J.split("/").pop(),K=0;if(typeof Q==="number"&&Q>=0&&X){let U=X.lastIndexOf(`
3633
3633
  `,Math.max(0,Q-1));K=Q-(U+1)+1}let W="";if(G>0)W+=`
@@ -3642,7 +3642,7 @@ ${$0.yellow}${$0.bold}Message:${$0.reset} ${Z}
3642
3642
  `,z)W+=`
3643
3643
  ${$0.blue}${$0.bold}Context:${$0.reset}
3644
3644
  ${$0.dim}${z}${$0.reset}
3645
- `;return W}function YL(){y2.clear(),v9.clear(),f9.clear()}function QL(){return{size:y2.size,maxSize:500}}var m$=E1(128);async function gz($,Z,J){let X=H1($,Z,J),Q=m$.get(X);if(Q){if(GZ(Q.deps))return Q;m$.delete(X)}let Y=p$($,{filePath:Z,projectRoot:process.cwd()}),G=Y.code,z=i$(Y.styles);G=t1(G).code;let{hasUserImports:q,bundleClientScript:K}=await a("stx/client-script-bundler",()=>import("./chunk-j3m3ydzv.js")),W=[],U=!1;if(q(G)){let L=G;G=await K(L,Z,{projectRoot:process.cwd(),minify:J,collectInputs:W}),U=G===L}let{stripStxRuntimeImports:H}=await a("stx/signal-processing",()=>import("./chunk-z7jx68nh.js"));G=H(G);let j=Z1(G),B=Ez(j),V=`function(__scopeId) {
3645
+ `;return W}function QL(){y2.clear(),v9.clear(),f9.clear()}function GL(){return{size:y2.size,maxSize:500}}var m$=E1(128);async function hz($,Z,J){let X=H1($,Z,J),Q=m$.get(X);if(Q){if(GZ(Q.deps))return Q;m$.delete(X)}let Y=p$($,{filePath:Z,projectRoot:process.cwd()}),G=Y.code,z=i$(Y.styles);G=t1(G).code;let{hasUserImports:q,bundleClientScript:K}=await a("stx/client-script-bundler",()=>import("./chunk-858xqty6.js")),W=[],U=!1;if(q(G)){let L=G;G=await K(L,Z,{projectRoot:process.cwd(),minify:J,collectInputs:W}),U=G===L}let{stripStxRuntimeImports:H}=await a("stx/signal-processing",()=>import("./chunk-5pvfm908.js"));G=H(G);let j=Z1(G),B=bz(j),V=`function(__scopeId) {
3646
3646
  ${i1("const",[...YZ,...B],j)}
3647
3647
  const __scope = window.stx._scopes = window.stx._scopes || {};
3648
3648
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -3671,18 +3671,18 @@ catch (e) {}
3671
3671
  finally {
3672
3672
  window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
3673
3673
  }
3674
- }`,F={vendorStyleTags:z,factoryBody:V,deps:QZ([...W,...Y.styles.map((L)=>L.resolvedPath)])};if(!U&&Y.unresolved.length===0)m$.set(X,F);return F}var hz=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function uz($){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 dz($,Z){let J=Z;while(!0){let X=y1.join(J,"node_modules",$,"package.json");if(C2.existsSync(X))return y1.dirname(X);let Q=y1.dirname(J);if(Q===J)return null;J=Q}}function mz($,Z){if(!$||typeof $!=="object")return null;let J=(Q)=>{if(typeof Q==="string")return Q;if(Q&&typeof Q==="object"){if(typeof Q.import==="string")return Q.import;if(typeof Q.default==="string")return Q.default;if(typeof Q.import==="object")return J(Q.import);if(typeof Q.default==="object")return J(Q.default)}return null};if(Object.prototype.hasOwnProperty.call($,Z))return J($[Z]);let X=null;for(let Q of Object.keys($)){let Y=Q.indexOf("*");if(Y===-1)continue;let G=Q.slice(0,Y),z=Q.slice(Y+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:Q,prefix:G,suffix:z}}if(X){let Q=Z.slice(X.prefix.length,Z.length-X.suffix.length),Y=J($[X.pattern]);if(Y)return Y.replace("*",Q)}return null}function lz($,Z){let J=uz($);if(!J||!J.subpath)return null;let X=dz(J.pkg,Z);if(!X)return null;let Q;try{Q=JSON.parse(C2.readFileSync(y1.join(X,"package.json"),"utf8"))}catch{return null}let Y=`.${J.subpath}`,G=mz(Q.exports,Y);if(!G)return null;let z=y1.resolve(X,G);return C2.existsSync(z)?z:null}function p$($,Z){let J=Z.filePath?y1.dirname(Z.filePath):Z.projectRoot||process.cwd(),X=Z.projectRoot||process.cwd(),Q=new Set,Y=[],G=[];return{code:$.replace(hz,(q,K)=>{let W;try{if(K.startsWith("./")||K.startsWith("../")||K.startsWith("/")){if(W=K.startsWith("/")?K:y1.resolve(J,K),!C2.existsSync(W))throw Error(`file not found: ${W}`)}else{let U=null;try{U=Bun.resolveSync(K,X)}catch{U=lz(K,X)}if(!U)throw Error(`could not resolve ${K} (Bun.resolveSync + exports fallback both failed)`);W=U}}catch(U){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(K)} (from ${Z.filePath||"<unknown>"}): ${U?.message||U}`),G.push(K),""}if(Q.has(W))return"";Q.add(W);try{let U=C2.readFileSync(W,"utf8");Y.push({source:K,resolvedPath:W,contents:U})}catch(U){console.warn(`[stx:vendor-css] could not read ${W}: ${U?.message||U}`),G.push(K)}return""}),styles:Y,unresolved:G}}function cz($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function i$($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${cz(Z.source)}" data-stx-layer="vendor">
3674
+ }`,F={vendorStyleTags:z,factoryBody:V,deps:QZ([...W,...Y.styles.map((L)=>L.resolvedPath)])};if(!U&&Y.unresolved.length===0)m$.set(X,F);return F}var uz=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function dz($){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 mz($,Z){let J=Z;while(!0){let X=y1.join(J,"node_modules",$,"package.json");if(C2.existsSync(X))return y1.dirname(X);let Q=y1.dirname(J);if(Q===J)return null;J=Q}}function lz($,Z){if(!$||typeof $!=="object")return null;let J=(Q)=>{if(typeof Q==="string")return Q;if(Q&&typeof Q==="object"){if(typeof Q.import==="string")return Q.import;if(typeof Q.default==="string")return Q.default;if(typeof Q.import==="object")return J(Q.import);if(typeof Q.default==="object")return J(Q.default)}return null};if(Object.prototype.hasOwnProperty.call($,Z))return J($[Z]);let X=null;for(let Q of Object.keys($)){let Y=Q.indexOf("*");if(Y===-1)continue;let G=Q.slice(0,Y),z=Q.slice(Y+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:Q,prefix:G,suffix:z}}if(X){let Q=Z.slice(X.prefix.length,Z.length-X.suffix.length),Y=J($[X.pattern]);if(Y)return Y.replace("*",Q)}return null}function cz($,Z){let J=dz($);if(!J||!J.subpath)return null;let X=mz(J.pkg,Z);if(!X)return null;let Q;try{Q=JSON.parse(C2.readFileSync(y1.join(X,"package.json"),"utf8"))}catch{return null}let Y=`.${J.subpath}`,G=lz(Q.exports,Y);if(!G)return null;let z=y1.resolve(X,G);return C2.existsSync(z)?z:null}function p$($,Z){let J=Z.filePath?y1.dirname(Z.filePath):Z.projectRoot||process.cwd(),X=Z.projectRoot||process.cwd(),Q=new Set,Y=[],G=[];return{code:$.replace(uz,(q,K)=>{let W;try{if(K.startsWith("./")||K.startsWith("../")||K.startsWith("/")){if(W=K.startsWith("/")?K:y1.resolve(J,K),!C2.existsSync(W))throw Error(`file not found: ${W}`)}else{let U=null;try{U=Bun.resolveSync(K,X)}catch{U=cz(K,X)}if(!U)throw Error(`could not resolve ${K} (Bun.resolveSync + exports fallback both failed)`);W=U}}catch(U){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(K)} (from ${Z.filePath||"<unknown>"}): ${U?.message||U}`),G.push(K),""}if(Q.has(W))return"";Q.add(W);try{let U=C2.readFileSync(W,"utf8");Y.push({source:K,resolvedPath:W,contents:U})}catch(U){console.warn(`[stx:vendor-css] could not read ${W}: ${U?.message||U}`),G.push(K)}return""}),styles:Y,unresolved:G}}function pz($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function i$($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${pz(Z.source)}" data-stx-layer="vendor">
3675
3675
  @layer vendor {
3676
3676
  ${Z.contents}
3677
3677
  }
3678
3678
  </style>`}).join(`
3679
3679
  `)}
3680
- `}var pz=jZ;function t1($){let Z=g0($),J=new Set;for(let z of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let q of z[1].split(",")){let K=q.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(K)J.add(K)}let X=new Set;for(let z of Z.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))X.add(z[1]);for(let z of Z.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let q of z[1].split(",")){let K=q.trim().split(/[:=]/).pop()?.trim();if(K)X.add(K)}let Q=k2.filter((z)=>{if(J.has(z)||X.has(z))return!1;return new RegExp(`\\b${z}\\s*\\(`).test(Z)}),Y=_Z(Z).filter((z)=>!J.has(z)&&!X.has(z));if(Q.length===0&&Y.length===0)return{code:$,imports:Q,models:Y};return{code:`${[Q.length>0?`import { ${Q.join(", ")} } from '@stacksjs/browser'`:"",Y.length>0?"import '@stacksjs/browser'":"",Y.length>0?`const { ${Y.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
3680
+ `}var iz=jZ;function t1($){let Z=g0($),J=new Set;for(let z of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let q of z[1].split(",")){let K=q.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(K)J.add(K)}let X=new Set;for(let z of Z.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))X.add(z[1]);for(let z of Z.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let q of z[1].split(",")){let K=q.trim().split(/[:=]/).pop()?.trim();if(K)X.add(K)}let Q=k2.filter((z)=>{if(J.has(z)||X.has(z))return!1;return OZ(Z,z,!0)}),Y=_Z(Z).filter((z)=>!J.has(z)&&!X.has(z));if(Q.length===0&&Y.length===0)return{code:$,imports:Q,models:Y};return{code:`${[Q.length>0?`import { ${Q.join(", ")} } from '@stacksjs/browser'`:"",Y.length>0?"import '@stacksjs/browser'":"",Y.length>0?`const { ${Y.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
3681
3681
  `)}
3682
- ${$}`,imports:Q,models:Y}}var iz=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 _Z($){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(!iz.has(X[1]))Z.add(X[1]);return Array.from(Z)}function nz($){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 Q=X.trim().split(/[:=]/).pop()?.trim();if(Q&&/^[A-Za-z_$][\w$]*$/.test(Q))Z.add(Q)}return Z}function LZ($){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 Q=new Set,Y=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,G;while((G=Y.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 F=V.trim();if(!F||F.startsWith("type "))continue;let L=F.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!L)continue;let O=L[1],_=L[2]||O;if(Q.add(O),Q.add(_),H==="stx"||H==="@stacksjs/stx")Z.add(O);else J.add(O);if(_!==O)j.push(`${_} = ${O}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";X=X.replace(G[0],B)}let z=nz(X);for(let U of pz){if(Q.has(U)||z.has(U))continue;if(new RegExp(`\\b${U}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(X))Z.add(U)}let q=g0(X),K=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)K.add(V)}}for(let U of k2){if(Q.has(U)||z.has(U)||K.has(U))continue;if(new RegExp(`\\b${U}\\b`,"g").test(q))J.add(U)}let W=_Z(X);for(let U of W)if(!Q.has(U)&&!z.has(U))J.add(U);return{code:X,stxImports:Array.from(Z),browserImports:Array.from(J)}}function OZ($,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
3682
+ ${$}`,imports:Q,models:Y}}var nz=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 _Z($){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(!nz.has(X[1]))Z.add(X[1]);return Array.from(Z)}function sz($){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 Q=X.trim().split(/[:=]/).pop()?.trim();if(Q&&/^[A-Za-z_$][\w$]*$/.test(Q))Z.add(Q)}return Z}function LZ($){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 Q=new Set,Y=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,G;while((G=Y.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 F=V.trim();if(!F||F.startsWith("type "))continue;let L=F.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!L)continue;let O=L[1],_=L[2]||O;if(Q.add(O),Q.add(_),H==="stx"||H==="@stacksjs/stx")Z.add(O);else J.add(O);if(_!==O)j.push(`${_} = ${O}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";X=X.replace(G[0],B)}let z=sz(X);for(let U of iz){if(Q.has(U)||z.has(U))continue;if(new RegExp(`\\b${U}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(X))Z.add(U)}let q=g0(X),K=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)K.add(V)}}for(let U of k2){if(Q.has(U)||z.has(U)||K.has(U))continue;if(OZ(q,U))J.add(U)}let W=_Z(X);for(let U of W)if(!Q.has(U)&&!z.has(U))J.add(U);return{code:X,stxImports:Array.from(Z),browserImports:Array.from(J)}}function OZ($,Z,J=!1){let X=new RegExp(`\\b${Z.replace(/[$]/g,"\\$")}\\b`,"g");for(let Q of $.matchAll(X)){let Y=Q.index??0,G=Y+Z.length,z=Y-1;while(z>=0&&/\s/.test($[z]))z--;if($[z]==="."&&$.slice(Math.max(0,z-2),z+1)!=="...")continue;let q=G;while(q<$.length&&/\s/.test($[q]))q++;if($[q]===":"&&$[q+1]!==":"&&($[z]==="{"||$[z]===","))continue;if(J&&!/^\s*(?:<[^>]*>)?\s*\(/.test($.slice(G)))continue;return!0}return!1}function FZ($,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
3683
3683
  ${J.join(`
3684
3684
  `)}
3685
- ${sz($,Z)}`;return""}function RL($,Z=[]){let{browserImports:J}=LZ($),X=new Set(Z);return OZ([],J.filter((Q)=>!X.has(Q)))}function sz($,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
3685
+ ${oz($,Z)}`;return""}function NL($,Z=[]){let{browserImports:J}=LZ($),X=new Set(Z);return FZ([],J.filter((Q)=>!X.has(Q)))}function oz($,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
3686
3686
  [${J.join(", ")}].forEach(function (e) {
3687
3687
  if (e[1] !== 'undefined') return;
3688
3688
  console.error(
@@ -3691,10 +3691,10 @@ ${sz($,Z)}`;return""}function RL($,Z=[]){let{browserImports:J}=LZ($),X=new Set(Z
3691
3691
  + 'or it should be imported from a relative path so the bundler includes it.'
3692
3692
  );
3693
3693
  });
3694
- `}function b9($){let Z=$.__stxClientPayload;if(Z&&typeof Z==="object"){let X={};for(let Q in Z){let Y=Z[Q];if(typeof Y==="function")continue;X[Q]=Y}return X.__stxDeclaredPayload=!0,X}let J={};for(let X in $){if(X.startsWith("__")||X.startsWith("$"))continue;let Q=$[X];if(typeof Q==="function")continue;J[X]=Q}return J}function WZ($,Z){let J=new Set;for(let X of $.split(",")){let Q=X.trim().replace(/^\.\.\./,"").trim();if(!Q)continue;if(Z){let Y=Q.lastIndexOf(":");if(Y!==-1)Q=Q.slice(Y+1).trim()}if(Q=Q.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(Q))J.add(Q)}return J}function oz($,Z){let J=g0($),{depths:X,balanced:Q}=VZ(J),Y=(z)=>!Q||X[z]===0,G=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${Z}\\b)`,"g");for(let z of J.matchAll(G)){let q=(z.index??0)+z[0].length-z[1].length;if(Y(q))return!0}for(let z of J.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(Y(z.index??0)&&WZ(z[1],!0).has(Z))return!0;for(let z of J.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(Y(z.index??0)&&WZ(z[1],!1).has(Z))return!0;return!1}function rz($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var az=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,UZ=new Set;function tz($,Z){let J=az.test($),X=Z.length>32768;if(!J&&!X)return;if(UZ.has($))return;if(UZ.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 E$($,Z){if(!Z)return"";let J=g0($),X=Z.__stxDeclaredPayload===!0,Q=[];for(let[Y,G]of Object.entries(Z)){if(!/^[A-Za-z_$][\w$]*$/.test(Y))continue;if(Y.startsWith("__")||Y.startsWith("$"))continue;if(!X&&!rz(J,Y))continue;if(oz($,Y)){if(X)console.warn(`[stx] defineClientPayload declares "${Y}", but this client block also declares "${Y}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${Y}" from defineClientPayload.`);continue}let z;try{z=JSON.stringify(G)}catch{continue}if(z===void 0)continue;tz(Y,z),Q.push(` var ${Y} = ${z.replace(/</g,"\\u003c")};`)}if(Q.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
3694
+ `}function b9($){let Z=$.__stxClientPayload;if(Z&&typeof Z==="object"){let X={};for(let Q in Z){let Y=Z[Q];if(typeof Y==="function")continue;X[Q]=Y}return X.__stxDeclaredPayload=!0,X}let J={};for(let X in $){if(X.startsWith("__")||X.startsWith("$"))continue;let Q=$[X];if(typeof Q==="function")continue;J[X]=Q}return J}function WZ($,Z){let J=new Set;for(let X of $.split(",")){let Q=X.trim().replace(/^\.\.\./,"").trim();if(!Q)continue;if(Z){let Y=Q.lastIndexOf(":");if(Y!==-1)Q=Q.slice(Y+1).trim()}if(Q=Q.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(Q))J.add(Q)}return J}function rz($,Z){let J=g0($),{depths:X,balanced:Q}=VZ(J),Y=(z)=>!Q||X[z]===0,G=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${Z}\\b)`,"g");for(let z of J.matchAll(G)){let q=(z.index??0)+z[0].length-z[1].length;if(Y(q))return!0}for(let z of J.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(Y(z.index??0)&&WZ(z[1],!0).has(Z))return!0;for(let z of J.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(Y(z.index??0)&&WZ(z[1],!1).has(Z))return!0;return!1}function az($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var tz=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,UZ=new Set;function ez($,Z){let J=tz.test($),X=Z.length>32768;if(!J&&!X)return;if(UZ.has($))return;if(UZ.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 E$($,Z){if(!Z)return"";let J=g0($),X=Z.__stxDeclaredPayload===!0,Q=[];for(let[Y,G]of Object.entries(Z)){if(!/^[A-Za-z_$][\w$]*$/.test(Y))continue;if(Y.startsWith("__")||Y.startsWith("$"))continue;if(!X&&!az(J,Y))continue;if(rz($,Y)){if(X)console.warn(`[stx] defineClientPayload declares "${Y}", but this client block also declares "${Y}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${Y}" from defineClientPayload.`);continue}let z;try{z=JSON.stringify(G)}catch{continue}if(z===void 0)continue;ez(Y,z),Q.push(` var ${Y} = ${z.replace(/</g,"\\u003c")};`)}if(Q.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
3695
3695
  ${Q.join(`
3696
3696
  `)}
3697
- `}var ez={left:0,middle:1,right:2};function $q($){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=ez[$.mouse];Z.push(`if ($event.button !== ${J}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function Zq($,Z){let{elementId:J,event:X,modifiers:Q}=$,Y=h9($.handler),G=$q(Q),z=[];if(Q.once)z.push("once: true");if(Q.capture)z.push("capture: true");if(Q.passive)z.push("passive: true");let q=z.length>0?`, { ${z.join(", ")} }`:"",K="";if(G)K+=`${G}; `;let W=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),U=`var $emit = function(name, detail) {
3697
+ `}var $q={left:0,middle:1,right:2};function Zq($){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=$q[$.mouse];Z.push(`if ($event.button !== ${J}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function Jq($,Z){let{elementId:J,event:X,modifiers:Q}=$,Y=h9($.handler),G=Zq(Q),z=[];if(Q.once)z.push("once: true");if(Q.capture)z.push("capture: true");if(Q.passive)z.push("passive: true");let q=z.length>0?`, { ${z.join(", ")} }`:"",K="";if(G)K+=`${G}; `;let W=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),U=`var $emit = function(name, detail) {
3698
3698
  $el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
3699
3699
  };`;function H(j){if(/\$emit\s*\(/.test(j))return`${U}
3700
3700
  ${j}`;return`var scope = $el.closest('[data-stx-scope]');
@@ -3737,11 +3737,11 @@ else {
3737
3737
  else {
3738
3738
  ${Y}
3739
3739
  }
3740
- }${q})`}function Jq($){if($.length===0)return"";return`
3740
+ }${q})`}function Xq($){if($.length===0)return"";return`
3741
3741
  // STX: auto-generated event bindings
3742
- ${$.map((J,X)=>Zq(J,X)).join(`
3742
+ ${$.map((J,X)=>Jq(J,X)).join(`
3743
3743
  `)}`}function HZ($){let Z=[],J=new Set,X=$.replace(/^\s*import\s+.*$/gm,""),Q=0,Y=X.length,G=0;while(G<Y){let z=X[G];if(z==="'"||z==='"'||z==="`"){let q=z;if(G++,q==="`"){let K=0;while(G<Y){if(X[G]==="\\"){G+=2;continue}if(X[G]==="`"&&K===0){G++;break}if(X[G]==="$"&&X[G+1]==="{"){K++,G+=2;continue}if(X[G]==="}"&&K>0){K--,G++;continue}G++}}else while(G<Y){if(X[G]==="\\"){G+=2;continue}if(X[G]===q){G++;break}G++}continue}if(z==="/"&&X[G+1]==="/"){while(G<Y&&X[G]!==`
3744
- `)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Y-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Q++,G++;continue}if(z==="}"){Q--,G++;continue}if(Q===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let W=q.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=q.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 Xq=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 Yq($){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(!Xq.has(B))Z.add(B)}}let Q=/\{\{([\s\S]*?)\}\}/g,Y;while((Y=Q.exec($))!==null)X(Y[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Y=G.exec($))!==null)X(Y[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Y=z.exec($))!==null)X(Y[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Y=q.exec($))!==null)X(Y[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Y=K.exec($))!==null)X(Y[1]);let W=/@model\s*=\s*["']([^"']*)["']/gi;while((Y=W.exec($))!==null)X(Y[1]);let U=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Y=U.exec($))!==null)X(Y[1]);return Z}async function y9($,Z={}){let J=$,X="",Q=!1,Y=[],G=p$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=i$(G.styles),q=t1(J);J=q.code,Y=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:W}=await a("stx/client-script-bundler",()=>import("./chunk-j3m3ydzv.js"));if(K(J))J=await W(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Q=!0;if(Z.autoImports!==!1){let _=LZ(J);J=_.code,X=OZ(_.stxImports,_.browserImports.filter((w)=>!Y.includes(w)))}if(X=`${E$(J,Z.serverData)}${X}`,J=Z1(J),!Q&&M1(Z.attrs||""))J=I1(J);let U=Jq(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 _=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),w=`type="module" data-stx-scoped${B}${_?` ${_}`:""}`;return`${z}<script ${w}>
3744
+ `)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Y-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Q++,G++;continue}if(z==="}"){Q--,G++;continue}if(Q===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let W=q.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=q.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 Yq=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 Qq($){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(!Yq.has(B))Z.add(B)}}let Q=/\{\{([\s\S]*?)\}\}/g,Y;while((Y=Q.exec($))!==null)X(Y[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Y=G.exec($))!==null)X(Y[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Y=z.exec($))!==null)X(Y[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Y=q.exec($))!==null)X(Y[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Y=K.exec($))!==null)X(Y[1]);let W=/@model\s*=\s*["']([^"']*)["']/gi;while((Y=W.exec($))!==null)X(Y[1]);let U=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Y=U.exec($))!==null)X(Y[1]);return Z}async function y9($,Z={}){let J=$,X="",Q=!1,Y=[],G=p$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=i$(G.styles),q=t1(J);J=q.code,Y=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:W}=await a("stx/client-script-bundler",()=>import("./chunk-858xqty6.js"));if(K(J))J=await W(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Q=!0;if(Z.autoImports!==!1){let _=LZ(J);J=_.code,X=FZ(_.stxImports,_.browserImports.filter((w)=>!Y.includes(w)))}if(X=`${E$(J,Z.serverData)}${X}`,J=Z1(J),!Q&&M1(Z.attrs||""))J=I1(J);let U=Xq(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 _=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),w=`type="module" data-stx-scoped${B}${_?` ${_}`:""}`;return`${z}<script ${w}>
3745
3745
  ${a1(`${X}${J}
3746
3746
  ${U}`)}
3747
3747
  </script>`}let V=BZ($),F=/function __stx_setup_/.test(J),L=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function O(_){let w=_.length>0?`
@@ -3750,10 +3750,10 @@ window.stx.mount(function() {
3750
3750
  'use strict';
3751
3751
  ${a1(`${X}${J}
3752
3752
  ${U}${w}`)}
3753
- })</script>`}if(!L&&!F){if(V)return O(HZ($));if(Z.templateContent){let _=HZ($);if(_.length>0){let w=Yq(Z.templateContent);if(_.some((N)=>w.has(N)))return O(_)}}}return`${z}<script data-stx-scoped data-stx-run="always"${B}>
3753
+ })</script>`}if(!L&&!F){if(V)return O(HZ($));if(Z.templateContent){let _=HZ($);if(_.length>0){let w=Qq(Z.templateContent);if(_.some((N)=>w.has(N)))return O(_)}}}return`${z}<script data-stx-scoped data-stx-run="always"${B}>
3754
3754
  ;(function() {
3755
3755
  'use strict';
3756
3756
  ${a1(`${X}${J}
3757
3757
  ${U}`)}
3758
3758
  })()</script>`}
3759
- export{rZ as Cl,aZ as Dl,tZ as El,e0 as Fl,s9 as Gl,o9 as Hl,r9 as Il,a9 as Jl,v3 as Kl,P3 as Ll,GJ as Ml,qJ as Nl,WJ as Ol,mq as Pl,lq as Ql,cq as Rl,pq as Sl,iq as Tl,sZ as Ul,b3 as Vl,y3 as Wl,C3 as Xl,S3 as Yl,uq as Zl,p3 as _l,W2 as $l,h9 as am,u9 as bm,MZ as cm,Z3 as dm,Gq as em,k2 as fm,e1 as gm,tB as hm,p$ as im,i$ as jm,pz as km,t1 as lm,LZ as mm,OZ as nm,RL as om,b9 as pm,E$ as qm,y9 as rm,Wq as sm,m2 as tm,Uq as um,Hq as vm,jq as wm,Bq as xm,c2 as ym,TZ as zm,Aq as Am,EZ as Bm,Mq as Cm,c9 as Dm,V3 as Em,Y1 as Fm,p9 as Gm,CZ as Hm,Iq as Im,V1 as Jm,SZ as Km,kq as Lm,v0 as Mm,Tq as Nm,Cq as Om,dZ as Pm,mZ as Qm,k3 as Rm,T3 as Sm,E3 as Tm,gq as Um,f3 as Vm,e9 as Wm,q2 as Xm,p2 as Ym,rq as Zm,t9 as _m,jJ as $m,BJ as an,VJ as bn,aq as cn,g3 as dn,h3 as en,q1 as fn,Y9 as gn,w0 as hn,S7 as in,R5 as jn,K1 as kn,O1 as ln,P7 as mn,V2 as nn,Q9 as on,N5 as pn,TX as qn,bX as rn,x7 as sn,CX as tn,SX as un,h7 as vn,F1 as wn,eW as xn,u7 as yn,T5 as zn,gX as An,k5 as Bn,hX as Cn,uX as Dn,$U as En,ZU as Fn,d7 as Gn,m7 as Hn,l7 as In,dX as Jn,mX as Kn,JU as Ln,XU as Mn,lX as Nn,YU as On,QU as Pn,i7 as Qn,r7 as Rn,y5 as Sn,_U as Tn,O2 as Un,C5 as Vn,S5 as Wn,LU as Xn,QY as Yn,OU as Zn,GY as _n,e7 as $n,FU as ao,zY as bo,wU as co,RU as do,z9 as eo,Z4 as fo,J4 as go,X4 as ho,IU as io,u5 as jo,mU as ko,lU as lo,cU as mo,pU as no,EY as oo,C4 as po,X$ as qo,hY as ro,Y$ as so,f6 as to,RB as uo,d6 as vo,$G as wo,oB as xo,QG as yo,$8 as zo,b$ as Ao,Z8 as Bo,X8 as Co,y$ as Do,RG as Eo,NG as Fo,Y8 as Go,o6 as Ho,DG as Io,MG as Jo,F$ as Ko,M6 as Lo,I6 as Mo,o8 as No,Uz as Oo,Hz as Po,jz as Qo,Bz as Ro,Vz as So,r8 as To,Fz as Uo,Dz as Vo,Az as Wo,e4 as Xo,U$ as Yo,Z6 as Zo,Rj as _o,Nj as $o,c4 as ap,Dj as bp,z$ as cp,q$ as dp,K$ as ep,Q6 as fp,G6 as gp,z6 as hp,V7 as ip,_7 as jp,L7 as kp,O7 as lp,H5 as mp,j5 as np,nK as op,sK as pp,oK as qp,ZX as rp,rK as sp,ij as tp,nj as up,K6 as vp,sj as wp,_Q as xp,U6 as yp,V6 as zp,_$ as Ap,CQ as Bp,L$ as Cp,w6 as Dp,R6 as Ep,dQ as Fp,YB as Gp,QB as Hp,N6 as Ip,GB as Jp,zB as Kp,O$ as Lp,E6 as Mp,A9 as Np,M9 as Op,r1 as Pp,cQ as Qp,y6 as Rp,C6 as Sp,HB as Tp,N$ as Up,pQ as Vp,iQ as Wp,D$ as Xp,A$ as Yp,S6 as Zp,P6 as _p,C$ as $p,S$ as aq,f$ as bq,h$ as cq,eG as dq,Yz as eq,Qz as fq,Gz as gq,zz as hq,kz as iq,M1 as jq,d$ as kq,I1 as lq,B9 as mq,Sz as nq,Pz as oq,vz as pq,A1 as qq,e as rq,a2 as sq,KZ as tq,_0 as uq,YL as vq,QL as wq,i3 as xq,n3 as yq,_1 as zq,s3 as Aq,S1 as Bq,o3 as Cq,U2 as Dq,WK as Eq,EJ as Fq,Z5 as Gq,UK as Hq,J5 as Iq,HK as Jq,jK as Kq,G1 as Lq,BK as Mq,VK as Nq,_K as Oq,LK as Pq,OK as Qq,FK as Rq,bJ as Sq,Y5 as Tq,r3 as Uq,RK as Vq,NK as Wq,DK as Xq,AK as Yq,MK as Zq,t3 as _q,IK as $q,e3 as ar,kK as br,TK as cr,H2 as dr,fJ as er,CK as fr,gJ as gr,Q7 as hr,o2 as ir,gK as jr,H7 as kr,U5 as lr,JW as mr,V5 as nr,zX as or,UX as pr,XW as qr,YW as rr,QW as sr,GW as tr,zW as ur,qW as vr,HX as wr,jX as xr,R7 as yr,_5 as zr,LX as Ar,O5 as Br,y7 as Cr,MW as Dr,IW as Er,w5 as Fr,DX as Gr,C7 as Hr};
3759
+ export{aZ as Cl,tZ as Dl,eZ as El,e0 as Fl,s9 as Gl,o9 as Hl,r9 as Il,a9 as Jl,v3 as Kl,P3 as Ll,zJ as Ml,KJ as Nl,UJ as Ol,lq as Pl,cq as Ql,pq as Rl,iq as Sl,nq as Tl,oZ as Ul,b3 as Vl,y3 as Wl,C3 as Xl,S3 as Yl,dq as Zl,p3 as _l,W2 as $l,h9 as am,u9 as bm,IZ as cm,Z3 as dm,zq as em,k2 as fm,e1 as gm,eB as hm,p$ as im,i$ as jm,iz as km,t1 as lm,LZ as mm,OZ as nm,FZ as om,NL as pm,b9 as qm,E$ as rm,y9 as sm,Uq as tm,m2 as um,Hq as vm,jq as wm,Bq as xm,Vq as ym,c2 as zm,EZ as Am,Mq as Bm,bZ as Cm,Iq as Dm,c9 as Em,V3 as Fm,Y1 as Gm,p9 as Hm,SZ as Im,kq as Jm,V1 as Km,PZ as Lm,Tq as Mm,v0 as Nm,Eq as Om,Sq as Pm,mZ as Qm,lZ as Rm,k3 as Sm,T3 as Tm,E3 as Um,hq as Vm,f3 as Wm,e9 as Xm,q2 as Ym,p2 as Zm,aq as _m,t9 as $m,BJ as an,VJ as bn,_J as cn,tq as dn,g3 as en,h3 as fn,q1 as gn,Y9 as hn,w0 as in,S7 as jn,R5 as kn,K1 as ln,O1 as mn,P7 as nn,V2 as on,Q9 as pn,N5 as qn,EX as rn,yX as sn,x7 as tn,SX as un,PX as vn,h7 as wn,F1 as xn,$U as yn,u7 as zn,T5 as An,hX as Bn,k5 as Cn,uX as Dn,dX as En,ZU as Fn,JU as Gn,d7 as Hn,m7 as In,l7 as Jn,mX as Kn,lX as Ln,XU as Mn,YU as Nn,cX as On,QU as Pn,GU as Qn,i7 as Rn,r7 as Sn,y5 as Tn,LU as Un,O2 as Vn,C5 as Wn,S5 as Xn,OU as Yn,GY as Zn,FU as _n,zY as $n,e7 as ao,wU as bo,qY as co,RU as do,NU as eo,z9 as fo,Z4 as go,J4 as ho,X4 as io,kU as jo,u5 as ko,lU as lo,cU as mo,pU as no,iU as oo,bY as po,C4 as qo,X$ as ro,uY as so,Y$ as to,f6 as uo,NB as vo,d6 as wo,ZG as xo,rB as yo,GG as zo,$8 as Ao,b$ as Bo,Z8 as Co,X8 as Do,y$ as Eo,NG as Fo,DG as Go,Y8 as Ho,o6 as Io,AG as Jo,IG as Ko,F$ as Lo,M6 as Mo,I6 as No,o8 as Oo,Hz as Po,jz as Qo,Bz as Ro,Vz as So,_z as To,r8 as Uo,wz as Vo,Az as Wo,Mz as Xo,e4 as Yo,U$ as Zo,Z6 as _o,Nj as $o,Dj as ap,c4 as bp,Aj as cp,z$ as dp,q$ as ep,K$ as fp,Q6 as gp,G6 as hp,z6 as ip,V7 as jp,_7 as kp,L7 as lp,O7 as mp,H5 as np,j5 as op,sK as pp,oK as qp,rK as rp,JX as sp,aK as tp,nj as up,sj as vp,K6 as wp,oj as xp,LQ as yp,U6 as zp,V6 as Ap,_$ as Bp,SQ as Cp,L$ as Dp,w6 as Ep,R6 as Fp,mQ as Gp,QB as Hp,GB as Ip,N6 as Jp,zB as Kp,qB as Lp,O$ as Mp,E6 as Np,A9 as Op,M9 as Pp,r1 as Qp,pQ as Rp,y6 as Sp,C6 as Tp,jB as Up,N$ as Vp,iQ as Wp,nQ as Xp,D$ as Yp,A$ as Zp,S6 as _p,P6 as $p,C$ as aq,S$ as bq,f$ as cq,h$ as dq,$z as eq,Qz as fq,Gz as gq,zz as hq,qz as iq,Tz as jq,M1 as kq,d$ as lq,I1 as mq,B9 as nq,Pz as oq,vz as pq,fz as qq,A1 as rq,e as sq,a2 as tq,KZ as uq,_0 as vq,QL as wq,GL as xq,i3 as yq,n3 as zq,_1 as Aq,s3 as Bq,S1 as Cq,o3 as Dq,U2 as Eq,UK as Fq,bJ as Gq,Z5 as Hq,HK as Iq,J5 as Jq,jK as Kq,BK as Lq,G1 as Mq,VK as Nq,_K as Oq,LK as Pq,OK as Qq,FK as Rq,wK as Sq,yJ as Tq,Y5 as Uq,r3 as Vq,NK as Wq,DK as Xq,AK as Yq,MK as Zq,IK as _q,t3 as $q,kK as ar,e3 as br,TK as cr,EK as dr,H2 as er,xJ as fr,SK as gr,hJ as hr,Q7 as ir,o2 as jr,hK as kr,H7 as lr,U5 as mr,XW as nr,V5 as or,qX as pr,HX as qr,YW as rr,QW as sr,GW as tr,zW as ur,qW as vr,KW as wr,jX as xr,BX as yr,R7 as zr,_5 as Ar,OX as Br,O5 as Cr,y7 as Dr,IW as Er,kW as Fr,w5 as Gr,AX as Hr,C7 as Ir};