@stacksjs/stx 0.2.915 → 0.2.919
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.
- package/dist/app-shell.js +3 -2
- package/dist/{chunk-frpsrv1e.js → chunk-09xqy448.js} +2 -2
- package/dist/chunk-0ebaf0pr.js +2 -0
- package/dist/chunk-0jjq552g.js +2 -0
- package/dist/chunk-0wctbtad.js +7 -0
- package/dist/{chunk-r7y1196g.js → chunk-0xyfs691.js} +4 -4
- package/dist/{chunk-w98yt4d4.js → chunk-14df2jzs.js} +2 -2
- package/dist/chunk-15rc8t28.js +2 -0
- package/dist/chunk-1a2c4pv8.js +54 -0
- package/dist/{chunk-1jakr6f2.js → chunk-1baxccfq.js} +18 -18
- package/dist/{chunk-0vyytd9v.js → chunk-1bf0grbf.js} +3 -3
- package/dist/chunk-1jrhjn2b.js +2 -0
- package/dist/chunk-1svffhzq.js +2 -0
- package/dist/{chunk-1hx6dyy9.js → chunk-1ts1pg90.js} +2 -2
- package/dist/{chunk-88fx8xc1.js → chunk-1vsjmwr1.js} +2 -2
- package/dist/{chunk-cxsc37fg.js → chunk-2f46pcg0.js} +2 -2
- package/dist/{chunk-pcwq66w3.js → chunk-2jm7map2.js} +2 -2
- package/dist/chunk-2m4ydym0.js +33 -0
- package/dist/chunk-2mv29s6w.js +9 -0
- package/dist/{chunk-d1ka4dvr.js → chunk-2szhk8mh.js} +5 -5
- package/dist/{chunk-gg715pj6.js → chunk-2zb642qr.js} +6 -6
- package/dist/chunk-3aayrnbh.js +21 -0
- package/dist/chunk-3br07y64.js +20 -0
- package/dist/{chunk-2f5jjxcj.js → chunk-3efpqm1f.js} +2 -2
- package/dist/chunk-3ftrv1f7.js +182 -0
- package/dist/{chunk-barb4gka.js → chunk-3hfv217t.js} +6 -6
- package/dist/{chunk-eptzpvn0.js → chunk-3kpxkjgm.js} +3 -3
- package/dist/{chunk-4w8t0a9e.js → chunk-3tcy9r6r.js} +27 -27
- package/dist/{chunk-zv3rn0ch.js → chunk-40j2pmnb.js} +6 -6
- package/dist/chunk-426gq0g5.js +2 -0
- package/dist/chunk-4ge80k8j.js +2 -0
- package/dist/chunk-4vdfqr64.js +2 -0
- package/dist/chunk-4yz33vzb.js +2 -0
- package/dist/chunk-4zcswx6x.js +2 -0
- package/dist/{chunk-smnt37jq.js → chunk-50zzar2c.js} +3 -3
- package/dist/{chunk-vayzmvf5.js → chunk-514yg4dr.js} +6 -6
- package/dist/{chunk-vnk582z7.js → chunk-5fdc8pej.js} +102 -36
- package/dist/chunk-5ht628zp.js +2 -0
- package/dist/chunk-67zy5p7x.js +2 -0
- package/dist/chunk-6bm7t0hm.js +3 -0
- package/dist/{chunk-7qzanp9y.js → chunk-6n6kndk0.js} +1 -1
- package/dist/chunk-6x5a2w5a.js +3 -0
- package/dist/{chunk-xc5esqcb.js → chunk-6ybq9pfh.js} +2 -2
- package/dist/{chunk-23x3k751.js → chunk-7axtwg1f.js} +2 -2
- package/dist/chunk-8153bfpx.js +2 -0
- package/dist/{chunk-16sfjkc4.js → chunk-858p3hkz.js} +2 -2
- package/dist/chunk-86p0m920.js +2 -0
- package/dist/chunk-88texeh4.js +2 -0
- package/dist/chunk-8mye65n9.js +2 -0
- package/dist/chunk-8ycgk8w6.js +2 -0
- package/dist/{chunk-npj20tj9.js → chunk-9707zz6v.js} +2 -2
- package/dist/{chunk-pyyda92j.js → chunk-9gr7m3tb.js} +1 -1
- package/dist/{chunk-952dfmcb.js → chunk-9mack1g8.js} +3 -3
- package/dist/chunk-9xcsn4pb.js +2 -0
- package/dist/{chunk-3jc6yb02.js → chunk-9zwmfkfg.js} +9 -9
- package/dist/chunk-a5tg553d.js +2 -0
- package/dist/chunk-agxxqjjt.js +2 -0
- package/dist/{chunk-phzhmnnm.js → chunk-ayrd026n.js} +3 -3
- package/dist/chunk-b44pvac7.js +2 -0
- package/dist/chunk-b4yp16a2.js +2 -0
- package/dist/{chunk-95j8660f.js → chunk-cbqe84g3.js} +2 -2
- package/dist/{chunk-qsexsrw2.js → chunk-d4xjwebv.js} +5 -5
- package/dist/{chunk-pmn9kynz.js → chunk-d69k67bn.js} +11 -11
- package/dist/chunk-ex6dne7e.js +3 -0
- package/dist/chunk-fb63xppz.js +2 -0
- package/dist/chunk-ffqqkeye.js +2 -0
- package/dist/chunk-fjpt8arw.js +3 -0
- package/dist/{chunk-mgj074y2.js → chunk-fn0y9z1t.js} +5 -5
- package/dist/{chunk-ar6jeqmm.js → chunk-ft34x0h1.js} +4 -4
- package/dist/{chunk-7x3tt27s.js → chunk-fwxgzktt.js} +2 -2
- package/dist/chunk-g1v12bjm.js +2 -0
- package/dist/chunk-gg0kkn2e.js +2 -0
- package/dist/chunk-ggg8b8n1.js +2 -0
- package/dist/chunk-ggrcg7k7.js +2 -0
- package/dist/{chunk-11c7xg1z.js → chunk-gjyz5ma7.js} +1 -1
- package/dist/chunk-gmn9ba8f.js +3 -0
- package/dist/chunk-gqe574d9.js +2 -0
- package/dist/chunk-h4nqjks2.js +2 -0
- package/dist/chunk-hajamm16.js +2 -0
- package/dist/chunk-hg2n2264.js +2 -0
- package/dist/{chunk-6t8ce21j.js → chunk-hht7n4zd.js} +2 -2
- package/dist/chunk-hxabvt31.js +2 -0
- package/dist/chunk-j3sat6vn.js +2 -0
- package/dist/chunk-j9gbnqxq.js +2 -0
- package/dist/{chunk-1hbf5e1h.js → chunk-jgtn9t5n.js} +2 -2
- package/dist/chunk-jj2z4nxa.js +2 -0
- package/dist/{chunk-0jdz31q1.js → chunk-jjq7c8s2.js} +3 -3
- package/dist/chunk-k289127j.js +2 -0
- package/dist/{chunk-p3fepzt9.js → chunk-kk9h53xg.js} +3 -3
- package/dist/{chunk-xnp031ba.js → chunk-ktv65e3n.js} +7 -7
- package/dist/chunk-m1hfh2t4.js +2 -0
- package/dist/{chunk-9b2wdkbq.js → chunk-m390z8w8.js} +11 -11
- package/dist/chunk-m3qwqhxp.js +2 -0
- package/dist/{chunk-t85zac4y.js → chunk-m6hrb7rm.js} +58 -58
- package/dist/{chunk-7gwysmrs.js → chunk-m86sjbx7.js} +3 -3
- package/dist/chunk-m9smh7fs.js +2 -0
- package/dist/{chunk-1jvt9t3r.js → chunk-m9ta0640.js} +2 -2
- package/dist/chunk-mhnjtc42.js +2 -0
- package/dist/{chunk-hhspwfva.js → chunk-mn9t5fnv.js} +2 -2
- package/dist/{chunk-36cz2v8k.js → chunk-mnpfvxpa.js} +31 -31
- package/dist/{chunk-2vx2ben8.js → chunk-mr9pp5cf.js} +2 -2
- package/dist/{chunk-1jxkc6d0.js → chunk-mztjpp7m.js} +2 -2
- package/dist/chunk-n4bxb2hx.js +2 -0
- package/dist/chunk-n958bxm6.js +2 -0
- package/dist/{chunk-8wqhzzkn.js → chunk-neymp1bb.js} +3 -3
- package/dist/chunk-nkbnsbb0.js +3 -0
- package/dist/chunk-nkr1aa5z.js +2 -0
- package/dist/{chunk-nhyv3w4r.js → chunk-p0xqm2ne.js} +1 -1
- package/dist/chunk-p3vswt0f.js +2 -0
- package/dist/{chunk-z110bf2c.js → chunk-p3x7kwb5.js} +7 -7
- package/dist/chunk-p4twxjfs.js +6 -0
- package/dist/chunk-p8wnp4p1.js +2 -0
- package/dist/{chunk-bvqgq18r.js → chunk-p97h91zx.js} +2 -2
- package/dist/chunk-pjv4dskp.js +2 -0
- package/dist/{chunk-5jc9hmwg.js → chunk-pwg544dw.js} +2 -2
- package/dist/chunk-pxvp0cc9.js +3 -0
- package/dist/chunk-q3z252d9.js +2 -0
- package/dist/{chunk-q9gbdzw0.js → chunk-qda8tmk9.js} +2 -2
- package/dist/chunk-qfkak3jb.js +2 -0
- package/dist/chunk-qnytvyy0.js +2 -0
- package/dist/{chunk-fznjm7qt.js → chunk-qsnw0qyp.js} +2 -2
- package/dist/{chunk-ftvpz1j4.js → chunk-qtzfbv7e.js} +5 -5
- package/dist/{chunk-9xmx8hc7.js → chunk-qzqqzraq.js} +8 -8
- package/dist/{chunk-47z0m17p.js → chunk-rk16391e.js} +3 -3
- package/dist/chunk-rt7xy537.js +2 -0
- package/dist/chunk-rwjye578.js +2 -0
- package/dist/{chunk-cwcmmgvz.js → chunk-s1x2pc9b.js} +2 -2
- package/dist/{chunk-zbpvmgjn.js → chunk-sbr3wg75.js} +65 -65
- package/dist/chunk-sftznswb.js +2 -0
- package/dist/{chunk-cq4cwfqf.js → chunk-sxrcac01.js} +2 -2
- package/dist/{chunk-fzcqw147.js → chunk-tb4be5ct.js} +3 -3
- package/dist/{chunk-m8n14s3z.js → chunk-tnbzg7fd.js} +2 -2
- package/dist/{chunk-jr2r2nh5.js → chunk-txk2z7v0.js} +4 -4
- package/dist/chunk-tz5ktd6d.js +2 -0
- package/dist/{chunk-302nw40c.js → chunk-v060015m.js} +1 -1
- package/dist/chunk-v1a5h1tc.js +38 -0
- package/dist/{chunk-7anbc757.js → chunk-v1x96kjr.js} +8 -8
- package/dist/chunk-vb609vbj.js +1323 -0
- package/dist/chunk-vf7tpgqz.js +70 -0
- package/dist/chunk-vtcyber4.js +2 -0
- package/dist/chunk-vtj3dwhh.js +4 -0
- package/dist/{chunk-p9fyn5k4.js → chunk-whnzf9hn.js} +5 -5
- package/dist/chunk-wq2bpt0w.js +2 -0
- package/dist/{chunk-sdmq09jw.js → chunk-wv0wsavj.js} +2 -2
- package/dist/chunk-wv8zt78c.js +2 -0
- package/dist/{chunk-whc4jptx.js → chunk-wxqay5c2.js} +1 -1
- package/dist/{chunk-gfp39bzr.js → chunk-x40j67z1.js} +2 -2
- package/dist/chunk-xakqpa4z.js +3 -0
- package/dist/{chunk-dgt9kfkp.js → chunk-xap1f1bw.js} +2 -2
- package/dist/{chunk-zk5g49p5.js → chunk-xk7hdpq5.js} +3 -3
- package/dist/{chunk-zkwkhesc.js → chunk-xmy75h5v.js} +2 -2
- package/dist/{chunk-dp6r6gtb.js → chunk-xpsg91dh.js} +5 -5
- package/dist/{chunk-va4xam1q.js → chunk-xq5s4vc1.js} +1 -1
- package/dist/chunk-xy3ex6ht.js +2 -0
- package/dist/chunk-y899wtm8.js +2 -0
- package/dist/chunk-ye45znz5.js +2 -0
- package/dist/chunk-yegp50jb.js +2 -0
- package/dist/chunk-yq9aqpk8.js +2 -0
- package/dist/{chunk-5xbx0r3k.js → chunk-yvaqgdv1.js} +2 -2
- package/dist/{chunk-etmq1qny.js → chunk-yye2pec5.js} +14 -14
- package/dist/{chunk-47nzpbvm.js → chunk-yzqb7y45.js} +6 -6
- package/dist/{chunk-n0nf8n0h.js → chunk-z6nyyt3n.js} +6 -6
- package/dist/{chunk-fs43342z.js → chunk-zaj3nnvv.js} +2 -2
- package/dist/{chunk-2qk2ppgm.js → chunk-zb6my502.js} +1 -1
- package/dist/{chunk-ra2tzsvz.js → chunk-zrxvj3zf.js} +5 -5
- package/dist/chunk-zt45dqfx.js +2 -0
- package/dist/cli.js +38 -38
- package/dist/color-mode-boot.d.ts +1 -8
- package/dist/color-mode-boot.js +46 -2
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/ts-css.d.ts +1 -1
- package/dist/dev-server/ts-css.js +2 -2
- package/dist/document-shell.d.ts +2 -0
- package/dist/document-shell.js +15 -3
- package/dist/document-tags.d.ts +2 -0
- package/dist/document-tags.js +9 -0
- package/dist/head-injection.d.ts +2 -0
- package/dist/head-injection.js +1 -0
- package/dist/head.d.ts +2 -0
- package/dist/head.js +2 -2
- package/dist/native/compiler/html-to-ir.d.ts +3 -1
- package/dist/native/compiler/html-to-ir.js +31 -0
- package/dist/native/compiler/ir.d.ts +1 -0
- package/dist/native/components/primitives.d.ts +1 -0
- package/dist/native/event-names.js +2 -0
- package/dist/native/runtime/browser-renderer.d.ts +1 -0
- package/dist/native/runtime/browser-renderer.js +23 -6
- package/dist/native/testing.d.ts +1 -0
- package/dist/native/testing.js +33 -0
- package/dist/page-head.js +1 -9
- package/dist/process.js +1 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +13 -13
- package/dist/types/config-types.d.ts +2 -1
- package/dist/variable-extractor.js +6 -1
- package/package.json +5 -5
- package/dist/chunk-0adc8x2h.js +0 -9
- package/dist/chunk-1gj46s0g.js +0 -2
- package/dist/chunk-1mx3j280.js +0 -2
- package/dist/chunk-1p6gaaf3.js +0 -3
- package/dist/chunk-1rfzs48h.js +0 -2
- package/dist/chunk-20hy5p3p.js +0 -2
- package/dist/chunk-29v3b5ks.js +0 -2
- package/dist/chunk-2cay3heb.js +0 -2
- package/dist/chunk-33fnbw33.js +0 -2
- package/dist/chunk-357qjcj1.js +0 -3
- package/dist/chunk-38y11q8x.js +0 -2
- package/dist/chunk-3q80f7mt.js +0 -2
- package/dist/chunk-43kz6rx9.js +0 -2
- package/dist/chunk-490rrkrp.js +0 -2
- package/dist/chunk-49980am3.js +0 -2
- package/dist/chunk-4a9bqc8f.js +0 -33
- package/dist/chunk-4e18r89n.js +0 -3
- package/dist/chunk-4r0028av.js +0 -1323
- package/dist/chunk-4vz17ytv.js +0 -68
- package/dist/chunk-4w9pvpfd.js +0 -2
- package/dist/chunk-5afnyvw5.js +0 -2
- package/dist/chunk-5pb1x7x6.js +0 -2
- package/dist/chunk-6n50b07t.js +0 -2
- package/dist/chunk-76mn123c.js +0 -2
- package/dist/chunk-8egbh6z1.js +0 -2
- package/dist/chunk-8n9jd8cz.js +0 -2
- package/dist/chunk-8tfpv6zf.js +0 -6
- package/dist/chunk-94qc4zwb.js +0 -2
- package/dist/chunk-9928zdej.js +0 -3
- package/dist/chunk-9ay18k46.js +0 -2
- package/dist/chunk-9tv0tw7f.js +0 -3
- package/dist/chunk-a5h9bwrc.js +0 -2
- package/dist/chunk-am7xmh9p.js +0 -2
- package/dist/chunk-bdkst2wp.js +0 -2
- package/dist/chunk-bej9kz05.js +0 -2
- package/dist/chunk-ccgabq3a.js +0 -2
- package/dist/chunk-cv6d4zr5.js +0 -2
- package/dist/chunk-e5rag6rh.js +0 -3
- package/dist/chunk-eqdg72re.js +0 -2
- package/dist/chunk-fvr3h2fr.js +0 -7
- package/dist/chunk-g0hkknzm.js +0 -2
- package/dist/chunk-g44932zc.js +0 -2
- package/dist/chunk-g4w3wms2.js +0 -2
- package/dist/chunk-gmmqz698.js +0 -2
- package/dist/chunk-hxftzw0x.js +0 -2
- package/dist/chunk-j3d3q3g7.js +0 -2
- package/dist/chunk-jmggm1ep.js +0 -3
- package/dist/chunk-jz37h2z0.js +0 -4
- package/dist/chunk-k8s3hyh2.js +0 -2
- package/dist/chunk-m8mmasgc.js +0 -2
- package/dist/chunk-man5ap64.js +0 -54
- package/dist/chunk-mdgcjzcn.js +0 -38
- package/dist/chunk-mjny8x91.js +0 -2
- package/dist/chunk-mjr5fkc2.js +0 -2
- package/dist/chunk-n1y82svg.js +0 -2
- package/dist/chunk-na0e3s88.js +0 -2
- package/dist/chunk-new89wh2.js +0 -2
- package/dist/chunk-nrap20qt.js +0 -2
- package/dist/chunk-q85wy43m.js +0 -2
- package/dist/chunk-q9yahsww.js +0 -2
- package/dist/chunk-qdwtemy1.js +0 -2
- package/dist/chunk-qp0ndbk6.js +0 -2
- package/dist/chunk-r1fhahnn.js +0 -2
- package/dist/chunk-r4e17p2x.js +0 -2
- package/dist/chunk-rnsa5zz5.js +0 -2
- package/dist/chunk-rzsvxjse.js +0 -2
- package/dist/chunk-senrtnx2.js +0 -2
- package/dist/chunk-sw5g5mbd.js +0 -2
- package/dist/chunk-t63y6qd5.js +0 -2
- package/dist/chunk-v1wr2vdx.js +0 -2
- package/dist/chunk-v6gkjg5f.js +0 -3
- package/dist/chunk-vq7m7xcz.js +0 -182
- package/dist/chunk-wsfqb5jk.js +0 -2
- package/dist/chunk-wvc6eayq.js +0 -2
- package/dist/chunk-wz44vmgn.js +0 -21
- package/dist/chunk-x1kzqxj5.js +0 -2
- package/dist/chunk-xa98a901.js +0 -2
- package/dist/chunk-xj95sk0y.js +0 -2
- package/dist/chunk-xtf3sab5.js +0 -2
- package/dist/chunk-yga49yw3.js +0 -2
- package/dist/chunk-yn02d599.js +0 -2
- package/dist/chunk-z5nx021e.js +0 -20
- package/dist/chunk-z9wwa50p.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{rn,ve,R}from"./chunk-jjq7c8s2.js";import{ee}from"./chunk-2mv29s6w.js";import{d,h,D,n,ce,te,u,Me,ta,K,Fn,na,Zt,ra,Ll,De,tn,tt,we,ne,Hn,Xr,Fl,xt,zl,Gr,Hl,Un,sa,Ul,Jr,Zr,je,oa}from"./chunk-vf7tpgqz.js";import{Li,ll,o,A,Ke,N,Pn,co,bl,wl,On,Vr,uo,po,vl,Vi,xl,Sl,kl,_l,Xe,Ge,fo,Ze,s,Mn,w,m,Z,ae,Ne,P,Yi}from"./chunk-vb609vbj.js";import{Jt}from"./chunk-14df2jzs.js";import{jn}from"./chunk-qda8tmk9.js";import{S}from"./chunk-m390z8w8.js";import{Mr,$n}from"./chunk-5fdc8pej.js";import{qc,Kc,Ir,ft,Xc,j}from"./chunk-3tcy9r6r.js";import{Ci,Ei,Ti,$i}from"./chunk-ktv65e3n.js";import{En,zc,Is}from"./chunk-d69k67bn.js";import{$s,Rs,As}from"./chunk-1a2c4pv8.js";import{Ms,yi,bi,Ds,Ls,wi}from"./chunk-3aayrnbh.js";import{Os,pi}from"./chunk-whnzf9hn.js";import{ci}from"./chunk-zaj3nnvv.js";import{ge,fi,gi,mi}from"./chunk-fjpt8arw.js";import{$r,Ae,Uc,Rr,Vc}from"./chunk-v1x96kjr.js";import{W,dt}from"./chunk-mztjpp7m.js";import{Jc,Yc}from"./chunk-50zzar2c.js";import{I,Vn,ia}from"./chunk-gmn9ba8f.js";import{Kn}from"./chunk-0wctbtad.js";import{O,c,f}from"./chunk-p4twxjfs.js";function Ve(r){return/\bimport\s*\.\s*meta\b/.test(Kn(r))}function Hr(r){let e=De(r),l=[],a=0;for(let g=0;g<e.length;g++){let t=e[g],p=t.name.toLowerCase();if(p==="template")a+=t.closing?-1:1;if(p!=="script"||t.closing)continue;let b=e[g+1];if(b?.name.toLowerCase()!=="script"||!b.closing)continue;l.push({start:t.start,end:b.end,attrs:t.attributes,body:r.slice(t.end,b.start),inert:a>0})}return l}function nt(r){return[...r].map(([e,l])=>l===!0?e:`${e}="${l.replace(/"/g,""")}"`).join(" ")}function wt(r){let e=Hr(r);if(e.some((y)=>N(y.attrs).has("data-stx-module-bootstrap")))return r;let l=(y)=>{if(Ve(y))return!0;try{return ee(y)}catch{return!1}};if(!e.some((y)=>l(y.body)||N(y.attrs).get("type")==="module"))return r;let a=new Bun.CryptoHasher("md5").update(r).digest("hex").slice(0,16),g="",t=0,p=!1,b=0;for(let y of e){let v=N(y.attrs),x=v.get("type");if(y.inert||v.has("data-stx-module-job")||v.has("data-stx-runtime")||v.has("data-stx-router"))continue;if(typeof x==="string"&&!["module","text/javascript","application/javascript"].includes(x.toLowerCase()))continue;if(![...v.keys()].some((T)=>/^data-stx-(?:scoped|modules|stores|(?:framework-)?composables)$/.test(T)))continue;let _=x==="module"||l(y.body);if(_)p=!0;if(!p)continue;if(!_&&(v.has("data-stx-owner")||v.has("data-stx-instance")))continue;g+=r.slice(t,y.start);let E=y.body,M=v.get("src");if(typeof M==="string")v.delete("src"),v.set("data-stx-source-url",M),E=`${_?"await":"return"} new Promise(function(resolve,reject){
|
|
3
3
|
var source=globalThis.__stxExecutingScript,script=document.createElement('script');
|
|
4
4
|
for(var attr of source.attributes)if(!['type','src','data-stx-module-job'].includes(attr.name))script.setAttribute(attr.name,attr.value);
|
|
5
5
|
${_?"script.type='module';":""}
|
|
@@ -8,7 +8,7 @@ script.src=new URL(source.getAttribute('data-stx-source-url'),document.baseURI).
|
|
|
8
8
|
script.onload=function(){${_?"":"globalThis.__stxExecutingScript=__stxPreviousScript;"}resolve();};
|
|
9
9
|
script.onerror=function(error){${_?"":"globalThis.__stxExecutingScript=__stxPreviousScript;"}reject(error);};
|
|
10
10
|
source.parentNode.insertBefore(script,source);
|
|
11
|
-
});`;if(_){let T=`${a}-${
|
|
11
|
+
});`;if(_){let T=`${a}-${b++}`,C=JSON.stringify(T),L=new Map(v);L.delete("type"),L.delete("async"),L.delete("defer"),L.set("data-stx-module-bootstrap",!0),g+=`<script ${nt(L)}>
|
|
12
12
|
;(function(){
|
|
13
13
|
var resolve,reject,previous=globalThis.__stxPageModulesReady||Promise.resolve();
|
|
14
14
|
var ready=new Promise(function(ok,fail){resolve=ok;reject=fail;});
|
|
@@ -27,7 +27,7 @@ window.addEventListener('error',job.fail,true);
|
|
|
27
27
|
globalThis.__stxPageModulesReady=ready;
|
|
28
28
|
ready.catch(function(error){console.error('[stx] page module failed',error);});
|
|
29
29
|
})();
|
|
30
|
-
</script>`,v.set("type","module"),v.delete("async"),v.delete("defer"),v.set("data-stx-module-job",T),
|
|
30
|
+
</script>`,v.set("type","module"),v.delete("async"),v.delete("defer"),v.set("data-stx-module-job",T),g+=`<script ${nt(v)}>
|
|
31
31
|
await globalThis.__stxModuleJobs[${C}].previous;
|
|
32
32
|
globalThis.__stxModuleJobs[${C}].previousScript=globalThis.__stxExecutingScript;
|
|
33
33
|
globalThis.__stxModuleJobs[${C}].script=document.querySelector('script[data-stx-module-job="${T}"]');
|
|
@@ -37,12 +37,12 @@ globalThis.__stxExecutingScript=globalThis.__stxModuleJobs[${C}].previousScript;
|
|
|
37
37
|
window.removeEventListener('error',globalThis.__stxModuleJobs[${C}].fail,true);
|
|
38
38
|
globalThis.__stxModuleJobs[${C}].resolve();
|
|
39
39
|
delete globalThis.__stxModuleJobs[${C}];
|
|
40
|
-
</script>`}else
|
|
40
|
+
</script>`}else g+=`<script ${nt(v)}>
|
|
41
41
|
;(function(__stxSource){
|
|
42
42
|
globalThis.__stxPageModulesReady=(globalThis.__stxPageModulesReady||Promise.resolve()).then(function(){
|
|
43
43
|
var __stxPreviousScript=globalThis.__stxExecutingScript;
|
|
44
44
|
globalThis.__stxExecutingScript=__stxSource;
|
|
45
|
-
${typeof
|
|
45
|
+
${typeof M==="string"?E:`var __stxLive=document.createElement('script');
|
|
46
46
|
for(var __stxAttr of __stxSource.attributes)if(!['src','type'].includes(__stxAttr.name))__stxLive.setAttribute(__stxAttr.name,__stxAttr.value);
|
|
47
47
|
if(__stxSource.nonce)__stxLive.nonce=__stxSource.nonce;
|
|
48
48
|
__stxLive.textContent=${JSON.stringify(E).replace(/<\/script/gi,"<\\/script")};
|
|
@@ -54,9 +54,9 @@ finally { window.removeEventListener('error',__stxCapture); globalThis.__stxExec
|
|
|
54
54
|
if(__stxFailure)throw __stxFailure;`}
|
|
55
55
|
});
|
|
56
56
|
})(document.currentScript);
|
|
57
|
-
</script>`;t=y.end}return
|
|
58
|
-
`),
|
|
59
|
-
`],y=l.start;for(let v of t)
|
|
57
|
+
</script>`;t=y.end}return g+r.slice(t)}import ls from"fs";import le from"path";function vt(r){let e=De(r),l=e.find((v)=>v.closing&&v.name.toLowerCase()==="head");if(!l)return r;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),g=0,t=[];for(let v=0;v<e.length;v++){let x=e[v];if(x.start<l.end)continue;let k=x.name.toLowerCase();if(a.has(k)){g=Math.max(0,g+(x.closing?-1:x.selfClosing?0:1));continue}if(k!=="style"||x.closing||g>0)continue;let _=e[v+1];if(_?.name.toLowerCase()==="style"&&_.closing){if(/@scope\s*\{/.test(r.slice(x.end,_.start)))continue;t.push({start:x.start,end:_.end}),v++}}if(!t.length)return r;let p=t.map((v)=>r.slice(v.start,v.end)).join(`
|
|
58
|
+
`),b=[r.slice(0,l.start),p,`
|
|
59
|
+
`],y=l.start;for(let v of t)b.push(r.slice(y,v.start)),y=v.end;return b.push(r.slice(y)),b.join("")}function St(){return`
|
|
60
60
|
// STX Lifecycle Runtime
|
|
61
61
|
(function() {
|
|
62
62
|
if (typeof window === 'undefined') return;
|
|
@@ -404,7 +404,7 @@ else {
|
|
|
404
404
|
|
|
405
405
|
console.log('[stx] Lifecycle runtime initialized');
|
|
406
406
|
})();
|
|
407
|
-
`}function st(r){return Symbol(r)}var Fs=st("theme"),Us=st("router"),qs=st("i18n");import*as _t from"crypto";function kt(r){let e=/\$(\w+)\./g,l=[],a;while((a=e.exec(r))!==null)if(!l.includes(a[1]))l.push(a[1]);return l}function
|
|
407
|
+
`}function st(r){return Symbol(r)}var Fs=st("theme"),Us=st("router"),qs=st("i18n");import*as _t from"crypto";function kt(r){let e=/\$(\w+)\./g,l=[],a;while((a=e.exec(r))!==null)if(!l.includes(a[1]))l.push(a[1]);return l}function Br(){return`stx-${_t.randomBytes(4).toString("hex")}`}function Fr(r){return/\$\w+\./.test(r)}function Ur(r){if(!/\{\{[^}]*\$\w/.test(r)||!/\$\w+\./.test(r))return{html:r,bindings:[],stores:new Set};let e=[],l=new Set,a=/<(\w+)([^>]*?)(\s*\/?>)/g,g=r;return g=g.replace(a,(t,p,b,y)=>{if(["script","style","template"].includes(p.toLowerCase()))return t;if(!b.includes("{{"))return t;let v=[],x=!1,k=b,_=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,E=[...b.matchAll(_)];for(let C of E){let L=C[0],F=C[1],q=C[2];if(Fr(q)){x=!0;let V=q.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(V){let H=V[1];if(v.push({attr:F,expr:H,fullMatch:L,originalAttr:F}),kt(H).forEach((U)=>l.add(U)),F==="text")k=k.replace(L,"");else if(F==="class")k=k.replace(L,'class=""');else if(F==="disabled"||F==="hidden")k=k.replace(L,"");else k=k.replace(L,`${F}=""`)}}}if(!x)return t;let M=k.match(/\bid\s*=\s*"([^"]+)"/),T;if(M)T=M[1];else T=Br(),k=` id="${T}"${k}`;for(let C of v)e.push({elementId:T,attribute:C.attr,expression:C.expr,stores:kt(C.expr)});return`<${p}${k}${y}`}),{html:g,bindings:e,stores:l}}function qr(r,e){if(r.length===0)return"";let l=Array.from(e),a=`
|
|
408
408
|
<script>
|
|
409
409
|
(function() {
|
|
410
410
|
'use strict';
|
|
@@ -420,11 +420,11 @@ else {
|
|
|
420
420
|
// Store references for expressions
|
|
421
421
|
// eslint-disable-next-line pickier/no-unused-vars
|
|
422
422
|
var $state = {};
|
|
423
|
-
`;for(let
|
|
423
|
+
`;for(let g of l)a+=` $state.${g} = stores.${g} ? stores.${g}.get() : {};
|
|
424
424
|
`;a+=`
|
|
425
425
|
// Binding update functions
|
|
426
426
|
function updateBindings() {
|
|
427
|
-
`;for(let
|
|
427
|
+
`;for(let g of r){let{elementId:t,attribute:p,expression:b}=g,y=b.replace(/\$(\w+)\./g,"$state.$1.");if(p==="text")a+=` (function() {
|
|
428
428
|
var el = document.getElementById('${t}');
|
|
429
429
|
if (el) {
|
|
430
430
|
try {
|
|
@@ -515,14 +515,14 @@ catch (e) { console.error('Binding error:', e); }
|
|
|
515
515
|
// using reactive-bindings stacked another subscription on every store,
|
|
516
516
|
// walking detached DOM forever. See stacksjs/stx#1709.
|
|
517
517
|
var _disposers = [];
|
|
518
|
-
`;for(let
|
|
519
|
-
var _unsub_${
|
|
520
|
-
$state.${
|
|
518
|
+
`;for(let g of l)a+=` if (stores.${g}) {
|
|
519
|
+
var _unsub_${g} = stores.${g}.subscribe(function(state) {
|
|
520
|
+
$state.${g} = state;
|
|
521
521
|
updateBindings();
|
|
522
522
|
});
|
|
523
523
|
// store.subscribe() may return the disposer (preferred) or void; both
|
|
524
524
|
// are tolerated here.
|
|
525
|
-
if (typeof _unsub_${
|
|
525
|
+
if (typeof _unsub_${g} === 'function') _disposers.push(_unsub_${g});
|
|
526
526
|
}
|
|
527
527
|
`;return a+=`
|
|
528
528
|
// Initial update
|
|
@@ -562,10 +562,10 @@ else {
|
|
|
562
562
|
}
|
|
563
563
|
})();
|
|
564
564
|
</script>
|
|
565
|
-
`,a}function $t(r){let{html:e,bindings:l,stores:a}=
|
|
565
|
+
`,a}function $t(r){let{html:e,bindings:l,stores:a}=Ur(r);if(l.length===0)return r;let g=qr(l,a),t=c(e);if(t!==-1)return e.slice(0,t)+g+e.slice(t);return e+g}function Wr(r){let e=r.analytics;if(!e?.enabled)return"";switch(e.driver){case"fathom":return zr(e);case"google-analytics":return Kr(e);case"plausible":return Qr(e);case"self-hosted":return Yr(e);case"custom":return en(e);default:return""}}function zr(r){let e=r.fathom;if(!e?.siteId)return"";let l=e.scriptUrl||"https://cdn.usefathom.com/script.js",a=e.defer!==!1?" defer":"",g=[`data-site="${fe(e.siteId)}"`];if(e.honorDnt)g.push('data-honor-dnt="true"');if(e.spa)g.push('data-spa="auto"');if(e.canonical)g.push(`data-canonical="${fe(e.canonical)}"`);if(e.auto===!1)g.push('data-auto="false"');return`
|
|
566
566
|
<!-- Fathom Analytics -->
|
|
567
|
-
<script src="${fe(l)}" ${
|
|
568
|
-
`}function
|
|
567
|
+
<script src="${fe(l)}" ${g.join(" ")}${a}></script>
|
|
568
|
+
`}function Kr(r){let e=r.googleAnalytics;if(!e?.measurementId)return"";let l=fe(e.measurementId),a=e.debug?`gtag('config', '${l}', { 'debug_mode': true });`:"";return`
|
|
569
569
|
<!-- Google Analytics -->
|
|
570
570
|
<script async src="https://www.googletagmanager.com/gtag/js?id=${l}"></script>
|
|
571
571
|
<script>
|
|
@@ -575,10 +575,10 @@ else {
|
|
|
575
575
|
gtag('config', '${l}');
|
|
576
576
|
${a}
|
|
577
577
|
</script>
|
|
578
|
-
`}function
|
|
578
|
+
`}function Qr(r){let e=r.plausible;if(!e?.domain)return"";let l=e.scriptUrl||"https://plausible.io/js/script.js",a=[`data-domain="${fe(e.domain)}"`],g=l,t=[];if(e.trackLocalhost)t.push("local");if(e.hashMode)t.push("hash");if(t.length>0&&l==="https://plausible.io/js/script.js")g=`https://plausible.io/js/script.${t.join(".")}.js`;return`
|
|
579
579
|
<!-- Plausible Analytics -->
|
|
580
|
-
<script defer data-domain="${fe(e.domain)}" src="${fe(
|
|
581
|
-
`}function
|
|
580
|
+
<script defer data-domain="${fe(e.domain)}" src="${fe(g)}"></script>
|
|
581
|
+
`}function Yr(r){let e=r.selfHosted;if(!e?.siteId||!e?.apiEndpoint)return"";let l=fe(e.siteId),a=fe(e.apiEndpoint),g=e.honorDnt?'if(n.doNotTrack==="1")return;':"",t=e.trackHashChanges?"w.addEventListener('hashchange',pv);":"",p=e.trackOutboundLinks?`
|
|
582
582
|
d.addEventListener('click',function(e){
|
|
583
583
|
var a=e.target.closest('a');
|
|
584
584
|
if(a&&a.hostname!==location.hostname){
|
|
@@ -591,7 +591,7 @@ else {
|
|
|
591
591
|
'use strict';
|
|
592
592
|
var d=document,w=window,n=navigator,s=d.currentScript;
|
|
593
593
|
var site=s.dataset.site,api=s.dataset.api;
|
|
594
|
-
${
|
|
594
|
+
${g}
|
|
595
595
|
var q=[],sid=Math.random().toString(36).slice(2);
|
|
596
596
|
function t(e,p){
|
|
597
597
|
var x=new XMLHttpRequest();
|
|
@@ -611,34 +611,34 @@ else {
|
|
|
611
611
|
w.stxAnalytics={track:function(n,v){t('event',{name:n,value:v});}};
|
|
612
612
|
})();
|
|
613
613
|
</script>
|
|
614
|
-
`}function
|
|
614
|
+
`}function en(r){let e=r.custom;if(!e)return"";if(e.inlineScript)return`
|
|
615
615
|
<!-- Custom Analytics -->
|
|
616
616
|
<script>
|
|
617
617
|
${e.inlineScript}
|
|
618
618
|
</script>
|
|
619
|
-
`;if(!e.scriptUrl)return"";let l=[];if(e.scriptId)l.push(`id="${fe(e.scriptId)}"`);if(e.attributes)for(let[
|
|
619
|
+
`;if(!e.scriptUrl)return"";let l=[];if(e.scriptId)l.push(`id="${fe(e.scriptId)}"`);if(e.attributes)for(let[g,t]of Object.entries(e.attributes))l.push(`${fe(g)}="${fe(t)}"`);return`
|
|
620
620
|
<!-- Custom Analytics -->
|
|
621
621
|
<script${l.length>0?` ${l.join(" ")}`:""} src="${fe(e.scriptUrl)}" defer></script>
|
|
622
|
-
`}function Et(r,e){let l=
|
|
623
|
-
${h}`)}function It(r,e){let l=r;return l=l.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<script nonce="${e}"${h}>`}),l=l.replace(/<style([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<style nonce="${e}"${h}>`}),l}function Ot(r,e,l,a){let h=r,t=a.csp;if(h=h.replace(/@csp\b/g,()=>{if(!t?.enabled||!t.directives)return"<!-- CSP not configured -->";let p=t.useNonce?Ze(e,t):void 0;return Rt(t.directives,p)}),h=h.replace(/@cspNonce\b/g,()=>{if(!t?.enabled||!t.useNonce)return"";return Ze(e,t)}),t?.enabled&&t.useNonce)e.cspNonce=Ze(e,t);return h}import ln from"crypto";var un=40,Lt="_token",at=null;function dn(r=un){let e=ln.randomBytes(Math.ceil(r/2)).toString("hex").slice(0,r);return at=e,e}function pn(){if(!at)dn();return at}function fn(r=Lt){let e=pn();return`<input type="hidden" name="${r}" value="${e}">`}function jt(r){return r.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,l,a)=>fn(a||Lt))}async function Nt(r,e,l,a){if(!a.customDirectives||a.customDirectives.length===0)return r;let h=r;for(let t of a.customDirectives){if(!t.name||typeof t.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",t);continue}if(t.hasEndTag)h=await gn(h,t,e,l,a);else h=await mn(h,t,e,l,a)}return h}async function gn(r,e,l,a,h){let{name:t,handler:p}=e,w=`@${t}`,y=`@end${t}`,v=r,x=en(`${w}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${y}`,"g"),k=[],_=x.exec(v);while(_!==null){let[E,D="",T=""]=_,C=_.index||0;try{let N=D?Ht(e,D):[],F=T.trim(),q=await p(F,N,l,a);k.push({original:E,processed:q,startIndex:C})}catch(N){let F=N instanceof Error?N.message:String(N);if(h.debug)console.error(`Error processing custom directive @${t}:`,N);k.push({original:E,processed:u("CustomDirective",`Error in @${t}${D?`(${D})`:""}: ${F}`,n.EVALUATION_ERROR),startIndex:C})}_=x.exec(v)}for(let E=k.length-1;E>=0;E--){let{original:D,processed:T}=k[E];v=v.replace(D,T)}return v}async function mn(r,e,l,a,h){let{name:t,handler:p}=e,w=r,y=[],v=[];if(e.rawParams){for(let _ of ea(w,en(`(?<![\\w$@])@${t}\\s*\\(`,"g")))if(_.end!==-1)v.push({fullMatch:_.call,paramString:_.args,startIndex:_.start})}else{let _=en(`@${t}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");_.lastIndex=0;let E=_.exec(w);while(E!==null)v.push({fullMatch:E[0],paramString:E[1]??"",startIndex:E.index||0}),E=_.exec(w)}for(let{fullMatch:_,paramString:E,startIndex:D}of v)try{let T=Ht(e,E),C=await p("",T,l,a);y.push({original:_,processed:C,startIndex:D})}catch(T){let C=T instanceof Error?T.message:String(T);if(h.debug)console.error(`Error processing custom directive @${t}:`,T);y.push({original:_,processed:u("CustomDirective",`Error in @${t}(${E}): ${C}`,n.EVALUATION_ERROR),startIndex:D})}let x=en(`@${t}(?!\\w)(?!\\s*\\()`,"g"),k=x.exec(w);while(k!==null){let[_]=k,E=k.index||0;try{let D=await p("",[],l,a);y.push({original:_,processed:D,startIndex:E})}catch(D){let T=D instanceof Error?D.message:String(D);if(h.debug)console.error(`Error processing custom directive @${t}:`,D);y.push({original:_,processed:u("CustomDirective",`Error in @${t}: ${T}`,n.EVALUATION_ERROR),startIndex:E})}k=x.exec(w)}for(let _=y.length-1;_>=0;_--){let{original:E,processed:D}=y[_];w=w.replace(E,D)}return w}function Ht(r,e){return r.rawParams?Zt(e):hn(e)}function hn(r){if(!r.trim())return[];let e=[],l="",a=!1,h="";for(let t=0;t<r.length;t++){let p=r[t];if((p==='"'||p==="'")&&(t===0||r[t-1]!=="\\"))if(!a)a=!0,h=p;else if(p===h)a=!1;else l+=p;else if(p===","&&!a)e.push(l.trim()),l="";else l+=p}if(l.trim())e.push(l.trim());return e.map((t)=>{let p=t.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Bt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Ft=/^[A-Za-z_$][\w$]*$/,yn=new Set(["light","dark","system"]);function Ee(r,e){if(typeof r!=="string"||r.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function bn(r){if(!r||typeof r!=="object"||Array.isArray(r))throw Error("@appearanceBootstrap expects an options object");let e=r,{appearance:l,colorMode:a}=e;if(Ee(e.storageKey,"storageKey"),l!==void 0&&(!l||typeof l!=="object"||Array.isArray(l)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if(Ee(a.key,"colorMode.key"),Ee(a.attribute,"colorMode.attribute"),Ee(a.default,"colorMode.default"),!Ft.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Bt.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!yn.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let h=null;if(l){if(Ee(l.key,"appearance.key"),Ee(l.attribute,"appearance.attribute"),Ee(l.default,"appearance.default"),!Ft.test(l.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Bt.test(l.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(l.allowed)||l.allowed.length===0||l.allowed.some((t)=>typeof t!=="string"||t.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!l.allowed.includes(l.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");h={key:l.key,attribute:l.attribute,allowed:[...new Set(l.allowed)],default:l.default}}return{storageKey:e.storageKey,appearance:h,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function wn(r){return JSON.stringify(r).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function vn(r){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${wn(r)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function xn(r,e){let l=1,a=null,h=!1;for(let t=e+1;t<r.length;t++){let p=r[t];if(h){h=!1;continue}if(a){if(p==="\\")h=!0;else if(p===a)a=null;continue}if(p==='"'||p==="'"||p==="`"){a=p;continue}if(p==="(")l++;else if(p===")"&&--l===0)return t}return-1}function Ut(r,e){let l=r,a=/@appearanceBootstrap\s*\(/g,h;while((h=a.exec(l))!==null){let t=h.index+h[0].length-1,p=xn(l,t);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let w=l.slice(t+1,p).trim(),y=d(`(${w})`,e),v=vn(bn(y));l=l.slice(0,h.index)+v+l.slice(p+1),a.lastIndex=h.index+v.length}return l}import Sn from"crypto";function re(r){return Y(String(r??""))}var Wt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ye(r,e,l,a){let h=r||e;return l?`${h} ${a}`:h}function ye(r){return String(r).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Oe(r,e){if(/\bid\s*=/i.test(r))return"";return` id="${re(e)}"`}function ct(r,e,l){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(l))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(l))a+=` aria-describedby="${re(`${ye(r)}-error`)}"`;return a}function _n(){return Sn.randomUUID()}function et(r,e){let l=r;return l=l.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=_n();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${re(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),l=l.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,h)=>{let t=h.toUpperCase();if(h&&!["GET","POST"].includes(t))return`<input type="hidden" name="_method" value="${re(t)}">`;return a}),l}function Vt(r,e,l=Wt){let a=r;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(h,t,p,w,y,v="")=>{let x=t||p||"POST",k=w||y||"",_=Se(v),E=x.toUpperCase(),D=["GET","POST"].includes(E)?E:"POST",T=`<form method="${re(D)}" action="${re(k)}"${_?` ${_}`:""}>`;if(T+=`
|
|
624
|
-
${
|
|
625
|
-
${
|
|
622
|
+
`}function Et(r,e){let l=Wr(e);if(!l)return r;if(!r.includes("</head>")){let a=c(r);if(a!==-1)return r.slice(0,a)+l+r.slice(a);return r+l}return f(r,l,"")}function fe(r){return r.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function It(r){let e=r.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function Tt(r){let e=r?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import nn from"fs";import it from"path";import{createHighlighter as sn}from"ts-syntax-highlighter";var ot=new Map;async function Ue(r,e={}){try{if(!await s(r))throw Error(`Markdown file not found: ${r}`);let a=(await nn.promises.stat(r)).mtime.getTime();if(e.cache&&ot.has(r)){let k=ot.get(r);if(k.updatedAt>=a)return{content:k.content,data:k.data}}let g=await Bun.file(r).text(),{data:t,content:p}=Ir(g),b=e.markdown||j.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},v=ft(p,{gfm:!0});if(b.syntaxHighlighting?.enabled&&b.syntaxHighlighting?.serverSide)v=await on(v,b.syntaxHighlighting?.defaultTheme||"github-dark",b.syntaxHighlighting?.highlightUnknownLanguages||!1);let x={content:v,data:t||{}};if(e.cache)ot.set(r,{...x,updatedAt:a});return x}catch(l){if(e.debug)console.error(`Error reading/parsing markdown file ${r}:`,l);let a=l instanceof Error?l.message:String(l);return{content:w("Markdown File",`Error reading/parsing markdown file: ${a}`,r,"",0,""),data:{}}}}var ze=null;async function on(r,e,l){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!ze)try{ze=await sn({theme:e||"github-dark",cache:!0})}catch(b){return console.error("Failed to initialize ts-syntax-highlighter:",b),r}let g=async(b,y,v,x)=>{let k=x.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'"),_=v||(l?"text":"");if(!_)return b;try{if(!ze.getSupportedLanguages().includes(_))return b;return(await ze.highlight(k,_,{theme:e})).html}catch(E){console.error(`Error highlighting code block with language ${v}:`,E)}return b},t=r,p=r.matchAll(a);for(let b of p){let[y,v,x,k]=b,_=await g(y,v,x,k);t=t.replace(y,_)}return t}async function Ct(r,e,l="",a={}){return await an(r,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(p,b,y,v)=>{try{let x=b;if(!it.isAbsolute(b))x=it.resolve(it.dirname(l),b);let k={};if(y)try{try{k=JSON.parse(y)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let F=y.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let q of F){let V=q.indexOf(":");if(V>0){let H=q.substring(0,V).trim(),B=q.substring(V+1).trim(),U=B.startsWith('"')&&B.endsWith('"'),J=B.startsWith("'")&&B.endsWith("'");if(U||J)B=B.substring(1,B.length-1);k[H]=B}}}}catch(L){if(a.debug)console.error("Error parsing context in @markdown-file directive:",L)}let{content:_,data:E}=await Ue(x,a),M={...e,...E,...k},T=_,C=/\{\{([^}]+)\}\}/g;return T=T.replace(C,(L,F)=>{let q=F.trim();return M[q]!==void 0?String(M[q]):L}),T}catch(x){let k=x instanceof Error?x.message:String(x);return w("Markdown File",`Error including markdown file: ${k}`,l,r,v,p)}})}async function an(r,e,l){let a=[],g;while((g=e.exec(r))!==null){let b=g[0],y=g.index,v=g;a.push(l(...v).then((x)=>({match:b,replacement:x,index:y})))}let t=await Promise.all(a);t.sort((b,y)=>y.index-b.index);let p=r;for(let{match:b,replacement:y}of t)p=p.replace(b,()=>y);return p}var At=new WeakMap;function Mt(r=16){let e=new Uint8Array(r);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function Je(r,e){if(!r)return e?.nonceGenerator?.()??Mt();let l=At.get(r);if(!l)l=e?.nonceGenerator?.()??Mt(),At.set(r,l);return l}function cn(r,e){let l=[];for(let[a,g]of Object.entries(r)){if(g===void 0||g===null)continue;if(typeof g==="boolean"){if(g)l.push(a);continue}if(Array.isArray(g)){let t=[...g];if(e&&(a==="script-src"||a==="style-src"))t=t.filter((p)=>!p.startsWith("'nonce-")),t.push(`'nonce-${e}'`);if(t.length>0)l.push(`${a} ${t.join(" ")}`)}}return l.join("; ")}function Rt(r,e){return`<meta http-equiv="Content-Security-Policy" content="${cn(r,e).replace(/&/g,"&").replace(/"/g,""")}">`}function Dt(r,e,l){if(!e.enabled||!e.addMetaTag)return r;if(r.includes('http-equiv="Content-Security-Policy"'))return r;if(!r.includes("<head>")&&!r.includes("<head "))return r;let a=e.useNonce?Je(l,e):void 0,g=Rt(e.directives,a);return r.replace(/<head([^>]*)>/,`<head$1>
|
|
623
|
+
${g}`)}function Ot(r,e){let l=r;return l=l.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<script nonce="${e}"${g}>`}),l=l.replace(/<style([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<style nonce="${e}"${g}>`}),l}function Lt(r,e,l,a){let g=r,t=a.csp;if(g=g.replace(/@csp\b/g,()=>{if(!t?.enabled||!t.directives)return"<!-- CSP not configured -->";let p=t.useNonce?Je(e,t):void 0;return Rt(t.directives,p)}),g=g.replace(/@cspNonce\b/g,()=>{if(!t?.enabled||!t.useNonce)return"";return Je(e,t)}),t?.enabled&&t.useNonce)e.cspNonce=Je(e,t);return g}import ln from"crypto";var un=40,Pt="_token",at=null;function dn(r=un){let e=ln.randomBytes(Math.ceil(r/2)).toString("hex").slice(0,r);return at=e,e}function pn(){if(!at)dn();return at}function fn(r=Pt){let e=pn();return`<input type="hidden" name="${r}" value="${e}">`}function jt(r){return r.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,l,a)=>fn(a||Pt))}async function Nt(r,e,l,a){if(!a.customDirectives||a.customDirectives.length===0)return r;let g=r;for(let t of a.customDirectives){if(!t.name||typeof t.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",t);continue}if(t.hasEndTag)g=await gn(g,t,e,l,a);else g=await mn(g,t,e,l,a)}return g}async function gn(r,e,l,a,g){let{name:t,handler:p}=e,b=`@${t}`,y=`@end${t}`,v=r,x=rn(`${b}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${y}`,"g"),k=[],_=x.exec(v);while(_!==null){let[E,M="",T=""]=_,C=_.index||0;try{let L=M?Ht(e,M):[],F=T.trim(),q=await p(F,L,l,a);k.push({original:E,processed:q,startIndex:C})}catch(L){let F=L instanceof Error?L.message:String(L);if(g.debug)console.error(`Error processing custom directive @${t}:`,L);k.push({original:E,processed:u("CustomDirective",`Error in @${t}${M?`(${M})`:""}: ${F}`,n.EVALUATION_ERROR),startIndex:C})}_=x.exec(v)}for(let E=k.length-1;E>=0;E--){let{original:M,processed:T}=k[E];v=v.replace(M,T)}return v}async function mn(r,e,l,a,g){let{name:t,handler:p}=e,b=r,y=[],v=[];if(e.rawParams){for(let _ of na(b,rn(`(?<![\\w$@])@${t}\\s*\\(`,"g")))if(_.end!==-1)v.push({fullMatch:_.call,paramString:_.args,startIndex:_.start})}else{let _=rn(`@${t}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");_.lastIndex=0;let E=_.exec(b);while(E!==null)v.push({fullMatch:E[0],paramString:E[1]??"",startIndex:E.index||0}),E=_.exec(b)}for(let{fullMatch:_,paramString:E,startIndex:M}of v)try{let T=Ht(e,E),C=await p("",T,l,a);y.push({original:_,processed:C,startIndex:M})}catch(T){let C=T instanceof Error?T.message:String(T);if(g.debug)console.error(`Error processing custom directive @${t}:`,T);y.push({original:_,processed:u("CustomDirective",`Error in @${t}(${E}): ${C}`,n.EVALUATION_ERROR),startIndex:M})}let x=rn(`@${t}(?!\\w)(?!\\s*\\()`,"g"),k=x.exec(b);while(k!==null){let[_]=k,E=k.index||0;try{let M=await p("",[],l,a);y.push({original:_,processed:M,startIndex:E})}catch(M){let T=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${t}:`,M);y.push({original:_,processed:u("CustomDirective",`Error in @${t}: ${T}`,n.EVALUATION_ERROR),startIndex:E})}k=x.exec(b)}for(let _=y.length-1;_>=0;_--){let{original:E,processed:M}=y[_];b=b.replace(E,M)}return b}function Ht(r,e){return r.rawParams?Zt(e):hn(e)}function hn(r){if(!r.trim())return[];let e=[],l="",a=!1,g="";for(let t=0;t<r.length;t++){let p=r[t];if((p==='"'||p==="'")&&(t===0||r[t-1]!=="\\"))if(!a)a=!0,g=p;else if(p===g)a=!1;else l+=p;else if(p===","&&!a)e.push(l.trim()),l="";else l+=p}if(l.trim())e.push(l.trim());return e.map((t)=>{let p=t.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Bt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Ft=/^[A-Za-z_$][\w$]*$/,yn=new Set(["light","dark","system"]);function Ee(r,e){if(typeof r!=="string"||r.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function bn(r){if(!r||typeof r!=="object"||Array.isArray(r))throw Error("@appearanceBootstrap expects an options object");let e=r,{appearance:l,colorMode:a}=e;if(Ee(e.storageKey,"storageKey"),l!==void 0&&(!l||typeof l!=="object"||Array.isArray(l)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if(Ee(a.key,"colorMode.key"),Ee(a.attribute,"colorMode.attribute"),Ee(a.default,"colorMode.default"),!Ft.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Bt.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!yn.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(l){if(Ee(l.key,"appearance.key"),Ee(l.attribute,"appearance.attribute"),Ee(l.default,"appearance.default"),!Ft.test(l.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Bt.test(l.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(l.allowed)||l.allowed.length===0||l.allowed.some((t)=>typeof t!=="string"||t.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!l.allowed.includes(l.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:l.key,attribute:l.attribute,allowed:[...new Set(l.allowed)],default:l.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function wn(r){return JSON.stringify(r).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function vn(r){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${wn(r)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function xn(r,e){let l=1,a=null,g=!1;for(let t=e+1;t<r.length;t++){let p=r[t];if(g){g=!1;continue}if(a){if(p==="\\")g=!0;else if(p===a)a=null;continue}if(p==='"'||p==="'"||p==="`"){a=p;continue}if(p==="(")l++;else if(p===")"&&--l===0)return t}return-1}function Ut(r,e){let l=r,a=/@appearanceBootstrap\s*\(/g,g;while((g=a.exec(l))!==null){let t=g.index+g[0].length-1,p=xn(l,t);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let b=l.slice(t+1,p).trim(),y=d(`(${b})`,e),v=vn(bn(y));l=l.slice(0,g.index)+v+l.slice(p+1),a.lastIndex=g.index+v.length}return l}import Sn from"crypto";function re(r){return Z(String(r??""))}var Wt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Qe(r,e,l,a){let g=r||e;return l?`${g} ${a}`:g}function ye(r){return String(r).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Oe(r,e){if(/\bid\s*=/i.test(r))return"";return` id="${re(e)}"`}function ct(r,e,l){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(l))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(l))a+=` aria-describedby="${re(`${ye(r)}-error`)}"`;return a}function kn(){return Sn.randomUUID()}function Ye(r,e){let l=r;return l=l.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=kn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${re(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),l=l.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,g)=>{let t=g.toUpperCase();if(g&&!["GET","POST"].includes(t))return`<input type="hidden" name="_method" value="${re(t)}">`;return a}),l}function Vt(r,e,l=Wt){let a=r;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,t,p,b,y,v="")=>{let x=t||p||"POST",k=b||y||"",_=ke(v),E=x.toUpperCase(),M=["GET","POST"].includes(E)?E:"POST",T=`<form method="${re(M)}" action="${re(k)}"${_?` ${_}`:""}>`;if(T+=`
|
|
624
|
+
${Ye("@csrf",e)}`,!["GET","POST"].includes(E))T+=`
|
|
625
|
+
${Ye(`@method('${E}')`,e)}`;return T}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(g,t,p,b,y,v="")=>{let x=t||p||"",k=b||y||"",_=ke(v),E=Be(x,e),M=E!==void 0&&E!==null?E:k||"",T=_.match(/type=['"]([^'"]+)['"]/i),C=T?T[1]:"text",L=Fe(x,e),F=_.match(/class=['"]([^'"]+)['"]/i),q=Qe(F?F[1]:"",l.input,L,l.inputError),V=_.replace(/class=['"][^'"]+['"]/i,"");return V=V.replace(/type=['"][^'"]+['"]/i,""),`<input type="${re(C)}" name="${re(x)}"${Oe(_,ye(x))} value="${re(M)}" class="${q}"${ct(x,L,_)}${V?` ${V}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(g,t,p="",b="")=>{let y=ke(p),v=Be(t,e)||b.trim(),x=Fe(t,e),k=y.match(/class=['"]([^'"]+)['"]/i),_=Qe(k?k[1]:"",l.input,x,l.inputError),E=y.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${re(t)}"${Oe(y,ye(t))} class="${_}"${ct(t,x,y)}${E?` ${E}`:""}>${re(v)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(g,t,p="",b)=>{let y=ke(p),v=Be(t,e),x=Fe(t,e),k=y.match(/class=['"]([^'"]+)['"]/i),_=Qe(k?k[1]:"",l.input,x,l.inputError),E=y.replace(/class=['"][^'"]+['"]/i,""),M=b;if(v!==void 0)M=b.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(T,C,L)=>{if((Array.isArray(v)?v.some((q)=>String(q)===L):String(v)===L)&&!C.includes("selected"))return C.replace(/(<option)/,"$1 selected");return T});return`<select name="${re(t)}"${Oe(y,ye(t))} class="${_}"${ct(t,x,y)}${E?` ${E}`:""}>${M}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(g,t,p,b="")=>{let y=p===void 0?"1":p,v=p===void 0?ye(t):`${ye(t)}-${ye(y)}`,x=ke(b),k=Be(t,e),_=k!==void 0&&(Array.isArray(k)?k.some((C)=>String(C)===y):k===!0||String(k)===y),E=x.match(/class=['"]([^'"]+)['"]/i),M=E?E[1]:l.checkInput,T=x.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${re(t)}"${Oe(x,v)} value="${re(y)}" class="${M}"${_?" checked":""}${T?` ${T}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,t,p,b="")=>{let y=ke(b),v=Be(t,e),x=v!==void 0&&v===p,k=y.match(/class=['"]([^'"]+)['"]/i),_=k?k[1]:l.checkInput,E=y.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${re(t)}"${Oe(y,`${ye(t)}-${ye(p)}`)} value="${re(p)}" class="${_}"${x?" checked":""}${E?` ${E}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,t,p="")=>{let b=ke(p),y=b.match(/accept=['"]([^'"]+)['"]/i),v=y?y[1]:"",x=b.includes("multiple"),k=Fe(t,e),_=b.match(/class=['"]([^'"]+)['"]/i),E=Qe(_?_[1]:"",l.input,k,l.inputError),M=b.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),T=[`<input type="file" name="${re(t)}"${Oe(b,ye(t))}`,`class="${E}"`];if(v)T.push(`accept="${re(v)}"`);if(x)T.push("multiple");if(M)T.push(M);return`${T.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(g,t,p="",b)=>{let y=ke(p),v=y.match(/class=['"]([^'"]+)['"]/i),x=v?v[1]:l.label,k=y.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${re(ye(t))}" class="${x}"${k?` ${k}`:""}>${b}</label>`}),a}function Xt(r,e,l=Wt){return r.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,g,t)=>{try{if(Fe(g,e)){let p=t.replace(/\{\{([^}]+)\}\}/g,(b,y,v)=>{let x=(k)=>ae(t,v,String(k??""),!1,b.length);try{if(y.trim()==="$message"||y.trim()==="message")return x(qt(g,e));if(y.trim().includes("errors.first")||y.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return x(e.errors.first(g));return x(qt(g,e))}let k=y.trim();if(h(k)){let _=d(k,e);return _!==void 0?x(_):k}return k}catch{return y}});return`<div id="${re(`${ye(g)}-error`)}" role="alert">${p}</div>`}return""}catch(p){return console.error("Error processing @error directive:",p),a}})}function Fe(r,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(r);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,r);return!1}function qt(r,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(r);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,r)){let l=e.errors[r];return Array.isArray(l)?l[0]:String(l)}return""}function Be(r,e){let l;if(e.old&&typeof e.old==="function")return e.old(r);if(e.old&&typeof e.old==="object")return e.old[r];if(r.endsWith("[]")){let a=r.slice(0,-2);if(l=e[a],l!==void 0)return l}return e[r]}function ke(r){if(!r.trim())return"";let e=[],l=r.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,g;while((g=a.exec(l))!==null){let[,t,,p]=g;e.push(`${t}="${p.trim()}"`)}return e.join(" ")}import*as lt from"path";async function zt(r,e,l=""){if(lt.basename(l)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,r.replace(/@js[\s\S]*?@endjs/g,"");return Gt(r,e,l,"@js","@endjs")}async function Kt(r,e,l=""){if(lt.basename(l)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((t)=>({...t,displayName:`User ${t.id}: ${t.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return r.replace(/@ts[\s\S]*?@endts/g,"")}return Gt(r,e,l,"@ts","@endts")}async function Gt(r,e,l,a,g){let t=r,p=rn(`${a}([\\s\\S]*?)${g}`,"g"),b=[],y;while((y=p.exec(r))!==null)b.push({fullMatch:y[0],content:y[1]||"",index:y.index});for(let{fullMatch:v,content:x,index:k}of b)try{let _={...e,global:e},E=Object.keys(_),M=Object.values(_),T=x.trim();if(a==="@ts")T=T.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=(T.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((B)=>B.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),F=L.length>0?`return { ${L.join(", ")} };`:"return {};",q=`
|
|
626
626
|
${T}
|
|
627
627
|
${F}
|
|
628
|
-
`,H=Function(...E,q)(...
|
|
629
|
-
<div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${
|
|
630
|
-
`)}}}return t}async function er(r,e,l,a){return Yt(r,e,l,a,"before")}async function tr(r,e,l,a){return Yt(r,e,l,a,"after")}function rr(r){return r.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,l,a,
|
|
631
|
-
`,T=`${
|
|
632
|
-
@endforeach`;e=e.slice(0,k.outerStart)+T+e.slice(k.outerEnd),l=k.outerStart+
|
|
628
|
+
`,H=Function(...E,q)(...M);if(H&&typeof H==="object")Object.assign(e,H);t=t.replace(v,"")}catch(_){console.error(`Error executing ${a} code block in ${l}:`,_);let E=_ instanceof Error?_.message:String(_),M=w(`${a} Directive`,`Error executing code: ${E}`,l,r,k,v);console.error(M),t=t.replace(v,"")}return t}function _n(r,e="_method"){let l=r.toUpperCase();if(l==="GET"||l==="POST")return"";return`<input type="hidden" name="${e}" value="${l}">`}function Qt(r){return r.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,l,a,g,t)=>_n(a,t||"_method"))}async function Yt(r,e,l,a,g){if(!a.middleware||a.middleware.length===0)return r;let t=r,p=a.middleware.filter((b)=>b.timing===g);if(p.length===0)return t;for(let b of p){if(!b.name||typeof b.handler!=="function"){if(a.debug)console.warn("Invalid middleware:",b);continue}try{let y=await b.handler(t,e,l,a);if(typeof y==="string")t=y;else if(a.debug)console.warn(`Middleware ${b.name} did not return a string`)}catch(y){if(a.debug)console.error(`Error in middleware ${b.name}:`,y);if(a.debug){let v=w("Middleware",`Error in middleware '${b.name}': ${y instanceof Error?y.message:String(y)}`,l,r);t=t.replace(/<body[^>]*>/,`$&
|
|
629
|
+
<div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${m(v)}</div>
|
|
630
|
+
`)}}}return t}async function er(r,e,l,a){return Yt(r,e,l,a,"before")}async function tr(r,e,l,a){return Yt(r,e,l,a,"after")}function rr(r){return r.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,l,a,g,t)=>{try{let p=g?D(g,{}):{};return Mr(a,p,t==="true")}catch(p){return console.error(`Error processing @route directive: ${p}`),"#route-error"}})}var qe={patterns:[],exact:{}};async function nr(r,e){let l=r.split("/").pop()?.split(".")[0]||"";if(qe.exact[r])for(let a of qe.exact[r])await Promise.resolve(a(e,r));if(qe.exact[l])for(let a of qe.exact[l])await Promise.resolve(a(e,r));for(let{pattern:a,callback:g}of qe.patterns)if(a.test(r)||a.test(l))await Promise.resolve(g(e,r))}var Tn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Cn=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 Ce(r,e){let l=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;l.lastIndex=e;let a=l.exec(r);if(!a)return null;let g=/\/\s*>$/.test(a[0])||a[1]===a[1].toLowerCase()&&Tn.has(a[1]),t=g?a[2].replace(/\/\s*$/,""):a[2];return{full:a[0],tag:a[1],attrs:t,selfClosing:g,start:a.index,end:a.index+a[0].length}}function An(r,e,l){let a=1,g=l,t=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),p=new RegExp(`</${e}\\s*>`,"gi");while(a>0&&g<r.length){t.lastIndex=g,p.lastIndex=g;let b=t.exec(r),y=p.exec(r);if(!y)return-1;if(b&&b.index<y.index)a++,g=b.index+b[0].length;else{if(a--,a===0)return y.index+y[0].length;g=y.index+y[0].length}}return-1}function Te(r,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let l=An(r,e.tag,e.end);if(l===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:l,innerHTML:r.slice(e.end,l-`</${e.tag}>`.length)}}function sr(r,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(r)||r.includes(` ${e}=`)||r.includes(` ${e} `)||r.trimEnd().endsWith(` ${e}`)}function We(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=r.match(new RegExp(`${l}="([^"]*)"`,"s"))||r.match(new RegExp(`${l}='([^']*)'`,"s"));return a?a[1]:null}function _e(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return r.replace(new RegExp(`\\s*${l}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${l}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${l}(?=\\s|$|>|/)`,"g"),"")}function Le(r,e,l){let a=e.selfClosing?" /":"",g=`<${e.tag}${l}${a}>`;return r.slice(0,e.start)+g+r.slice(e.end)}function Rn(r){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(r)}function Dn(r){let e=r,l=0;while(l<e.length){let a=Ce(e,l);if(!a)break;let g=We(a.attrs,"v-for");if(g===null){l=a.end;continue}let t=g.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!t){l=a.end;continue}let p=t[1].trim(),b=t[2].trim(),y;if(p.includes(",")){let C=p.split(",").map((q)=>q.trim()),L=C[0],F=C[1];y=`${b} as ${F} => ${L}`}else y=`${b} as ${p}`;let v=_e(a.attrs,"v-for"),x=_e(v,":key").replace(/\s*v-bind:key="[^"]*"/g,""),k=Te(e,a),_=e.slice(k.outerStart,k.outerEnd),E=Le(_,{...a,start:0,end:a.end-a.start},x),M=`@foreach(${y})
|
|
631
|
+
`,T=`${M}${E}
|
|
632
|
+
@endforeach`;e=e.slice(0,k.outerStart)+T+e.slice(k.outerEnd),l=k.outerStart+M.length}return e}function In(r){let e=r,l=0;while(l<e.length){let a=Ce(e,l);if(!a)break;let g=We(a.attrs,"v-if");if(g===null){l=a.end;continue}let t=[],p=Te(e,a),b=_e(a.attrs,"v-if"),y=Le(e.slice(p.outerStart,p.outerEnd),{...a,start:0,end:a.end-a.start},b);t.push({type:"if",expr:g,outerStart:p.outerStart,outerEnd:p.outerEnd,element:y,parsedTag:a});let v=p.outerEnd,x=!0;while(x){let T=e.slice(v).match(/^\s*/),C=T?T[0].length:0,L=Ce(e,v+C);if(!L){x=!1;break}let F=We(L.attrs,"v-else-if"),q=sr(L.attrs,"v-else");if(F!==null){let V=Te(e,L),H=_e(L.attrs,"v-else-if"),B=Le(e.slice(V.outerStart,V.outerEnd),{...L,start:0,end:L.end-L.start},H);t.push({type:"else-if",expr:F,outerStart:v,outerEnd:V.outerEnd,element:B,parsedTag:L}),v=V.outerEnd}else if(q){let V=Te(e,L),H=_e(L.attrs,"v-else"),B=Le(e.slice(V.outerStart,V.outerEnd),{...L,start:0,end:L.end-L.start},H);t.push({type:"else",outerStart:v,outerEnd:V.outerEnd,element:B,parsedTag:L}),x=!1}else x=!1}let k=[];for(let T of t)if(T.type==="if")k.push(`@if(${T.expr})
|
|
633
633
|
${T.element}`);else if(T.type==="else-if")k.push(`@elseif(${T.expr})
|
|
634
634
|
${T.element}`);else k.push(`@else
|
|
635
635
|
${T.element}`);k.push("@endif");let _=k.join(`
|
|
636
|
-
`),E=t[0].outerStart,
|
|
637
|
-
${
|
|
638
|
-
@endonce`;e=e.slice(0,t.outerStart)+y+e.slice(t.outerEnd),l=t.outerStart+y.length}return e}function Gn(r){return r.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function Zn(r){return r.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 ir(r){if(!
|
|
639
|
-
<meta name="stx-build" content="${e}">`}var
|
|
636
|
+
`),E=t[0].outerStart,M=t[t.length-1].outerEnd;e=e.slice(0,E)+_+e.slice(M),l=E+_.length}return e}function Ln(r){return r.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function Nn(r){let e=r,l=0;while(l<e.length){let a=Ce(e,l);if(!a)break;let g=Cn.has(a.tag),t=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(b,y,v)=>{let x=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(y);if(!x||!v||!/^["']/.test(v))return b;let k=x[1]||"modelValue",_=x[2];if(g&&!x[1])return`@model${_}=${v}`;let E=v[0],M=v.slice(1,-1),T=`:${k}=${v} @update:${k}=${E}${M} = $event${E}`;if(_){let C=x[1]?`${k}Modifiers`:"modelModifiers",L=_.slice(1).split(".").map((F)=>`${F}: true`).join(", ");T+=` :${C}="{ ${L} }"`}return T});if(t===a.attrs){l=a.end;continue}let p=Le(a.full,{...a,start:0,end:a.full.length},t);e=e.slice(0,a.start)+p+e.slice(a.end),l=a.start+p.length}return e}function Bn(r){return r.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function qn(r){return r.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function Wn(r){let e=r,l=0;while(l<e.length){let a=Ce(e,l);if(!a)break;let g=We(a.attrs,"v-html");if(g===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let t=Te(e,a),p=_e(a.attrs,"v-html"),b=a.selfClosing?" /":"",y=`<${a.tag}${p}${b}>{!! ${g} !!}</${a.tag}>`;e=e.slice(0,t.outerStart)+y+e.slice(t.outerEnd),l=t.outerStart+y.length}return e}function Xn(r){let e=r,l=0;while(l<e.length){let a=Ce(e,l);if(!a)break;let g=We(a.attrs,"v-text");if(g===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let t=Te(e,a),p=_e(a.attrs,"v-text"),b=a.selfClosing?" /":"",y=`<${a.tag}${p}${b}>{{ ${g} }}</${a.tag}>`;e=e.slice(0,t.outerStart)+y+e.slice(t.outerEnd),l=t.outerStart+y.length}return e}function zn(r){return r.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 Jn(r){let e=r,l=0;while(l<e.length){let a=Ce(e,l);if(!a)break;if(!sr(a.attrs,"v-once")){l=a.end;continue}let g=_e(a.attrs,"v-once"),t=Te(e,a),p=e.slice(t.outerStart,t.outerEnd),y=`@once
|
|
637
|
+
${Le(p,{...a,start:0,end:a.end-a.start},g)}
|
|
638
|
+
@endonce`;e=e.slice(0,t.outerStart)+y+e.slice(t.outerEnd),l=t.outerStart+y.length}return e}function Gn(r){return r.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function Zn(r){return r.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 ir(r){if(!Rn(r))return r;let e=r;return e=Dn(e),e=In(e),e=Jn(e),e=Bn(e),e=qn(e),e=Nn(e),e=Ln(e),e=Zn(e),e=Wn(e),e=Xn(e),e=zn(e),e=Gn(e),e}function et(r){return r.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}var ut=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"]),Qn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Yn(r,e){let l=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(r),a=l?l[1]:r,g=d(a,e);if(g&&typeof g==="string")return g;let t=a.trim();return ut.has(t)?t:null}function or(r){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(r);return e?e[1]:r}function ar(r,e,l){let a=e.replace(/\s*(?::is|v-bind:is|__stx_is)\s*=\s*"[^"]*"/gi,"").replace(/\b__stx_([\w-]+)\s*=\s*"([^"]*)"/g,(t,p,b)=>{let y=En(b);if(y===null||y===void 0||y===!1)return"";if(y===!0)return p;return`${p}="${String(y).replace(/&/g,"&").replace(/"/g,""")}"`}).trim(),g=a?`<${r} ${a}>`:`<${r}>`;if(Qn.has(r))return a?`<${r} ${a}>`:`<${r}>`;return`${g}${l}</${r}>`}function cr(r,e,l){if(e!==void 0){let a=En(e);return typeof a==="string"&&a?a:null}return Yn(r??"",l)}function lr(r,e){let l={},a=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,g;while((g=a.exec(r.trim()))!==null){let t=g[1]||g[2],p=g[3];if(g[1])try{l[t]=d(p,e)}catch{l[t]=p}else if(t.startsWith("__stx_"))l[t.slice(6)]=En(p);else l[t]=p}return l}async function ur(r,e,l,a,g){let t=r,p=/<component\s+(?:(?::is|v-bind:is)\s*=\s*"([^"]*)"|__stx_is\s*=\s*"([^"]*)")([^>]*)>([\s\S]*?)<\/component>/gi,b=[],y;while((y=p.exec(t))!==null)b.push({full:y[0],expr:y[1],encoded:y[2],attrs:y[3],slotContent:y[4],index:y.index});for(let v=b.length-1;v>=0;v--){let x=b[v];try{let k=cr(x.expr,x.encoded,e);if(!k||typeof k!=="string"){let T=`<!-- dynamic component: could not resolve "${et(or(x.expr??"a value a loop evaluated"))}" -->`;t=t.slice(0,x.index)+T+t.slice(x.index+x.full.length);continue}if(ut.has(k)){let T=ar(k,x.attrs,x.slotContent);t=t.slice(0,x.index)+T+t.slice(x.index+x.full.length);continue}let _=lr(x.attrs,e),E=a.componentsDir||"components",M=await Ze(k,_,x.slotContent,E,e,l,a,new Set,g??new Set);t=t.slice(0,x.index)+M+t.slice(x.index+x.full.length)}catch(k){let _=k instanceof Error?k.message:String(k),E=`<!-- dynamic component error: ${et(_)} -->`;t=t.slice(0,x.index)+E+t.slice(x.index+x.full.length)}}return t=await es(t,e,l,a,g),t}async function es(r,e,l,a,g){let t=r,p=/<component\s+(?:(?::is|v-bind:is)\s*=\s*"([^"]*)"|__stx_is\s*=\s*"([^"]*)")([^>]*?)\/>/gi,b=[],y;while((y=p.exec(t))!==null)b.push({full:y[0],expr:y[1],encoded:y[2],attrs:y[3],index:y.index});for(let v=b.length-1;v>=0;v--){let x=b[v];try{let k=cr(x.expr,x.encoded,e);if(!k||typeof k!=="string"){let M=`<!-- dynamic component: could not resolve "${et(or(x.expr??"a value a loop evaluated"))}" -->`;t=t.slice(0,x.index)+M+t.slice(x.index+x.full.length);continue}if(ut.has(k)){let M=ar(k,x.attrs,"");t=t.slice(0,x.index)+M+t.slice(x.index+x.full.length);continue}let _=a.componentsDir||"components",E=await Ze(k,lr(x.attrs,e),"",_,e,l,a,new Set,g??new Set);t=t.slice(0,x.index)+E+t.slice(x.index+x.full.length)}catch(k){let _=k instanceof Error?k.message:String(k),E=`<!-- dynamic component error: ${et(_)} -->`;t=t.slice(0,x.index)+E+t.slice(x.index+x.full.length)}}return t}var Lc="X-STX-Build",pt=Symbol.for("stx.buildId");function Ts(){let r=globalThis;if(!r[pt])r[pt]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return r[pt]}function dr(r,e=Ts()){if(r.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(r))return null;return`
|
|
639
|
+
<meta name="stx-build" content="${e}">`}var ii="/_stx/sw.js";function ts(r){if(typeof r!=="string"||!r.startsWith("/"))return null;let e=[],l=[],a=r.replace(/\/+$/,"").split("/").slice(1).map((g)=>{let t=/^:(\w+)$/.exec(g)||/^\[(\w+)\]$/.exec(g);if(t)return e.push(t[1]),l.push("0"),"([^/]+)";return l.push(g),g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:r,re:`^/${a.join("/")}/?$`,names:e,sample:`/${l.join("/")}`}}function rs(r,e){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let l=navigator.serviceWorker,a=window;if(a.stxOffline)return;let g=null,t=!1,p=!1,b=[],y={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>g,onUpdateReady(_){if(y.updateReady)try{_()}catch{}else b.push(_);return()=>{let E=b.indexOf(_);if(E!==-1)b.splice(E,1)}},applyUpdate(){let _=g&&g.waiting;if(!_)return!1;return p=!0,_.postMessage({type:"stx:activate-update",force:!0}),!0}};a.stxOffline=y;let v=(_)=>{if(!_.waiting||!l.controller||y.updateReady)return;y.updateReady=!0;let E=b.splice(0);for(let M of E)try{M()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};l.addEventListener("message",(_)=>{let E=_.data||{};if(E.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:E.url,kind:E.kind,fragment:!!E.fragment}}))}catch{}if(E.type==="stx:reachability"){if(a.stxOffline.reachable=E.reachable!==!1,Number(E.at)>0)a.stxOffline.reachedAt=Number(E.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:E.reachable!==!1,at:Number(E.at)||0}}))}catch{}}}),l.addEventListener("controllerchange",()=>{if(p)p=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&g&&g.waiting)g.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let x=()=>{if(t)return;if(e&&!e.some((_)=>{let E=_.replace(/\/+$/,"")||"/";return E==="/"||location.pathname===E||location.pathname.startsWith(`${E}/`)}))return;t=!0,window.removeEventListener("stx:load",k),l.register(r,{scope:"/"}).then((_)=>{g=_;try{l.controller?.postMessage({type:"stx:reachability?"})}catch{}if(_.waiting)v(_),_.waiting.postMessage({type:"stx:activate-update",reason:"load"});_.addEventListener("updatefound",()=>{let E=_.installing;if(!E)return;E.addEventListener("statechange",()=>{if(E.state==="installed")v(_)})})}).catch(()=>{if(t=!1,e)window.addEventListener("stx:load",k)})},k=()=>{let _=(E)=>{setTimeout(E,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>_(x));else _(x)};if(e)window.addEventListener("stx:load",k);if(!l.controller)if(document.readyState==="complete")k();else addEventListener("load",k);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",k);else k()}function pr(r){let e=r?.filter((a)=>typeof a==="string"&&a.startsWith("/")&&!a.startsWith("//")),l=`(${rs.toString()})(${JSON.stringify("/_stx/sw.js")}${e?`,${JSON.stringify(e)}`:""})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(l).trim().replace(/;$/,"")}catch{return l}}function ns(r,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!r||!r.startsWith("/"))return null;let l=r.split(/[?#]/)[0].split("/").filter(Boolean)[0];return l?`/${l}`:"/"}var ss=`<script data-stx-offline>${pr()}</script>`;function fr(r){return r.registerOn===void 0?ss:`<script data-stx-offline>${pr(r.registerOn)}</script>`}function ai(r,e,l=[]){let a=Number(r.precacheTimeoutMs),g={build:String(e||"dev"),pages:Array.from(new Set((r.pages||[]).filter((t)=>typeof t==="string"&&t.startsWith("/")))),exactPages:Array.from(new Set([...l,...r.pages||[],...r.routes||[]].filter((t)=>typeof t==="string"&&t.startsWith("/")&&!t.includes("[")&&!t.includes(":")&&!t.includes("*")).map((t)=>t.replace(/\/+$/,"")||"/"))),staticPages:(r.staticPages||[]).filter((t)=>typeof t==="string"&&((r.pages||[]).includes(t)||(r.routes||[]).includes(t))),api:r.apiPrefix||"/api/",timeout:Math.max(500,Number(r.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(a)&&a>0?Math.min(2147483647,Math.max(1,Math.floor(a))):1e4,precacheQuiet:Number.isFinite(Number(r.precacheQuietMs))&&Number(r.precacheQuietMs)>=0?Math.min(60000,Math.floor(Number(r.precacheQuietMs))):1500,networkFirst:(r.networkFirst||[]).filter((t)=>typeof t==="string"&&t.startsWith("/")),updateOnColdStart:r.updateOnColdStart===!0,fallback:r.fallback||r.pages&&r.pages[0]||null,fallbackScope:ns(r.fallback||r.pages&&r.pages[0]||null,r.fallbackScope),routes:(r.routes||[]).map(ts).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...r.exclude||[]],mediaMax:Math.max(10485760,Number(r.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(r.assetsMaxEntries)||500)};return`/* stx offline worker, build ${g.build} */
|
|
640
640
|
'use strict';
|
|
641
|
-
var S = ${JSON.stringify(
|
|
641
|
+
var S = ${JSON.stringify(g)};
|
|
642
642
|
var SHELL = 'stx-shell-' + S.build;
|
|
643
643
|
var ASSETS = 'stx-assets';
|
|
644
644
|
var DATA = 'stx-data';
|
|
@@ -1425,43 +1425,43 @@ function answerFetch(event) {
|
|
|
1425
1425
|
event.respondWith(pageResponse(request, event));
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
1428
|
-
`}import
|
|
1429
|
-
`+" `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 l[hr]=!0,l}async function yr(r,e,l){let a=r,
|
|
1428
|
+
`}import Pe from"path";function gr(r){return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("//")}async function mr(r,e,l){try{let a;if(r.startsWith("/")){let g=e;for(let t=0;t<5;t++){let p=Pe.join(g,r);if(await Bun.file(p).exists())return p;g=Pe.dirname(g)}a=Pe.join(e,r)}else if(r.startsWith("./")||r.startsWith("../"))a=Pe.resolve(e,r);else a=Pe.resolve(e,r);if(await Bun.file(a).exists())return a;return null}catch{return null}}var hr=Symbol.for("stx.inline-assets.import-meta");function is(r,e){if(!r.includes("import.meta"))return;let l=Error(`[stx] ${e} 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.
|
|
1429
|
+
`+" `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 l[hr]=!0,l}async function yr(r,e,l){let a=r,g=Pe.dirname(e),t=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,p;while((p=t.exec(a))!==null){let[v,x,k,_]=p;if(gr(k))continue;let E=await mr(k,g,e);if(E)try{let M=await Bun.file(E).text();if(l.add(E),k.endsWith(".ts")||k.endsWith(".tsx")){let C=await Bun.build({entrypoints:[E],target:"browser",minify:!0,define:A()});if(C.outputs.length>0)M=await C.outputs[0].text(),is(M,k)}let T=`<script>
|
|
1430
1430
|
// Source: ${k}
|
|
1431
|
-
${
|
|
1432
|
-
</script>`;a=a.replace(v,T),t.lastIndex=0}catch(
|
|
1431
|
+
${M}
|
|
1432
|
+
</script>`;a=a.replace(v,T),t.lastIndex=0}catch(M){if(M?.[hr])throw M}}let b=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,y;while((y=b.exec(a))!==null){let[v,x,k,_]=y,E=x+_;if(gr(k))continue;if(/rel=["']stylesheet["']/.test(E)||k.endsWith(".css")){let T=await mr(k,g,e);if(T)try{let C=await Bun.file(T).text();l.add(T);let L=`<style>
|
|
1433
1433
|
/* Source: ${k} */
|
|
1434
1434
|
${C}
|
|
1435
|
-
</style>`;a=a.replace(v,
|
|
1436
|
-
`,a+2),a===-1)return-1;a+=1,
|
|
1437
|
-
`){y=-1;break}y++}if(y===-1){a++,
|
|
1438
|
-
`)break;a++}
|
|
1439
|
-
`+r.slice(a,l.start)+r.slice(l.end);let
|
|
1440
|
-
`+t;return t.slice(0,p)+
|
|
1441
|
-
`+t.slice(p)}function hs(r){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return r.replace(e,(l,a,
|
|
1442
|
-
`),...v.htmlAttrs&&{htmlAttrs:
|
|
1443
|
-
<meta name="stx-layout" content="${
|
|
1444
|
-
<meta name="stx-layout-group" content="${
|
|
1445
|
-
${v}`).join(""))}else{let y=await
|
|
1446
|
-
`+p.slice(v)}}if(t)p=
|
|
1435
|
+
</style>`;a=a.replace(v,L),b.lastIndex=0}catch(C){}}}return a}import gt from"path";var os=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,as=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function cs(r,e){if(!e||!r.includes("/"))return r;let l=gt.dirname(e);return r.replace(os,(a,g,t,p)=>{let b=gt.resolve(l,p);return`${g}${t}${b.split(gt.sep).join("/")}${t}`})}function br(r,e){if(!e||!r.includes("<script"))return r;return r.replace(as,(l,a,g,t)=>`${a}${cs(g,e)}${t}`)}var Re="<!--PARENT_CONTENT_PLACEHOLDER-->";function wr(r){return r.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Cr(r,e){let l=r.length,a=e,g=!0,t=[],p=(b)=>b+9<=l&&r[b]==="<"&&r[b+1]==="/"&&(r[b+2]==="s"||r[b+2]==="S")&&(r[b+3]==="c"||r[b+3]==="C")&&(r[b+4]==="r"||r[b+4]==="R")&&(r[b+5]==="i"||r[b+5]==="I")&&(r[b+6]==="p"||r[b+6]==="P")&&(r[b+7]==="t"||r[b+7]==="T")&&(r[b+8]===">"||/\s/.test(r[b+8]));while(a<l){let b=r[a];if(p(a))return a;if(b==="/"&&r[a+1]==="/"){if(a=r.indexOf(`
|
|
1436
|
+
`,a+2),a===-1)return-1;a+=1,g=!0;continue}if(b==="/"&&r[a+1]==="*"){let y=r.indexOf("*/",a+2);if(y===-1)return-1;a=y+2,g=!0;continue}if(b==="/"&&g){let y=a+1,v=!1;while(y<l){let x=r[y];if(x==="\\"){y+=2;continue}if(x==="[")v=!0;else if(x==="]")v=!1;else if(x==="/"&&!v){y++;break}else if(x===`
|
|
1437
|
+
`){y=-1;break}y++}if(y===-1){a++,g=!1;continue}while(y<l&&/[a-z]/.test(r[y]))y++;a=y,g=!1;continue}if(b==="'"||b==='"'){let y=b;a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]===y){a++;break}if(r[a]===`
|
|
1438
|
+
`)break;a++}g=!1;continue}if(b==="`"){a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,g=!0;break}a++}if(t.length===0)g=!1;continue}if(b==="}"&&t.length>0){t.pop(),a++;while(a<l){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++,g=!1;break}if(r[a]==="$"&&r[a+1]==="{"){t.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(b));else if(/[)\].\w$]/.test(b))g=!1;else g=!0;a++}return-1}function Ar(r,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${l}(?:\\s|=|/?>))[^>]*>`,"i").exec(r);if(!a)return null;let g=a.index+a[0].length,t=r.indexOf("</script>",g);if(t===-1)return null;let p=r.indexOf(">",t);if(p===-1)return null;return{start:a.index,end:p+1}}var us=4096;async function mt(r,e,l){if(Ve(e)||ee(e)||l.buildMode!=="serve"||e.length<us)return null;let{registerServeModuleBundle:a}=await import("./chunk-tz5ktd6d.js");return`<script ${r} src="${a(e)}"></script>`}async function Sr(r,e,l,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:t}=await o("stx/client-module-registry",()=>import("./chunk-n958bxm6.js")),p=[],b=await t(g(...r),{minify:ia(e.buildMode,e.minifyClient),collectInputs:p});for(let y of p)l?.add(y);if(a)a.inputs=p,a.code=b??void 0;if(!b)return null;if(e.buildMode==="serve"&&!Ve(b)&&!ee(b)){let{registerServeModuleBundle:y}=await import("./chunk-tz5ktd6d.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${y(b)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${b.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function ds(r,e,l,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:_}=await o("stx/framework-composables",()=>import("./chunk-6n6kndk0.js"));g.frameworkScript=await _(r)}catch{}let t=null;try{t=await o("stx/store-loader",()=>import("./chunk-jj2z4nxa.js"))}catch{}let p=e.storesDir,b=!!a.__stx_native_screen||(t?.pageStoresAll()??!0),y=b?"":r.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),v=[],x=[],k=null;for(let _=0;_<8;_++){let E=null,M="",T=!1;try{if(t){let q=b?await t.getStoreScript(p).then((V)=>V?{code:V,stores:["*"],functions:null}:null):await t.getStoreScriptFor(p,[y],{reads:t.storesReadInFiles([...v,...x]),runOnce:!0});if(q)E=q.code,M=q.stores.join(","),T=!!q.functions&&!b}}catch{}if(k!==null&&M===k)break;k=M;let C=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",L=E?`<script ${C}>${E}</script>`:null;g.storeCode=E,g.storeTag=E?await mt(C,E,e)??L:null;let F={};g.modulesTag=await Sr([r,L],e,l,F),g.modulesCode=F.code??null,v=F.inputs??[],g.composableTag=null,g.composableCode=null,x=[];try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-k289127j.js")),V=e.composablesDir,H=[g.modulesCode??g.modulesTag,L,g.frameworkScript].filter((U)=>U!==null),B=await q(e._layerComposableDirs??V,r,H,x);if(B)g.composableCode=B,g.composableTag=await mt('data-stx-scoped data-stx-run="always" data-stx-composables',B,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${B.replace(/<\/script/gi,"<\\/script")}</script>`}catch{}if(b||!t)break}return g}async function ps(r,e,l,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:t}=await import("./chunk-xy3ex6ht.js"),p=await import("./chunk-8153bfpx.js"),{messages:b,webModules:y}=e,v=null,x=null,k=t()===""&&!a.__stx_native_screen;if(b&&p.pageMessagesEnabled(e)&&k)try{v=await p.loadPageMessages(process.cwd(),b)}catch(C){fs(C)}if(y&&Object.keys(y).length&&k)try{x=await(await import("./chunk-wv0wsavj.js")).loadWebModules(process.cwd(),y)}catch(C){gs(C)}let _=new Map([...x??[],...v?.stubs??[]]),E=()=>ds(r,e,l,a),M=_.size?await g(_,E):await E(),T=null;if(v){let C=p.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),L=p.pageMessagesScript(v,p.pageLanguages(r,v),C);if(L)T=await mt('data-stx-scoped data-stx-run="always" data-stx-messages',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${L.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((C)=>C!==null)}var vr=!1;function fs(r){if(vr)return;vr=!0,console.warn(`[stx] messages: ${r instanceof Error?r.message:String(r)}; pages ship every language`)}var xr=!1;function gs(r){if(xr)return;xr=!0,console.warn(`[stx] ${r instanceof Error?r.message:String(r)}; pages bundle the real modules`)}function ms(r,e=""){let l=Ar(r,"data-stx-runtime");if(!l)return r;let a=$r(r);if(a===-1||a===l.start){if(!e)return r;return r.slice(0,l.end)+e+r.slice(l.end)}if(a<l.start)return r.slice(0,a)+r.slice(l.start,l.end)+e+`
|
|
1439
|
+
`+r.slice(a,l.start)+r.slice(l.end);let g=r.slice(l.start,l.end),t=r.slice(0,l.start)+r.slice(l.end),p=$r(t);if(p===-1)return g+e+`
|
|
1440
|
+
`+t;return t.slice(0,p)+g+e+`
|
|
1441
|
+
`+t.slice(p)}function hs(r){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return r.replace(e,(l,a,g)=>{let t=r.slice(0,g);return t.lastIndexOf("<")>t.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(r,e,l,a,g){if(await R(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return r;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Ne(r,l);let t=!e.__stxProcessingDepth;On(e);for(let p of a._layerGraph?.configDependencies??[])g.add(p);if(t&&a.runtimeConfig)await jn(e,l,a.runtimeConfig);if(t)kl(e),e.__stx_scope_seq??={n:0,key:fo(String(e.__filename??l))},e.__stx_head_injections=ra(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!I()&&!Vn())&&l&&l.endsWith(".stx"))ci(r,l);try{return await ve.timeAsync("template-processing",async()=>{let p=await ys(r,e,l,a,g);if(t)p=Vi(p);if(t&&a.autoShell&&a.buildMode!=="compile"){let b=je(a.app?.head,{known:Zr,source:"app.head"}),v=(e.__stx_runtime_head||null)??oa(),x=(e.__stx_head_raw||"").trim(),k,_=x.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(_)k=_[1].trim(),x=x.replace(_[0],"").trim();let E=e.__sections?.title,M=E?P(E,e,l):void 0,T=v.title||k||M,C=!v.title&&(!!k||!!M),L=v.meta||[],F=new Set(L.map((J)=>xt(J)).filter(Boolean)),q={...b,...T&&{title:T},meta:[...(b.meta||[]).filter((J)=>!F.has(xt(J))),...L],link:[...b.link||[],...v.link||[]],script:[...b.script||[],...v.script||[]],headRaw:[b.headRaw,x].filter(Boolean).join(`
|
|
1442
|
+
`),...v.htmlAttrs&&{htmlAttrs:zl(b.htmlAttrs,v.htmlAttrs)},...v.bodyAttrs&&{bodyAttrs:{...b.bodyAttrs||{},...v.bodyAttrs}}},V=sa(p);if(p=Jr(p,q,{...C&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},V),V)p=Ul(p,b),p=Gr(p,q.htmlAttrs);let H=p.match(/<!-- stx-layout: ([^ ]+) -->/);if(H&&p.includes("<head")){let J=H[1],de=$n(J);p=p.replace(/<head\b[^>]*>/i,(G)=>`${G}
|
|
1443
|
+
<meta name="stx-layout" content="${wr(J)}">
|
|
1444
|
+
<meta name="stx-layout-group" content="${wr(de)}">`)}let B=p.match(/function (__stx_setup_\w+)\(/),U=B?W(p):null;if(B&&U&&!/\bdata-stx=/.test(U.tag)){p=dt(p,(de,G)=>`<body${G} data-stx="${B[1]}">`);let J=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${B[1]}"`,"i");p=p.replace(J,"$1")}}if(t){let b=e.__stx_head_injections??ra(),y=Hl(p);if(y!==null)b.beforeClose.push(y);let v=dr(p);if(v!==null)b.afterOpen.push(v);let x=a.offline;if(x?.enabled&&!p.includes("data-stx-offline"))b.beforeClose.push(fr(x));p=Ll(p,b);let k=a.app?.colorMode;if(k)p=Xr(p,k)}if(t)if(Ar(p,"data-stx-runtime")){let y=await ps(p,a,g,e);p=ms(p,y.map((v)=>`
|
|
1445
|
+
${v}`).join(""))}else{let y=await Sr([p],a,g);if(y){let v=p.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(v!==-1)p=p.slice(0,v)+y+`
|
|
1446
|
+
`+p.slice(v)}}if(t)p=Fl(p);if(t&&e.__stx_inject_css!==!1)p=await S(p,void 0,a.buildMode==="serve",!0,a.inlineGeneratedCssBytes);else if(t)p=Pn(p);if(t)p=vt(p);if(p=p.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),p=hs(p),t&&e.__stx_runtime_config)p=Jt(p,e.__stx_runtime_config);if(t&&!e.__stx_defer_server_data){let b=Vr(e);if(b){let y=/<head\b[^>]*>/i.exec(p),v=y?y.index+y[0].length:0;p=p.slice(0,v)+b+p.slice(v)}}return t?wt(p):p})}catch(p){if(p instanceof te)throw p;let b=p instanceof Error?p.message:String(p),y=new ce(`Template processing failed: ${b}`,l,void 0,void 0,r.substring(0,200)+(r.length>200?"...":""));if(K.log(y,{filePath:l,context:e}),Fn.logDetailedError(y,{filePath:l,template:r.substring(0,500)}),I()&&!a.debug)console.error(`[stx] ${le.relative(process.cwd(),l)||l}: ${y.message}`);if(a.debug)throw y;return ta.createFallbackContent("Template Processing",y)}}async function ys(r,e,l,a,g){let t=process.cwd(),p={...a,partialsDir:a.partialsDir&&!le.isAbsolute(a.partialsDir)?le.resolve(t,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!le.isAbsolute(a.componentsDir)?le.resolve(t,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!le.isAbsolute(a.layoutsDir)?le.resolve(t,a.layoutsDir):a.layoutsDir},b=p,y=r;await vs(l,e),ws(e,b),y=await Me(()=>er(y,e,l,b),y,(H)=>{K.log(H,{filePath:l,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${l}: ${H.message}`)}),y=y.replace(/\{\{--[\s\S]*?--\}\}/g,"");let v=we(y,tt,(H,B)=>`\x00STX_HTML_COMMENT_${B}\x00`);y=v.output;let x=v.tokens,k=(H)=>x.length===0?H:H.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(B,U)=>x[Number(U)]??""),_="\x00STX_ESCAPED_AT\x00",E="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";y=y.replace(/@@/g,_),y=y.replace(/@\{\{([\s\S]*?)\}\}/g,(H,B)=>`${E}${B}${M}`),y=ir(y),y=await yr(y,l,g);let T={};y=Rs(y,T);let C={...e.__sections||{}},L="",F=Tt(It(r)),q=/@nolayout\b/.test(y)||F===!1;if(/@nolayout\b/.test(y))y=y.replace(/@nolayout\b\s*/g,"");let V=y.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(V)L=V[1],y=y.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(L=F,!/@section\s*\(/.test(y))y=`@section('content')
|
|
1447
1447
|
${y.trim()}
|
|
1448
|
-
@endsection`}if(!
|
|
1448
|
+
@endsection`}if(!L&&!q&&b.defaultLayout){let H=Un(y),B=/@section\s*\(/.test(y);if(!H||B){let U="",J=le.dirname(l),de=b.layoutsDir?le.dirname(b.layoutsDir):process.cwd();for(let G=0;G<20;G++){let pe=le.join(J,"_layout.stx");if(await s(pe)){U=pe;break}let ue=le.dirname(J);if(ue===J||ue.length<de.length)break;J=ue}if(U)L=U;else if(b.layoutsDir){let G=le.isAbsolute(b.layoutsDir)?b.layoutsDir:le.resolve(process.cwd(),b.layoutsDir),pe=le.join(G,`${b.defaultLayout}.stx`);if(await s(pe))L=pe}if(L&&!B)y=`@section('content')
|
|
1449
1449
|
${y.trim()}
|
|
1450
|
-
@endsection`}}if(
|
|
1450
|
+
@endsection`}}if(L&&y.includes("<script")){let H=ne(y),B=H.scripts.map((U)=>kr(U,l)??U);y=Hn(H.output,B)}if(y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(H,B,U)=>(C[B]=U,"")),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(H,B,U)=>{if(/^(['"]).*\1$/.test(U.trim()))return H;try{let J=d(U.trim(),e);if(J===void 0)return H;let G=(e.__stx_inline_section_values??=[]).push(J)-1;return C[B]=`{{ __stx_inline_section_values[${G}] }}`,""}catch{return H}}),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(H,B,U)=>{if(U.includes("@parent"))C[B]=U.replace("@parent",Re);else C[B]=U.trim();return""}),e.__sections=C,y=y.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(H,B,U)=>C[B]||U||""),!("slot"in e)||e.slot===void 0)y=y.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||"");if(y=As(y,T),L){let H=[],B=ne(y),U=we(B.output,tn,(J,de)=>`\x00STX_ORPHAN_STYLE_${de}\x00`);if(y=U.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(J,de,G)=>{let pe=de==="SCRIPT"?kr(B.scripts[Number(G)],l):U.tokens[Number(G)];if(pe)H.push(pe);return""}),H.length>0){let J=H.join(`
|
|
1451
1451
|
`);C.content=C.content?`${C.content}
|
|
1452
|
-
${J}`:J,e.__sections=C}}if(
|
|
1453
|
-
${y}`,k(y)}catch(H){if(H instanceof te)throw H;throw new ce(`Error processing layout ${
|
|
1454
|
-
`;if(t=G(t,e),t=pe(t,e,l),t=rr(t),t=
|
|
1452
|
+
${J}`:J,e.__sections=C}}if(L)try{let H;if(le.isAbsolute(L))H=L,g.add(L);else H=await Me(()=>Mn(L,l,p,g),null,()=>{throw new ce(`Failed to resolve layout path: ${L}`,l,void 0,void 0,`Layout referenced from ${l}`)});if(!H){let ue=(Q)=>{if(!Q)return[];try{let Se=le.isAbsolute(Q)?Q:le.resolve(process.cwd(),Q);return ls.readdirSync(Se).filter(($e)=>$e.endsWith(".stx")).map(($e)=>$e.replace(/\.stx$/,""))}catch{return[]}},se=[...ue(p.layoutsDir),...ue(p.fallbackLayoutsDir)].filter((Q,Se,$e)=>$e.indexOf(Q)===Se).sort(),xe=[p.layoutsDir,p.fallbackLayoutsDir].filter((Q)=>typeof Q==="string"&&Q.length>0),me=xe.length>0?` Searched: ${xe.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",ie=`Layout not found: ${L} (referenced from ${l})`+(se.length>0?`. Available layouts: ${se.join(", ")}`:p.layoutsDir?`. No .stx layouts found in ${p.layoutsDir}`:"")+me;if(K.log(Error(ie),{layoutPath:L,filePath:l,available:se},"error"),console.error(`[stx] ${ie}`),p.debug)throw new ce(ie,l);return y}let B=await Me(()=>Bun.file(H).text(),"",()=>{throw new ce(`Failed to read layout file: ${H}`,l,void 0,void 0,"Layout content could not be loaded")});B=br(B,H),B=B.replace(/\{\{--[\s\S]*?--\}\}/g,"");let U=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(U.includes(H)){let ue=[...U.slice(U.indexOf(H)),H];throw new ce(ue.length===2?`Circular layout: ${H} extends itself`:`Circular layout: ${ue.join(" -> ")}`,l,void 0,void 0,"Remove the @extends or @layout line that points back at a layout already in use")}let J=B.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(J){if(p.debug)console.log(`Found nested layout: ${J[1]} in ${H}`);let ue={},se=B.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ie,Q,Se)=>(ue[Q]=Se.trim(),""));for(let[ie,Q]of Object.entries(ue))if(C[ie]&&C[ie].includes(Re)){let Se=C[ie].indexOf(Re);C[ie]=C[ie].slice(0,Se)+Q+C[ie].slice(Se+Re.length)}else if(!C[ie])C[ie]=Q;let xe={...e,__sections:C,__layoutChain:[...U,H]},me=`@layout('${J[1]}')${se}`;return await i(me,xe,H,p,g)}let de=B.replace(/\{\{--[\s\S]*?--\}\}/g,""),G=Rs(de,T),pe={};return G=G.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ue,se,xe)=>(pe[se]=xe.trim(),`@slot('${se}')`)),G=G.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ue,se,xe)=>{if(C[se]){let me=C[se];if(me.includes(Re)){let ie=pe[se]||"",Q=me.indexOf(Re);me=me.slice(0,Q)+ie+me.slice(Q+Re.length)}return me}return xe||""}),G=bs(G,C),G=G.replace(/\{\{\s*slot\s*\}\}/g,()=>C.content||""),G=As(G,T),e.__originalFilePath=l,y=await Tr(G,e,H,p,g),y=`<!-- stx-layout: ${L} -->
|
|
1453
|
+
${y}`,k(y)}catch(H){if(H instanceof te)throw H;throw new ce(`Error processing layout ${L}: ${H instanceof Error?H.message:String(H)}`,l)}return k(await Tr(y,e,l,p,g))}function bs(r,e){return r.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(l,a,g)=>{let t=e[a];if(t!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(t))return t}return g||""})}function ws(r,e){if(r.__stx_sfc_mode=!0,r.__stx_options=e,e.buildMode)r.__stx_buildMode=e.buildMode;let l=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,t]of Object.entries(process.env))if(g.startsWith(l)&&t!==void 0)a[g]=t;r.$env=a}async function vs(r,e){await Me(()=>nr(r,e),void 0,(l)=>{K.log(l,{filePath:r,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${r}: ${l.message}`)})}var ht="data-stx-source";function kr(r,e){if(!r)return r;let l=/^<script\b([^>]*)>/i.exec(r);if(!l||!/\bserver\b/.test(l[1])||l[1].includes(ht))return r;return`<script ${ht}="${encodeURIComponent(e)}"${r.slice(7)}`}function xs(r){let e=new RegExp(`${ht}="([^"]*)"`).exec(r);return e?decodeURIComponent(e[1]):void 0}function _r(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Er(r,e,l){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${_r(r)}</span><span style="display:block;margin-top:4px">${_r(l)}</span></div>`}async function Ss(r,e,l,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-67zy5p7x.js")),t=[],p=!I()&&!Vn();for(let y of g(r)){let v=y.attrs;if(!/\bserver\b/.test(v))continue;let x=y.start+y.fullMatch.indexOf(">")+1,k=Cr(r,x);if(k===-1)continue;let _=r.slice(x,k);if(!_.trim())continue;let E=xs(v)??l,M={index:y.start,length:k+9-y.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-ggrcg7k7.js"));await T(_,e,E,{preserveExisting:!0,onFailure:(C)=>{if(C.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:E,kind:C.kind,message:C.message}),!p)return;t.push({...M,markup:Er(E,C.kind,C.message)})}})}catch(T){let C=T instanceof Error?T:Error(String(T));if(K.log(C,{filePath:E,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${E}: ${C.message}`),p)t.push({...M,markup:Er(E,"unknown",C.message)})}}if(t.length===0)return r;let b=r;for(let y of t.sort((v,x)=>x.index-v.index))b=b.slice(0,y.index)+y.markup+b.slice(y.index+y.length);return b}async function ks(r,e,l){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-p8wnp4p1.js"));return a(r,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return K.log(g,{filePath:l,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${l}: ${g.message}`),r}}async function Tr(r,e,l,a,g){let t=r;await R();let p=a;if(t=await Ss(t,e,l,a),t=await zt(t,e,l),t=await Kt(t,e,l),t=await ks(t,e,l),await R(),t=await Nt(t,e,l,p),Ne(t))t=yi(t,e),t=Ls(t,e),t=Ds(t,e);t=bi(t),await R();let{processStreamDirectives:b}=await o("stx/streaming",()=>import("./chunk-m1hfh2t4.js"));t=b(t,e),t=await pi(t,e,l,p,!0),await R(),t=await ur(t,e,l,p,g),t=await Is(t,e,l,p,g),await R(),t=qc(t,e,l,p);let{processDeferDirectives:y}=await o("stx/defer",()=>import("./chunk-qfkak3jb.js"));t=y(t,e,l);let{processTeleportDirectives:v}=await o("stx/teleport",()=>import("./chunk-m3qwqhxp.js"));t=v(t,e,l);let{processTransitionDirectives:x,processTransitionAttributes:k}=await o("stx/transitions",()=>import("./chunk-b4yp16a2.js"));t=x(t,e,l),t=k(t);let{processErrorBoundaryDirectives:_,stripRenderFailedMarkers:E}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));t=_(t,e,l),t=E(t);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-b44pvac7.js"));t=M(t,e,l);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-hg2n2264.js"));t=T(t,e,l);let{processKeepAliveDirectives:C}=await o("stx/keep-alive",()=>import("./chunk-yq9aqpk8.js"));t=C(t,e,l);let{processVirtualListDirectives:L,processVirtualGridDirectives:F,processInfiniteListDirectives:q}=await o("stx/virtual-scrolling",()=>import("./chunk-gqe574d9.js"));t=L(t,e,l),t=F(t,e,l),t=q(t,e,l),await R();let{processPartialHydrationDirectives:V,processStaticDirectives:H}=await o("stx/partial-hydration",()=>import("./chunk-wv8zt78c.js"));t=V(t,e,l),t=H(t);let{processComputedDirectives:B,processWatchDirectives:U}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));t=B(t,e,l),t=U(t,e,l);let{processFormValidationDirectives:J}=await o("stx/forms-validation",()=>import("./chunk-4vdfqr64.js"));t=J(t,e,l);let{processHeadDirective:de,processTitleDirective:G,processMetaDirective:pe,resetHead:ue}=await o("stx/head",()=>import("./chunk-mhnjtc42.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ue();let se=de(t);if(t=se.content,se.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${se.headContent}
|
|
1454
|
+
`;if(t=G(t,e),t=pe(t,e,l),t=rr(t),t=fi(t,e),t=jt(t),t=Qt(t),t=await $s(t,e,l,p,g),t=await Is(t,e,l,p,g),await R(),t=t.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),t=Vi(t),t=ge(t,e,l),t=Os(t),await R(),e.__stxProcessingDepth===1)t=_l(t,e);if(t=bl(t,e,{filePath:l,buildMode:p.buildMode}),t=gi(t,e),t=mi(t,e),t=Ye(t,e),t=Vt(t,e),t=Xt(t,e),t=await Ct(t,e,l,p),t=await Xc(t,e,l),t=await Jc(t,e,l,p),await R(),t=Yc(t,e,l,p),t=Ci(t,e,l,p),t=Ei(t,e,l),t=Ti(t,e,l,p),t=Lt(t,e,l,p),t=uo(t,e),t=po(t),t=vl(t),!p.skipEventDirectives)t=ll(t,e,l);if(t=wl(t,e,l,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await R(),p.debug){let X=/\bx-data\s*=/.test(t),z=Ms(r);if(X&&z)console.warn(`[stx] ${l}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
1455
1455
|
Both work on the same page, but they manage separate scopes.
|
|
1456
|
-
Prefer signals (state/derived/effect) for new components.`)}t=
|
|
1456
|
+
Prefer signals (state/derived/effect) for new components.`)}t=zc(t,e),t=await Yi(t,e,l),await R(),t=xl(t),t=Sl(t),t=$t(t);let{processXElementDirectives:xe}=await o("stx/x-element",()=>import("./chunk-xq5s4vc1.js"));t=xe(t);let me=e.__originalFilePath||l,ie=Xe(e);if(t=await wi(t,p,me,ie),await R(),t=Ut(t,e),t=await tr(t,e,l,p),await R(),p.media?.image?.autoSiblings){let X=p.publicDir||"public",{rewriteImagesWithSiblings:z}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-q3z252d9.js"));t=await z(t,{publicDir:X})}if(p.seo?.enabled)t=$i(t,e,p);let Q=(X,z,Y=!0)=>{if(!z)return X;let be=z.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),oe=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(X),he=oe?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(oe[0]):null;if(be&&oe&&he){if(Y){let Ie=oe.index+he.index;X=X.slice(0,Ie)+be[0]+X.slice(Ie+he[0].length)}if(z=z.replace(be[0],"").trim(),!z)return X}if(/<\/head>/i.test(X))return f(X,z);if(/<head\b[^>]*>/i.test(X))return X.replace(/(<head\b[^>]*>)/i,`$1
|
|
1457
1457
|
${z}`);if(/<html\b[^>]*>/i.test(X))return X.replace(/(<html\b[^>]*>)/i,`$1
|
|
1458
1458
|
<head>
|
|
1459
1459
|
${z}
|
|
1460
|
-
</head>`);return X},{renderHead:
|
|
1460
|
+
</head>`);return X},{renderHead:Se,getHead:$e}=await o("stx/head",()=>import("./chunk-mhnjtc42.js")),He=e.__stx_runtime_head??$e();if(He.title||He.meta?.length||He.link?.length){let X=Se(He);if(X)t=Q(t,X)}if(se.headContent)t=Q(t,se.headContent,!He.title);if(p.csp?.enabled&&p.csp.addMetaTag)t=Dt(t,p.csp,e);if(p.analytics?.enabled)t=Et(t,p);if(p.heatmap?.enabled)t=Kc(t,p);if(p.pwa?.enabled&&p.pwa.autoInject!==!1){let{injectPwaTags:X}=await o("stx/pwa/inject",()=>import("./chunk-1jrhjn2b.js"));t=X(t,p)}let Dr=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(t),Or=/\bSTX\.\w+/.test(t),Lr=/window\.STX\s*=/.test(t);if(Dr&&Or&&!Lr){let z=`<script data-stx-scoped data-stx-run="once">
|
|
1461
1461
|
${St()}
|
|
1462
|
-
</script>`;if(t.includes("</head>")){let
|
|
1462
|
+
</script>`;if(t.includes("</head>")){let Y=O(t),oe=t.slice(0,Y).indexOf("<script");if(oe!==-1){let he=t.slice(0,oe),Ie=t.slice(oe);t=he+z+`
|
|
1463
1463
|
`+Ie}else t=f(t,z)}else if(t.includes("<body"))t=t.replace(/<body([^>]*)>/,`<body$1>
|
|
1464
1464
|
${z}`);else t=z+`
|
|
1465
|
-
`+t}{let{scanScriptTags:X}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1466
|
-
`+t.slice(
|
|
1467
|
-
export{
|
|
1465
|
+
`+t}{let{scanScriptTags:X}=await o("stx/signal-processing",()=>import("./chunk-67zy5p7x.js")),z=[];for(let Y of X(t)){if(!/\bserver\b/i.test(Y.attrs))continue;let be=Y.start+Y.fullMatch.indexOf(">")+1,oe=Cr(t,be);if(oe===-1)continue;let he=oe+9;while(he<t.length&&/\s/.test(t[he]))he++;z.push({start:Y.start,end:he})}if(z.length>0){let Y=Array(z.length+1),be=0;for(let oe=0;oe<z.length;oe++){let{start:he,end:Ie}=z[oe];Y[oe]=t.slice(be,he),be=Ie}Y[z.length]=t.slice(be),t=Y.join("")}}let yt=co(t,l);if(yt.hasScoped)t=yt.html;let Pr=e.__stx_event_bindings||[],rt=!1,bt=[],jr=/\s:[a-z][\w.-]*\s*=/.test(t),{scanScriptTags:Nr}=await o("stx/signal-processing",()=>import("./chunk-67zy5p7x.js"));for(let X of Nr(t,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))bt.push({match:X.fullMatch,attrs:X.attrs,content:X.body});for(let{match:X,attrs:z,content:Y}of bt){rt=!0;let be=Y;Ke(Y,l,a.strict,e.__originalFilePath);let oe=await Ge(Y,{eventBindings:Pr,attrs:z,hasColonDirectives:jr,templateContent:r,filePath:l,projectRoot:process.cwd(),production:ia(a.buildMode,a.minifyClient),serverData:ie});t=t.replace(X,()=>oe)}if(rt)e.__stx_event_bindings=[];if(!rt&&e.__stxProcessingDepth===1){let X=e.__stx_event_bindings||[];if(X.length>0){let z=Li(X);if(z){let Y=c(t);t=Y===-1?t+z:t.slice(0,Y)+z+`
|
|
1466
|
+
`+t.slice(Y)}e.__stx_event_bindings=[]}}if(!p.skipSignalsRuntime&&!Ae(t)&&Uc(t))t=await Rr(t,p);if(t=Vc(t),p.csp?.enabled&&p.csp.useNonce&&typeof e.cspNonce==="string")t=Ot(t,e.cspNonce);return t}
|
|
1467
|
+
export{It,Ue,Lc,Ts,ii,ai,Sr,i};
|