@stacksjs/stx 0.2.858 → 0.2.861
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/body-close.d.ts +13 -0
- package/dist/body-close.js +8 -0
- package/dist/{chunk-s322kcw7.js → chunk-02css3vk.js} +5 -5
- package/dist/chunk-0hqr6bff.js +2 -0
- package/dist/{chunk-wskdnfh9.js → chunk-121cgm3s.js} +4 -4
- package/dist/{chunk-eazccp6e.js → chunk-15jymk6t.js} +2 -2
- package/dist/{chunk-qvwzaxdd.js → chunk-15rkvc0t.js} +4 -4
- package/dist/chunk-15sgdvyd.js +2 -0
- package/dist/{chunk-7fgfzaah.js → chunk-1jwcp2k0.js} +2 -2
- package/dist/{chunk-jdqmk5sv.js → chunk-261t62q4.js} +63 -63
- package/dist/chunk-2b4a8tbd.js +3 -0
- package/dist/chunk-2fw36w1x.js +2 -0
- package/dist/chunk-2jcxsw75.js +2 -0
- package/dist/{chunk-6d74qdc6.js → chunk-2pbhdaka.js} +1 -1
- package/dist/chunk-2wba5ypm.js +2 -0
- package/dist/chunk-353gnvfe.js +2 -0
- package/dist/{chunk-ff3j7jnf.js → chunk-36vksrry.js} +2 -2
- package/dist/{chunk-m2rm2gxv.js → chunk-37tefp7s.js} +5 -5
- package/dist/{chunk-1z2am28h.js → chunk-38qp2pg2.js} +2 -2
- package/dist/chunk-3cr5y8v1.js +2 -0
- package/dist/{chunk-jwwsxym6.js → chunk-3gfd9t8a.js} +2 -2
- package/dist/{chunk-zn9dp7yn.js → chunk-3wg9kr5z.js} +5 -5
- package/dist/chunk-3y7yp0ka.js +2 -0
- package/dist/chunk-41wwqw0q.js +2 -0
- package/dist/chunk-4a1y51fs.js +2 -0
- package/dist/chunk-4a751brg.js +2 -0
- package/dist/{chunk-cqkr291c.js → chunk-4jgcd4d9.js} +5 -5
- package/dist/{chunk-kedgfk9z.js → chunk-4rrxrxp6.js} +4 -4
- package/dist/chunk-5awhm4na.js +2 -0
- package/dist/chunk-5fhp9hxd.js +2 -0
- package/dist/{chunk-q93jcdgj.js → chunk-5ka3h8dy.js} +12 -12
- package/dist/chunk-5mg443dw.js +2 -0
- package/dist/{chunk-e8we717q.js → chunk-5n7m8vqx.js} +2 -2
- package/dist/{chunk-kq3h2rjq.js → chunk-5neezkj1.js} +4 -4
- package/dist/{chunk-6qbha6fb.js → chunk-5q4tncfw.js} +6 -6
- package/dist/{chunk-sny8rqe8.js → chunk-5rxks14t.js} +2 -2
- package/dist/chunk-5x9ajbq0.js +2 -0
- package/dist/{chunk-az9b4bj4.js → chunk-5xdkmn39.js} +2 -2
- package/dist/{chunk-fw50vydb.js → chunk-65cbfx5x.js} +2 -2
- package/dist/{chunk-tk67pqaf.js → chunk-68w65mhs.js} +3 -3
- package/dist/chunk-6g7tkmty.js +2 -0
- package/dist/{chunk-1347hwt5.js → chunk-6nb49h13.js} +40 -40
- package/dist/{chunk-e7thwrt5.js → chunk-6tp0w6hf.js} +2 -2
- package/dist/chunk-72bj7ea4.js +2 -0
- package/dist/{chunk-jwtp4csj.js → chunk-74g64pzt.js} +4 -4
- package/dist/{chunk-78amng8s.js → chunk-76360zky.js} +6 -6
- package/dist/{chunk-gz0j98dy.js → chunk-7bajrfb1.js} +4 -4
- package/dist/{chunk-rq9pqd4s.js → chunk-7de5y29a.js} +5 -5
- package/dist/{chunk-jafn7f7f.js → chunk-7yhhwv07.js} +2 -2
- package/dist/chunk-811hh6vp.js +2 -0
- package/dist/{chunk-0z2gqttt.js → chunk-830ej8d2.js} +12 -12
- package/dist/chunk-8fkmxrat.js +2 -0
- package/dist/{chunk-gjbnzn7k.js → chunk-8hck9qqm.js} +4 -4
- package/dist/chunk-8p9npc8y.js +2 -0
- package/dist/chunk-9fz3h6sx.js +2 -0
- package/dist/chunk-9jr30fns.js +2 -0
- package/dist/{chunk-e763qsg0.js → chunk-9pyvc0dc.js} +2 -2
- package/dist/{chunk-3b7q7d7j.js → chunk-9syvkm5z.js} +6 -6
- package/dist/{chunk-ym5qgw03.js → chunk-9xr628ew.js} +2 -2
- package/dist/{chunk-k19ba3jz.js → chunk-a6d92kv6.js} +2 -2
- package/dist/chunk-a9m6ajd7.js +2 -0
- package/dist/{chunk-mxazxwc4.js → chunk-aj6vqdf7.js} +3 -3
- package/dist/chunk-asr5v51s.js +2 -0
- package/dist/{chunk-252enthj.js → chunk-avp271q4.js} +1 -1
- package/dist/{chunk-8623gte8.js → chunk-b1tctqn5.js} +6 -6
- package/dist/{chunk-71s4hpkj.js → chunk-b7nmgkwa.js} +3 -3
- package/dist/{chunk-fxk1psd8.js → chunk-bag9q4m0.js} +30 -30
- package/dist/{chunk-0vptj943.js → chunk-bg0ywp5w.js} +2 -2
- package/dist/{chunk-g8d24rfk.js → chunk-bv14vry8.js} +2 -2
- package/dist/chunk-byx82s10.js +2 -0
- package/dist/{chunk-smve11g0.js → chunk-c2w4wc9f.js} +1 -1
- package/dist/chunk-c9y1g61m.js +2 -0
- package/dist/chunk-ck5nzbbv.js +2 -0
- package/dist/{chunk-mh45hcsa.js → chunk-cq2hedwn.js} +6 -6
- package/dist/chunk-cvdm0hgq.js +2 -0
- package/dist/{chunk-27zp4q77.js → chunk-cxpq2zna.js} +1 -1
- package/dist/{chunk-y67r0d0c.js → chunk-d6216bcw.js} +4 -4
- package/dist/{chunk-pa8xkctc.js → chunk-dba4bwkd.js} +6 -6
- package/dist/{chunk-3evwxrpx.js → chunk-dt73ww6m.js} +1 -1
- package/dist/chunk-e0fxgbcc.js +2 -0
- package/dist/{chunk-z703xzhy.js → chunk-e8nzbz66.js} +2 -2
- package/dist/chunk-ed2m6pjf.js +2 -0
- package/dist/chunk-ednwdhv0.js +2 -0
- package/dist/chunk-egtphftq.js +2 -0
- package/dist/{chunk-bhzh7mj1.js → chunk-eye156nv.js} +1 -1
- package/dist/chunk-fahqq7c4.js +2 -0
- package/dist/chunk-fcbpzdyz.js +2 -0
- package/dist/{chunk-4h9kkkh7.js → chunk-fpkp0bqf.js} +1 -1
- package/dist/{chunk-tpw435g0.js → chunk-fyfvqd2s.js} +2 -2
- package/dist/{chunk-xz1csyq9.js → chunk-gc79s0wh.js} +10 -10
- package/dist/{chunk-hjh5wt5f.js → chunk-gggadrs4.js} +3 -3
- package/dist/{chunk-nv5xhfwz.js → chunk-gjnrmz2q.js} +2 -2
- package/dist/{chunk-fbnykfnv.js → chunk-gp1dt8b8.js} +3 -3
- package/dist/{chunk-jgvwzt1t.js → chunk-gx96hctv.js} +2 -2
- package/dist/chunk-h0dsxxz4.js +2 -0
- package/dist/{chunk-wd4z5w4d.js → chunk-h2cvfp9y.js} +1 -1
- package/dist/{chunk-egwtv5hp.js → chunk-h4aqpf2r.js} +3 -3
- package/dist/{chunk-4ezfen91.js → chunk-hyea17hp.js} +69 -69
- package/dist/{chunk-admnvsmx.js → chunk-jh2v1vvb.js} +2 -2
- package/dist/chunk-k3yym9zg.js +2 -0
- package/dist/chunk-k9fsd6t3.js +2 -0
- package/dist/chunk-kepxsjfx.js +2 -0
- package/dist/chunk-kh01rvag.js +2 -0
- package/dist/{chunk-mzg1wq86.js → chunk-kv40xq53.js} +15 -15
- package/dist/{chunk-tjer45j7.js → chunk-m3p4hksq.js} +4 -4
- package/dist/chunk-mad172af.js +2 -0
- package/dist/{chunk-c7eew8qs.js → chunk-mjkdskeg.js} +1 -1
- package/dist/{chunk-qv52et0d.js → chunk-naj146zq.js} +2 -2
- package/dist/chunk-npt0mdzb.js +2 -0
- package/dist/{chunk-snmq7yn4.js → chunk-nwxjh1gv.js} +3 -3
- package/dist/chunk-p95fsnbk.js +2 -0
- package/dist/chunk-ptc3yqn3.js +2 -0
- package/dist/chunk-pybm7c9p.js +2 -0
- package/dist/{chunk-69zj9q02.js → chunk-q6w7a1vc.js} +3 -3
- package/dist/{chunk-w7s3afam.js → chunk-qjm23ma2.js} +1 -1
- package/dist/chunk-qnx71b17.js +2 -0
- package/dist/chunk-qx8cav4w.js +2 -0
- package/dist/chunk-rb7cwck6.js +2 -0
- package/dist/chunk-s1e0t3hv.js +2 -0
- package/dist/chunk-s7vfmasx.js +2 -0
- package/dist/{chunk-bxn4b0wm.js → chunk-scwbttvt.js} +2 -2
- package/dist/{chunk-ksxbfyef.js → chunk-sxtvy0sm.js} +2 -2
- package/dist/chunk-t7z67vf6.js +2 -0
- package/dist/chunk-tarvase5.js +2 -0
- package/dist/{chunk-qa4vs1qg.js → chunk-thdnk1kd.js} +3 -3
- package/dist/{chunk-8cpqcn19.js → chunk-tjz3r7rj.js} +5 -5
- package/dist/{chunk-xhvw0t0f.js → chunk-tm201m9x.js} +3 -3
- package/dist/chunk-tqs9pcga.js +2 -0
- package/dist/chunk-twjfrywv.js +2 -0
- package/dist/{chunk-me16tftr.js → chunk-v0wdgxga.js} +1 -1
- package/dist/{chunk-bef0wr53.js → chunk-vggtxttf.js} +5 -5
- package/dist/chunk-vyna2rsq.js +2 -0
- package/dist/chunk-w4gjx2zs.js +18 -0
- package/dist/{chunk-fd7e162p.js → chunk-wrbhq1y2.js} +3 -3
- package/dist/{chunk-2bks42z4.js → chunk-x69457q9.js} +5 -5
- package/dist/chunk-xhe7pw6e.js +2 -0
- package/dist/{chunk-d6am6en8.js → chunk-xmy6g81m.js} +1 -1
- package/dist/chunk-y86mpnrg.js +2 -0
- package/dist/{chunk-3zjyhhg4.js → chunk-yj9nyt93.js} +2 -2
- package/dist/{chunk-jtag68hg.js → chunk-z99bf0q0.js} +2 -2
- package/dist/chunk-zm0g7ntw.js +2 -0
- package/dist/{chunk-5xy1z71a.js → chunk-zpkgs5d3.js} +4 -4
- package/dist/chunk-zrm2x65c.js +2 -0
- package/dist/{chunk-va1hj69e.js → chunk-zs4s9fcq.js} +4 -4
- package/dist/cli.js +19 -19
- package/dist/config.js +11 -1
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/pwa.js +3 -3
- package/dist/render.js +2 -6
- package/dist/serve.js +2 -6
- package/dist/site-builder/build.js +2 -2
- package/dist/site-builder/router.js +2 -5
- package/dist/site-builder/theme.js +2 -2
- package/dist/ssg.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-0ts3p84y.js +0 -2
- package/dist/chunk-139mxsyc.js +0 -2
- package/dist/chunk-1barsha6.js +0 -2
- package/dist/chunk-1fnx7ze9.js +0 -2
- package/dist/chunk-1g06wfs9.js +0 -2
- package/dist/chunk-1nasq00e.js +0 -2
- package/dist/chunk-2102tvxh.js +0 -2
- package/dist/chunk-39cwa35j.js +0 -2
- package/dist/chunk-3rcegvgg.js +0 -2
- package/dist/chunk-3wvq28hz.js +0 -2
- package/dist/chunk-6m4v1tsq.js +0 -2
- package/dist/chunk-75e4wzzs.js +0 -3
- package/dist/chunk-7ambc4f7.js +0 -2
- package/dist/chunk-8nmc3rh7.js +0 -2
- package/dist/chunk-8pn7ah12.js +0 -2
- package/dist/chunk-8zwwmnpb.js +0 -2
- package/dist/chunk-98bgx3ws.js +0 -2
- package/dist/chunk-a4v8z93r.js +0 -2
- package/dist/chunk-a58w524e.js +0 -2
- package/dist/chunk-a6v6x2pg.js +0 -2
- package/dist/chunk-afrqm7w5.js +0 -18
- package/dist/chunk-b62mr2kz.js +0 -2
- package/dist/chunk-b7vxb2y6.js +0 -2
- package/dist/chunk-bb20hnqd.js +0 -2
- package/dist/chunk-bc3sknxf.js +0 -2
- package/dist/chunk-cbrbrkp1.js +0 -2
- package/dist/chunk-d8djpp7f.js +0 -2
- package/dist/chunk-dk6t4h48.js +0 -2
- package/dist/chunk-dkbm7117.js +0 -2
- package/dist/chunk-e44bse67.js +0 -2
- package/dist/chunk-ewnfgczq.js +0 -2
- package/dist/chunk-f1v5hvbt.js +0 -2
- package/dist/chunk-g6epqcb3.js +0 -2
- package/dist/chunk-gmvypdm8.js +0 -2
- package/dist/chunk-hmgry6dn.js +0 -2
- package/dist/chunk-jbv1srnh.js +0 -2
- package/dist/chunk-jzynkjfc.js +0 -2
- package/dist/chunk-k1qajhpx.js +0 -2
- package/dist/chunk-m28j4ym7.js +0 -2
- package/dist/chunk-mzembfxk.js +0 -2
- package/dist/chunk-ngzjwp2e.js +0 -2
- package/dist/chunk-nj9n0en9.js +0 -2
- package/dist/chunk-nyasqjnt.js +0 -2
- package/dist/chunk-pn0rmd8d.js +0 -2
- package/dist/chunk-pvx1hrqq.js +0 -2
- package/dist/chunk-q78dsejp.js +0 -2
- package/dist/chunk-qw1f97s7.js +0 -2
- package/dist/chunk-rcn0yyh2.js +0 -2
- package/dist/chunk-t9h3e3bp.js +0 -2
- package/dist/chunk-ts9bvjzh.js +0 -2
- package/dist/chunk-tzvgjrp4.js +0 -2
- package/dist/chunk-v8b1wz1b.js +0 -2
- package/dist/chunk-w9aa8xte.js +0 -2
- package/dist/chunk-wegkgjmf.js +0 -2
- package/dist/chunk-wn065q3f.js +0 -2
- package/dist/chunk-y2dtqrrz.js +0 -2
- package/dist/chunk-yss7n9db.js +0 -2
- package/dist/chunk-z6p0yxwd.js +0 -2
- package/dist/chunk-zcpwc47w.js +0 -2
- package/dist/chunk-zsmrq1w3.js +0 -2
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function qe(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function Pn(e){if(e.entries.length===0)return"[]";return`[
|
|
3
3
|
${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
|
-
]`}function
|
|
6
|
-
export{qe,Pn,
|
|
5
|
+
]`}function Fi(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
|
|
6
|
+
export{qe,Pn,Fi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ca,yu,Un,qm,bu,wu,vu,Km}from"./chunk-wrbhq1y2.js";import"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{Un as Validator,yu as defineForm,bu as processErrorDirective,wu as processErrorsDirective,Km as processFormValidationDirectives,vu as processHasErrorsDirective,Ca as useForm,qm as v};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ft,le,_,u,f,P,t,ee,K,l,Ce,
|
|
2
|
+
import{Ft,le,_,u,f,P,t,ee,K,l,Ce,Pi,z,En,Ii,Vt,Oi,ml,Ir,hl,lt,yl,Or,bl,Tn,Ni,wl,Nr,Dr,Ee,Mi}from"./chunk-830ej8d2.js";import{fi,Bc,o,C,Me,Nt,mn,De,ge,J,kr,hn,Vs,Xc,Jc,bn,$r,Ws,qs,Yc,vi,Zc,Qc,el,tl,je,Be,Ks,He,s,xn,m,p,W,Q,_e,E,Ti}from"./chunk-261t62q4.js";import{Bt}from"./chunk-5rxks14t.js";import{_n}from"./chunk-naj146zq.js";import{b}from"./chunk-5q4tncfw.js";import{br,Ns}from"./chunk-3gfd9t8a.js";import{Sc,kc,mr,tt,_c,O}from"./chunk-6nb49h13.js";import{ri,si,oi,ii}from"./chunk-dba4bwkd.js";import{yc,ms}from"./chunk-b7nmgkwa.js";import{us,ds,ps}from"./chunk-7de5y29a.js";import{bs,Xo,Jo,ws,vs,Yo}from"./chunk-b1tctqn5.js";import{hs,Uo}from"./chunk-aj6vqdf7.js";import{Fo}from"./chunk-t5q31st4.js";import{ie,Wo,qo,Ko}from"./chunk-v0wdgxga.js";import{dr,ve,wc,pr,vc}from"./chunk-02css3vk.js";import{B,Qe}from"./chunk-pb09xy77.js";import{Ec,Tc}from"./chunk-68w65mhs.js";import{T,$n,Di}from"./chunk-9xr628ew.js";import Kn from"fs";import se from"path";function pt(n){let e=Nt(n),c=e.find((x)=>x.closing&&x.name.toLowerCase()==="head");if(!c)return n;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),g=0,r=[];for(let x=0;x<e.length;x++){let w=e[x];if(w.start<c.end)continue;let v=w.name.toLowerCase();if(a.has(v)){g=Math.max(0,g+(w.closing?-1:w.selfClosing?0:1));continue}if(v!=="style"||w.closing||g>0)continue;let k=e[x+1];if(k?.name.toLowerCase()==="style"&&k.closing){if(/@scope\s*\{/.test(n.slice(w.end,k.start)))continue;r.push({start:w.start,end:k.end}),x++}}if(!r.length)return n;let d=r.map((x)=>n.slice(x.start,x.end)).join(`
|
|
3
3
|
`),y=[n.slice(0,c.start),d,`
|
|
4
4
|
`],h=c.start;for(let x of r)y.push(n.slice(h,x.start)),h=x.end;return y.push(n.slice(h)),y.join("")}function ft(){return`
|
|
5
5
|
// STX Lifecycle Runtime
|
|
@@ -565,7 +565,7 @@ ${e.inlineScript}
|
|
|
565
565
|
<!-- Custom Analytics -->
|
|
566
566
|
<script${c.length>0?` ${c.join(" ")}`:""} src="${ue(e.scriptUrl)}" defer></script>
|
|
567
567
|
`}function yt(n,e){let c=Br(e);if(!c)return n;if(!n.includes("</head>")){let a=n.lastIndexOf("</body>");if(a!==-1)return n.slice(0,a)+c+n.slice(a);return n+c}return n.replace("</head>",`${c}</head>`)}function ue(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function vt(n){let e=n.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function bt(n){let e=n?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import Xr from"fs";import Je from"path";import{createHighlighter as zr}from"ts-syntax-highlighter";var Ye=new Map;async function Pe(n,e={}){try{if(!await s(n))throw Error(`Markdown file not found: ${n}`);let a=(await Xr.promises.stat(n)).mtime.getTime();if(e.cache&&Ye.has(n)){let v=Ye.get(n);if(v.updatedAt>=a)return{content:v.content,data:v.data}}let g=await Bun.file(n).text(),{data:r,content:d}=mr(g),y=e.markdown||O.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},x=tt(d,{gfm:!0});if(y.syntaxHighlighting?.enabled&&y.syntaxHighlighting?.serverSide)x=await Kr(x,y.syntaxHighlighting?.defaultTheme||"github-dark",y.syntaxHighlighting?.highlightUnknownLanguages||!1);let w={content:x,data:r||{}};if(e.cache)Ye.set(n,{...w,updatedAt:a});return w}catch(c){if(e.debug)console.error(`Error reading/parsing markdown file ${n}:`,c);let a=c instanceof Error?c.message:String(c);return{content:m("Markdown File",`Error reading/parsing markdown file: ${a}`,n,"",0,""),data:{}}}}var Ve=null;async function Kr(n,e,c){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Ve)try{Ve=await zr({theme:e||"github-dark",cache:!0})}catch(y){return console.error("Failed to initialize ts-syntax-highlighter:",y),n}let g=async(y,h,x,w)=>{let v=w.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'"),k=x||(c?"text":"");if(!k)return y;try{if(!Ve.getSupportedLanguages().includes(k))return y;return(await Ve.highlight(v,k,{theme:e})).html}catch(S){console.error(`Error highlighting code block with language ${x}:`,S)}return y},r=n,d=n.matchAll(a);for(let y of d){let[h,x,w,v]=y,k=await g(h,x,w,v);r=r.replace(h,k)}return r}async function wt(n,e,c="",a={}){return await Gr(n,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(d,y,h,x)=>{try{let w=y;if(!Je.isAbsolute(y))w=Je.resolve(Je.dirname(c),y);let v={};if(h)try{try{v=JSON.parse(h)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let j=h.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let N of j){let F=N.indexOf(":");if(F>0){let I=N.substring(0,F).trim(),L=N.substring(F+1).trim(),H=L.startsWith('"')&&L.endsWith('"'),V=L.startsWith("'")&&L.endsWith("'");if(H||V)L=L.substring(1,L.length-1);v[I]=L}}}}catch(D){if(a.debug)console.error("Error parsing context in @markdown-file directive:",D)}let{content:k,data:S}=await Pe(w,a),M={...e,...S,...v},A=k,R=/\{\{([^}]+)\}\}/g;return A=A.replace(R,(D,j)=>{let N=j.trim();return M[N]!==void 0?String(M[N]):D}),A}catch(w){let v=w instanceof Error?w.message:String(w);return m("Markdown File",`Error including markdown file: ${v}`,c,n,x,d)}})}async function Gr(n,e,c){let a=[],g;while((g=e.exec(n))!==null){let y=g[0],h=g.index,x=g;a.push(c(...x).then((w)=>({match:y,replacement:w,index:h})))}let r=await Promise.all(a);r.sort((y,h)=>h.index-y.index);let d=n;for(let{match:y,replacement:h}of r)d=d.replace(y,()=>h);return d}var xt=new WeakMap;function kt(n=16){let e=new Uint8Array(n);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function We(n,e){if(!n)return e?.nonceGenerator?.()??kt();let c=xt.get(n);if(!c)c=e?.nonceGenerator?.()??kt(),xt.set(n,c);return c}function Zr(n,e){let c=[];for(let[a,g]of Object.entries(n)){if(g===void 0||g===null)continue;if(typeof g==="boolean"){if(g)c.push(a);continue}if(Array.isArray(g)){let r=[...g];if(e&&(a==="script-src"||a==="style-src"))r=r.filter((d)=>!d.startsWith("'nonce-")),r.push(`'nonce-${e}'`);if(r.length>0)c.push(`${a} ${r.join(" ")}`)}}return c.join("; ")}function St(n,e){return`<meta http-equiv="Content-Security-Policy" content="${Zr(n,e).replace(/&/g,"&").replace(/"/g,""")}">`}function $t(n,e,c){if(!e.enabled||!e.addMetaTag)return n;if(n.includes('http-equiv="Content-Security-Policy"'))return n;if(!n.includes("<head>")&&!n.includes("<head "))return n;let a=e.useNonce?We(c,e):void 0,g=St(e.directives,a);return n.replace(/<head([^>]*)>/,`<head$1>
|
|
568
|
-
${g}`)}function Et(n,e){let c=n;return c=c.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<script nonce="${e}"${g}>`}),c=c.replace(/<style([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<style nonce="${e}"${g}>`}),c}function _t(n,e,c,a){let g=n,r=a.csp;if(g=g.replace(/@csp\b/g,()=>{if(!r?.enabled||!r.directives)return"<!-- CSP not configured -->";let d=r.useNonce?We(e,r):void 0;return St(r.directives,d)}),g=g.replace(/@cspNonce\b/g,()=>{if(!r?.enabled||!r.useNonce)return"";return We(e,r)}),r?.enabled&&r.useNonce)e.cspNonce=We(e,r);return g}import Jr from"crypto";var Qr=40,Ct="_token",et=null;function Yr(n=Qr){let e=Jr.randomBytes(Math.ceil(n/2)).toString("hex").slice(0,n);return et=e,e}function en(){if(!et)Yr();return et}function tn(n=Ct){let e=en();return`<input type="hidden" name="${n}" value="${e}">`}function Tt(n){return n.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,c,a)=>tn(a||Ct))}async function At(n,e,c,a){if(!a.customDirectives||a.customDirectives.length===0)return n;let g=n;for(let r of a.customDirectives){if(!r.name||typeof r.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",r);continue}if(r.hasEndTag)g=await rn(g,r,e,c,a);else g=await nn(g,r,e,c,a)}return g}async function rn(n,e,c,a,g){let{name:r,handler:d}=e,y=`@${r}`,h=`@end${r}`,x=n,w=Ft(`${y}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${h}`,"g"),v=[],k=w.exec(x);while(k!==null){let[S,M="",A=""]=k,R=k.index||0;try{let D=M?Rt(e,M):[],j=A.trim(),N=await d(j,D,c,a);v.push({original:S,processed:N,startIndex:R})}catch(D){let j=D instanceof Error?D.message:String(D);if(g.debug)console.error(`Error processing custom directive @${r}:`,D);v.push({original:S,processed:l("CustomDirective",`Error in @${r}${M?`(${M})`:""}: ${j}`,t.EVALUATION_ERROR),startIndex:R})}k=w.exec(x)}for(let S=v.length-1;S>=0;S--){let{original:M,processed:A}=v[S];x=x.replace(M,A)}return x}async function nn(n,e,c,a,g){let{name:r,handler:d}=e,y=n,h=[],x=[];if(e.rawParams){for(let k of Pi(y,Ft(`(?<![\\w$@])@${r}\\s*\\(`,"g")))if(k.end!==-1)x.push({fullMatch:k.call,paramString:k.args,startIndex:k.start})}else{let k=Ft(`@${r}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");k.lastIndex=0;let S=k.exec(y);while(S!==null)x.push({fullMatch:S[0],paramString:S[1]??"",startIndex:S.index||0}),S=k.exec(y)}for(let{fullMatch:k,paramString:S,startIndex:M}of x)try{let A=Rt(e,S),R=await d("",A,c,a);h.push({original:k,processed:R,startIndex:M})}catch(A){let R=A instanceof Error?A.message:String(A);if(g.debug)console.error(`Error processing custom directive @${r}:`,A);h.push({original:k,processed:l("CustomDirective",`Error in @${r}(${S}): ${R}`,t.EVALUATION_ERROR),startIndex:M})}let w=Ft(`@${r}(?!\\w)(?!\\s*\\()`,"g"),v=w.exec(y);while(v!==null){let[k]=v,S=v.index||0;try{let M=await d("",[],c,a);h.push({original:k,processed:M,startIndex:S})}catch(M){let A=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${r}:`,M);h.push({original:k,processed:l("CustomDirective",`Error in @${r}: ${A}`,t.EVALUATION_ERROR),startIndex:S})}v=w.exec(y)}for(let k=h.length-1;k>=0;k--){let{original:S,processed:M}=h[k];y=y.replace(S,M)}return y}function Rt(n,e){return n.rawParams?Vt(e):sn(e)}function sn(n){if(!n.trim())return[];let e=[],c="",a=!1,g="";for(let r=0;r<n.length;r++){let d=n[r];if((d==='"'||d==="'")&&(r===0||n[r-1]!=="\\"))if(!a)a=!0,g=d;else if(d===g)a=!1;else c+=d;else if(d===","&&!a)e.push(c.trim()),c="";else c+=d}if(c.trim())e.push(c.trim());return e.map((r)=>{let d=r.trim();if(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))return d.substring(1,d.length-1);return d})}var Mt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Dt=/^[A-Za-z_$][\w$]*$/,on=new Set(["light","dark","system"]);function ke(n,e){if(typeof n!=="string"||n.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function an(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("@appearanceBootstrap expects an options object");let e=n,{appearance:c,colorMode:a}=e;if(ke(e.storageKey,"storageKey"),c!==void 0&&(!c||typeof c!=="object"||Array.isArray(c)))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(ke(a.key,"colorMode.key"),ke(a.attribute,"colorMode.attribute"),ke(a.default,"colorMode.default"),!Dt.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Mt.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!on.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(c){if(ke(c.key,"appearance.key"),ke(c.attribute,"appearance.attribute"),ke(c.default,"appearance.default"),!Dt.test(c.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Mt.test(c.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(c.allowed)||c.allowed.length===0||c.allowed.some((r)=>typeof r!=="string"||r.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!c.allowed.includes(c.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:c.key,attribute:c.attribute,allowed:[...new Set(c.allowed)],default:c.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function cn(n){return JSON.stringify(n).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ln(n){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${cn(n)};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 un(n,e){let c=1,a=null,g=!1;for(let r=e+1;r<n.length;r++){let d=n[r];if(g){g=!1;continue}if(a){if(d==="\\")g=!0;else if(d===a)a=null;continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="(")c++;else if(d===")"&&--c===0)return r}return-1}function It(n,e){let c=n,a=/@appearanceBootstrap\s*\(/g,g;while((g=a.exec(c))!==null){let r=g.index+g[0].length-1,d=un(c,r);if(d===-1)throw Error("@appearanceBootstrap has an unclosed options object");let y=c.slice(r+1,d).trim(),h=u(`(${y})`,e),x=ln(an(h));c=c.slice(0,g.index)+x+c.slice(d+1),a.lastIndex=g.index+x.length}return c}import dn from"crypto";function Y(n){return W(String(n??""))}var Lt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Xe(n,e,c,a){let g=n||e;return c?`${g} ${a}`:g}function fe(n){return String(n).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Re(n,e){if(/\bid\s*=/i.test(n))return"";return` id="${Y(e)}"`}function rt(n,e,c){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(c))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(c))a+=` aria-describedby="${Y(`${fe(n)}-error`)}"`;return a}function pn(){return dn.randomUUID()}function ze(n,e){let c=n;return c=c.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=pn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Y(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),c=c.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,g)=>{let r=g.toUpperCase();if(g&&!["GET","POST"].includes(r))return`<input type="hidden" name="_method" value="${Y(r)}">`;return a}),c}function Pt(n,e,c=Lt){let a=n;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,r,d,y,h,x="")=>{let w=r||d||"POST",v=y||h||"",k=be(x),S=w.toUpperCase(),M=["GET","POST"].includes(S)?S:"POST",A=`<form method="${Y(M)}" action="${Y(v)}"${k?` ${k}`:""}>`;if(A+=`
|
|
568
|
+
${g}`)}function Et(n,e){let c=n;return c=c.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<script nonce="${e}"${g}>`}),c=c.replace(/<style([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<style nonce="${e}"${g}>`}),c}function _t(n,e,c,a){let g=n,r=a.csp;if(g=g.replace(/@csp\b/g,()=>{if(!r?.enabled||!r.directives)return"<!-- CSP not configured -->";let d=r.useNonce?We(e,r):void 0;return St(r.directives,d)}),g=g.replace(/@cspNonce\b/g,()=>{if(!r?.enabled||!r.useNonce)return"";return We(e,r)}),r?.enabled&&r.useNonce)e.cspNonce=We(e,r);return g}import Jr from"crypto";var Qr=40,Ct="_token",et=null;function Yr(n=Qr){let e=Jr.randomBytes(Math.ceil(n/2)).toString("hex").slice(0,n);return et=e,e}function en(){if(!et)Yr();return et}function tn(n=Ct){let e=en();return`<input type="hidden" name="${n}" value="${e}">`}function Tt(n){return n.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,c,a)=>tn(a||Ct))}async function At(n,e,c,a){if(!a.customDirectives||a.customDirectives.length===0)return n;let g=n;for(let r of a.customDirectives){if(!r.name||typeof r.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",r);continue}if(r.hasEndTag)g=await rn(g,r,e,c,a);else g=await nn(g,r,e,c,a)}return g}async function rn(n,e,c,a,g){let{name:r,handler:d}=e,y=`@${r}`,h=`@end${r}`,x=n,w=Ft(`${y}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${h}`,"g"),v=[],k=w.exec(x);while(k!==null){let[S,M="",A=""]=k,R=k.index||0;try{let D=M?Rt(e,M):[],j=A.trim(),N=await d(j,D,c,a);v.push({original:S,processed:N,startIndex:R})}catch(D){let j=D instanceof Error?D.message:String(D);if(g.debug)console.error(`Error processing custom directive @${r}:`,D);v.push({original:S,processed:l("CustomDirective",`Error in @${r}${M?`(${M})`:""}: ${j}`,t.EVALUATION_ERROR),startIndex:R})}k=w.exec(x)}for(let S=v.length-1;S>=0;S--){let{original:M,processed:A}=v[S];x=x.replace(M,A)}return x}async function nn(n,e,c,a,g){let{name:r,handler:d}=e,y=n,h=[],x=[];if(e.rawParams){for(let k of Ii(y,Ft(`(?<![\\w$@])@${r}\\s*\\(`,"g")))if(k.end!==-1)x.push({fullMatch:k.call,paramString:k.args,startIndex:k.start})}else{let k=Ft(`@${r}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");k.lastIndex=0;let S=k.exec(y);while(S!==null)x.push({fullMatch:S[0],paramString:S[1]??"",startIndex:S.index||0}),S=k.exec(y)}for(let{fullMatch:k,paramString:S,startIndex:M}of x)try{let A=Rt(e,S),R=await d("",A,c,a);h.push({original:k,processed:R,startIndex:M})}catch(A){let R=A instanceof Error?A.message:String(A);if(g.debug)console.error(`Error processing custom directive @${r}:`,A);h.push({original:k,processed:l("CustomDirective",`Error in @${r}(${S}): ${R}`,t.EVALUATION_ERROR),startIndex:M})}let w=Ft(`@${r}(?!\\w)(?!\\s*\\()`,"g"),v=w.exec(y);while(v!==null){let[k]=v,S=v.index||0;try{let M=await d("",[],c,a);h.push({original:k,processed:M,startIndex:S})}catch(M){let A=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${r}:`,M);h.push({original:k,processed:l("CustomDirective",`Error in @${r}: ${A}`,t.EVALUATION_ERROR),startIndex:S})}v=w.exec(y)}for(let k=h.length-1;k>=0;k--){let{original:S,processed:M}=h[k];y=y.replace(S,M)}return y}function Rt(n,e){return n.rawParams?Vt(e):sn(e)}function sn(n){if(!n.trim())return[];let e=[],c="",a=!1,g="";for(let r=0;r<n.length;r++){let d=n[r];if((d==='"'||d==="'")&&(r===0||n[r-1]!=="\\"))if(!a)a=!0,g=d;else if(d===g)a=!1;else c+=d;else if(d===","&&!a)e.push(c.trim()),c="";else c+=d}if(c.trim())e.push(c.trim());return e.map((r)=>{let d=r.trim();if(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))return d.substring(1,d.length-1);return d})}var Mt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Dt=/^[A-Za-z_$][\w$]*$/,on=new Set(["light","dark","system"]);function ke(n,e){if(typeof n!=="string"||n.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function an(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("@appearanceBootstrap expects an options object");let e=n,{appearance:c,colorMode:a}=e;if(ke(e.storageKey,"storageKey"),c!==void 0&&(!c||typeof c!=="object"||Array.isArray(c)))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(ke(a.key,"colorMode.key"),ke(a.attribute,"colorMode.attribute"),ke(a.default,"colorMode.default"),!Dt.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Mt.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!on.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(c){if(ke(c.key,"appearance.key"),ke(c.attribute,"appearance.attribute"),ke(c.default,"appearance.default"),!Dt.test(c.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Mt.test(c.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(c.allowed)||c.allowed.length===0||c.allowed.some((r)=>typeof r!=="string"||r.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!c.allowed.includes(c.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:c.key,attribute:c.attribute,allowed:[...new Set(c.allowed)],default:c.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function cn(n){return JSON.stringify(n).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ln(n){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${cn(n)};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 un(n,e){let c=1,a=null,g=!1;for(let r=e+1;r<n.length;r++){let d=n[r];if(g){g=!1;continue}if(a){if(d==="\\")g=!0;else if(d===a)a=null;continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="(")c++;else if(d===")"&&--c===0)return r}return-1}function It(n,e){let c=n,a=/@appearanceBootstrap\s*\(/g,g;while((g=a.exec(c))!==null){let r=g.index+g[0].length-1,d=un(c,r);if(d===-1)throw Error("@appearanceBootstrap has an unclosed options object");let y=c.slice(r+1,d).trim(),h=u(`(${y})`,e),x=ln(an(h));c=c.slice(0,g.index)+x+c.slice(d+1),a.lastIndex=g.index+x.length}return c}import dn from"crypto";function Y(n){return W(String(n??""))}var Lt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Xe(n,e,c,a){let g=n||e;return c?`${g} ${a}`:g}function fe(n){return String(n).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Re(n,e){if(/\bid\s*=/i.test(n))return"";return` id="${Y(e)}"`}function rt(n,e,c){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(c))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(c))a+=` aria-describedby="${Y(`${fe(n)}-error`)}"`;return a}function pn(){return dn.randomUUID()}function ze(n,e){let c=n;return c=c.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=pn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Y(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),c=c.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,g)=>{let r=g.toUpperCase();if(g&&!["GET","POST"].includes(r))return`<input type="hidden" name="_method" value="${Y(r)}">`;return a}),c}function Pt(n,e,c=Lt){let a=n;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,r,d,y,h,x="")=>{let w=r||d||"POST",v=y||h||"",k=be(x),S=w.toUpperCase(),M=["GET","POST"].includes(S)?S:"POST",A=`<form method="${Y(M)}" action="${Y(v)}"${k?` ${k}`:""}>`;if(A+=`
|
|
569
569
|
${ze("@csrf",e)}`,!["GET","POST"].includes(S))A+=`
|
|
570
570
|
${ze(`@method('${S}')`,e)}`;return A}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(g,r,d,y,h,x="")=>{let w=r||d||"",v=y||h||"",k=be(x),S=Ne(w,e),M=S!==void 0&&S!==null?S:v||"",A=k.match(/type=['"]([^'"]+)['"]/i),R=A?A[1]:"text",D=Fe(w,e),j=k.match(/class=['"]([^'"]+)['"]/i),N=Xe(j?j[1]:"",c.input,D,c.inputError),F=k.replace(/class=['"][^'"]+['"]/i,"");return F=F.replace(/type=['"][^'"]+['"]/i,""),`<input type="${Y(R)}" name="${Y(w)}"${Re(k,fe(w))} value="${Y(M)}" class="${N}"${rt(w,D,k)}${F?` ${F}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(g,r,d="",y="")=>{let h=be(d),x=Ne(r,e)||y.trim(),w=Fe(r,e),v=h.match(/class=['"]([^'"]+)['"]/i),k=Xe(v?v[1]:"",c.input,w,c.inputError),S=h.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${Y(r)}"${Re(h,fe(r))} class="${k}"${rt(r,w,h)}${S?` ${S}`:""}>${Y(x)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(g,r,d="",y)=>{let h=be(d),x=Ne(r,e),w=Fe(r,e),v=h.match(/class=['"]([^'"]+)['"]/i),k=Xe(v?v[1]:"",c.input,w,c.inputError),S=h.replace(/class=['"][^'"]+['"]/i,""),M=y;if(x!==void 0)M=y.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(A,R,D)=>{if((Array.isArray(x)?x.some((N)=>String(N)===D):String(x)===D)&&!R.includes("selected"))return R.replace(/(<option)/,"$1 selected");return A});return`<select name="${Y(r)}"${Re(h,fe(r))} class="${k}"${rt(r,w,h)}${S?` ${S}`:""}>${M}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(g,r,d,y="")=>{let h=d===void 0?"1":d,x=d===void 0?fe(r):`${fe(r)}-${fe(h)}`,w=be(y),v=Ne(r,e),k=v!==void 0&&(Array.isArray(v)?v.some((R)=>String(R)===h):v===!0||String(v)===h),S=w.match(/class=['"]([^'"]+)['"]/i),M=S?S[1]:c.checkInput,A=w.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${Y(r)}"${Re(w,x)} value="${Y(h)}" class="${M}"${k?" checked":""}${A?` ${A}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,r,d,y="")=>{let h=be(y),x=Ne(r,e),w=x!==void 0&&x===d,v=h.match(/class=['"]([^'"]+)['"]/i),k=v?v[1]:c.checkInput,S=h.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${Y(r)}"${Re(h,`${fe(r)}-${fe(d)}`)} value="${Y(d)}" class="${k}"${w?" checked":""}${S?` ${S}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,r,d="")=>{let y=be(d),h=y.match(/accept=['"]([^'"]+)['"]/i),x=h?h[1]:"",w=y.includes("multiple"),v=Fe(r,e),k=y.match(/class=['"]([^'"]+)['"]/i),S=Xe(k?k[1]:"",c.input,v,c.inputError),M=y.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),A=[`<input type="file" name="${Y(r)}"${Re(y,fe(r))}`,`class="${S}"`];if(x)A.push(`accept="${Y(x)}"`);if(w)A.push("multiple");if(M)A.push(M);return`${A.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(g,r,d="",y)=>{let h=be(d),x=h.match(/class=['"]([^'"]+)['"]/i),w=x?x[1]:c.label,v=h.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${Y(fe(r))}" class="${w}"${v?` ${v}`:""}>${y}</label>`}),a}function jt(n,e,c=Lt){return n.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,g,r)=>{try{if(Fe(g,e)){let d=r.replace(/\{\{([^}]+)\}\}/g,(y,h,x)=>{let w=(v)=>Q(r,x,String(v??""),!1,y.length);try{if(h.trim()==="$message"||h.trim()==="message")return w(Ot(g,e));if(h.trim().includes("errors.first")||h.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return w(e.errors.first(g));return w(Ot(g,e))}let v=h.trim();if(f(v)){let k=u(v,e);return k!==void 0?w(k):v}return v}catch{return h}});return`<div id="${Y(`${fe(g)}-error`)}" role="alert">${d}</div>`}return""}catch(d){return console.error("Error processing @error directive:",d),a}})}function Fe(n,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(n);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,n);return!1}function Ot(n,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(n);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,n)){let c=e.errors[n];return Array.isArray(c)?c[0]:String(c)}return""}function Ne(n,e){let c;if(e.old&&typeof e.old==="function")return e.old(n);if(e.old&&typeof e.old==="object")return e.old[n];if(n.endsWith("[]")){let a=n.slice(0,-2);if(c=e[a],c!==void 0)return c}return e[n]}function be(n){if(!n.trim())return"";let e=[],c=n.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,g;while((g=a.exec(c))!==null){let[,r,,d]=g;e.push(`${r}="${d.trim()}"`)}return e.join(" ")}import*as nt from"path";async function Ht(n,e,c=""){if(nt.basename(c)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,n.replace(/@js[\s\S]*?@endjs/g,"");return qt(n,e,c,"@js","@endjs")}async function Ut(n,e,c=""){if(nt.basename(c)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((r)=>({...r,displayName:`User ${r.id}: ${r.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return n.replace(/@ts[\s\S]*?@endts/g,"")}return qt(n,e,c,"@ts","@endts")}async function qt(n,e,c,a,g){let r=n,d=Ft(`${a}([\\s\\S]*?)${g}`,"g"),y=[],h;while((h=d.exec(n))!==null)y.push({fullMatch:h[0],content:h[1]||"",index:h.index});for(let{fullMatch:x,content:w,index:v}of y)try{let k={...e,global:e},S=Object.keys(k),M=Object.values(k),A=w.trim();if(a==="@ts")A=A.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 D=(A.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((L)=>L.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),j=D.length>0?`return { ${D.join(", ")} };`:"return {};",N=`
|
|
571
571
|
${A}
|
|
@@ -580,7 +580,7 @@ ${A.element}`);else v.push(`@else
|
|
|
580
580
|
${A.element}`);v.push("@endif");let k=v.join(`
|
|
581
581
|
`),S=r[0].outerStart,M=r[r.length-1].outerEnd;e=e.slice(0,S)+k+e.slice(M),c=S+k.length}return e}function Cn(n){return n.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function An(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=yn.has(a.tag),r=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(y,h,x)=>{let w=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(h);if(!w||!x||!/^["']/.test(x))return y;let v=w[1]||"modelValue",k=w[2];if(g&&!w[1])return`@model${k}=${x}`;let S=x[0],M=x.slice(1,-1),A=`:${v}=${x} @update:${v}=${S}${M} = $event${S}`;if(k){let R=w[1]?`${v}Modifiers`:"modelModifiers",D=k.slice(1).split(".").map((j)=>`${j}: true`).join(", ");A+=` :${R}="{ ${D} }"`}return A});if(r===a.attrs){c=a.end;continue}let d=Ie(a.full,{...a,start:0,end:a.full.length},r);e=e.slice(0,a.start)+d+e.slice(a.end),c=a.start+d.length}return e}function Rn(n){return n.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Mn(n){return n.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function Dn(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=qe(a.attrs,"v-html");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let r=Se(e,a),d=we(a.attrs,"v-html"),y=a.selfClosing?" /":"",h=`<${a.tag}${d}${y}>{!! ${g} !!}</${a.tag}>`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function In(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=qe(a.attrs,"v-text");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let r=Se(e,a),d=we(a.attrs,"v-text"),y=a.selfClosing?" /":"",h=`<${a.tag}${d}${y}>{{ ${g} }}</${a.tag}>`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function On(n){return n.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 Ln(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;if(!Jt(a.attrs,"v-once")){c=a.end;continue}let g=we(a.attrs,"v-once"),r=Se(e,a),d=e.slice(r.outerStart,r.outerEnd),h=`@once
|
|
582
582
|
${Ie(d,{...a,start:0,end:a.end-a.start},g)}
|
|
583
|
-
@endonce`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function Pn(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function jn(n){return n.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 Qt(n){if(!vn(n))return n;let e=n;return e=kn(e),e=Sn(e),e=Ln(e),e=Rn(e),e=Mn(e),e=An(e),e=Cn(e),e=jn(e),e=Dn(e),e=In(e),e=On(e),e=Pn(e),e}function Ke(n){return n.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}var st=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"]),Nn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Yt(n,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=c?c[1]:n,g=u(a,e);if(g&&typeof g==="string")return g;let r=a.trim();return st.has(r)?r:null}function er(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function tr(n,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${n} ${a}>`:`<${n}>`;if(Nn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${g}${c}</${n}>`}async function rr(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],slotContent:h[3],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let j=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}if(st.has(v)){let j=tr(v,w.attrs,w.slotContent);r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,A;while((A=M.exec(k))!==null){let j=A[1]||A[2],N=A[3];if(A[1])try{S[j]=u(N,e)}catch{S[j]=N}else S[j]=N}let R=a.componentsDir||"components",D=await He(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+D+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r=await Hn(r,e,c,a,g),r}async function Hn(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}if(st.has(v)){let M=tr(v,w.attrs,"");r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await He(v,{},"",k,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r}var
|
|
583
|
+
@endonce`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function Pn(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function jn(n){return n.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 Qt(n){if(!vn(n))return n;let e=n;return e=kn(e),e=Sn(e),e=Ln(e),e=Rn(e),e=Mn(e),e=An(e),e=Cn(e),e=jn(e),e=Dn(e),e=In(e),e=On(e),e=Pn(e),e}function Ke(n){return n.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}var st=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"]),Nn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Yt(n,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=c?c[1]:n,g=u(a,e);if(g&&typeof g==="string")return g;let r=a.trim();return st.has(r)?r:null}function er(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function tr(n,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${n} ${a}>`:`<${n}>`;if(Nn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${g}${c}</${n}>`}async function rr(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],slotContent:h[3],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let j=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}if(st.has(v)){let j=tr(v,w.attrs,w.slotContent);r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,A;while((A=M.exec(k))!==null){let j=A[1]||A[2],N=A[3];if(A[1])try{S[j]=u(N,e)}catch{S[j]=N}else S[j]=N}let R=a.componentsDir||"components",D=await He(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+D+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r=await Hn(r,e,c,a,g),r}async function Hn(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}if(st.has(v)){let M=tr(v,w.attrs,"");r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await He(v,{},"",k,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r}var fc="X-STX-Build",it=Symbol.for("stx.buildId");function ls(){let n=globalThis;if(!n[it])n[it]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return n[it]}function nr(n,e=ls()){if(n.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(n))return null;return`
|
|
584
584
|
<meta name="stx-build" content="${e}">`}var jo="/_stx/sw.js";function Bn(n){if(typeof n!=="string"||!n.startsWith("/"))return null;let e=[],c=[],a=n.replace(/\/+$/,"").split("/").slice(1).map((g)=>{let r=/^:(\w+)$/.exec(g)||/^\[(\w+)\]$/.exec(g);if(r)return e.push(r[1]),c.push("0"),"([^/]+)";return c.push(g),g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:n,re:`^/${a.join("/")}/?$`,names:e,sample:`/${c.join("/")}`}}function Fn(n){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,c=window;if(c.stxOffline)return;let a=null,g=!1,r=[],d={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(w){if(d.updateReady)try{w()}catch{}else r.push(w);return()=>{let v=r.indexOf(w);if(v!==-1)r.splice(v,1)}},applyUpdate(){let w=a&&a.waiting;if(!w)return!1;return g=!0,w.postMessage({type:"stx:activate-update",force:!0}),!0}};c.stxOffline=d;let y=(w)=>{if(!w.waiting||!e.controller||d.updateReady)return;d.updateReady=!0;let v=r.splice(0);for(let k of v)try{k()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(w)=>{let v=w.data||{};if(v.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:v.url,kind:v.kind,fragment:!!v.fragment}}))}catch{}if(v.type==="stx:reachability"){if(c.stxOffline.reachable=v.reachable!==!1,Number(v.at)>0)c.stxOffline.reachedAt=Number(v.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:v.reachable!==!1,at:Number(v.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(g)g=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let h=()=>{e.register(n,{scope:"/"}).then((w)=>{a=w;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(w.waiting)y(w),w.waiting.postMessage({type:"stx:activate-update",reason:"load"});w.addEventListener("updatefound",()=>{let v=w.installing;if(!v)return;v.addEventListener("statechange",()=>{if(v.state==="installed")y(w)})})}).catch(()=>{})},x=()=>{let w=(v)=>{setTimeout(v,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>w(h));else w(h)};if(!e.controller)if(document.readyState==="complete")x();else addEventListener("load",x);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",x);else x()}function Un(){let n=`(${Fn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim().replace(/;$/,"")}catch{return n}}function qn(n,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!n||!n.startsWith("/"))return null;let c=n.split(/[?#]/)[0].split("/").filter(Boolean)[0];return c?`/${c}`:"/"}var sr=`<script data-stx-offline>${Un()}</script>`;function Bo(n,e){let c=Number(n.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((n.pages||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")))),staticPages:(n.staticPages||[]).filter((g)=>typeof g==="string"&&((n.pages||[]).includes(g)||(n.routes||[]).includes(g))),api:n.apiPrefix||"/api/",timeout:Math.max(500,Number(n.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(c)&&c>0?Math.min(2147483647,Math.max(1,Math.floor(c))):1e4,networkFirst:(n.networkFirst||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")),updateOnColdStart:n.updateOnColdStart===!0,fallback:n.fallback||n.pages&&n.pages[0]||null,fallbackScope:qn(n.fallback||n.pages&&n.pages[0]||null,n.fallbackScope),routes:(n.routes||[]).map(Bn).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...n.exclude||[]],mediaMax:Math.max(10485760,Number(n.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(n.assetsMaxEntries)||500)};return`/* stx offline worker, build ${a.build} */
|
|
585
585
|
'use strict';
|
|
586
586
|
var S = ${JSON.stringify(a)};
|
|
@@ -1295,35 +1295,35 @@ ${R}
|
|
|
1295
1295
|
</style>`;a=a.replace(x,D),y.lastIndex=0}catch(R){}}}return a}import ot from"path";var Wn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Xn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function zn(n,e){if(!e||!n.includes("/"))return n;let c=ot.dirname(e);return n.replace(Wn,(a,g,r,d)=>{let y=ot.resolve(c,d);return`${g}${r}${y.split(ot.sep).join("/")}${r}`})}function ur(n,e){if(!e||!n.includes("<script"))return n;return n.replace(Xn,(c,a,g,r)=>`${a}${zn(g,e)}${r}`)}var Te="<!--PARENT_CONTENT_PLACEHOLDER-->";function fr(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Sr(n,e){let c=n.length,a=e,g=!0,r=[],d=(y)=>y+9<=c&&n[y]==="<"&&n[y+1]==="/"&&(n[y+2]==="s"||n[y+2]==="S")&&(n[y+3]==="c"||n[y+3]==="C")&&(n[y+4]==="r"||n[y+4]==="R")&&(n[y+5]==="i"||n[y+5]==="I")&&(n[y+6]==="p"||n[y+6]==="P")&&(n[y+7]==="t"||n[y+7]==="T")&&(n[y+8]===">"||/\s/.test(n[y+8]));while(a<c){let y=n[a];if(d(a))return a;if(y==="/"&&n[a+1]==="/"){if(a=n.indexOf(`
|
|
1296
1296
|
`,a+2),a===-1)return-1;a+=1,g=!0;continue}if(y==="/"&&n[a+1]==="*"){let h=n.indexOf("*/",a+2);if(h===-1)return-1;a=h+2,g=!0;continue}if(y==="/"&&g){let h=a+1,x=!1;while(h<c){let w=n[h];if(w==="\\"){h+=2;continue}if(w==="[")x=!0;else if(w==="]")x=!1;else if(w==="/"&&!x){h++;break}else if(w===`
|
|
1297
1297
|
`){h=-1;break}h++}if(h===-1){a++,g=!1;continue}while(h<c&&/[a-z]/.test(n[h]))h++;a=h,g=!1;continue}if(y==="'"||y==='"'){let h=y;a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]===h){a++;break}if(n[a]===`
|
|
1298
|
-
`)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(y==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function Er(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function at(n,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-
|
|
1298
|
+
`)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(y==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function Er(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function at(n,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-qx8cav4w.js");return`<script ${n} src="${a(e)}"></script>`}async function or(n,e,c,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:r}=await o("stx/client-module-registry",()=>import("./chunk-9fz3h6sx.js")),d=[],y=await r(g(...n),{minify:Di(e.buildMode,e.minifyClient),collectInputs:d});for(let h of d)c?.add(h);if(a)a.inputs=d,a.code=y??void 0;if(!y)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:h}=await import("./chunk-qx8cav4w.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${h(y)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${y.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Zn(n,e,c,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:k}=await o("stx/framework-composables",()=>import("./chunk-mjkdskeg.js"));g.frameworkScript=await k(n)}catch{}let r=null;try{r=await o("stx/store-loader",()=>import("./chunk-5x9ajbq0.js"))}catch{}let d=e.storesDir,y=!!a.__stx_native_screen||(r?.pageStoresAll()??!0),h=y?"":n.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],w=[],v=null;for(let k=0;k<8;k++){let S=null,M="",A=!1;try{if(r){let N=y?await r.getStoreScript(d).then((F)=>F?{code:F,stores:["*"],functions:null}:null):await r.getStoreScriptFor(d,[h],{reads:r.storesReadInFiles([...x,...w]),runOnce:!0});if(N)S=N.code,M=N.stores.join(","),A=!!N.functions&&!y}}catch{}if(v!==null&&M===v)break;v=M;let R=A?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",D=S?`<script ${R}>${S}</script>`:null;g.storeCode=S,g.storeTag=S?await at(R,S,e)??D:null;let j={};g.modulesTag=await or([n,D],e,c,j),g.modulesCode=j.code??null,x=j.inputs??[],g.composableTag=null,g.composableCode=null,w=[];try{let{getComposableScript:N}=await o("stx/composable-loader",()=>import("./chunk-3y7yp0ka.js")),F=e.composablesDir,I=[g.modulesCode??g.modulesTag,D,g.frameworkScript].filter((H)=>H!==null),L=await N(e._layerComposableDirs??F,n,I,w);if(L)g.composableCode=L,g.composableTag=await at('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(y||!r)break}return g}async function Jn(n,e,c,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:r}=await import("./chunk-mad172af.js"),d=await import("./chunk-kh01rvag.js"),{messages:y,webModules:h}=e,x=null,w=null,v=r()===""&&!a.__stx_native_screen;if(y&&d.pageMessagesEnabled(e)&&v)try{x=await d.loadPageMessages(process.cwd(),y)}catch(R){Qn(R)}if(h&&Object.keys(h).length&&v)try{w=await(await import("./chunk-xmy6g81m.js")).loadWebModules(process.cwd(),h)}catch(R){Yn(R)}let k=new Map([...w??[],...x?.stubs??[]]),S=()=>Zn(n,e,c,a),M=k.size?await g(k,S):await S(),A=null;if(x){let R=d.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),D=d.pageMessagesScript(x,d.pageLanguages(n,x),R);if(D)A=await at('data-stx-scoped data-stx-run="always" data-stx-messages',D,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${D.replace(/<\/script/gi,"<\\/script")}</script>`}return[A,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((R)=>R!==null)}var gr=!1;function Qn(n){if(gr)return;gr=!0,console.warn(`[stx] messages: ${n instanceof Error?n.message:String(n)}; pages ship every language`)}var hr=!1;function Yn(n){if(hr)return;hr=!0,console.warn(`[stx] ${n instanceof Error?n.message:String(n)}; pages bundle the real modules`)}function es(n,e=""){let c=Er(n,"data-stx-runtime");if(!c)return n;let a=dr(n);if(a===-1||a===c.start){if(!e)return n;return n.slice(0,c.end)+e+n.slice(c.end)}if(a<c.start)return n.slice(0,a)+n.slice(c.start,c.end)+e+`
|
|
1299
1299
|
`+n.slice(a,c.start)+n.slice(c.end);let g=n.slice(c.start,c.end),r=n.slice(0,c.start)+n.slice(c.end),d=dr(r);if(d===-1)return g+e+`
|
|
1300
1300
|
`+r;return r.slice(0,d)+g+e+`
|
|
1301
|
-
`+r.slice(d)}function ts(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(c,a,g)=>{let r=n.slice(0,g);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,c,a,g){if(await _(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=_e(n,c);let r=!e.__stxProcessingDepth;bn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(r&&a.runtimeConfig)await _n(e,c,a.runtimeConfig);if(r)
|
|
1302
|
-
`),...x.htmlAttrs&&{htmlAttrs:
|
|
1301
|
+
`+r.slice(d)}function ts(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(c,a,g)=>{let r=n.slice(0,g);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,c,a,g){if(await _(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=_e(n,c);let r=!e.__stxProcessingDepth;bn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(r&&a.runtimeConfig)await _n(e,c,a.runtimeConfig);if(r)el(e),e.__stx_scope_seq??={n:0,key:Ks(String(e.__filename??c))},e.__stx_head_injections=Oi(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!T()&&!$n())&&c&&c.endsWith(".stx"))Fo(n,c);try{return await le.timeAsync("template-processing",async()=>{let d=await rs(n,e,c,a,g);if(r)d=vi(d);if(r&&a.autoShell&&a.buildMode!=="compile"){let y=Ee(a.app?.head,{known:Dr,source:"app.head"}),x=(e.__stx_runtime_head||null)??Mi(),w=(e.__stx_head_raw||"").trim(),v,k=w.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(k)v=k[1].trim(),w=w.replace(k[0],"").trim();let S=e.__sections?.title,M=S?E(S,e,c):void 0,A=x.title||v||M,R=!x.title&&(!!v||!!M),D=x.meta||[],j=new Set(D.map((V)=>lt(V)).filter(Boolean)),N={...y,...A&&{title:A},meta:[...(y.meta||[]).filter((V)=>!j.has(lt(V))),...D],link:[...y.link||[],...x.link||[]],script:[...y.script||[],...x.script||[]],headRaw:[y.headRaw,w].filter(Boolean).join(`
|
|
1302
|
+
`),...x.htmlAttrs&&{htmlAttrs:yl(y.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...y.bodyAttrs||{},...x.bodyAttrs}}},F=Ni(d);if(d=Nr(d,N,{...R&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},F),F)d=wl(d,y),d=Or(d,N.htmlAttrs);let I=d.match(/<!-- stx-layout: ([^ ]+) -->/);if(I&&d.includes("<head")){let V=I[1],ae=Ns(V);d=d.replace(/<head\b[^>]*>/i,(X)=>`${X}
|
|
1303
1303
|
<meta name="stx-layout" content="${fr(V)}">
|
|
1304
|
-
<meta name="stx-layout-group" content="${fr(ae)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?B(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Qe(d,(ae,X)=>`<body${X} data-stx="${L[1]}">`);let V=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(V,"$1")}}if(r){let y=e.__stx_head_injections??
|
|
1304
|
+
<meta name="stx-layout-group" content="${fr(ae)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?B(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Qe(d,(ae,X)=>`<body${X} data-stx="${L[1]}">`);let V=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(V,"$1")}}if(r){let y=e.__stx_head_injections??Oi(),h=bl(d);if(h!==null)y.beforeClose.push(h);let x=nr(d);if(x!==null)y.afterOpen.push(x);if(a.offline?.enabled&&!d.includes("data-stx-offline"))y.beforeClose.push(sr);d=ml(d,y);let w=a.app?.colorMode;if(w)d=Ir(d,w)}if(r)if(Er(d,"data-stx-runtime")){let h=await Jn(d,a,g,e);d=es(d,h.map((x)=>`
|
|
1305
1305
|
${x}`).join(""))}else{let h=await or([d],a,g);if(h){let x=d.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)d=d.slice(0,x)+h+`
|
|
1306
|
-
`+d.slice(x)}}if(r)d=
|
|
1306
|
+
`+d.slice(x)}}if(r)d=hl(d);if(r&&e.__stx_inject_css!==!1)d=await b(d,void 0,a.buildMode==="serve",!0);else if(r)d=hn(d);if(r)d=pt(d);if(d=d.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),d=ts(d),r&&e.__stx_runtime_config)d=Bt(d,e.__stx_runtime_config);if(r&&!e.__stx_defer_server_data){let y=$r(e);if(y){let h=/<head\b[^>]*>/i.exec(d),x=h?h.index+h[0].length:0;d=d.slice(0,x)+y+d.slice(x)}}return d})}catch(d){if(d instanceof K)throw d;let y=d instanceof Error?d.message:String(d),h=new ee(`Template processing failed: ${y}`,c,void 0,void 0,n.substring(0,200)+(n.length>200?"...":""));if(z.log(h,{filePath:c,context:e}),En.logDetailedError(h,{filePath:c,template:n.substring(0,500)}),T()&&!a.debug)console.error(`[stx] ${se.relative(process.cwd(),c)||c}: ${h.message}`);if(a.debug)throw h;return Pi.createFallbackContent("Template Processing",h)}}async function rs(n,e,c,a,g){let r=process.cwd(),d={...a,partialsDir:a.partialsDir&&!se.isAbsolute(a.partialsDir)?se.resolve(r,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!se.isAbsolute(a.componentsDir)?se.resolve(r,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!se.isAbsolute(a.layoutsDir)?se.resolve(r,a.layoutsDir):a.layoutsDir},y=d,h=n;await is(c,e),ss(e,y),h=await Ce(()=>zt(h,e,c,y),h,(I)=>{z.log(I,{filePath:c,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${c}: ${I.message}`)}),h=h.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=ge(h,De,(I,L)=>`\x00STX_HTML_COMMENT_${L}\x00`);h=x.output;let w=x.tokens,v=(I)=>w.length===0?I:I.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(L,H)=>w[Number(H)]??""),k="\x00STX_ESCAPED_AT\x00",S="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";h=h.replace(/@@/g,k),h=h.replace(/@\{\{([\s\S]*?)\}\}/g,(I,L)=>`${S}${L}${M}`),h=Qt(h),h=await lr(h,c,g);let A={};h=ds(h,A);let R={...e.__sections||{}},D="",j=bt(vt(n)),N=/@nolayout\b/.test(h)||j===!1;if(/@nolayout\b/.test(h))h=h.replace(/@nolayout\b\s*/g,"");let F=h.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(F)D=F[1],h=h.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof j==="string"){if(D=j,!/@section\s*\(/.test(h))h=`@section('content')
|
|
1307
1307
|
${h.trim()}
|
|
1308
1308
|
@endsection`}if(!D&&!N&&y.defaultLayout){let I=Tn(h),L=/@section\s*\(/.test(h);if(!I||L){let H="",V=se.dirname(c),ae=y.layoutsDir?se.dirname(y.layoutsDir):process.cwd();for(let X=0;X<20;X++){let ce=se.join(V,"_layout.stx");if(await s(ce)){H=ce;break}let oe=se.dirname(V);if(oe===V||oe.length<ae.length)break;V=oe}if(H)D=H;else if(y.layoutsDir){let X=se.isAbsolute(y.layoutsDir)?y.layoutsDir:se.resolve(process.cwd(),y.layoutsDir),ce=se.join(X,`${y.defaultLayout}.stx`);if(await s(ce))D=ce}if(D&&!L)h=`@section('content')
|
|
1309
1309
|
${h.trim()}
|
|
1310
1310
|
@endsection`}}if(D&&h.includes("<script")){let I=J(h),L=I.scripts.map((H)=>yr(H,c)??H);h=kr(I.output,L)}if(h=h.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(I,L,H)=>(R[L]=H,"")),h=h.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(I,L,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return I;try{let V=u(H.trim(),e);if(V===void 0)return I;let X=(e.__stx_inline_section_values??=[]).push(V)-1;return R[L]=`{{ __stx_inline_section_values[${X}] }}`,""}catch{return I}}),h=h.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(I,L,H)=>{if(H.includes("@parent"))R[L]=H.replace("@parent",Te);else R[L]=H.trim();return""}),e.__sections=R,h=h.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(I,L,H)=>R[L]||H||""),!("slot"in e)||e.slot===void 0)h=h.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||"");if(h=ps(h,A),D){let I=[],L=J(h),H=ge(L.output,mn,(V,ae)=>`\x00STX_ORPHAN_STYLE_${ae}\x00`);if(h=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(V,ae,X)=>{let ce=ae==="SCRIPT"?yr(L.scripts[Number(X)],c):H.tokens[Number(X)];if(ce)I.push(ce);return""}),I.length>0){let V=I.join(`
|
|
1311
1311
|
`);R.content=R.content?`${R.content}
|
|
1312
1312
|
${V}`:V,e.__sections=R}}if(D)try{let I;if(se.isAbsolute(D))I=D,g.add(D);else I=await Ce(()=>xn(D,c,d,g),null,()=>{throw new ee(`Failed to resolve layout path: ${D}`,c,void 0,void 0,`Layout referenced from ${c}`)});if(!I){let oe=(G)=>{if(!G)return[];try{let ye=se.isAbsolute(G)?G:se.resolve(process.cwd(),G);return Kn.readdirSync(ye).filter((xe)=>xe.endsWith(".stx")).map((xe)=>xe.replace(/\.stx$/,""))}catch{return[]}},te=[...oe(d.layoutsDir),...oe(d.fallbackLayoutsDir)].filter((G,ye,xe)=>xe.indexOf(G)===ye).sort(),he=[d.layoutsDir,d.fallbackLayoutsDir].filter((G)=>typeof G==="string"&&G.length>0),de=he.length>0?` Searched: ${he.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",re=`Layout not found: ${D} (referenced from ${c})`+(te.length>0?`. Available layouts: ${te.join(", ")}`:d.layoutsDir?`. No .stx layouts found in ${d.layoutsDir}`:"")+de;if(z.log(Error(re),{layoutPath:D,filePath:c,available:te},"error"),console.error(`[stx] ${re}`),d.debug)throw new ee(re,c);return h}let L=await Ce(()=>Bun.file(I).text(),"",()=>{throw new ee(`Failed to read layout file: ${I}`,c,void 0,void 0,"Layout content could not be loaded")});L=ur(L,I),L=L.replace(/\{\{--[\s\S]*?--\}\}/g,"");let H=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(H.includes(I)){let oe=[...H.slice(H.indexOf(I)),I];throw new ee(oe.length===2?`Circular layout: ${I} extends itself`:`Circular layout: ${oe.join(" -> ")}`,c,void 0,void 0,"Remove the @extends or @layout line that points back at a layout already in use")}let V=L.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(V){if(d.debug)console.log(`Found nested layout: ${V[1]} in ${I}`);let oe={},te=L.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(re,G,ye)=>(oe[G]=ye.trim(),""));for(let[re,G]of Object.entries(oe))if(R[re]&&R[re].includes(Te)){let ye=R[re].indexOf(Te);R[re]=R[re].slice(0,ye)+G+R[re].slice(ye+Te.length)}else if(!R[re])R[re]=G;let he={...e,__sections:R,__layoutChain:[...H,I]},de=`@layout('${V[1]}')${te}`;return await i(de,he,I,d,g)}let ae=L.replace(/\{\{--[\s\S]*?--\}\}/g,""),X=ds(ae,A),ce={};return X=X.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(oe,te,he)=>(ce[te]=he.trim(),`@slot('${te}')`)),X=X.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(oe,te,he)=>{if(R[te]){let de=R[te];if(de.includes(Te)){let re=ce[te]||"",G=de.indexOf(Te);de=de.slice(0,G)+re+de.slice(G+Te.length)}return de}return he||""}),X=ns(X,R),X=X.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||""),X=ps(X,A),e.__originalFilePath=c,h=await xr(X,e,I,d,g),h=`<!-- stx-layout: ${D} -->
|
|
1313
|
-
${h}`,v(h)}catch(I){if(I instanceof K)throw I;throw new ee(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await xr(h,e,c,d,g))}function ns(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function ss(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function is(n,e){await Ce(()=>Zt(n,e),void 0,(c)=>{z.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var ct="data-stx-source";function yr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return n;return`<script ${ct}="${encodeURIComponent(e)}"${n.slice(7)}`}function os(n){let e=new RegExp(`${ct}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function wr(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function vr(n,e,c){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">${wr(n)}</span><span style="display:block;margin-top:4px">${wr(c)}</span></div>`}async function as(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1314
|
-
`;if(r=X(r,e),r=ce(r,e,c),r=Gt(r),r=Wo(r,e),r=Tt(r),r=Wt(r),r=await us(r,e,c,d,g),r=await ms(r,e,c,d,g),await _(),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=
|
|
1313
|
+
${h}`,v(h)}catch(I){if(I instanceof K)throw I;throw new ee(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await xr(h,e,c,d,g))}function ns(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function ss(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function is(n,e){await Ce(()=>Zt(n,e),void 0,(c)=>{z.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var ct="data-stx-source";function yr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return n;return`<script ${ct}="${encodeURIComponent(e)}"${n.slice(7)}`}function os(n){let e=new RegExp(`${ct}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function wr(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function vr(n,e,c){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">${wr(n)}</span><span style="display:block;margin-top:4px">${wr(c)}</span></div>`}async function as(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-pybm7c9p.js")),r=[],d=!T()&&!$n();for(let h of g(n)){let x=h.attrs;if(!/\bserver\b/.test(x))continue;let w=h.start+h.fullMatch.indexOf(">")+1,v=Sr(n,w);if(v===-1)continue;let k=n.slice(w,v);if(!k.trim())continue;let S=os(x)??c,M={index:h.start,length:v+9-h.start};try{let{extractVariables:A}=await o("stx/variable-extractor",()=>import("./chunk-2wba5ypm.js"));await A(k,e,S,{preserveExisting:!0,onFailure:(R)=>{if(R.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:S,kind:R.kind,message:R.message}),!d)return;r.push({...M,markup:vr(S,R.kind,R.message)})}})}catch(A){let R=A instanceof Error?A:Error(String(A));if(z.log(R,{filePath:S,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${S}: ${R.message}`),d)r.push({...M,markup:vr(S,"unknown",R.message)})}}if(r.length===0)return n;let y=n;for(let h of r.sort((x,w)=>w.index-x.index))y=y.slice(0,h.index)+h.markup+y.slice(h.index+h.length);return y}async function cs(n,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-zrm2x65c.js"));return a(n,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return z.log(g,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${g.message}`),n}}async function xr(n,e,c,a,g){let r=n;await _();let d=a;if(r=await as(r,e,c,a),r=await Ht(r,e,c),r=await Ut(r,e,c),r=await cs(r,e,c),await _(),r=await At(r,e,c,d),_e(r))r=Xo(r,e),r=vs(r,e),r=ws(r,e);r=Jo(r),await _();let{processStreamDirectives:y}=await o("stx/streaming",()=>import("./chunk-ck5nzbbv.js"));r=y(r,e),r=await Uo(r,e,c,d,!0),await _(),r=await rr(r,e,c,d,g),r=await ms(r,e,c,d,g),await _(),r=Sc(r,e,c,d);let{processDeferDirectives:h}=await o("stx/defer",()=>import("./chunk-6g7tkmty.js"));r=h(r,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-c9y1g61m.js"));r=x(r,e,c);let{processTransitionDirectives:w,processTransitionAttributes:v}=await o("stx/transitions",()=>import("./chunk-y86mpnrg.js"));r=w(r,e,c),r=v(r);let{processErrorBoundaryDirectives:k,stripRenderFailedMarkers:S}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));r=k(r,e,c),r=S(r);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-9jr30fns.js"));r=M(r,e,c);let{processAsyncDirectives:A}=await o("stx/async-components",()=>import("./chunk-fcbpzdyz.js"));r=A(r,e,c);let{processKeepAliveDirectives:R}=await o("stx/keep-alive",()=>import("./chunk-41wwqw0q.js"));r=R(r,e,c);let{processVirtualListDirectives:D,processVirtualGridDirectives:j,processInfiniteListDirectives:N}=await o("stx/virtual-scrolling",()=>import("./chunk-asr5v51s.js"));r=D(r,e,c),r=j(r,e,c),r=N(r,e,c),await _();let{processPartialHydrationDirectives:F,processStaticDirectives:I}=await o("stx/partial-hydration",()=>import("./chunk-fahqq7c4.js"));r=F(r,e,c),r=I(r);let{processComputedDirectives:L,processWatchDirectives:H}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));r=L(r,e,c),r=H(r,e,c);let{processFormValidationDirectives:V}=await o("stx/forms-validation",()=>import("./chunk-kepxsjfx.js"));r=V(r,e,c);let{processHeadDirective:ae,processTitleDirective:X,processMetaDirective:ce,resetHead:oe}=await o("stx/head",()=>import("./chunk-zm0g7ntw.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)oe();let te=ae(r);if(r=te.content,te.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${te.headContent}
|
|
1314
|
+
`;if(r=X(r,e),r=ce(r,e,c),r=Gt(r),r=Wo(r,e),r=Tt(r),r=Wt(r),r=await us(r,e,c,d,g),r=await ms(r,e,c,d,g),await _(),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=vi(r),r=ie(r,e,c),r=hs(r),await _(),e.__stxProcessingDepth===1)r=tl(r,e);if(r=Xc(r,e,{filePath:c,buildMode:d.buildMode}),r=qo(r,e),r=Ko(r,e),r=ze(r,e),r=Pt(r,e),r=jt(r,e),r=await wt(r,e,c,d),r=await _c(r,e,c),r=await Ec(r,e,c,d),await _(),r=Tc(r,e,c,d),r=ri(r,e,c,d),r=si(r,e,c),r=oi(r,e,c,d),r=_t(r,e,c,d),r=Ws(r,e),r=qs(r),r=Yc(r),!d.skipEventDirectives)r=Bc(r,e,c);if(r=Jc(r,e,c,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await _(),d.debug){let U=/\bx-data\s*=/.test(r),q=bs(n);if(U&&q)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
1315
1315
|
Both work on the same page, but they manage separate scopes.
|
|
1316
|
-
Prefer signals (state/derived/effect) for new components.`)}r=
|
|
1316
|
+
Prefer signals (state/derived/effect) for new components.`)}r=yc(r,e),r=await Ti(r,e,c),await _(),r=Zc(r),r=Qc(r),r=ht(r);let{processXElementDirectives:he}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));r=he(r);let de=e.__originalFilePath||c,re=je(e);if(r=await Yo(r,d,de,re),await _(),r=It(r,e),r=await Kt(r,e,c,d),await _(),d.media?.image?.autoSiblings){let U=d.publicDir||"public",{rewriteImagesWithSiblings:q}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-k9fsd6t3.js"));r=await q(r,{publicDir:U})}if(d.seo?.enabled)r=ii(r,e,d);let G=(U,q,Z=!0)=>{if(!q)return U;let me=q.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ne=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(U),pe=ne?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ne[0]):null;if(me&&ne&&pe){if(Z){let Ae=ne.index+pe.index;U=U.slice(0,Ae)+me[0]+U.slice(Ae+pe[0].length)}if(q=q.replace(me[0],"").trim(),!q)return U}if(/<\/head>/i.test(U))return U.replace(/<\/head>/i,`${q}
|
|
1317
1317
|
</head>`);if(/<head\b[^>]*>/i.test(U))return U.replace(/(<head\b[^>]*>)/i,`$1
|
|
1318
1318
|
${q}`);if(/<html\b[^>]*>/i.test(U))return U.replace(/(<html\b[^>]*>)/i,`$1
|
|
1319
1319
|
<head>
|
|
1320
1320
|
${q}
|
|
1321
|
-
</head>`);return U},{renderHead:ye,getHead:xe}=await o("stx/head",()=>import("./chunk-
|
|
1321
|
+
</head>`);return U},{renderHead:ye,getHead:xe}=await o("stx/head",()=>import("./chunk-zm0g7ntw.js")),Le=e.__stx_runtime_head??xe();if(Le.title||Le.meta?.length||Le.link?.length){let U=ye(Le);if(U)r=G(r,U)}if(te.headContent)r=G(r,te.headContent,!Le.title);if(d.csp?.enabled&&d.csp.addMetaTag)r=$t(r,d.csp,e);if(d.analytics?.enabled)r=yt(r,d);if(d.heatmap?.enabled)r=kc(r,d);if(d.pwa?.enabled&&d.pwa.autoInject!==!1){let{injectPwaTags:U}=await o("stx/pwa/inject",()=>import("./chunk-5mg443dw.js"));r=U(r,d)}let _r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(r),Cr=/\bSTX\.\w+/.test(r),Tr=/window\.STX\s*=/.test(r);if(_r&&Cr&&!Tr){let q=`<script data-stx-scoped data-stx-run="once">
|
|
1322
1322
|
${ft()}
|
|
1323
1323
|
</script>`;if(r.includes("</head>")){let Z=r.indexOf("</head>"),ne=r.slice(0,Z).indexOf("<script");if(ne!==-1){let pe=r.slice(0,ne),Ae=r.slice(ne);r=pe+q+`
|
|
1324
1324
|
`+Ae}else r=r.replace("</head>",`${q}
|
|
1325
1325
|
</head>`)}else if(r.includes("<body"))r=r.replace(/<body([^>]*)>/,`<body$1>
|
|
1326
1326
|
${q}`);else r=q+`
|
|
1327
|
-
`+r}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1328
|
-
`+r.slice(Z)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!ve(r)&&
|
|
1329
|
-
export{vt,Pe,
|
|
1327
|
+
`+r}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-pybm7c9p.js")),q=[];for(let Z of U(r)){if(!/\bserver\b/i.test(Z.attrs))continue;let me=Z.start+Z.fullMatch.indexOf(">")+1,ne=Sr(r,me);if(ne===-1)continue;let pe=ne+9;while(pe<r.length&&/\s/.test(r[pe]))pe++;q.push({start:Z.start,end:pe})}if(q.length>0){let Z=Array(q.length+1),me=0;for(let ne=0;ne<q.length;ne++){let{start:pe,end:Ae}=q[ne];Z[ne]=r.slice(me,pe),me=Ae}Z[q.length]=r.slice(me),r=Z.join("")}}let ut=Vs(r,c);if(ut.hasScoped)r=ut.html;let Ar=e.__stx_event_bindings||[],Ge=!1,dt=[],Rr=/\s:[a-z][\w.-]*\s*=/.test(r),{scanScriptTags:Mr}=await o("stx/signal-processing",()=>import("./chunk-pybm7c9p.js"));for(let U of Mr(r,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))dt.push({match:U.fullMatch,attrs:U.attrs,content:U.body});for(let{match:U,attrs:q,content:Z}of dt){Ge=!0;let me=Z;Me(Z,c,a.strict,e.__originalFilePath);let ne=await Be(Z,{eventBindings:Ar,attrs:q,hasColonDirectives:Rr,templateContent:n,filePath:c,projectRoot:process.cwd(),production:Di(a.buildMode,a.minifyClient),serverData:re});r=r.replace(U,()=>ne)}if(Ge)e.__stx_event_bindings=[];if(!Ge&&e.__stxProcessingDepth===1){let U=e.__stx_event_bindings||[];if(U.length>0){let q=fi(U);if(q){let Z=r.lastIndexOf("</body>");r=Z===-1?r+q:r.slice(0,Z)+q+`
|
|
1328
|
+
`+r.slice(Z)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!ve(r)&&wc(r))r=await pr(r,d);if(r=vc(r),d.csp?.enabled&&d.csp.useNonce&&typeof e.cspNonce==="string")r=Et(r,e.cspNonce);return r}
|
|
1329
|
+
export{vt,Pe,fc,ls,jo,Bo,or,i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{qe,Pn,
|
|
2
|
+
import{qe,Pn,Fi}from"./chunk-jh2v1vvb.js";function so(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?qe(a,e):null,h=u?Pn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
|
|
3
3
|
* Service Worker - Auto-generated by stx
|
|
4
4
|
* Cache Version: ${i}
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@ import{qe,Pn,Bi}from"./chunk-admnvsmx.js";function so(e,a){let t=e.pwa;if(!t?.en
|
|
|
13
13
|
* Additional features:
|
|
14
14
|
* - Push notifications: ${r?.enabled?"enabled":"disabled"}
|
|
15
15
|
* - Background sync: ${s?.enabled?"enabled":"disabled"}
|
|
16
|
-
* - Cache limits: ${n?.maxSize?`${
|
|
16
|
+
* - Cache limits: ${n?.maxSize?`${Fi(n.maxSize*1024*1024)}`:"unlimited"}
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
const CACHE_VERSION = '${i}';
|
|
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
|
|
|
825
825
|
event.waitUntil(registerFormSync(event.data.payload));
|
|
826
826
|
}
|
|
827
827
|
});
|
|
828
|
-
`}function Wt(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function
|
|
829
|
-
export{so,Wt,
|
|
828
|
+
`}function Wt(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Ol(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function Fg(e,a){if(!e.pwa?.enabled)return"";if(Ol(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-cxpq2zna.js");return t(e,a)}return so(e,a)}
|
|
829
|
+
export{so,Wt,Ol,Fg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pf,If,be,Of,lc,sn,on,Lh,uc,an,rr,Nf,Mf,Df,cs,Lf,jf,dc,cn,Bf,ln,pc,jh}from"./chunk-74g64pzt.js";import"./chunk-15rkvc0t.js";import"./chunk-mzes9ds7.js";import"./chunk-6nb49h13.js";import"./chunk-68w65mhs.js";import"./chunk-9pyvc0dc.js";import"./chunk-4rrxrxp6.js";import"./chunk-dba4bwkd.js";import"./chunk-3gfd9t8a.js";import"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{rr as MODULE_SPECIFIER_PREFIX,dc as assertBundleBuildCanSettle,Pf as bundleCacheDir,If as bundleCacheEntryLimit,jh as bundleClientEntriesSplit,ln as bundleClientScript,on as clearBundleFailures,be as clientBundleDependencies,sn as getBundleFailures,an as hasUserImports,jf as isWithinBundlerCallback,cn as moduleSubstitutionKey,Mf as normalizeRegistrySpecifiers,Bf as queueClientBundleBuild,lc as recordBundleFailure,Nf as registryIdForPath,uc as resolveBundlerFallback,Df as rewriteRegistryImports,Lh as setBundlerFallbackMode,Of as shouldLogBundlerDiagnostics,pc as tempBuildName,cs as withModuleSubstitutes,Lf as withinBundlerCallback};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-1jwcp2k0.js";import"./chunk-xppm4cs4.js";import"./chunk-830ej8d2.js";import{w,S,C,Z}from"./chunk-261t62q4.js";import"./chunk-5rxks14t.js";import"./chunk-naj146zq.js";import{lr}from"./chunk-14cvwsy1.js";import{existsSync as R}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],F=new Set(b);var u=new Map,h=w(64),x=new Set,k=0,P=new Set(b);function z(){u.clear(),h.clear()}function I(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function M(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function L(s){if(!s)return[];let o=S(s,k),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of P){if(x.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function _(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(R(l.join(s,`index.${o}`)))return s;let t=lr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=L(s);if(t.length===0)return null;let i=o??_();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=Z({loader:"ts",target:"browser",define:C()}),O=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=I(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let y=t.filter((n)=>!d.has(n)&&!M(s,n));if(y.length>0)console.warn(`[stx] could not bundle ${y.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return u.set(r,""),null;let E=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
|
|
4
4
|
`),v=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Cn,M}from"./chunk-
|
|
2
|
+
import{Cn,M}from"./chunk-5rxks14t.js";import m from"fs";import e from"path";async function _n(r,o,i){if(r.__stx_runtime_config)return;let n=Cn();if(n||i){r.__stx_runtime_config=n??M(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-h0dsxxz4.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=M(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function $i(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
|
|
4
4
|
`),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
|
|
6
6
|
`)}
|
|
7
|
-
export{_n
|
|
7
|
+
export{_n,$i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ym,bm,wm,vm,Jl,xm,Sm,km,_m,Cm,Em,Tm}from"./chunk-5xdkmn39.js";export{Em as Broadcast,Tm as BroadcastServer,Jl as broadcast,_m as broadcastPresence,km as broadcastPrivate,Cm as channel,ym as getBroadcastServer,vm as loadChannels,bm as startBroadcasting,wm as stopBroadcasting,xm as toUser,Sm as toUsers};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=
|
|
2
|
+
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=pl(t,n+2),n<t.length)n++;continue}n++}return t.length}function pl(t,i){let n=1,e=i,s="{",f="";while(e<t.length){let l=t[e];if(l==="\\"){e+=2;continue}if(l==='"'||l==="'"){e=o(t,e),s=h,f="";continue}if(l==="`"){e=b(t,e),s=h,f="";continue}if(l==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
|
|
3
3
|
`)e++;continue}if(l==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(l==="/"&&a(s,f)){let u=w(t,e);if(u!==-1){e=u,s=h,f="";continue}}if(l==="{")n++;else if(l==="}"){if(n--,n===0)return e}if(/[\w$]/.test(l))f=/[\w$]/.test(s)?f+l:l,s=l;else if(!/\s/.test(l))s=l,f="";e++}return t.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function a(t,i){if(i)return m.has(i);return!(t===")"||t==="]"||t===h)}var h="\x00";function w(t,i){let n=i+1,e=!1;while(n<t.length){let s=t[n];if(s===`
|
|
4
4
|
`)return-1;if(s==="\\"){n+=2;continue}if(s==="[")e=!0;else if(s==="]")e=!1;else if(s==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function r(t){let i="",n=0,e="",s="";while(n<t.length){let f=t.slice(n,n+2);if(f==="//"){while(n<t.length&&t[n]!==`
|
|
5
5
|
`)i+=" ",n++;continue}if(f==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")i+=t[n]===`
|
|
6
6
|
`?`
|
|
7
7
|
`:" ",n++;i+=" ",n+=2;continue}let l=t[n];if(l==='"'||l==="'"){let u=l;i+=" ",n++;while(n<t.length&&t[n]!==u){if(t[n]==="\\"){i+=" ",n+=2;continue}i+=t[n]===`
|
|
8
8
|
`?`
|
|
9
|
-
`:" ",n++}i+=" ",n++,e=h,s="";continue}if(l==="/"&&a(e,s)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,s="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=
|
|
9
|
+
`:" ",n++}i+=" ",n++,e=h,s="";continue}if(l==="/"&&a(e,s)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,s="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=pl(t,u);if(i+=" ",i+=r(t.slice(u,g)),g<t.length)i+=" ";n=g+1;continue}i+=t[n]===`
|
|
10
10
|
`?`
|
|
11
11
|
`:" ",n++}i+=" ",n++,e=h,s="";continue}if(i+=l,n++,/[\w$]/.test(l))s=/[\w$]/.test(e)?s+l:l,e=l;else if(!/\s/.test(l))e=l,s=""}return i}function he(t){let i=new Uint16Array(t.length),n=0,e=!0;for(let s=0;s<t.length;s++){let f=t[s];if(f===")"||f==="]"||f==="}")if(n===0)e=!1;else n--;if(i[s]=n,f==="("||f==="["||f==="{")n++}return{depths:i,balanced:e&&n===0}}
|
|
12
|
-
export{
|
|
12
|
+
export{pl,r,he};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ai,ci,Ct,pe,hr,Ps,yr,Is,Os,ng,rg,sg,br,og,ig,ag,cg,Nc,Mc,Dc,li,Lc,lg,Et,Tt,$t,Rt,At,Pt,rt,ug}from"./chunk-3gfd9t8a.js";export{yr as Router,ag as abortNavigation,Ps as bracketPathToRegex,Et as clearMiddleware,Mc as createClientCookieManager,At as createMiddlewareContext,Rt as createRouteLocation,Nc as createServerCookieManager,Dc as createStorageManager,cg as defineMiddleware,rg as defineRoute,sg as defineRoutes,Is as findErrorPage,Os as formatRoutes,ci as generateRouteManifest,ai as generateRouteTypes,Lc as getMiddleware,Tt as getMiddlewareNames,rt as getRouterScript,ug as getRouterScriptDev,lg as hasMiddleware,Ct as isFileRequestPath,$t as loadMiddlewareFromDirectory,hr as matchRoute,ig as navigateTo,pe as patternToRegex,li as registerMiddleware,og as resetRoutes,br as route,Pt as runMiddleware,ng as setAppUrl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Xh,ys,Go,bs,ur,Xo,Jo,Xf,ws,vs,xs,Yo,bc,Jf,St}from"./chunk-b1tctqn5.js";import"./chunk-02css3vk.js";import"./chunk-h2cvfp9y.js";import"./chunk-6nb49h13.js";import"./chunk-68w65mhs.js";import"./chunk-9pyvc0dc.js";import"./chunk-4rrxrxp6.js";import"./chunk-dba4bwkd.js";import"./chunk-3gfd9t8a.js";import{V}from"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{Xf as bindLoopInterpolations,Xh as clearScriptScanCache,ws as convertServerLoopAttributesToDirectives,Xo as convertSignalDirectivesToAttributes,vs as convertSignalLoopsToAttributes,ur as extractClientSignalNames,V as extractExports,bc as findMarkupIndexOutsideScripts,bs as hasSignalsSyntax,Go as parseLoopExpression,Jo as preEvalLiteralReactiveIfs,xs as processScriptSetup,Yo as processSignals,Jf as rewriteStxImportSpecifiers,ys as scanScriptTags,St as stripStxRuntimeImports};
|
|
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
45
45
|
});
|
|
46
46
|
})();
|
|
47
47
|
</script>
|
|
48
|
-
`}function
|
|
48
|
+
`}function oh(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
|
|
49
49
|
<div id="${a}" class="stx-teleport-source" style="display: none;">
|
|
50
50
|
<template>${c}</template>
|
|
51
51
|
</div>
|
|
52
52
|
${m}
|
|
53
|
-
`})}function
|
|
53
|
+
`})}function ih(){return`
|
|
54
54
|
<script>
|
|
55
55
|
(function() {
|
|
56
56
|
// Common teleport targets
|
|
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
68
68
|
})();
|
|
69
69
|
</script>
|
|
70
70
|
`}
|
|
71
|
-
export{
|
|
71
|
+
export{oh,ih};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
2
|
+
function Sa(e){return e}class a{plugins=new Map;sortedPlugins=[];initialized=!1;async register(e,t){if(this.plugins.has(e.name))throw Error(`Plugin "${e.name}" is already registered`);if(e.dependencies){for(let r of e.dependencies)if(!this.plugins.has(r))throw Error(`Plugin "${e.name}" depends on "${r}" which is not registered`)}if(this.plugins.set(e.name,e),e.onRegister)await e.onRegister(t);this.sortPlugins()}async unregister(e){let t=this.plugins.get(e);if(!t)return!1;for(let[r,i]of this.plugins)if(i.dependencies?.includes(e))throw Error(`Cannot unregister "${e}" because "${r}" depends on it`);if(t.onUnregister)await t.onUnregister();return this.plugins.delete(e),this.sortPlugins(),!0}get(e){return this.plugins.get(e)}has(e){return this.plugins.has(e)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let e=[];for(let t of this.sortedPlugins)if(t.registerDirectives)e.push(...t.registerDirectives());return e}getAllFilters(){let e={};for(let t of this.sortedPlugins)if(t.registerFilters)Object.assign(e,t.registerFilters());return e}async runBeforeProcess(e){return this.runHooks("beforeProcess",e)}async runAfterParse(e){return this.runHooks("afterParse",e)}async runBeforeDirective(e,t){return this.runDirectiveHooks("beforeDirective",e,t)}async runAfterDirective(e,t){return this.runDirectiveHooks("afterDirective",e,t)}async runBeforeRender(e){return this.runHooks("beforeRender",e)}async runAfterRender(e){return this.runHooks("afterRender",e)}async runOnError(e){for(let t of this.sortedPlugins)if(t.onError)try{let r=await t.onError(e);if(r){if(r.template!==void 0)e.template=r.template;if(r.context)e.context={...e.context,...r.context};if(r.metadata)e.metadata={...e.metadata,...r.metadata};if(r.skip)return e}}catch(r){console.error(`Error in plugin "${t.name}" onError hook:`,r)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((e,t)=>(e.priority??100)-(t.priority??100))}async runHooks(e,t){let r={...t};for(let i of this.sortedPlugins){let s=i[e];if(s)try{let n=await s(r);if(n){if(n.template!==void 0)r.template=n.template;if(n.context)r.context={...r.context,...n.context};if(n.metadata)r.metadata={...r.metadata,...n.metadata};if(n.skip)break}}catch(n){console.error(`Error in plugin "${i.name}" ${e} hook:`,n)}}return r}async runDirectiveHooks(e,t,r){let i={...r};for(let s of this.sortedPlugins){let n=s[e];if(n)try{let o=await n(t,i);if(o){if(o.template!==void 0)i.template=o.template;if(o.context)i.context={...i.context,...o.context};if(o.metadata)i.metadata={...i.metadata,...o.metadata};if(o.skip)break}}catch(o){console.error(`Error in plugin "${s.name}" ${e} hook:`,o)}}return i}}var $m=new a;var u=Sa({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(e){console.log("[stx-debug] beforeProcess:",e.filePath)},afterParse(e){console.log("[stx-debug] afterParse:",e.template.length,"chars")},beforeDirective(e,t){console.log("[stx-debug] beforeDirective:",e)},afterDirective(e,t){console.log("[stx-debug] afterDirective:",e)},beforeRender(e){console.log("[stx-debug] beforeRender")},afterRender(e){console.log("[stx-debug] afterRender:",e.template.length,"chars")},onError(e){console.error("[stx-debug] onError:",e.error.message,"in phase:",e.phase)}}),l=Sa({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(e){e.metadata.startTime=performance.now()},afterRender(e){let t=e.metadata.startTime;if(t){let r=performance.now()-t;console.log(`[stx-timing] Processing took ${r.toFixed(2)}ms`)}}});export{Sa,$m};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hs,Kf,Uo,Gf}from"./chunk-aj6vqdf7.js";import"./chunk-v0wdgxga.js";import"./chunk-b1tctqn5.js";import"./chunk-02css3vk.js";import"./chunk-h2cvfp9y.js";import"./chunk-6nb49h13.js";import"./chunk-68w65mhs.js";import"./chunk-9pyvc0dc.js";import"./chunk-4rrxrxp6.js";import"./chunk-dba4bwkd.js";import"./chunk-3gfd9t8a.js";import{Mt}from"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{Gf as declareBareLoopHead,Mt as parseLoopBinding,Kf as processLoops,Uo as processLoopsAsync,hs as reportDeferredLoopWarnings};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Yf,Jh,Yh,Zh,Qh,Zf,Qf,ey,ty,Qo,ny,fr,gr,ks}from"./chunk-z99bf0q0.js";import{st}from"./chunk-9n8t7v78.js";import"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{Qh as __setSignalsGeneratorsForTest,st as cacheEngineFingerprint,gr as cacheTemplate,fr as checkCache,ny as clearDevCaches,Qf as getCachedRouterScript,Zf as getCachedSignalsRuntime,ey as getServeClientAsset,Qo as getServeModuleBundle,ks as hashFilePath,Yh as invalidateFileCache,Zh as invalidateFileCacheByDir,Jh as readFileCached,ty as registerServeModuleBundle,Yf as templateCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{g,xi,nl,rl,xg,Sg,kg,_g,Cg,Ks,Eg,Fe,Z,ze,Tg,Rr,$g,il,al,_i,He,s,xn,cl,m,me,dy}from"./chunk-261t62q4.js";import"./chunk-naj146zq.js";import"./chunk-5rxks14t.js";import"./chunk-830ej8d2.js";import"./chunk-xppm4cs4.js";import"./chunk-1jwcp2k0.js";export{al as SIGNAL_COMPOSABLE_CALL,me as clearComponentCache,_i as componentClientSignalNames,xi as convertToCommonJS,m as createDetailedErrorMessage,Cg as extractDirectiveNames,nl as extractScriptFromTemplate,g as extractVariables,s as fileExists,dy as getComponentCacheStats,Sg as getPositionInfo,Z as getSharedTranspiler,cl as getSourceLineInfo,_g as hasDirectives,rl as hasVariables,$g as isHydrateTrigger,Eg as isJavaScriptScript,He as renderComponentWithSlot,xn as resolveTemplatePath,Tg as scopeOnRootElement,Ks as scopeSequenceKey,Fe as shouldTranspileTypeScript,il as slotContentHasExpressions,ze as transpileTypeScript,Rr as userComponentFileExists,kg as validateDirective,xg as validateTemplate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fl,ua,zl,Hl,da,Vl,Ul,Wl,ql,pa,Kl,dm}from"./chunk-zs4s9fcq.js";import{xa,Yl}from"./chunk-15jymk6t.js";import{te,ne,re,jn,ye,Re,Yr,yt,Zt,Bn,Fn,zn,se,Hn,Vn,Zr}from"./chunk-fyfvqd2s.js";import{nu}from"./chunk-e8nzbz66.js";import"./chunk-yj9nyt93.js";export{ne as DEFAULT_FORMATS,re as DEFAULT_QUALITY,te as DEFAULT_WIDTHS,Zr as ImageProcessingError,Hl as clearImageCache,da as createImageDirective,Yl as createImageHandler,Ul as createImagePlugin,dm as defaultImageConfig,Vn as formatSize,pa as generateImageManifest,Zt as generateSizes,yt as generateSrcSet,Bn as getFallbackVariant,Yr as getImageMetadata,se as getMimeType,Hn as getTotalSize,Fn as groupVariantsByFormat,xa as handleImageRequest,Vl as imageDirective,ye as isImageBackendAvailable,zn as isImageFile,jn as isSharpAvailable,ql as optimizeDirectory,Wl as optimizeImage,ua as parseImageComponent,Re as processImage,zl as processImageComponents,Fl as renderImageComponent,nu as rewriteImagesWithSiblings,Kl as writeImageManifest};
|