@stacksjs/stx 0.2.826 → 0.2.827
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/chunk-02zvytqx.js +2 -0
- package/dist/{chunk-bt0amey5.js → chunk-04z1xyrb.js} +2 -2
- package/dist/chunk-0jhq2kza.js +2 -0
- package/dist/{chunk-f0txsdpa.js → chunk-0rvntfhj.js} +3 -3
- package/dist/chunk-12m1qwzd.js +2 -0
- package/dist/chunk-17zrprh0.js +2 -0
- package/dist/chunk-1bpx9b0m.js +2 -0
- package/dist/{chunk-wy0gghvh.js → chunk-1vzncfka.js} +2 -2
- package/dist/chunk-2b1w7py1.js +2 -0
- package/dist/chunk-2mrdtxfy.js +2 -0
- package/dist/{chunk-2vqpz4qv.js → chunk-2qngyyaz.js} +2 -2
- package/dist/{chunk-7yb82rm6.js → chunk-2x9zhezb.js} +2 -2
- package/dist/{chunk-cmf6ar8v.js → chunk-3esj6tb8.js} +5 -5
- package/dist/{chunk-mfy2ayv0.js → chunk-3g7bjpj6.js} +3 -3
- package/dist/{chunk-981z8va1.js → chunk-3p7r3ajd.js} +2 -2
- package/dist/chunk-3qx7whh5.js +2 -0
- package/dist/chunk-3vsz0vrk.js +2 -0
- package/dist/{chunk-cgtpbr01.js → chunk-3x3zcfxp.js} +48 -48
- package/dist/chunk-3zfras5s.js +2 -0
- package/dist/chunk-42c92rp3.js +2 -0
- package/dist/{chunk-8ycrmsba.js → chunk-48z7tg83.js} +3 -3
- package/dist/chunk-4a3r1kh1.js +43 -0
- package/dist/{chunk-vwtejkb5.js → chunk-4d8ep00w.js} +50 -50
- package/dist/chunk-4z0jpzdq.js +3 -0
- package/dist/{chunk-6qvn1h09.js → chunk-5201w0f1.js} +3 -3
- package/dist/{chunk-bq7cfqk3.js → chunk-543yvntm.js} +2 -2
- package/dist/{chunk-d9yjpdyn.js → chunk-5phdmpa7.js} +6 -6
- package/dist/{chunk-q45xwvf6.js → chunk-5r63bv4g.js} +3 -3
- package/dist/chunk-67nq6csk.js +2 -0
- package/dist/chunk-6aak0b7c.js +2 -0
- package/dist/{chunk-7sh9fa3q.js → chunk-6k26n0sj.js} +2 -2
- package/dist/chunk-6r4teng3.js +2 -0
- package/dist/{chunk-d6d2s7n6.js → chunk-6tjm38e4.js} +2 -2
- package/dist/{chunk-06hc6rs6.js → chunk-716jrdcg.js} +1 -1
- package/dist/{chunk-y2bf32vg.js → chunk-717qsbap.js} +10 -10
- package/dist/chunk-72n804gy.js +2 -0
- package/dist/chunk-7amk61bt.js +2 -0
- package/dist/{chunk-3yh6y00f.js → chunk-7k9yahng.js} +6 -6
- package/dist/{chunk-wf0n9gpj.js → chunk-7p8m82pj.js} +4 -4
- package/dist/{chunk-h864en4b.js → chunk-7z2ygy9p.js} +7 -7
- package/dist/chunk-8n8vj099.js +2 -0
- package/dist/chunk-8ta7f5en.js +2 -0
- package/dist/{chunk-r9e0r6jx.js → chunk-8y8kgw9s.js} +3 -3
- package/dist/{chunk-b64y3yh0.js → chunk-8yy8qrcv.js} +10 -10
- package/dist/chunk-a7ewznxk.js +2 -0
- package/dist/{chunk-gjf8cjdt.js → chunk-ac9ncbfw.js} +3 -3
- package/dist/chunk-ahd8jdzx.js +2 -0
- package/dist/chunk-ay7ggc4k.js +2 -0
- package/dist/chunk-ayk94a19.js +2 -0
- package/dist/{chunk-mv3yhspn.js → chunk-b1q40vq4.js} +2 -2
- package/dist/{chunk-w45njn1r.js → chunk-b3nv89wq.js} +2 -2
- package/dist/{chunk-3axb6t08.js → chunk-b7tb00nz.js} +2 -2
- package/dist/chunk-b92vzax2.js +2 -0
- package/dist/{chunk-he5njpsd.js → chunk-bh35v908.js} +1 -1
- package/dist/chunk-bh7v78je.js +2 -0
- package/dist/{chunk-tgk2hcxv.js → chunk-bjvmmsvp.js} +6 -6
- package/dist/{chunk-8qy616yt.js → chunk-bwnwv91e.js} +8 -8
- package/dist/chunk-c7ybxv8x.js +2 -0
- package/dist/{chunk-4qhz8q0d.js → chunk-c8vza3p0.js} +22 -22
- package/dist/{chunk-8ttmzcxb.js → chunk-c9mdvpf5.js} +29 -29
- package/dist/{chunk-5emrarpf.js → chunk-car6nhfe.js} +2 -2
- package/dist/{chunk-e4jwhmpb.js → chunk-cca18z35.js} +31 -31
- package/dist/chunk-cfrgrnej.js +2 -0
- package/dist/{chunk-vzbyn4nh.js → chunk-ckg6q98b.js} +5 -5
- package/dist/{chunk-k81trehg.js → chunk-cv1zc9dg.js} +2 -2
- package/dist/chunk-cw8vpk41.js +2 -0
- package/dist/chunk-d2n2zrdg.js +2 -0
- package/dist/{chunk-0scyzg9r.js → chunk-d9s37xm5.js} +19 -19
- package/dist/chunk-db1c0c3c.js +2 -0
- package/dist/{chunk-cxz4cdcn.js → chunk-e75dntfb.js} +2 -2
- package/dist/chunk-e8a6s6xs.js +25 -0
- package/dist/{chunk-wceg59n0.js → chunk-ekh3mxyp.js} +2 -2
- package/dist/{chunk-4mj9dem1.js → chunk-em8tv6nz.js} +2 -2
- package/dist/{chunk-7qk4exw1.js → chunk-ema1c29k.js} +2 -2
- package/dist/{chunk-z23arg8m.js → chunk-f49x34sr.js} +2 -2
- package/dist/{chunk-8w9spdbn.js → chunk-f6b7av6b.js} +9 -9
- package/dist/{chunk-9gmceny5.js → chunk-f7jgda7x.js} +5 -5
- package/dist/chunk-fb90n0by.js +2 -0
- package/dist/chunk-fevyb337.js +3 -0
- package/dist/chunk-fqq5qzm0.js +2 -0
- package/dist/chunk-fr9e8kb9.js +2 -0
- package/dist/{chunk-g25rz48g.js → chunk-ftw0a5dm.js} +6 -6
- package/dist/{chunk-b4x5ndt9.js → chunk-fwktw49p.js} +4 -4
- package/dist/chunk-g4qzy5hv.js +2 -0
- package/dist/{chunk-tksjakyv.js → chunk-gcf97wgx.js} +1 -1
- package/dist/chunk-gg48cgx3.js +2 -0
- package/dist/{chunk-076fj387.js → chunk-hd378dgy.js} +1 -1
- package/dist/chunk-j9aftb7p.js +2 -0
- package/dist/chunk-jp6sbk05.js +2 -0
- package/dist/chunk-k6ye0159.js +3 -0
- package/dist/{chunk-eycaj8mk.js → chunk-kfkbqwyf.js} +2 -2
- package/dist/{chunk-p1sfwzmb.js → chunk-kh2n3zqa.js} +1 -1
- package/dist/{chunk-x6863pzd.js → chunk-kmqcvpz2.js} +5 -5
- package/dist/chunk-kshem79d.js +2 -0
- package/dist/chunk-kve27dy3.js +2 -0
- package/dist/chunk-m3tnxk01.js +2 -0
- package/dist/chunk-m716f2ga.js +2 -0
- package/dist/{chunk-sk0tmtd3.js → chunk-m973xh3a.js} +13 -13
- package/dist/chunk-m9bbhg46.js +3 -0
- package/dist/chunk-m9dj8pgb.js +2 -0
- package/dist/{chunk-8p86mpfv.js → chunk-mfebs2s2.js} +2 -2
- package/dist/{chunk-qj4r08jb.js → chunk-mxvevxb8.js} +4 -4
- package/dist/{chunk-btxnrqxf.js → chunk-myje6fhm.js} +5 -5
- package/dist/{chunk-1f7d1c0y.js → chunk-mypygxdm.js} +2 -2
- package/dist/{chunk-76eh43e9.js → chunk-nfpsaaqm.js} +2 -2
- package/dist/{chunk-rptnx3s6.js → chunk-ng5revck.js} +29 -29
- package/dist/chunk-nxnkd48v.js +2 -0
- package/dist/chunk-pe5qqem0.js +2 -0
- package/dist/chunk-pg146fc5.js +2 -0
- package/dist/{chunk-67kbsav0.js → chunk-q5pwvr98.js} +1 -1
- package/dist/{chunk-2nj9aewf.js → chunk-qadce16v.js} +1 -1
- package/dist/chunk-qg2tpvdw.js +2 -0
- package/dist/chunk-qm6epp9h.js +2 -0
- package/dist/{chunk-bwsz6sv4.js → chunk-qn06sy9j.js} +5 -5
- package/dist/{chunk-q7zwv88b.js → chunk-qnrgfm9v.js} +2 -2
- package/dist/{chunk-f05tmz4z.js → chunk-qz82cpyv.js} +9 -9
- package/dist/chunk-rbq4dn2a.js +2 -0
- package/dist/{chunk-t9vwggkw.js → chunk-ret52ds0.js} +6 -6
- package/dist/{chunk-xpy9yjyx.js → chunk-rkdsgfhd.js} +13 -13
- package/dist/{chunk-bfbh0hfn.js → chunk-rmygv0n0.js} +6 -6
- package/dist/{chunk-n7arptzc.js → chunk-s53wjw7y.js} +3 -3
- package/dist/{chunk-p1fpferp.js → chunk-s5dhvnnd.js} +6 -6
- package/dist/chunk-s5ejh2yx.js +2 -0
- package/dist/chunk-s6399qe7.js +2 -0
- package/dist/chunk-se3fqsxk.js +2 -0
- package/dist/chunk-t59bc7na.js +3 -0
- package/dist/{chunk-21syn2j5.js → chunk-t96229jm.js} +2 -2
- package/dist/{chunk-9kj5p5jq.js → chunk-tngj0fp6.js} +8 -8
- package/dist/chunk-txzap6yn.js +2 -0
- package/dist/{chunk-tjhcrj3z.js → chunk-tzhs7drk.js} +11 -11
- package/dist/chunk-v1mwhvf8.js +2 -0
- package/dist/chunk-vb4xzz5c.js +2 -0
- package/dist/{chunk-me6kgvsm.js → chunk-vpnyqf0h.js} +1 -1
- package/dist/chunk-vxhq8n8y.js +2 -0
- package/dist/{chunk-mwxbdpb1.js → chunk-vyv76w55.js} +2 -2
- package/dist/chunk-w39cfxa6.js +2 -0
- package/dist/chunk-w9gpscjf.js +2 -0
- package/dist/chunk-wb6w807m.js +2 -0
- package/dist/chunk-wpyhavjy.js +2 -0
- package/dist/{chunk-j3st59hv.js → chunk-wr7bmkne.js} +2 -2
- package/dist/chunk-wt7qhv5b.js +2 -0
- package/dist/{chunk-y8p85kcj.js → chunk-wvds0s9m.js} +2 -2
- package/dist/chunk-x742wppj.js +2 -0
- package/dist/chunk-xdwnbr9b.js +4 -0
- package/dist/{chunk-928y0wer.js → chunk-xj3my6b9.js} +105 -105
- package/dist/{chunk-qz3fdmrc.js → chunk-xn9jg1q5.js} +3 -3
- package/dist/chunk-xrspzeqx.js +2 -0
- package/dist/{chunk-x5vxkypk.js → chunk-xtn0hnmz.js} +6 -6
- package/dist/{chunk-1d67wtj4.js → chunk-y6nz6bk2.js} +3 -3
- package/dist/{chunk-cmnze7at.js → chunk-ybq56wam.js} +2 -2
- package/dist/{chunk-y9bj3566.js → chunk-yrw5ensv.js} +3 -3
- package/dist/{chunk-e648sx8w.js → chunk-yv1vw0kx.js} +2 -2
- package/dist/{chunk-pvj0bpqg.js → chunk-z25w7kmr.js} +4 -4
- package/dist/chunk-zty254tw.js +2 -0
- package/dist/{chunk-j737tnvt.js → chunk-zvvv6x8c.js} +4 -4
- package/dist/cli.js +23 -23
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/loops.d.ts +2 -0
- package/dist/loops.js +22 -3
- package/dist/performance-utils.d.ts +2 -0
- package/dist/performance-utils.js +7 -0
- package/dist/process.js +16 -10
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +11 -11
- package/package.json +5 -5
- package/dist/chunk-09285y4b.js +0 -2
- package/dist/chunk-0jvrzpfs.js +0 -2
- package/dist/chunk-19gk9k01.js +0 -2
- package/dist/chunk-2c5bwrnh.js +0 -2
- package/dist/chunk-2fwssv2z.js +0 -2
- package/dist/chunk-2v3r330m.js +0 -3
- package/dist/chunk-2vk7dtvs.js +0 -2
- package/dist/chunk-30rpspzt.js +0 -43
- package/dist/chunk-3bf48zrh.js +0 -2
- package/dist/chunk-4amybnpc.js +0 -2
- package/dist/chunk-4zjxj8ex.js +0 -2
- package/dist/chunk-58e92xts.js +0 -2
- package/dist/chunk-6h1qa3hw.js +0 -2
- package/dist/chunk-7pz76f28.js +0 -2
- package/dist/chunk-82v1egn6.js +0 -2
- package/dist/chunk-897gqcby.js +0 -2
- package/dist/chunk-9z9c025j.js +0 -2
- package/dist/chunk-a8fy7jv8.js +0 -2
- package/dist/chunk-akj26p4b.js +0 -3
- package/dist/chunk-b22yj5j5.js +0 -2
- package/dist/chunk-brhas9mp.js +0 -3
- package/dist/chunk-c1e45rtv.js +0 -2
- package/dist/chunk-cgamtmxv.js +0 -2
- package/dist/chunk-d0jcw9h6.js +0 -2
- package/dist/chunk-erf2g5b2.js +0 -2
- package/dist/chunk-exke928x.js +0 -2
- package/dist/chunk-fwk0gjbq.js +0 -2
- package/dist/chunk-g4sdthck.js +0 -2
- package/dist/chunk-g8nqmnb7.js +0 -2
- package/dist/chunk-gnt36wgk.js +0 -25
- package/dist/chunk-h67pm636.js +0 -2
- package/dist/chunk-hb8jxg45.js +0 -2
- package/dist/chunk-hfgzqapw.js +0 -2
- package/dist/chunk-hhats9b3.js +0 -2
- package/dist/chunk-htdbm0sd.js +0 -2
- package/dist/chunk-j0hrk24j.js +0 -2
- package/dist/chunk-jjbdtj4w.js +0 -2
- package/dist/chunk-jzc3rw49.js +0 -2
- package/dist/chunk-jzgyrxye.js +0 -2
- package/dist/chunk-k0xdvegc.js +0 -2
- package/dist/chunk-kep17bvj.js +0 -2
- package/dist/chunk-kfn7g24h.js +0 -2
- package/dist/chunk-kq5k2qbz.js +0 -2
- package/dist/chunk-ksxtrmy2.js +0 -2
- package/dist/chunk-m934bzg2.js +0 -2
- package/dist/chunk-mfc5d181.js +0 -2
- package/dist/chunk-mmeck545.js +0 -2
- package/dist/chunk-mz6qjee1.js +0 -2
- package/dist/chunk-ndjmt3vg.js +0 -3
- package/dist/chunk-p9dma8k0.js +0 -2
- package/dist/chunk-pby6dxnc.js +0 -2
- package/dist/chunk-prt4ntb0.js +0 -2
- package/dist/chunk-q2ynwst2.js +0 -2
- package/dist/chunk-q5bct2ks.js +0 -2
- package/dist/chunk-qp7dajd2.js +0 -2
- package/dist/chunk-r2hjn9ds.js +0 -2
- package/dist/chunk-s2zsa16d.js +0 -2
- package/dist/chunk-s8b6re34.js +0 -2
- package/dist/chunk-sddp2398.js +0 -2
- package/dist/chunk-sv4emtcj.js +0 -2
- package/dist/chunk-tcyvwy8p.js +0 -2
- package/dist/chunk-tg18j1yf.js +0 -2
- package/dist/chunk-tj7dh2dz.js +0 -2
- package/dist/chunk-tsvnhc0c.js +0 -4
- package/dist/chunk-v2ps4gnx.js +0 -2
- package/dist/chunk-vafxrky2.js +0 -2
- package/dist/chunk-wpendr22.js +0 -3
- package/dist/chunk-x30gh7vt.js +0 -2
- package/dist/chunk-x5r1cty7.js +0 -2
- package/dist/chunk-zd3dsp6p.js +0 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Xe,se,Za}from"./chunk-s53wjw7y.js";import v from"fs";import g from"path";import V from"crypto";import{generatePlaceholder as T,processImage as L}from"ts-images";var ee=[320,640,768,1024,1280,1536,1920],te=["webp","jpeg"],ne=80,D=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],U={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},I=null,M=!1;async function d(){if(M)return I;M=!0;try{let t=await import("sharp");return I=t.default||t,I}catch{return null}}async function Mn(){return await d()!==null}async function he(){return!0}async function $e(t,e={}){let{widths:a=ee,formats:r=te,quality:n=ne,fit:c="cover",placeholder:i="none",outputDir:m=".stx/images",baseUrl:s="/images"}=e,h,l;if(typeof t==="string"){if(l=t,!await Bun.file(t).exists())throw new Xr(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((o)=>Buffer.from(o))}else l="buffer-input",h=t;let b=V.createHash("sha256").update(h).digest("hex").slice(0,12),j=await Kr(h),{width:u,height:x}=j,F=u/x;await v.promises.mkdir(m,{recursive:!0});let B=[],A=g.basename(l,g.extname(l)),f=a.filter((o)=>o<=u);if(!f.includes(u)&&u<=Math.max(...a))f.push(u);f.sort((o,p)=>o-p);for(let o of f){let p=Math.round(o/F);for(let w of r){let S=`${A}-${o}w-${b}.${w}`,P=g.join(m,S),q=`${s}/${S}`,E=await ql(h,{width:o,height:p,format:w,quality:n,fit:c});await Bun.write(P,E),B.push({path:P,url:q,width:o,height:p,format:w,size:E.length})}}let y;if(i!=="none")y=await k(h,i);return{src:l,variants:B,placeholder:y,width:u,height:x,aspectRatio:F,hash:b}}async function Kr(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let n=await a(e).metadata();return{width:n.width||0,height:n.height||0,format:n.format||"unknown",hasAlpha:n.hasAlpha}}return R(e)}function R(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let n=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:n,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,n=(a>>14&16383)+1;return{width:r,height:n,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new Xr("Unable to parse image dimensions","PARSE_ERROR")}async function ql(t,e){let a=await d();if(a){let r=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":r=r.webp({quality:e.quality});break;case"avif":r=r.avif({quality:e.quality});break;case"jpeg":r=r.jpeg({quality:e.quality});break;case"png":r=r.png({quality:e.quality});break}return r.toBuffer()}return await Za("img",async(r)=>{let n=g.join(r,`out.${e.format}`);return await L({input:t,output:n,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(n).arrayBuffer())})}async function k(t,e){let a=await d();if(e==="blur"&&a){let m=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),s=await Kr(t);return`data:${U[s.format]||"image/jpeg"};base64,${m}`}if(e==="dominant-color"&&a){let{dominant:i}=await a(t).resize(1,1).toBuffer().then(async(m)=>{let s=await a(m).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${i.r}, ${i.g}, ${i.b})`}let r=await Kr(t),n=Xe("ph"),c=g.join(n,`in.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(c,t);let i=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",s=await T(c,{strategy:i,width:i==="thumbhash"?void 0:32});if(e==="dominant-color"&&s.dominantColor)return s.dominantColor;if(s.dataURL)return s.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{se(n)}}function mt(t,e){return(e?t.filter((r)=>r.format===e):t).sort((r,n)=>r.width-n.width).map((r)=>`${r.url} ${r.width}w`).join(", ")}function Gt(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,r)=>{let n=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(r[0].replace(/\D/g,""))||0)-n}).map(([a,r])=>`(max-width: ${a}) ${r}`).join(", ")+", 100vw"}function Dn(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,n)=>r.width-n.width);return a[Math.floor(a.length/2)]}function Ln(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function jn(t){let e=g.extname(t).toLowerCase();return D.includes(e)}function re(t){return U[t]||"application/octet-stream"}function Bn(t){return t.reduce((e,a)=>e+a.size,0)}function Fn(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class Xr extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
|
|
3
|
+
export{ee,te,ne,Mn,he,$e,Kr,ql,mt,Gt,Dn,Ln,jn,re,Bn,Fn,Xr};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{
|
|
2
|
+
import{Pc,s,ge}from"./chunk-xj3my6b9.js";import{rt}from"./chunk-car6nhfe.js";import{c}from"./chunk-k6ye0159.js";import o from"fs";import l from"path";var Ff=new Map,m=new Map;async function Lh(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(r){n=r;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function jh(e){m.delete(e)}function Bh(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function Fh(e){x=e}async function zf(e=!1){let t=x??await import("./chunk-fqq5qzm0.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function Hf(){if(S===null){let{getRouterScript:e}=await import("./chunk-8n8vj099.js");S=e()}return S}var y={};async function zh(e,t=!1){let n=e==="runtime"?await zf(t):await Hf(),i=e==="runtime"&&t?"runtime-debug":e,r=y[i];if(!r||r.content!==n)r={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=r;return{content:n,hash:r.hash,url:`/_stx/${e}.${r.hash}.js`}}var E=500,T=33554432,u=new Map,p=0;function C(e){return c(process.cwd(),"module-bundles",`${e}.js`)}function Hh(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=u.get(t),i=n!==void 0;if(i)u.delete(t),p-=n.length*2;u.set(t,e),p+=e.length*2;while(u.size>1&&(u.size>E||p>T)){let r=u.keys().next().value;p-=u.get(r).length*2,u.delete(r)}if(!i)try{let r=C(t);if(!o.existsSync(r))o.mkdirSync(l.dirname(r),{recursive:!0}),o.writeFileSync(r,e)}catch{}return`/_stx/modules.${t}.js`}function Go(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=u.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function Vh(){m.clear(),ge(),Pc(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function lr(e,t){try{if(!t.cachePath)return null;let n=l.resolve(t.cachePath),i=l.join(n,`${ws(e)}.html`),r=l.join(n,`${ws(e)}.meta.json`);if(!await s(i)||!await s(r))return null;let g=await Bun.file(r).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==rt())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await s(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function ur(e,t,n,i){try{if(!i.cachePath)return;let r=l.resolve(i.cachePath);await o.promises.mkdir(r,{recursive:!0});let g=l.join(r,`${ws(e)}.html`),a=l.join(r,`${ws(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:rt(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),Ff.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(r){console.warn(`Failed to cache template ${e}:`,r)}}var _=16;function ws(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
|
|
3
|
+
export{Ff,Lh,jh,Bh,Fh,zf,Hf,zh,Hh,Go,Vh,lr,ur,ws};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function M(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return M(e.replace(/^\//,""))}function
|
|
3
|
-
`),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function
|
|
4
|
-
`))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function St(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function ue(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function pr(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Ts(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return ue(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class fr{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:X,params:P}=ue(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:X,params:P,filePath:h,isDynamic:P.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");ni(this.routes,s),ri(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function $s(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Rs(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Vf(e){k=e.replace(/\/$/,"")}function Uf(e,t,a={}){f[e]={path:t,name:e,params:a}}function Wf(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function gr(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function qf(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import q from"path";function Kf(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Xf(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Gf(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function _c(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Cc(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function Ec(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function si(e,t){v.set(e,t)}function Tc(e){return v.get(e)}function Jf(e){return v.has(e)}function kt(){v.clear()}function _t(){return Array.from(v.keys())}async function Ct(e,t="middleware"){let a=q.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=q.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")si(o,s);else if(typeof s==="function")si(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Et(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function Tt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?_c(a,i):Cc(),storage:Ec(),state:{},request:a,responseHeaders:i}}async function $t(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=Tc(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function As(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function et(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||As(n)}}var A,T;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function U(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function H(){return`
|
|
2
|
+
import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function M(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return M(e.replace(/^\//,""))}function ri(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
|
|
3
|
+
`),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function si(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
|
|
4
|
+
`))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function kt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function de(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function pr(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Ts(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return de(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class fr{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:X,params:P}=de(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:X,params:P,filePath:h,isDynamic:P.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");ri(this.routes,s),si(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function $s(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Rs(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Wf(e){k=e.replace(/\/$/,"")}function qf(e,t,a={}){f[e]={path:t,name:e,params:a}}function Kf(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function gr(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Xf(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import q from"path";function Gf(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Jf(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Yf(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function Cc(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Ec(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function Tc(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function oi(e,t){v.set(e,t)}function $c(e){return v.get(e)}function Zf(e){return v.has(e)}function _t(){v.clear()}function Ct(){return Array.from(v.keys())}async function Et(e,t="middleware"){let a=q.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=q.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")oi(o,s);else if(typeof s==="function")oi(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Tt(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function $t(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?Cc(a,i):Ec(),storage:Tc(),state:{},request:a,responseHeaders:i}}async function Rt(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=$c(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function As(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function tt(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||As(n)}}var A,T;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function U(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function H(){return`
|
|
5
5
|
;(function(){
|
|
6
6
|
'use strict';
|
|
7
7
|
var ROUTER_REV=8;
|
|
@@ -4095,4 +4095,4 @@ else {
|
|
|
4095
4095
|
|
|
4096
4096
|
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();
|
|
4097
4097
|
})();
|
|
4098
|
-
`}function
|
|
4098
|
+
`}function nt(){if(A)return A;return A=U(W(H()),!0),A}function Qf(){if(T)return T;return T=U(H()),T}export{ri,si,kt,de,pr,Ts,fr,$s,Rs,Wf,qf,Kf,gr,Xf,Gf,Jf,Yf,Cc,Ec,Tc,oi,$c,Zf,_t,Ct,Et,Tt,$t,Rt,As,tt,nt,Qf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function
|
|
2
|
+
function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function Jm(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function Ym(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function Zm(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
|
|
3
3
|
<div
|
|
4
4
|
class="stx-transition-wrapper"
|
|
5
5
|
data-transition="${l}"
|
|
@@ -41,7 +41,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
|
|
|
41
41
|
});
|
|
42
42
|
})();
|
|
43
43
|
</script>
|
|
44
|
-
`})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function
|
|
44
|
+
`})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function Qm(){return`
|
|
45
45
|
/* STX Transition Presets */
|
|
46
46
|
|
|
47
47
|
/* Fade */
|
|
@@ -228,7 +228,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
|
|
|
228
228
|
opacity: 1;
|
|
229
229
|
max-height: 1000px;
|
|
230
230
|
}
|
|
231
|
-
`}function
|
|
231
|
+
`}function eh(){return`
|
|
232
232
|
// STX Transition Runtime
|
|
233
233
|
(function() {
|
|
234
234
|
if (typeof window === 'undefined') return;
|
|
@@ -317,5 +317,5 @@ else {
|
|
|
317
317
|
|
|
318
318
|
console.log('[stx] Transition runtime initialized');
|
|
319
319
|
})();
|
|
320
|
-
`}function
|
|
321
|
-
export{
|
|
320
|
+
`}function th(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
|
|
321
|
+
export{Jm,Ym,Zm,Qm,eh,th};
|
|
@@ -298,5 +298,5 @@ catch (error) {
|
|
|
298
298
|
init();
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
|
-
</script>`}var
|
|
302
|
-
export{
|
|
301
|
+
</script>`}var Ag={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Pg={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Ig={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Og={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},to=[Ag,Pg,Ig,Og];function my(t){return[...t,...to]}
|
|
302
|
+
export{Ag,Pg,Ig,Og,to,my};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{existsSync as x,realpathSync as b,statSync as y}from"fs";import f from"path";import k from"process";var E=/^[\w-]+(?:\/[\w-]+)*$/,j=/^[\w-]+$/;async function jr(s,e){let n=f.resolve(s,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let a=new Map,r=new Map;for(let t of e.languages){if(!j.test(t))throw Error(`messages: "${t}" is not a language directory name`);let g=f.join(n,t);if(!x(g))throw Error(`messages: ${f.relative(s,g)} does not exist`);let o=new Map;for(let i of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:g})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(i))continue;let l=i.replace(/\.[^./]+$/,"").split(f.sep).join("/");if(!E.test(l))throw Error(`messages: ${t}/${i} is not an area name`);if(o.has(l))throw Error(`messages: ${t}/${l} is defined twice`);let c=f.join(g,i),p=await import(c),m=Object.keys(p).filter((S)=>S!=="default");if(m.length)throw Error(`messages: ${t}/${i} exports ${m.join(", ")}; a message module exports its messages as default, and nothing else`);let u=p.default,d=u!==null&&typeof u==="object"&&!Array.isArray(u)?JSON.stringify(u):void 0;if(d===void 0||!Bun.deepEquals(JSON.parse(d),u,!0))throw Error(`messages: ${t}/${i} must export plain data (an object JSON can hold) as default`);o.set(l,d),a.set(c,{language:t,area:l})}r.set(t,o)}return{files:a,data:r}}function h(s,e){return`stx-messages:${s}:${e}`}function _(s,e){let n=JSON.stringify(h(s,e));return`var kept = globalThis.__stxMessages || (globalThis.__stxMessages = {});
|
|
3
|
-
export default kept[${n}] || (kept[${n}] = {});`}var M=new Map;function Br(s){let e=[s];try{e.push(b(s))}catch{}for(let n of[...e])if(n.startsWith("/private/"))e.push(n.slice(8));return[...new Set(e)]}function
|
|
3
|
+
export default kept[${n}] || (kept[${n}] = {});`}var M=new Map;function Br(s){let e=[s];try{e.push(b(s))}catch{}for(let n of[...e])if(n.startsWith("/private/"))e.push(n.slice(8));return[...new Set(e)]}function Vg(s,e=k.env){if(!s.messages||e.STX_PAGE_MESSAGES==="0")return!1;return e.STX_PAGE_MESSAGES==="1"||e.NODE_ENV==="production"}async function Ug(s,e){let n=f.resolve(s,e.dir),a=e.languages.map((c)=>{try{return`${c}:${y(f.join(n,c)).mtimeMs}`}catch{return`${c}:-`}}).join("|"),r=`${n}\x00${e.languages.join(",")}\x00${e.fallback??""}`,t=M.get(r);if(t&&t.signature===a)return t.messages;let g=await jr(s,e),o=new Map;for(let[c,{language:p,area:m}]of g.files){let u=_(p,m);for(let d of Br(c))o.set(d,u)}let i=e.fallback??e.languages[0];if(!e.languages.includes(i))throw Error(`messages.fallback "${i}" is not one of messages.languages`);let l={...g,stubs:o,languages:[...e.languages],fallback:i};return M.set(r,{signature:a,messages:l}),l}function Wg(...s){let e=new Set;for(let n of s){if(!n||!n.includes("stx-messages:"))continue;for(let a of n.matchAll(/stx-messages:[\w-]+:([\w/-]+)/g))e.add(a[1])}return e}function qg(s,e){let n=/<html\b[^>]*>/i.exec(s)?.[0]??"",a=/\slang\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(n),r=(a?a[1]??a[2]??a[3]??"":"").trim().toLowerCase(),t=new Map(e.languages.map((o)=>[o.toLowerCase(),o])),g=t.get(r)??t.get(r.split(/[-_]/)[0]??"");if(!g)return[...e.languages];return[...new Set([g,e.fallback])]}var w=new WeakMap;function Kg(s,e,n){let a=[...n].sort(),r=w.get(s);if(!r)w.set(s,r=new Map);let t=`${e.join(",")}\x00${a.join(",")}`;if(r.has(t))return r.get(t);let g=P(s,e,a);return r.set(t,g),g}function P(s,e,n){let a=[];for(let r of e){let t=s.data.get(r);if(!t)continue;for(let g of n){let o=t.get(g);if(o!==void 0)a.push(`put(${JSON.stringify(h(r,g))},${JSON.stringify(o)})`)}}if(a.length===0)return null;return`;(function(){var kept=globalThis.__stxMessages||(globalThis.__stxMessages={}),filled=globalThis.__stxMessagesFilled||(globalThis.__stxMessagesFilled={});function put(key,json){if(filled[key])return;filled[key]=1;var into=kept[key]||(kept[key]={}),data=JSON.parse(json);for(var name in data)into[name]=data[name]}
|
|
4
4
|
${a.join(`;
|
|
5
5
|
`)};
|
|
6
6
|
})();`}
|
|
7
|
-
export{jr,Br,
|
|
7
|
+
export{jr,Br,Vg,Ug,Wg,qg,Kg};
|