@stacksjs/stx 0.2.674 → 0.2.676
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-szevd7d5.js → chunk-028e9fty.js} +2 -2
- package/dist/{chunk-rr527jt6.js → chunk-078qg8r5.js} +2 -2
- package/dist/chunk-0gk78x3r.js +2 -0
- package/dist/{chunk-fw413k9q.js → chunk-1b9thkg5.js} +2 -2
- package/dist/chunk-1e73whqh.js +2 -0
- package/dist/chunk-1rztwjdj.js +130 -0
- package/dist/{chunk-srq9fqq8.js → chunk-245sas8r.js} +38 -38
- package/dist/chunk-248a88mc.js +2 -0
- package/dist/chunk-2nqtmp8c.js +2 -0
- package/dist/chunk-2pga7zzb.js +4 -0
- package/dist/{chunk-bkkpq8dx.js → chunk-304dbbsw.js} +10 -10
- package/dist/{chunk-z22zy22p.js → chunk-34e8e8te.js} +2 -2
- package/dist/{chunk-md2jn67b.js → chunk-374nhgyf.js} +2 -2
- package/dist/chunk-3bfegbpw.js +2 -0
- package/dist/chunk-3gdt16xa.js +2 -0
- package/dist/chunk-3wsm9g9c.js +2 -0
- package/dist/chunk-3xx9d934.js +2 -0
- package/dist/{chunk-ham5x7ts.js → chunk-4fhbh04h.js} +4 -4
- package/dist/{chunk-5vt48yce.js → chunk-4jnv2v5e.js} +9 -9
- package/dist/chunk-4rk5qnqf.js +24 -0
- package/dist/chunk-526mf3fr.js +4 -0
- package/dist/chunk-54zkkxmb.js +2 -0
- package/dist/{chunk-kdebh22m.js → chunk-551s7ha0.js} +10 -10
- package/dist/chunk-5v7vm8cv.js +14 -0
- package/dist/{chunk-rdr09efy.js → chunk-5z0q3qv3.js} +5 -5
- package/dist/{chunk-6sjtyd0k.js → chunk-5z8mq37c.js} +4 -4
- package/dist/{chunk-ce6zddpf.js → chunk-6beg47t4.js} +2 -2
- package/dist/{chunk-trz8z4j4.js → chunk-6bwca55g.js} +37 -37
- package/dist/chunk-6kam8r5y.js +2 -0
- package/dist/{chunk-tddnb5bv.js → chunk-6ycyaf5g.js} +2 -2
- package/dist/chunk-707sx5sk.js +20 -0
- package/dist/chunk-78d5tn4r.js +2 -0
- package/dist/{chunk-pb6erpj3.js → chunk-78x52gz3.js} +5 -5
- package/dist/{chunk-zp79zkkd.js → chunk-78yjmbbs.js} +2 -2
- package/dist/{chunk-v21bhhjb.js → chunk-7j7h1eg3.js} +1 -1
- package/dist/{chunk-zmg1peyg.js → chunk-8aq07a1j.js} +3 -3
- package/dist/chunk-8p92r2sc.js +2 -0
- package/dist/chunk-909ymsjz.js +2 -0
- package/dist/{chunk-r7fdw2v5.js → chunk-97h9ga3b.js} +3 -3
- package/dist/chunk-9859r1d5.js +2 -0
- package/dist/{chunk-25zmy8q6.js → chunk-9wdd7eq6.js} +2 -2
- package/dist/{chunk-p6qd7ad0.js → chunk-a2zb5fgg.js} +2 -2
- package/dist/chunk-arh1qgmp.js +2 -0
- package/dist/chunk-b18x0v21.js +2 -0
- package/dist/chunk-b23vscaq.js +2 -0
- package/dist/{chunk-4b9s7wgy.js → chunk-be2rswkw.js} +2 -2
- package/dist/{chunk-qz5b8ed4.js → chunk-bh19ezq0.js} +5 -5
- package/dist/chunk-bm42rsaa.js +2 -0
- package/dist/{chunk-cbjabv1w.js → chunk-bpj387yx.js} +6 -6
- package/dist/chunk-c4enpsj8.js +2 -0
- package/dist/chunk-cdbaanmx.js +2 -0
- package/dist/chunk-cfm6a679.js +2 -0
- package/dist/chunk-cs8wq7nv.js +2 -0
- package/dist/{chunk-hegfgw27.js → chunk-cxgremn0.js} +5 -5
- package/dist/chunk-d2xf5hh9.js +2 -0
- package/dist/{chunk-rym0309c.js → chunk-d4ch6exz.js} +3 -3
- package/dist/chunk-dda8pdya.js +2 -0
- package/dist/{chunk-7adznted.js → chunk-dera8fmc.js} +2 -2
- package/dist/chunk-dmd7mgjw.js +3 -0
- package/dist/chunk-ds91e0fe.js +2 -0
- package/dist/{chunk-hgry3mjd.js → chunk-dxh45gve.js} +1 -1
- package/dist/chunk-e492je6q.js +2 -0
- package/dist/{chunk-7j1zgrnf.js → chunk-ehzd1yc6.js} +9 -9
- package/dist/chunk-etz2dmec.js +2 -0
- package/dist/{chunk-4s8zacxg.js → chunk-f26n6y9p.js} +4 -4
- package/dist/{chunk-4w6baw62.js → chunk-fbrgz3s8.js} +2 -2
- package/dist/chunk-fd72t30s.js +2 -0
- package/dist/{chunk-sqn3y9qt.js → chunk-fdvfzknd.js} +2 -2
- package/dist/chunk-ft3f9nj0.js +2 -0
- package/dist/{chunk-dgc1a3yt.js → chunk-fzc98qgn.js} +7 -7
- package/dist/{chunk-s0vtjyyj.js → chunk-g12ht81a.js} +2 -2
- package/dist/chunk-g6gqja52.js +2 -0
- package/dist/{chunk-hb3edeq9.js → chunk-ga5kjf9b.js} +6 -6
- package/dist/chunk-ggwvnpwj.js +2 -0
- package/dist/{chunk-hsmcbh0p.js → chunk-ghm9f13q.js} +5 -5
- package/dist/chunk-gx6wxmbv.js +2 -0
- package/dist/chunk-gz5rvwgx.js +2 -0
- package/dist/chunk-hamk3dky.js +2 -0
- package/dist/{chunk-vayhx642.js → chunk-haz2ezyk.js} +2 -2
- package/dist/chunk-hh58k0nh.js +3 -0
- package/dist/chunk-hqj28381.js +3 -0
- package/dist/chunk-j60jye3e.js +25 -0
- package/dist/chunk-jjet6qxq.js +2 -0
- package/dist/chunk-jk7chxkt.js +2 -0
- package/dist/{chunk-d09q93yf.js → chunk-jv021x8e.js} +2 -2
- package/dist/{chunk-pg2v1pb5.js → chunk-k06n5bjp.js} +3 -3
- package/dist/{chunk-35ezh7de.js → chunk-k72jqz6a.js} +3 -3
- package/dist/chunk-kn34esxw.js +2 -0
- package/dist/chunk-kqbpkg8n.js +2 -0
- package/dist/{chunk-aet1pgw7.js → chunk-krcd3039.js} +74 -74
- package/dist/{chunk-asezs2n3.js → chunk-kxj8e1gd.js} +6 -6
- package/dist/{chunk-5zhp87wv.js → chunk-mabja59q.js} +2 -2
- package/dist/chunk-mf19qxgv.js +3 -0
- package/dist/chunk-mjsebtg6.js +2 -0
- package/dist/{chunk-fd49fahd.js → chunk-mn47s2ef.js} +5 -5
- package/dist/{chunk-nj343mw2.js → chunk-mq915g3j.js} +5 -5
- package/dist/chunk-n63r9b4f.js +2 -0
- package/dist/{chunk-j6m8xqh3.js → chunk-n8wvqnfc.js} +2 -2
- package/dist/chunk-n94ts3t9.js +21 -0
- package/dist/{chunk-w7t2cfgy.js → chunk-p27ptd9f.js} +65 -65
- package/dist/{chunk-t0k16vqv.js → chunk-p9az13b2.js} +2 -2
- package/dist/chunk-pwn0j1vq.js +2 -0
- package/dist/chunk-q1jcf6vm.js +2 -0
- package/dist/{chunk-am2w363p.js → chunk-q3gactm1.js} +4 -4
- package/dist/chunk-q3nnaxf9.js +2 -0
- package/dist/{chunk-w3d98907.js → chunk-q4rejyd2.js} +2 -2
- package/dist/{chunk-hz4x7h0n.js → chunk-qbzqary0.js} +5 -5
- package/dist/{chunk-a4p18ybc.js → chunk-qr7a378v.js} +3 -3
- package/dist/{chunk-bsajk82t.js → chunk-qwdcts9w.js} +19 -19
- package/dist/chunk-rc79yyqx.js +2 -0
- package/dist/{chunk-yx3dpdwc.js → chunk-rfc5pdv2.js} +3 -3
- package/dist/chunk-rnws0dh3.js +2 -0
- package/dist/chunk-rxxajm31.js +31 -0
- package/dist/{chunk-thceyzj6.js → chunk-rza1p6e4.js} +2 -2
- package/dist/chunk-s73z8zss.js +11 -0
- package/dist/chunk-s8qe247r.js +2 -0
- package/dist/{chunk-d1a86qx8.js → chunk-sptewgky.js} +1 -1
- package/dist/{chunk-mwnhdsbp.js → chunk-sqh3tvtw.js} +2 -2
- package/dist/{chunk-6s7tvmqp.js → chunk-sr3hmrah.js} +2 -2
- package/dist/chunk-sswy3tfc.js +2 -0
- package/dist/chunk-swxznm5v.js +2 -0
- package/dist/{chunk-9dtbvjpp.js → chunk-tmqrbs98.js} +31 -20
- package/dist/chunk-tst8p27s.js +12 -0
- package/dist/chunk-tz09earb.js +2 -0
- package/dist/{chunk-fbmth6xv.js → chunk-vay5v6sj.js} +13 -13
- package/dist/{chunk-ck2e3e47.js → chunk-vd5w1jaz.js} +3 -3
- package/dist/chunk-vewt3464.js +2 -0
- package/dist/{chunk-xghcsg3f.js → chunk-vg1pg6yt.js} +1 -1
- package/dist/{chunk-s2wptfm1.js → chunk-wav0xbnb.js} +2 -2
- package/dist/chunk-whzvx5w5.js +2 -0
- package/dist/chunk-wk1gt95z.js +2 -0
- package/dist/{chunk-t9kxhe46.js → chunk-wr1gm35v.js} +1 -1
- package/dist/{chunk-faakv1p6.js → chunk-wscnjtss.js} +2 -2
- package/dist/{chunk-t79jfpv6.js → chunk-x4q4bx3q.js} +2 -2
- package/dist/chunk-x63f2ywm.js +2 -0
- package/dist/{chunk-y1pcdeg9.js → chunk-x7wr720m.js} +5 -5
- package/dist/chunk-xk7cp691.js +2 -0
- package/dist/chunk-xna6b7km.js +2 -0
- package/dist/{chunk-v6peecfp.js → chunk-xnx06qqt.js} +2 -2
- package/dist/chunk-xw4rm5zj.js +2 -0
- package/dist/{chunk-5qtthtg3.js → chunk-y34tyrpb.js} +7 -7
- package/dist/chunk-yar7fwrb.js +2 -0
- package/dist/{chunk-2zzc7006.js → chunk-yn9kvsk1.js} +2 -2
- package/dist/chunk-yt33wzqk.js +2 -0
- package/dist/chunk-z35ftpqp.js +421 -0
- package/dist/{chunk-4bgjrrvz.js → chunk-z7ghjs7w.js} +1 -1
- package/dist/chunk-zq7xbc1k.js +2 -0
- package/dist/cli.js +22 -22
- package/dist/client/signals-for-runtime.js +16 -5
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/headwind-to-style.js +13 -1
- package/dist/native/compiler/html-to-ir.d.ts +2 -0
- package/dist/native/compiler/html-to-ir.js +9 -0
- package/dist/native/compiler/ir.d.ts +1 -0
- package/dist/native/compiler/render-screen.js +4 -3
- package/dist/native/compiler/style-config.d.ts +3 -0
- package/dist/native/compiler/style-config.js +5 -0
- package/dist/native/components/primitives.d.ts +2 -0
- package/dist/native/event-names.js +2 -0
- package/dist/native/prop-names.js +1 -0
- package/dist/native/runtime/craft-bridge.js +15 -8
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.js +75 -16
- package/dist/ssg-static-paths.d.ts +12 -0
- package/dist/ssg-static-paths.js +62 -0
- package/dist/ssg.d.ts +2 -4
- package/dist/ssg.js +43 -47
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-0jwdcqj8.js +0 -2
- package/dist/chunk-0mwdq478.js +0 -2
- package/dist/chunk-0nfqgv4n.js +0 -4
- package/dist/chunk-1y6egkty.js +0 -2
- package/dist/chunk-280p4q7a.js +0 -2
- package/dist/chunk-2881tcqt.js +0 -2
- package/dist/chunk-2a775q7x.js +0 -2
- package/dist/chunk-2asdbd5e.js +0 -2
- package/dist/chunk-34yj93hh.js +0 -2
- package/dist/chunk-40tswfe7.js +0 -21
- package/dist/chunk-41de209e.js +0 -2
- package/dist/chunk-506mv7hb.js +0 -3
- package/dist/chunk-5s1ay9mv.js +0 -2
- package/dist/chunk-7kznee1g.js +0 -2
- package/dist/chunk-7mvz972c.js +0 -12
- package/dist/chunk-80zgyaqe.js +0 -2
- package/dist/chunk-84tqb1rn.js +0 -2
- package/dist/chunk-8azm7nha.js +0 -2
- package/dist/chunk-902qnyg0.js +0 -2
- package/dist/chunk-9n6jwcpb.js +0 -2
- package/dist/chunk-a6y8td0d.js +0 -2
- package/dist/chunk-a7kt1ts4.js +0 -2
- package/dist/chunk-a81y8g40.js +0 -2
- package/dist/chunk-aft1zc84.js +0 -2
- package/dist/chunk-bawq4fqy.js +0 -31
- package/dist/chunk-bdp2r0v4.js +0 -2
- package/dist/chunk-brtvm8mb.js +0 -2
- package/dist/chunk-bvzr9zqt.js +0 -2
- package/dist/chunk-cbvgtf3m.js +0 -2
- package/dist/chunk-cfydbaeq.js +0 -2
- package/dist/chunk-dq8c3h4n.js +0 -2
- package/dist/chunk-e36pne7n.js +0 -2
- package/dist/chunk-e62qfexp.js +0 -2
- package/dist/chunk-eq5jzaj5.js +0 -2
- package/dist/chunk-f9zyf9n6.js +0 -421
- package/dist/chunk-fb7t1nn9.js +0 -24
- package/dist/chunk-fr39emcz.js +0 -2
- package/dist/chunk-fsq13amm.js +0 -2
- package/dist/chunk-fxh12vqd.js +0 -2
- package/dist/chunk-gcc9fa33.js +0 -2
- package/dist/chunk-h6t2ney6.js +0 -2
- package/dist/chunk-hvtzw1jh.js +0 -2
- package/dist/chunk-j8g5cvvm.js +0 -2
- package/dist/chunk-jzjpyyw2.js +0 -2
- package/dist/chunk-k1b8x73j.js +0 -2
- package/dist/chunk-nw9bdk2n.js +0 -2
- package/dist/chunk-p4jkswz8.js +0 -2
- package/dist/chunk-p4r90vqf.js +0 -2
- package/dist/chunk-p8bgy5tt.js +0 -2
- package/dist/chunk-pqqe2b6m.js +0 -11
- package/dist/chunk-q6nwcav4.js +0 -2
- package/dist/chunk-qmqavdz2.js +0 -2
- package/dist/chunk-qpw72bty.js +0 -2
- package/dist/chunk-qwnh1kj6.js +0 -2
- package/dist/chunk-qy9m6qdn.js +0 -2
- package/dist/chunk-qychcdsm.js +0 -2
- package/dist/chunk-rj3w1ama.js +0 -2
- package/dist/chunk-rv39s5az.js +0 -20
- package/dist/chunk-sf0r963g.js +0 -2
- package/dist/chunk-ss820yys.js +0 -2
- package/dist/chunk-t4j9g2vh.js +0 -2
- package/dist/chunk-trh7s6k3.js +0 -130
- package/dist/chunk-ttemwrbx.js +0 -2
- package/dist/chunk-twqzn21x.js +0 -14
- package/dist/chunk-v14rq8b4.js +0 -3
- package/dist/chunk-vdxg7e1y.js +0 -4
- package/dist/chunk-vq513cxx.js +0 -2
- package/dist/chunk-vvq8xe3n.js +0 -2
- package/dist/chunk-w8t31bn9.js +0 -2
- package/dist/chunk-x1kz4d7j.js +0 -2
- package/dist/chunk-xaa36b0x.js +0 -3
- package/dist/chunk-xcsyqwxf.js +0 -25
- package/dist/chunk-xn9jrjzh.js +0 -2
- package/dist/chunk-z97bwx8m.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{Y,Z,Q,
|
|
2
|
+
import{Ue,te,Yi}from"./chunk-qr7a378v.js";import v from"fs";import g from"path";import V from"crypto";import{generatePlaceholder as T,processImage as L}from"ts-images";var Y=[320,640,768,1024,1280,1536,1920],Z=["webp","jpeg"],Q=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 Tn(){return await d()!==null}async function ge(){return!0}async function Ce(t,e={}){let{widths:a=Y,formats:r=Z,quality:n=Q,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 Or(`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 Ir(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 Vc(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 Ir(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 Or("Unable to parse image dimensions","PARSE_ERROR")}async function Vc(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 Yi("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 Ir(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 Ir(t),n=Ue("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{te(n)}}function dt(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 Wt(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 $n(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 Rn(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 An(t){let e=g.extname(t).toLowerCase();return D.includes(e)}function ee(t){return U[t]||"application/octet-stream"}function Pn(t){return t.reduce((e,a)=>e+a.size,0)}function In(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class Or extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
|
|
3
|
+
export{Y,Z,Q,Tn,ge,Ce,Ir,Vc,dt,Wt,$n,Rn,An,ee,Pn,In,Or};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{g,No,Wa,qa,Zl,Ql,eu,tu,nu,bs,ru,Me,X,Le,su,pr,ou,Xa,jo,je,n,gn,Ja,m,pe,Ip}from"./chunk-z35ftpqp.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{pe as clearComponentCache,jo as componentClientSignalNames,No as convertToCommonJS,m as createDetailedErrorMessage,nu as extractDirectiveNames,Wa as extractScriptFromTemplate,g as extractVariables,n as fileExists,Ip as getComponentCacheStats,Ql as getPositionInfo,X as getSharedTranspiler,Ja as getSourceLineInfo,tu as hasDirectives,qa as hasVariables,ou as isHydrateTrigger,ru as isJavaScriptScript,je as renderComponentWithSlot,gn as resolveTemplatePath,su as scopeOnRootElement,bs as scopeSequenceKey,Me as shouldTranspileTypeScript,Xa as slotContentHasExpressions,Le as transpileTypeScript,pr as userComponentFileExists,eu as validateDirective,Zl as validateTemplate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function
|
|
2
|
+
var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function Dd(e,t={},n){let i=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return e.replace(i,(a,c,o)=>{let s=l(),r=u(c||"");return p(s,o.trim(),r)})}function u(e){let t={max:10},n=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,i;while((i=n.exec(e))!==null){let a=i[1],c=i[2]||i[3],o=i[4];switch(a){case"max":t.max=o?parseInt(o,10):10;break;case"include":t.include=c;break;case"exclude":t.exclude=c;break;case"id":t.id=c;break}}return t}function p(e,t,n){let{max:i,include:a,exclude:c}=n,o=n.id||e;return`
|
|
3
3
|
<div class="stx-keep-alive" data-keep-alive-id="${e}" data-custom-id="${o}">
|
|
4
4
|
<div class="stx-keep-alive-content" data-keep-alive-content="${e}">
|
|
5
5
|
${t}
|
|
@@ -286,7 +286,7 @@ else {
|
|
|
286
286
|
});
|
|
287
287
|
})();
|
|
288
288
|
</script>
|
|
289
|
-
`}function
|
|
289
|
+
`}function Md(e={}){return{id:e.id||l(),cache:new Map,max:e.max||10,include:e.include?e.include.split(",").map((n)=>n.trim()):null,exclude:e.exclude?e.exclude.split(",").map((n)=>n.trim()):null}}function Ld(e,t){if(t.exclude&&t.exclude.includes(e))return!1;if(t.include&&!t.include.includes(e))return!1;return!0}function jd(){return`
|
|
290
290
|
/* STX Keep-Alive Styles */
|
|
291
291
|
.stx-keep-alive {
|
|
292
292
|
position: relative;
|
|
@@ -311,7 +311,7 @@ else {
|
|
|
311
311
|
.stx-keep-alive-content > [data-activated] {
|
|
312
312
|
opacity: 1;
|
|
313
313
|
}
|
|
314
|
-
`}function
|
|
314
|
+
`}function Bd(){return`
|
|
315
315
|
// STX Keep-Alive Runtime
|
|
316
316
|
(function() {
|
|
317
317
|
if (typeof window === 'undefined') return;
|
|
@@ -347,5 +347,5 @@ else {
|
|
|
347
347
|
|
|
348
348
|
console.log('[stx] Keep-alive runtime initialized');
|
|
349
349
|
})();
|
|
350
|
-
`}function
|
|
351
|
-
export{
|
|
350
|
+
`}function Fd(e){if(typeof document<"u")document.addEventListener("stx:activated",(t)=>{e(t.detail)})}function zd(e){if(typeof document<"u")document.addEventListener("stx:deactivated",(t)=>{e(t.detail)})}
|
|
351
|
+
export{Dd,Md,Ld,jd,Bd,Fd,zd};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{N,Il,mo,i,R,_p,Cp}from"./chunk-245sas8r.js";import"./chunk-d4ch6exz.js";import"./chunk-dera8fmc.js";import"./chunk-q3gactm1.js";import"./chunk-y34tyrpb.js";import"./chunk-f26n6y9p.js";import"./chunk-z35ftpqp.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{R as config,N as defaultConfig,_p as defineStxConfig,mo as discoverConfig,i as loadStxConfig,Il as resolveStxDirectories,Cp as validateConfig};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l,p,ec,u,t,a}from"./chunk-bsajk82t.js";import{Ke,yt,tn,uo}from"./chunk-hgry3mjd.js";function L(w,e){try{let f=w.trim();if(p(f))return u(f,Object.keys(e))(...Object.values(e));else return l(f,e)}catch{return!1}}function Q(w,e,f){let n=w,v=!0;while(v){v=!1;let h=n.match(/@switch\s*\(/);if(!h||h.index===void 0)break;let b=h.index,s=uo(n,b);if(!s)break;try{let o;if(p(s.expression))o=u(s.expression,Object.keys(e))(...Object.values(e));else o=l(s.expression,e);let r="",g=!1;for(let i of s.cases)if(i.type==="default"){if(!g)r=i.content.trim()}else try{let y;if(i.value&&p(i.value))y=u(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=l(i.value,e);if(o===y){r=i.content.trim(),g=!0;break}}catch{continue}n=n.substring(0,b)+r+n.substring(s.end),v=!0}catch(o){let r=o instanceof Error?o.message:String(o),g=a("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+g+n.substring(s.end);break}}return n}function H(w){let e=[];return{masked:w.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(n)=>(e.push(n),`\x00stx-script-${e.length-1}\x00`)),scripts:e}}function J(w,e){if(e.length===0)return w;return w.replace(/\u0000stx-script-(\d+)\u0000/g,(f,n)=>e[Number(n)]??f)}function ne(w,e,f){let{masked:n,scripts:v}=H(w);return J(K(n,e,f),v)}function K(w,e,f){let n=w;n=Q(n,e,f);{let h=!0;while(h){h=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Ke(n,s+7);if(!o)break;let r=o.endPos,g=yt(n,"unless","endunless",r);if(g===-1){console.warn(`[stx] @unless directive at position ${s} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let i=n.slice(r,g),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,d=/@(?:endif|endunless)(?![a-z])/g,E=/@else(?![a-z])/g,S=[],C;while((C=k.exec(i))!==null)S.push({pos:C.index,type:"open"});while((C=d.exec(i))!==null)S.push({pos:C.index,type:"close"});while((C=E.exec(i))!==null)S.push({pos:C.index,type:"else"});S.sort((P,R)=>P.pos-R.pos);for(let P of S)if(P.type==="open")x++;else if(P.type==="close")x--;else if(P.type==="else"&&x===0){m=P.pos;break}}let c;if(m!==-1){let x=i.slice(0,m),k=i.slice(m+5);c=`@if (${y})${k}@else ${x}@endif`}else c=`@if (!(${y}))${i}@endif`;n=n.substring(0,s)+c+n.substring(g+10),h=!0}}n=so(n,e,f),n=oo(n,e,f),n=ro(n,e);let v=()=>{let h=tn(n);if(h.length===0)return!1;let b=Array(h.length);for(let r=h.length-1;r>=0;r--){let g=h[r];try{let i="",y=!1;for(let m of g.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?ec(m.condition,e):!1)i=m.content,y=!0}catch(c){i=a(m.type==="if"?"If":"Elseif",`Error in @${m.type}(${m.condition}): ${c instanceof Error?c.message:String(c)}`,t.EVALUATION_ERROR),y=!0}}b[r]=i}catch(i){let y=i instanceof Error?i.message:String(i);b[r]=a("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(h.length*2+1),o=0;for(let r=0;r<h.length;r++){let g=h[r];s[r*2]=n.slice(o,g.start),s[r*2+1]=b[r],o=g.end}return s[h.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let h=n;if(!v())break;if(n===h)break}return n}function q(w){let e=0;while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!=="(")return null;e++;while(e<w.length&&/\s/.test(w[e]))e++;let f=w[e];if(f!=="'"&&f!=='"')return null;e++;let n=[];while(e<w.length){let v=w[e];if(v==="\\"&&e+1<w.length){n.push(w[e+1]),e+=2;continue}if(v===f){e++;break}n.push(v),e++}while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!==")")return null;return e++,{value:n.join(""),consumed:e}}function ro(w,e){let f=w;function n(s,o,r,g){let i=1,y=g,m=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),c=new RegExp(`@${r}(?![a-z])`,"g");while(y<s.length&&i>0){m.lastIndex=y,c.lastIndex=y;let x=m.exec(s),k=c.exec(s),d=x?x.index:1/0,E=k?k.index:1/0;if(d<E)i++,y=d+x[0].length;else if(E<1/0){if(i--,i===0)return E;y=E+k[0].length}else break}return-1}function v(s,o,r){let g=0,i=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),y=new RegExp(`@${r}(?![a-z])`,"g"),m=/@else(?![a-z])/g,c=[],x;while((x=i.exec(s))!==null)c.push({pos:x.index,type:"open"});while((x=y.exec(s))!==null)c.push({pos:x.index,type:"close"});while((x=m.exec(s))!==null)c.push({pos:x.index,type:"else"});c.sort((k,d)=>k.pos-d.pos);for(let k of c)if(k.type==="open")g++;else if(k.type==="close")g--;else if(k.type==="else"&&g===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=f.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+5),m=q(y);if(m)g=m.value,i=r+5+m.consumed;else i=r+5;let c=n(f,"auth","endauth",i);if(c===-1){console.warn(`[stx] @auth directive at position ${r} has no matching @endauth \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"auth","endauth"),d;if(!e.auth)d=!1;else d=g?L(`auth?.check && auth?.user?.[${g}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=f.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+6),m=q(y);if(m)g=m.value,i=r+6+m.consumed;else i=r+6;let c=n(f,"guest","endguest",i);if(c===-1){console.warn(`[stx] @guest directive at position ${r} has no matching @endguest \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"guest","endguest"),d;if(!e.auth)d=!0;else d=g?L(`!auth?.check || !auth?.user?.[${g}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+9),s=!0}}function h(s,o,r){if(e.userCan&&typeof e.userCan[s]==="boolean")return e.userCan[s];if(e.permissions?.check&&typeof e.permissions.check==="function")try{let g=[s];if(o)g.push(o);if(r){let i=L(r,e);g.push(i)}return e.permissions.check(...g)}catch{return!1}return!1}function b(s){let o=s.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!o)return null;return{ability:o[1],type:o[2],id:o[3]?.trim(),paramsEnd:o[0].length}}for(let s of["can","cannot"]){let o=`end${s}`,r=s==="can"?"elsecan":"elsecannot",g=!0;while(g){g=!1;let i=f.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=f.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(f,s,o,x);if(k===-1){console.warn(`[stx] @${s} directive at position ${y} has no matching @${o} \u2014 the block was skipped.`);break}let d=f.slice(x,k),E=[],S=0,C=new RegExp(`@${s}\\s*\\(`,"g"),P=new RegExp(`@${o}(?![a-z])`,"g"),R=new RegExp(`@${r}\\s*\\(`,"g"),T=/@else(?![a-z])/g,_=[],M;while((M=C.exec(d))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(d))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(d))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(d))!==null)_.push({pos:M.index,type:"else"});_.sort((A,z)=>A.pos-z.pos);for(let A of _){if(A.type==="open"){S++;continue}if(A.type==="close"){S--;continue}if(S===0)E.push(A)}let I=[],F=0;for(let A=0;A<E.length;A++){let z=E[A];if(I.push({content:d.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=d.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:d.slice(F,z.pos)},F=z.pos+`@${r}`.length+B.paramsEnd,I.push({content:"",ability:B.ability,type:B.type,id:B.id}),I.pop();let G=E[A+1],U=G?G.pos:d.length;I.push({content:d.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<d.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:d.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:d.slice(F)})}let O=h(c.ability,c.type,c.id),j=s==="can"?O:!O,V="";if(j)V=I[0]?.content||"";else{let A=!1;for(let z=1;z<I.length;z++){let D=I[z];if(D.isFinalElse){V=D.content,A=!0;break}if(D.ability){let B=h(D.ability,D.type,D.id);if(s==="can"?B:!B){V=D.content,A=!0;break}}}if(!A&&I.length>0){let z=I[I.length-1];if(z.isFinalElse)V=z.content}}f=f.substring(0,y)+V+f.substring(k+`@${o}`.length),g=!0}}return f}function so(w,e,f){let n=w;function v(h,b,s,o,r){let g=!0;while(g){g=!1;let i=new RegExp(`@${b}\\s*\\(`),y=h.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Ke(h,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=yt(h,b,s,x);if(k===-1){console.warn(`[stx] @${b} directive at position ${m} has no matching @${s} \u2014 the block was skipped.`);break}let d=h.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<d.length){let R=d.indexOf("@",P);if(R===-1)break;let T=d.substring(R);if(/^@(?:if|unless|isset|empty)\s*\(/.test(T)){C++,P=R+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(T)){C--,P=R+1;continue}if(C===0&&/^@else(?![a-z])/.test(T)){S=R;break}P=R+1}try{let R=o(E.trim()),T;if(S!==-1){let _=d.slice(0,S),M=d.slice(S+5);T=R?_:M}else T=R?d:"";h=h.substring(0,m)+T+h.substring(k+`@${s}`.length),g=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=a(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);h=h.substring(0,m)+_+h.substring(k+`@${s}`.length);break}}return h}return n=v(n,"isset","endisset",(h)=>{let b=L(h,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(h)=>{let b=L(h,e);return b===void 0||b===null||b===""||b===0||b===!1||Array.isArray(b)&&b.length===0||typeof b==="object"&&b!==null&&Object.keys(b).length===0},"Empty"),n}function oo(w,e,f){let n=w,v="development";function h(b,s,o,r){let g=new RegExp(`@${s}(?![a-z])`,"g"),i=new RegExp(`@${o}(?![a-z])`,"g"),y=new RegExp(`^@${s}(?![a-z])`),m=new RegExp(`^@${o}(?![a-z])`),c=b,x=!0;while(x){x=!1,g.lastIndex=0;let k=g.exec(c);if(!k)break;let d=k.index,E=d+k[0].length;if(s==="env"){let O=c.substring(E).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!O)break;E+=O[0].length,r=v===O[2]}let S=1,C=E,P=-1;while(S>0&&C<c.length){g.lastIndex=C,i.lastIndex=C;let O=g.exec(c),j=i.exec(c),V=O?O.index:1/0,A=j?j.index:1/0;if(V<A)S++,C=V+O[0].length;else if(A<1/0){if(S--,S===0){P=A;break}C=A+j[0].length}else break}if(P===-1){console.warn(`[stx] @${s} directive at position ${d} has no matching @${o} \u2014 the block was skipped.`);break}let R=c.substring(E,P),T=-1,_=0,M=0;while(M<R.length){let O=R.indexOf("@",M);if(O===-1)break;let j=R.substring(O);if(y.test(j)){_++,M=O+1;continue}if(m.test(j)){_--,M=O+1;continue}if(_===0&&/^@else(?![a-z])/.test(j)){T=O;break}M=O+1}let I;if(T!==-1){let O=R.slice(0,T),j=R.slice(T+5);I=r?O:j}else I=r?R:"";let F=`@${o}`.length;c=c.substring(0,d)+I+c.substring(P+F),x=!0}return c}return n=h(n,"env","endenv",!1),n=h(n,"production","endproduction",v==="production"),n=h(n,"development","enddevelopment",v==="development"),n=h(n,"staging","endstaging",v==="staging"),n=h(n,"testing","endtesting",v==="testing"),n}
|
|
3
|
-
export{ne,
|
|
2
|
+
import{l,p,tc,u,t,a}from"./chunk-qwdcts9w.js";import{Xe,yt,rn,fo}from"./chunk-dxh45gve.js";function L(w,e){try{let f=w.trim();if(p(f))return u(f,Object.keys(e))(...Object.values(e));else return l(f,e)}catch{return!1}}function Q(w,e,f){let n=w,v=!0;while(v){v=!1;let h=n.match(/@switch\s*\(/);if(!h||h.index===void 0)break;let b=h.index,s=fo(n,b);if(!s)break;try{let o;if(p(s.expression))o=u(s.expression,Object.keys(e))(...Object.values(e));else o=l(s.expression,e);let r="",g=!1;for(let i of s.cases)if(i.type==="default"){if(!g)r=i.content.trim()}else try{let y;if(i.value&&p(i.value))y=u(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=l(i.value,e);if(o===y){r=i.content.trim(),g=!0;break}}catch{continue}n=n.substring(0,b)+r+n.substring(s.end),v=!0}catch(o){let r=o instanceof Error?o.message:String(o),g=a("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+g+n.substring(s.end);break}}return n}function H(w){let e=[];return{masked:w.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(n)=>(e.push(n),`\x00stx-script-${e.length-1}\x00`)),scripts:e}}function J(w,e){if(e.length===0)return w;return w.replace(/\u0000stx-script-(\d+)\u0000/g,(f,n)=>e[Number(n)]??f)}function ne(w,e,f){let{masked:n,scripts:v}=H(w);return J(K(n,e,f),v)}function K(w,e,f){let n=w;n=Q(n,e,f);{let h=!0;while(h){h=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Xe(n,s+7);if(!o)break;let r=o.endPos,g=yt(n,"unless","endunless",r);if(g===-1){console.warn(`[stx] @unless directive at position ${s} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let i=n.slice(r,g),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,d=/@(?:endif|endunless)(?![a-z])/g,E=/@else(?![a-z])/g,S=[],C;while((C=k.exec(i))!==null)S.push({pos:C.index,type:"open"});while((C=d.exec(i))!==null)S.push({pos:C.index,type:"close"});while((C=E.exec(i))!==null)S.push({pos:C.index,type:"else"});S.sort((P,R)=>P.pos-R.pos);for(let P of S)if(P.type==="open")x++;else if(P.type==="close")x--;else if(P.type==="else"&&x===0){m=P.pos;break}}let c;if(m!==-1){let x=i.slice(0,m),k=i.slice(m+5);c=`@if (${y})${k}@else ${x}@endif`}else c=`@if (!(${y}))${i}@endif`;n=n.substring(0,s)+c+n.substring(g+10),h=!0}}n=io(n,e,f),n=ao(n,e,f),n=oo(n,e);let v=()=>{let h=rn(n);if(h.length===0)return!1;let b=Array(h.length);for(let r=h.length-1;r>=0;r--){let g=h[r];try{let i="",y=!1;for(let m of g.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?tc(m.condition,e):!1)i=m.content,y=!0}catch(c){i=a(m.type==="if"?"If":"Elseif",`Error in @${m.type}(${m.condition}): ${c instanceof Error?c.message:String(c)}`,t.EVALUATION_ERROR),y=!0}}b[r]=i}catch(i){let y=i instanceof Error?i.message:String(i);b[r]=a("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(h.length*2+1),o=0;for(let r=0;r<h.length;r++){let g=h[r];s[r*2]=n.slice(o,g.start),s[r*2+1]=b[r],o=g.end}return s[h.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let h=n;if(!v())break;if(n===h)break}return n}function q(w){let e=0;while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!=="(")return null;e++;while(e<w.length&&/\s/.test(w[e]))e++;let f=w[e];if(f!=="'"&&f!=='"')return null;e++;let n=[];while(e<w.length){let v=w[e];if(v==="\\"&&e+1<w.length){n.push(w[e+1]),e+=2;continue}if(v===f){e++;break}n.push(v),e++}while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!==")")return null;return e++,{value:n.join(""),consumed:e}}function oo(w,e){let f=w;function n(s,o,r,g){let i=1,y=g,m=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),c=new RegExp(`@${r}(?![a-z])`,"g");while(y<s.length&&i>0){m.lastIndex=y,c.lastIndex=y;let x=m.exec(s),k=c.exec(s),d=x?x.index:1/0,E=k?k.index:1/0;if(d<E)i++,y=d+x[0].length;else if(E<1/0){if(i--,i===0)return E;y=E+k[0].length}else break}return-1}function v(s,o,r){let g=0,i=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),y=new RegExp(`@${r}(?![a-z])`,"g"),m=/@else(?![a-z])/g,c=[],x;while((x=i.exec(s))!==null)c.push({pos:x.index,type:"open"});while((x=y.exec(s))!==null)c.push({pos:x.index,type:"close"});while((x=m.exec(s))!==null)c.push({pos:x.index,type:"else"});c.sort((k,d)=>k.pos-d.pos);for(let k of c)if(k.type==="open")g++;else if(k.type==="close")g--;else if(k.type==="else"&&g===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=f.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+5),m=q(y);if(m)g=m.value,i=r+5+m.consumed;else i=r+5;let c=n(f,"auth","endauth",i);if(c===-1){console.warn(`[stx] @auth directive at position ${r} has no matching @endauth \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"auth","endauth"),d;if(!e.auth)d=!1;else d=g?L(`auth?.check && auth?.user?.[${g}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=f.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+6),m=q(y);if(m)g=m.value,i=r+6+m.consumed;else i=r+6;let c=n(f,"guest","endguest",i);if(c===-1){console.warn(`[stx] @guest directive at position ${r} has no matching @endguest \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"guest","endguest"),d;if(!e.auth)d=!0;else d=g?L(`!auth?.check || !auth?.user?.[${g}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+9),s=!0}}function h(s,o,r){if(e.userCan&&typeof e.userCan[s]==="boolean")return e.userCan[s];if(e.permissions?.check&&typeof e.permissions.check==="function")try{let g=[s];if(o)g.push(o);if(r){let i=L(r,e);g.push(i)}return e.permissions.check(...g)}catch{return!1}return!1}function b(s){let o=s.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!o)return null;return{ability:o[1],type:o[2],id:o[3]?.trim(),paramsEnd:o[0].length}}for(let s of["can","cannot"]){let o=`end${s}`,r=s==="can"?"elsecan":"elsecannot",g=!0;while(g){g=!1;let i=f.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=f.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(f,s,o,x);if(k===-1){console.warn(`[stx] @${s} directive at position ${y} has no matching @${o} \u2014 the block was skipped.`);break}let d=f.slice(x,k),E=[],S=0,C=new RegExp(`@${s}\\s*\\(`,"g"),P=new RegExp(`@${o}(?![a-z])`,"g"),R=new RegExp(`@${r}\\s*\\(`,"g"),T=/@else(?![a-z])/g,_=[],M;while((M=C.exec(d))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(d))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(d))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(d))!==null)_.push({pos:M.index,type:"else"});_.sort((A,z)=>A.pos-z.pos);for(let A of _){if(A.type==="open"){S++;continue}if(A.type==="close"){S--;continue}if(S===0)E.push(A)}let I=[],F=0;for(let A=0;A<E.length;A++){let z=E[A];if(I.push({content:d.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=d.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:d.slice(F,z.pos)},F=z.pos+`@${r}`.length+B.paramsEnd,I.push({content:"",ability:B.ability,type:B.type,id:B.id}),I.pop();let G=E[A+1],U=G?G.pos:d.length;I.push({content:d.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<d.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:d.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:d.slice(F)})}let O=h(c.ability,c.type,c.id),j=s==="can"?O:!O,V="";if(j)V=I[0]?.content||"";else{let A=!1;for(let z=1;z<I.length;z++){let D=I[z];if(D.isFinalElse){V=D.content,A=!0;break}if(D.ability){let B=h(D.ability,D.type,D.id);if(s==="can"?B:!B){V=D.content,A=!0;break}}}if(!A&&I.length>0){let z=I[I.length-1];if(z.isFinalElse)V=z.content}}f=f.substring(0,y)+V+f.substring(k+`@${o}`.length),g=!0}}return f}function io(w,e,f){let n=w;function v(h,b,s,o,r){let g=!0;while(g){g=!1;let i=new RegExp(`@${b}\\s*\\(`),y=h.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Xe(h,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=yt(h,b,s,x);if(k===-1){console.warn(`[stx] @${b} directive at position ${m} has no matching @${s} \u2014 the block was skipped.`);break}let d=h.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<d.length){let R=d.indexOf("@",P);if(R===-1)break;let T=d.substring(R);if(/^@(?:if|unless|isset|empty)\s*\(/.test(T)){C++,P=R+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(T)){C--,P=R+1;continue}if(C===0&&/^@else(?![a-z])/.test(T)){S=R;break}P=R+1}try{let R=o(E.trim()),T;if(S!==-1){let _=d.slice(0,S),M=d.slice(S+5);T=R?_:M}else T=R?d:"";h=h.substring(0,m)+T+h.substring(k+`@${s}`.length),g=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=a(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);h=h.substring(0,m)+_+h.substring(k+`@${s}`.length);break}}return h}return n=v(n,"isset","endisset",(h)=>{let b=L(h,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(h)=>{let b=L(h,e);return b===void 0||b===null||b===""||b===0||b===!1||Array.isArray(b)&&b.length===0||typeof b==="object"&&b!==null&&Object.keys(b).length===0},"Empty"),n}function ao(w,e,f){let n=w,v="development";function h(b,s,o,r){let g=new RegExp(`@${s}(?![a-z])`,"g"),i=new RegExp(`@${o}(?![a-z])`,"g"),y=new RegExp(`^@${s}(?![a-z])`),m=new RegExp(`^@${o}(?![a-z])`),c=b,x=!0;while(x){x=!1,g.lastIndex=0;let k=g.exec(c);if(!k)break;let d=k.index,E=d+k[0].length;if(s==="env"){let O=c.substring(E).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!O)break;E+=O[0].length,r=v===O[2]}let S=1,C=E,P=-1;while(S>0&&C<c.length){g.lastIndex=C,i.lastIndex=C;let O=g.exec(c),j=i.exec(c),V=O?O.index:1/0,A=j?j.index:1/0;if(V<A)S++,C=V+O[0].length;else if(A<1/0){if(S--,S===0){P=A;break}C=A+j[0].length}else break}if(P===-1){console.warn(`[stx] @${s} directive at position ${d} has no matching @${o} \u2014 the block was skipped.`);break}let R=c.substring(E,P),T=-1,_=0,M=0;while(M<R.length){let O=R.indexOf("@",M);if(O===-1)break;let j=R.substring(O);if(y.test(j)){_++,M=O+1;continue}if(m.test(j)){_--,M=O+1;continue}if(_===0&&/^@else(?![a-z])/.test(j)){T=O;break}M=O+1}let I;if(T!==-1){let O=R.slice(0,T),j=R.slice(T+5);I=r?O:j}else I=r?R:"";let F=`@${o}`.length;c=c.substring(0,d)+I+c.substring(P+F),x=!0}return c}return n=h(n,"env","endenv",!1),n=h(n,"production","endproduction",v==="production"),n=h(n,"development","enddevelopment",v==="development"),n=h(n,"staging","endstaging",v==="staging"),n=h(n,"testing","endtesting",v==="testing"),n}
|
|
3
|
+
export{ne,oo,io,ao};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,a,
|
|
2
|
+
import{t,a,Mt,Lt,jt,Fe,nt,P,_s,br,ze}from"./chunk-qwdcts9w.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,r){return(n)=>P(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function N(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function bo(e,r,n,g){if(!e.includes("@meta"))return e;let i=Mt(e,O,(s,c)=>{let o=br(Lt(s),r);if(o.kind==="tag")return N(o.tag);if(o.kind==="empty")return"";return P("Meta",c,o.message,n,o.code)},_("Meta",n));return i=Mt(i,I,(s,c)=>{let o=jt(s,r);if(!o.ok)return P("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!nt(o.value))return P("MetaTag",c,`expected an object such as { name, content }, got ${Fe(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return P("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},_("MetaTag",n)),i}function b(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(nt(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(nt))return e.map(r);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function vo(e,r,n){if(!e.includes("@structuredData"))return e;return Mt(e,C,(g,i)=>{let s=jt(g,r);if(!s.ok)return P("StructuredData",i,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=b(s.value);if(!c)return P("StructuredData",i,`expected an object or an array of objects, got ${Fe(s.value)}`,n,t.TYPE_ERROR);try{return E(c)}catch(o){let u=o instanceof Error?o.message:String(o);return P("StructuredData",i,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},_("StructuredData",n))}var j=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function wo(e,r,n,g){if(!e.includes("@seo"))return e;return Mt(e,k,(i,s)=>{if(!i.trim())return P("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=jt(i,r);if(!c.ok)return P("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!nt(c.value))return P("SEO",s,`expected an object such as { title, description }, got ${Fe(c.value)}`,n,t.TYPE_ERROR);try{return L(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return P("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},_("SEO",n))}function R(e,r,n,g){let i=e[r];if(i===void 0||i===null||i===!1)return;if(nt(i))return i;_s(n,`${r} must be an object, got ${Fe(i)}; its tags were left out`,g);return}function L(e,r,n){let g=Object.keys(e).filter((o)=>!j.has(o));if(g.length>0){let o=g.map((u)=>A[u]?`${u} (use ${A[u]})`:u).join(", ");_s(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let i="";if(e.title)i+=`<title>${l(e.title)}</title>
|
|
3
3
|
`,i+=`<meta name="title" content="${l(e.title)}">
|
|
4
4
|
`;if(e.description)i+=`<meta name="description" content="${l(e.description)}">
|
|
5
5
|
`;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;i+=`<meta name="keywords" content="${l(o)}">
|
|
@@ -25,7 +25,7 @@ import{t,a,Dt,Mt,Lt,Be,nt,P,Ss,hr,Fe}from"./chunk-bsajk82t.js";var O=/(?<![\w$@]
|
|
|
25
25
|
`}if(c.site)i+=`<meta name="twitter:site" content="${l(c.site)}">
|
|
26
26
|
`;if(c.creator)i+=`<meta name="twitter:creator" content="${l(c.creator)}">
|
|
27
27
|
`}if(e.structuredData!==void 0&&e.structuredData!==null){let o=b(e.structuredData);if(o)i+=`${E(o)}
|
|
28
|
-
`;else
|
|
28
|
+
`;else _s(r,`structuredData must be an object or an array of objects, got ${Fe(e.structuredData)}; it was left out`,n)}return i.trim()}function xo(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=q(e),o=M(c),u=G(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
|
|
29
29
|
<meta name="title" content="${l(p)}">`,D=V(c)?"":`
|
|
30
30
|
<meta name="description" content="${l(m)}">`,y=`
|
|
31
31
|
<!-- stx SEO Tags -->${f}${D}
|
|
@@ -43,7 +43,7 @@ import{t,a,Dt,Mt,Lt,Be,nt,P,Ss,hr,Fe}from"./chunk-bsajk82t.js";var O=/(?<![\w$@]
|
|
|
43
43
|
${y}
|
|
44
44
|
`),h;return h.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${y}
|
|
46
|
-
`)}function q(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function v(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function M(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function V(e){return x(e).length>0}function G(e){for(let r of x(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return v(g)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var
|
|
46
|
+
`)}function q(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function v(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function M(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function V(e){return x(e).length>0}function G(e){for(let r of x(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return v(g)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Zr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=br(r,n??{});if(i.kind==="error")return P("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=ze(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Qr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return a("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return a("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let s=i instanceof Error?i.message:String(i);return a("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function Ep(){return[Zr,Qr]}function Tp(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??i,h=` <url>
|
|
47
47
|
<loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
|
|
48
48
|
<xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(o(w.href))}"/>`;if(f)h+=`
|
|
49
49
|
<lastmod>${f}</lastmod>`;return h+=`
|
|
@@ -53,13 +53,13 @@ ${y}
|
|
|
53
53
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
|
|
54
54
|
${u.join(`
|
|
55
55
|
`)}
|
|
56
|
-
</urlset>`}function
|
|
56
|
+
</urlset>`}function $p(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
57
57
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
58
58
|
${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
|
|
59
59
|
<loc>${T(c)}</loc>
|
|
60
60
|
<lastmod>${g}</lastmod>
|
|
61
61
|
</sitemap>`}).join(`
|
|
62
62
|
`)}
|
|
63
|
-
</sitemapindex>`}async function
|
|
64
|
-
`).trim()}function
|
|
65
|
-
export{
|
|
63
|
+
</sitemapindex>`}async function Rp(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,i=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((o,u)=>o.loc.localeCompare(u.loc)),i}function es(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
|
|
64
|
+
`).trim()}function Ap(e){return es({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
65
|
+
export{bo,vo,wo,xo,Zr,Qr,Ep,Tp,$p,Rp,es,Ap};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ec,ki,Tc,$c,_i,Rc,Ac,Pc,Ic,Ci,Oc,Nu}from"./chunk-bh19ezq0.js";import{Ni,Bc}from"./chunk-1b9thkg5.js";import{Y,Z,Q,Tn,ge,Ce,Ir,dt,Wt,$n,Rn,An,ee,Pn,In,Or}from"./chunk-x4q4bx3q.js";import{cl}from"./chunk-q4rejyd2.js";import"./chunk-qr7a378v.js";export{Z as DEFAULT_FORMATS,Q as DEFAULT_QUALITY,Y as DEFAULT_WIDTHS,Or as ImageProcessingError,$c as clearImageCache,_i as createImageDirective,Bc as createImageHandler,Ac as createImagePlugin,Nu as defaultImageConfig,In as formatSize,Ci as generateImageManifest,Wt as generateSizes,dt as generateSrcSet,$n as getFallbackVariant,Ir as getImageMetadata,ee as getMimeType,Pn as getTotalSize,Rn as groupVariantsByFormat,Ni as handleImageRequest,Rc as imageDirective,ge as isImageBackendAvailable,An as isImageFile,Tn as isSharpAvailable,Ic as optimizeDirectory,Pc as optimizeImage,ki as parseImageComponent,Ce as processImage,Tc as processImageComponents,Ec as renderImageComponent,cl as rewriteImagesWithSiblings,Oc as writeImageManifest};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import n from"fs";import a from"path";import{fileURLToPath as s}from"url";var i;function
|
|
3
|
-
export{
|
|
2
|
+
import n from"fs";import a from"path";import{fileURLToPath as s}from"url";var i;function Qe(){if(i)return i;let t="unknown";try{t=String(JSON.parse(n.readFileSync(new URL("../package.json",import.meta.url),"utf8")).version)}catch{}if(import.meta.url.endsWith(".ts"))try{let o=a.dirname(s(import.meta.url)),e=0;for(let r of n.readdirSync(o,{recursive:!0,withFileTypes:!0}))if(r.isFile()&&r.name.endsWith(".ts"))e=Math.max(e,n.statSync(a.join(r.parentPath,r.name)).mtimeMs);t+=`+src.${Math.trunc(e)}`}catch{}return i=t,t}
|
|
3
|
+
export{Qe};
|