@stacksjs/stx 0.2.914 → 0.2.917
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/build-defer-scripts.d.ts +12 -0
- package/dist/build-defer-scripts.js +37 -0
- package/dist/build-externalize-repeated.js +2 -0
- package/dist/build-externalize.js +1 -1
- package/dist/builtins/image-delivery.js +2 -0
- package/dist/builtins/image-placeholder.js +2 -0
- package/dist/{chunk-2vdbt2a7.js → chunk-0adc8x2h.js} +1 -1
- package/dist/{chunk-tykdvjbe.js → chunk-0asdv3hk.js} +2 -2
- package/dist/{chunk-1mmv8wb8.js → chunk-0atz8fjx.js} +4 -4
- package/dist/chunk-0fm6avxt.js +3 -0
- package/dist/{chunk-5ya4nmmr.js → chunk-0sj79ha5.js} +4 -4
- package/dist/{chunk-dhkw1r4y.js → chunk-0v7555tr.js} +4 -4
- package/dist/{chunk-5jn2qyv7.js → chunk-11c7xg1z.js} +1 -1
- package/dist/chunk-11rnqey0.js +2 -0
- package/dist/{chunk-4b110x6r.js → chunk-16sfjkc4.js} +2 -2
- package/dist/{chunk-kmy34he2.js → chunk-1hbf5e1h.js} +2 -2
- package/dist/{chunk-9atdw0p8.js → chunk-1jvt9t3r.js} +2 -2
- package/dist/chunk-1mx3j280.js +2 -0
- package/dist/{chunk-0d3pkkrv.js → chunk-23x3k751.js} +2 -2
- package/dist/chunk-29v3b5ks.js +2 -0
- package/dist/chunk-2cay3heb.js +2 -0
- package/dist/{chunk-6yketqa1.js → chunk-2f5jjxcj.js} +2 -2
- package/dist/{chunk-razwegar.js → chunk-2vx2ben8.js} +2 -2
- package/dist/{chunk-132j46ey.js → chunk-302nw40c.js} +1 -1
- package/dist/chunk-31yx4sjh.js +2 -0
- package/dist/chunk-33fnbw33.js +2 -0
- package/dist/{chunk-wbsbrm6n.js → chunk-36cz2v8k.js} +30 -30
- package/dist/{chunk-9gptdyqq.js → chunk-388xpdw5.js} +31 -5
- package/dist/chunk-38kerh2r.js +2 -0
- package/dist/chunk-38y11q8x.js +2 -0
- package/dist/{chunk-kyfydbtg.js → chunk-3h4db9yb.js} +3 -3
- package/dist/{chunk-3m457a9q.js → chunk-3jc6yb02.js} +3 -3
- package/dist/chunk-3q80f7mt.js +2 -0
- package/dist/{chunk-fghf6amb.js → chunk-43sgpy4e.js} +5 -5
- package/dist/{chunk-w4177qn3.js → chunk-4e18r89n.js} +2 -2
- package/dist/chunk-4pve3r5a.js +2 -0
- package/dist/{chunk-c08jvjqt.js → chunk-4vz17ytv.js} +8 -8
- package/dist/chunk-5afnyvw5.js +2 -0
- package/dist/chunk-5d5dxts6.js +2 -0
- package/dist/chunk-5fdsyyfe.js +2 -0
- package/dist/chunk-67yr4m5h.js +2 -0
- package/dist/chunk-6aqr0e6s.js +2 -0
- package/dist/chunk-6bw02d1t.js +2 -0
- package/dist/chunk-76mn123c.js +2 -0
- package/dist/{chunk-3z3b98f0.js → chunk-789yp1tg.js} +3 -3
- package/dist/chunk-7ar11ccn.js +2 -0
- package/dist/chunk-7fc0vrs5.js +2 -0
- package/dist/chunk-82fg5gp6.js +2 -0
- package/dist/{chunk-gyv2bsmn.js → chunk-88fx8xc1.js} +2 -2
- package/dist/chunk-89r7bbsk.js +2 -0
- package/dist/{chunk-h8tgqq8x.js → chunk-8b8az19t.js} +5 -5
- package/dist/chunk-8egbh6z1.js +2 -0
- package/dist/chunk-8n9jd8cz.js +2 -0
- package/dist/{chunk-9tj16d70.js → chunk-8wqhzzkn.js} +2 -2
- package/dist/chunk-8x3yaahc.js +2 -0
- package/dist/{chunk-rcwg2pdk.js → chunk-91p8p2cc.js} +5 -5
- package/dist/chunk-94qc4zwb.js +2 -0
- package/dist/{chunk-d4hnj3ct.js → chunk-952dfmcb.js} +2 -2
- package/dist/{chunk-72pbhpq8.js → chunk-95j8660f.js} +2 -2
- package/dist/{chunk-75r2p1cz.js → chunk-9928zdej.js} +2 -2
- package/dist/{chunk-8f5x16ht.js → chunk-9ay18k46.js} +1 -1
- package/dist/{chunk-2gwgcybp.js → chunk-9kn81bmp.js} +1 -1
- package/dist/{chunk-9bexzgws.js → chunk-9tv0tw7f.js} +1 -1
- package/dist/{chunk-0h06ry05.js → chunk-9w9y84t5.js} +6 -6
- package/dist/chunk-a5h9bwrc.js +2 -0
- package/dist/{chunk-gg31th5s.js → chunk-ar6jeqmm.js} +4 -4
- package/dist/{chunk-kx3mmpfd.js → chunk-b5qzed8y.js} +37 -37
- package/dist/chunk-bej9kz05.js +2 -0
- package/dist/chunk-bh2khcet.js +2 -0
- package/dist/{chunk-4h48fgkz.js → chunk-bm6y085n.js} +3 -3
- package/dist/{chunk-9phqwza2.js → chunk-c13dv3wm.js} +10 -10
- package/dist/chunk-c6096ssb.js +2 -0
- package/dist/chunk-ccgabq3a.js +2 -0
- package/dist/{chunk-sdf4c754.js → chunk-cxsc37fg.js} +2 -2
- package/dist/{chunk-jap66ea8.js → chunk-da05660m.js} +37 -37
- package/dist/{chunk-2671myh8.js → chunk-dwt2drzf.js} +5 -5
- package/dist/chunk-e0tvd7jj.js +2 -0
- package/dist/{chunk-sg95ne5m.js → chunk-ezqfrea9.js} +5 -5
- package/dist/{chunk-z27szg5v.js → chunk-f0sxbgbm.js} +1 -1
- package/dist/{chunk-08bzdet4.js → chunk-fn1reean.js} +19 -19
- package/dist/{chunk-2m4d8jkv.js → chunk-frpsrv1e.js} +2 -2
- package/dist/{chunk-pc89t52s.js → chunk-ftvpz1j4.js} +5 -5
- package/dist/{chunk-zjrnz9yt.js → chunk-fvr3h2fr.js} +3 -3
- package/dist/{chunk-8p3vqt2q.js → chunk-fzcqw147.js} +2 -2
- package/dist/{chunk-jttzrv0w.js → chunk-gg715pj6.js} +5 -5
- package/dist/chunk-gmmqz698.js +2 -0
- package/dist/{chunk-nzw0y1ny.js → chunk-h0aw9hmc.js} +3 -3
- package/dist/chunk-hxftzw0x.js +2 -0
- package/dist/{chunk-mpfm5ctr.js → chunk-jr2r2nh5.js} +4 -4
- package/dist/chunk-js1wayhb.js +2 -0
- package/dist/chunk-k2t0w8z1.js +2 -0
- package/dist/chunk-k8s3hyh2.js +2 -0
- package/dist/chunk-kcpxqsdj.js +2 -0
- package/dist/{chunk-nan0ysys.js → chunk-m8n14s3z.js} +2 -2
- package/dist/{chunk-as1p2pch.js → chunk-ma5ptt4m.js} +2 -2
- package/dist/{chunk-fyb9qy7x.js → chunk-mf5cqv1k.js} +9 -9
- package/dist/{chunk-jhegz7az.js → chunk-mgj074y2.js} +5 -5
- package/dist/chunk-mjr5fkc2.js +2 -0
- package/dist/{chunk-gqh8shzf.js → chunk-mt5ewkbg.js} +2 -2
- package/dist/{chunk-0m0w8rr1.js → chunk-n4m50dpk.js} +14 -14
- package/dist/chunk-na0e3s88.js +2 -0
- package/dist/chunk-new89wh2.js +2 -0
- package/dist/{chunk-eyw4g6kq.js → chunk-ngqb22wj.js} +9 -9
- package/dist/{chunk-v0yay1kw.js → chunk-nhyv3w4r.js} +1 -1
- package/dist/{chunk-yzgtsrjb.js → chunk-npj20tj9.js} +2 -2
- package/dist/{chunk-j01a1am0.js → chunk-nwef47nx.js} +1 -1
- package/dist/{chunk-zk1c6tg7.js → chunk-p3fepzt9.js} +3 -3
- package/dist/{chunk-z8rf8abt.js → chunk-p3x84jj0.js} +1 -1
- package/dist/chunk-p9bghe13.js +2 -0
- package/dist/{chunk-fycxc75p.js → chunk-pyyda92j.js} +1 -1
- package/dist/chunk-q2cwzgd0.js +2 -0
- package/dist/chunk-q60afqr7.js +2 -0
- package/dist/chunk-qdwtemy1.js +2 -0
- package/dist/chunk-qp0ndbk6.js +2 -0
- package/dist/{chunk-1ezcxbpg.js → chunk-qsexsrw2.js} +5 -5
- package/dist/{chunk-w3y8408q.js → chunk-r7y1196g.js} +2 -2
- package/dist/{chunk-ta7cwykn.js → chunk-ra2tzsvz.js} +4 -4
- package/dist/chunk-rzsvxjse.js +2 -0
- package/dist/chunk-s2c0ynn9.js +2 -0
- package/dist/{chunk-6w9av0n9.js → chunk-sdmq09jw.js} +1 -1
- package/dist/{chunk-qvjg8w1a.js → chunk-t65f98qv.js} +2 -2
- package/dist/chunk-v1wr2vdx.js +2 -0
- package/dist/{chunk-4fmfc48n.js → chunk-v78hjbz0.js} +3 -3
- package/dist/{chunk-ekyx5z50.js → chunk-vayzmvf5.js} +6 -6
- package/dist/{chunk-f9vch452.js → chunk-w6ydg43d.js} +3 -3
- package/dist/{chunk-e52rtbde.js → chunk-wc10m4tp.js} +3 -3
- package/dist/chunk-wcxa8xy2.js +2 -0
- package/dist/chunk-wgrj0cvs.js +2 -0
- package/dist/{chunk-49n9xce7.js → chunk-wj9bqkc0.js} +1 -1
- package/dist/{chunk-r4za879x.js → chunk-wm24jx3t.js} +2 -2
- package/dist/chunk-wpkwx3wq.js +2 -0
- package/dist/chunk-wq17dce6.js +2 -0
- package/dist/chunk-wvc6eayq.js +2 -0
- package/dist/chunk-xa98a901.js +2 -0
- package/dist/chunk-xjt5129x.js +2 -0
- package/dist/{chunk-eca022er.js → chunk-xnp031ba.js} +6 -6
- package/dist/{chunk-hgtcgz9b.js → chunk-yc3frw0z.js} +2 -2
- package/dist/chunk-yn02d599.js +2 -0
- package/dist/{chunk-g9bsafzx.js → chunk-yq2krsc9.js} +4 -4
- package/dist/chunk-ywrpmyzj.js +5 -0
- package/dist/{chunk-95x3jvmz.js → chunk-z110bf2c.js} +8 -6
- package/dist/{chunk-3syagjd7.js → chunk-zv3rn0ch.js} +4 -4
- package/dist/cli.js +14 -14
- package/dist/client/signals-mount-runtime.js +4 -2
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/ts-css.d.ts +1 -1
- package/dist/dev-server/ts-css.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/native/compiler/html-to-ir.d.ts +3 -1
- package/dist/native/compiler/html-to-ir.js +30 -0
- package/dist/process.js +1 -1
- package/dist/pwa.js +3 -3
- package/dist/serve-page-assets.d.ts +2 -0
- package/dist/serve-page-assets.js +14 -0
- package/dist/ssg.js +25 -25
- package/dist/types/config-types.d.ts +2 -0
- package/package.json +5 -5
- package/dist/chunk-1dc6h93m.js +0 -2
- package/dist/chunk-1htdsypj.js +0 -3
- package/dist/chunk-1k5ns68h.js +0 -2
- package/dist/chunk-2870sk9z.js +0 -2
- package/dist/chunk-2fyey6pn.js +0 -2
- package/dist/chunk-2jkq15je.js +0 -2
- package/dist/chunk-3d3f35fz.js +0 -2
- package/dist/chunk-3e3zsgke.js +0 -2
- package/dist/chunk-3fabcebr.js +0 -2
- package/dist/chunk-41y868zf.js +0 -2
- package/dist/chunk-5xsghm23.js +0 -2
- package/dist/chunk-7k1thytm.js +0 -2
- package/dist/chunk-8n42epb6.js +0 -5
- package/dist/chunk-94r6mkcy.js +0 -2
- package/dist/chunk-9s8he3d1.js +0 -2
- package/dist/chunk-9y4gz22m.js +0 -2
- package/dist/chunk-a02sy0m5.js +0 -2
- package/dist/chunk-abs4fwmf.js +0 -2
- package/dist/chunk-abxwggen.js +0 -2
- package/dist/chunk-asewbsct.js +0 -2
- package/dist/chunk-bprjp80g.js +0 -2
- package/dist/chunk-c60egpe6.js +0 -2
- package/dist/chunk-cjq455ve.js +0 -2
- package/dist/chunk-cqq68aw8.js +0 -2
- package/dist/chunk-d9066gp6.js +0 -2
- package/dist/chunk-dmsrpf7h.js +0 -2
- package/dist/chunk-fzh73jtc.js +0 -2
- package/dist/chunk-g3a2gx3p.js +0 -2
- package/dist/chunk-g6s4151k.js +0 -2
- package/dist/chunk-gcc5tp4j.js +0 -2
- package/dist/chunk-gf4a9h9x.js +0 -2
- package/dist/chunk-gmczbe3j.js +0 -2
- package/dist/chunk-h13csdpm.js +0 -2
- package/dist/chunk-h7k1y40p.js +0 -2
- package/dist/chunk-h7xqba9k.js +0 -2
- package/dist/chunk-hpxhxwda.js +0 -2
- package/dist/chunk-j846tv4t.js +0 -2
- package/dist/chunk-jnk3nk5k.js +0 -2
- package/dist/chunk-jy5gh22e.js +0 -2
- package/dist/chunk-jzbte09f.js +0 -2
- package/dist/chunk-k0b1t59r.js +0 -2
- package/dist/chunk-k5v22gn4.js +0 -2
- package/dist/chunk-kwh5pjqd.js +0 -2
- package/dist/chunk-mgcakk1m.js +0 -2
- package/dist/chunk-n3bt1sv5.js +0 -2
- package/dist/chunk-n62nqhey.js +0 -2
- package/dist/chunk-n6ve45hj.js +0 -2
- package/dist/chunk-ptrz5xwt.js +0 -2
- package/dist/chunk-q3ha3fcj.js +0 -2
- package/dist/chunk-qgc59a7d.js +0 -2
- package/dist/chunk-qjkpwjg6.js +0 -2
- package/dist/chunk-t4paeg33.js +0 -2
- package/dist/chunk-tfn3x8t2.js +0 -2
- package/dist/chunk-vhk7a79j.js +0 -2
- package/dist/chunk-vmn8vpp8.js +0 -2
- package/dist/chunk-x1svtz8k.js +0 -2
- package/dist/chunk-ykx4zt07.js +0 -2
- package/dist/chunk-zb75qq5j.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function
|
|
3
|
-
export{
|
|
2
|
+
import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function Eu(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&").replace(/"/g,""")}
|
|
3
|
+
export{Eu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function
|
|
2
|
+
var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function Dh(s,n={},t){let e=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return s.replace(e,(r,i,o,d)=>{let u=l(),a=p(i||"");return f(u,o.trim(),d.trim(),a)})}function p(s){let n={},t=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,e;while((e=t.exec(s))!==null){let r=e[1],i=e[2]||e[3],o=e[4];switch(r){case"id":n.id=i;break;case"timeout":n.timeout=o?parseInt(o,10):void 0;break}}return n}function f(s,n,t,e){let r=e.timeout||30000,i=e.id||s;return`
|
|
3
3
|
<div class="stx-suspense" data-suspense-id="${s}" data-custom-id="${i}" data-status="pending">
|
|
4
4
|
<div class="stx-suspense-fallback" data-suspense-fallback="${s}">
|
|
5
5
|
${t}
|
|
@@ -189,7 +189,7 @@ else {
|
|
|
189
189
|
}, 0);
|
|
190
190
|
})();
|
|
191
191
|
</script>
|
|
192
|
-
`}function
|
|
192
|
+
`}function Lh(s,n,t){return{id:s,fallback:t,content:n}}async function jh(s){let n=s.map((e)=>`
|
|
193
193
|
<div id="stx-ssr-suspense-${e.id}" class="stx-ssr-suspense">
|
|
194
194
|
${e.fallback}
|
|
195
195
|
</div>
|
|
@@ -214,7 +214,7 @@ else {
|
|
|
214
214
|
}
|
|
215
215
|
})();
|
|
216
216
|
</script>
|
|
217
|
-
`}}return{initial:n,streaming:t()}}function
|
|
217
|
+
`}}return{initial:n,streaming:t()}}function Bh(){return`
|
|
218
218
|
/* STX Suspense Styles */
|
|
219
219
|
.stx-suspense {
|
|
220
220
|
position: relative;
|
|
@@ -270,7 +270,7 @@ else {
|
|
|
270
270
|
background-size: 200% 100%;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
`}function
|
|
273
|
+
`}function Fh(){return`
|
|
274
274
|
// STX Suspense Runtime
|
|
275
275
|
(function() {
|
|
276
276
|
if (typeof window === 'undefined') return;
|
|
@@ -338,4 +338,4 @@ else {
|
|
|
338
338
|
console.log('[stx] Suspense runtime initialized');
|
|
339
339
|
})();
|
|
340
340
|
`}
|
|
341
|
-
export{
|
|
341
|
+
export{Dh,Lh,jh,Bh,Fh};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function y(e,s){let i=e[s],n=s+1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]===i)return n+1;n++}return e.length}function k(e,s){let i=s+1;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==="`")return i+1;if(e[i]==="$"&&e[i+1]==="{"){if(i=
|
|
2
|
+
function y(e,s){let i=e[s],n=s+1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]===i)return n+1;n++}return e.length}function k(e,s){let i=s+1;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==="`")return i+1;if(e[i]==="$"&&e[i+1]==="{"){if(i=Vl(e,i+2),i<e.length)i++;continue}i++}return e.length}function Vl(e,s){let i=1,n=s,f="{",r="";while(n<e.length){let l=e[n];if(l==="\\"){n+=2;continue}if(l==='"'||l==="'"){n=y(e,n),f=c,r="";continue}if(l==="`"){n=k(e,n),f=c,r="";continue}if(l==="/"&&e[n+1]==="/"){while(n<e.length&&e[n]!==`
|
|
3
3
|
`)n++;continue}if(l==="/"&&e[n+1]==="*"){n+=2;while(n<e.length&&e.slice(n,n+2)!=="*/")n++;n+=2;continue}if(l==="/"&&m(f,r)){let g=E(e,n);if(g!==-1){n=g,f=c,r="";continue}}if(l==="{")i++;else if(l==="}"){if(i--,i===0)return n}if(/[\w$]/.test(l))r=/[\w$]/.test(f)?r+l:l,f=l;else if(!/\s/.test(l))f=l,r="";n++}return e.length}var L=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function m(e,s){if(s)return L.has(s);return!(e===")"||e==="]"||e===c)}var c="\x00";function E(e,s){let i=s+1,n=!1;while(i<e.length){let f=e[i];if(f===`
|
|
4
4
|
`)return-1;if(f==="\\"){i+=2;continue}if(f==="[")n=!0;else if(f==="]")n=!1;else if(f==="/"&&!n){i++;while(i<e.length&&/[a-z]/i.test(e[i]))i++;return i}i++}return-1}function t(e){return b(e,!1)}function Un(e){return b(e,!0)}function b(e,s){let i="",n=0,f=/[\w$]+|\s+|[^\w$\s]/g,r="",l="";while(n<e.length){f.lastIndex=n;let g=f.exec(e)[0];if(g.length>1||/[\w$\s]/.test(g)){if(i+=g,n+=g.length,!/\s/.test(g[0]))l=/[\w$]/.test(r)?l+g:g,r=g[g.length-1];continue}let o=g;if(o==="/"&&e[n+1]==="/"){let u=e.indexOf(`
|
|
5
|
-
`,n),a=u===-1?e.length:u;i+=" ".repeat(a-n),n=a;continue}if(o==="/"&&e[n+1]==="*"){let u=e.indexOf("*/",n),a=u===-1?e.length:u;i+=p(e.slice(n,a)),n=a,i+=" ",n+=2;continue}if(o==='"'||o==="'"){let u=o;i+=" ",n++;let a=u==='"'?/["\\]/g:/['\\]/g;while(n<e.length&&e[n]!==u){if(e[n]==="\\"){i+=" ",n+=2;continue}a.lastIndex=n;let w=a.exec(e)?.index??e.length;i+=p(e.slice(n,w)),n=w}i+=s?"$":" ",n++,r=c,l="";continue}if(o==="/"&&m(r,l)){let u=E(e,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,r=c,l="";continue}}if(o==="`"){i+=s?"(":" ",n++;let u=/[\\`$]/g;while(n<e.length&&e[n]!=="`"){if(e[n]==="\\"){i+=" ",n+=2;continue}if(e[n]==="$"&&e[n+1]==="{"){let w=n+2,x=
|
|
5
|
+
`,n),a=u===-1?e.length:u;i+=" ".repeat(a-n),n=a;continue}if(o==="/"&&e[n+1]==="*"){let u=e.indexOf("*/",n),a=u===-1?e.length:u;i+=p(e.slice(n,a)),n=a,i+=" ",n+=2;continue}if(o==='"'||o==="'"){let u=o;i+=" ",n++;let a=u==='"'?/["\\]/g:/['\\]/g;while(n<e.length&&e[n]!==u){if(e[n]==="\\"){i+=" ",n+=2;continue}a.lastIndex=n;let w=a.exec(e)?.index??e.length;i+=p(e.slice(n,w)),n=w}i+=s?"$":" ",n++,r=c,l="";continue}if(o==="/"&&m(r,l)){let u=E(e,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,r=c,l="";continue}}if(o==="`"){i+=s?"(":" ",n++;let u=/[\\`$]/g;while(n<e.length&&e[n]!=="`"){if(e[n]==="\\"){i+=" ",n+=2;continue}if(e[n]==="$"&&e[n+1]==="{"){let w=n+2,x=Vl(e,w);if(i+=s?" {":" ",i+=b(e.slice(w,x),s),x<e.length)i+=s?"}":" ";n=x+1;continue}let a=n;n++,u.lastIndex=n,n=u.exec(e)?.index??e.length,i+=p(e.slice(a,n))}i+=s?")":" ",n++,r=c,l="";continue}i+=o,n++,r=o,l=""}return i}function p(e){return e.includes(`
|
|
6
6
|
`)?e.replace(/[^\n]/g," "):" ".repeat(e.length)}function h(e){let s=new Uint16Array(e.length),i=0,n=!0;for(let f=0;f<e.length;f++){let r=e[f];if(r===")"||r==="]"||r==="}")if(i===0)n=!1;else i--;if(s[f]=i,r==="("||r==="["||r==="{")i++}return{depths:s,balanced:n&&i===0}}
|
|
7
|
-
export{
|
|
7
|
+
export{Vl,t,Un,h};
|
|
@@ -4,5 +4,5 @@ var qo=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{na
|
|
|
4
4
|
`)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
|
|
5
5
|
${r} [${o.join(`,
|
|
6
6
|
${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
|
|
7
|
-
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Ga(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Xa,createHotReloadServer:Ga,NATIVE_COMPONENTS:qo},
|
|
8
|
-
export{qo,Xa,Ga,
|
|
7
|
+
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Ga(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Xa,createHotReloadServer:Ga,NATIVE_COMPONENTS:qo},ey=K;
|
|
8
|
+
export{qo,Xa,Ga,ey};
|
|
@@ -76,7 +76,7 @@ function Va(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
76
76
|
};
|
|
77
77
|
})();
|
|
78
78
|
</script>
|
|
79
|
-
`})}function
|
|
79
|
+
`})}function Tu(){return`
|
|
80
80
|
.virtual-list-container {
|
|
81
81
|
position: relative;
|
|
82
82
|
overflow-y: auto;
|
|
@@ -124,7 +124,7 @@ function Va(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
124
124
|
0% { background-position: 200% 0; }
|
|
125
125
|
100% { background-position: -200% 0; }
|
|
126
126
|
}
|
|
127
|
-
`}function
|
|
127
|
+
`}function $u(v,c){let l=null,u=()=>{if(!l)l=Va(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function Ru(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=Wa(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
|
|
128
128
|
// Infinite scroll detection
|
|
129
129
|
container.addEventListener('scroll', function() {
|
|
130
130
|
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
@@ -142,7 +142,7 @@ function Va(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
142
142
|
${x}
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
145
|
-
`})}function
|
|
145
|
+
`})}function Au(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
|
|
146
146
|
<div class="virtual-grid-item"
|
|
147
147
|
style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
|
|
148
148
|
data-index="${I}">
|
|
@@ -212,5 +212,5 @@ function Va(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
212
212
|
});
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
|
-
`})}var
|
|
216
|
-
export{Va,Wa,
|
|
215
|
+
`})}var fh={createVirtualList:Va,processVirtualListDirectives:Wa,processInfiniteListDirectives:Ru,processVirtualGridDirectives:Au,generateVirtualListCSS:Tu,useVirtualList:$u};
|
|
216
|
+
export{Va,Wa,Tu,$u,Ru,Au,fh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Oo,Aa,cs,No,Mo,qn,an,Pa,ls,us,Do,Lo,Im,Om,Ct}from"./chunk-3jc6yb02.js";export{Ct as DeployError,Aa as calculateSha1,cs as collectDeployFiles,us as createDefaultNetlifyConfig,No as createFileManifest,Oo as createNetlifyClient,Im as deploy,ls as detectProjectConfig,Mo as filterRequiredFiles,qn as formatSize,Pa as generateNetlifyToml,an as getTotalSize,Lo as hasNetlifyConfig,Om as initNetlify,Do as writeNetlifyConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{B,
|
|
2
|
+
import{B,hl,co,Pn,y,Ge,Je}from"./chunk-b5qzed8y.js";import{$r,pt,q}from"./chunk-mf5cqv1k.js";import{br,i}from"./chunk-n4m50dpk.js";import{Pe}from"./chunk-8b8az19t.js";import{la}from"./chunk-8tfpv6zf.js";function h(s){return s.endsWith(".md")||s.endsWith(".markdown")}function C(s){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(n,p){let g;while((g=n.exec(s))!==null){let t=g.index,o=t+g[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function b(s,e={}){let{data:r,content:m}=$r(s),a=await(e.renderer??((n)=>pt(n)))(m);return{html:C(a),frontmatter:r??{}}}import{dirname as k,resolve as R}from"path";function v(s){let e=s,r=B(s);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),g;while((g=m.exec(s))!==null){let o=g[1],l=g[2],d=g[0],u=o.includes("server");if(p(l))n.push(d);else if(u)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let u=l.index+l[0].length,f=t.indexOf("</script>",u);if(f===-1)continue;d.push({start:l.index,end:f+9}),o.lastIndex=f+9}for(let u=d.length-1;u>=0;u--)t=t.substring(0,d[u].start)+t.substring(d[u].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function M(s,e){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -9,8 +9,8 @@ import{B,gl,co,Pn,y,Ge,Je}from"./chunk-kx3mmpfd.js";import{$r,pt,q}from"./chunk-
|
|
|
9
9
|
<body>
|
|
10
10
|
${s}
|
|
11
11
|
</body>
|
|
12
|
-
</html>`}async function _c(s,e={}){let r=R(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(h(r)){let n=await b(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=R(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:g,injectCSS:t,...o}=e,l={...e.context||{}};Pn(l);let d=await w(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),u=await p.text(),f={...l,content:d},x={...o,context:f,injectCSS:t};return w(u,n,x)}return w(c,r,e)}async function w(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=v(s),n={...q,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...co(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await y(o,p,e);let g=new Set,t=m;if(t=await i(t,p,e,n,g),
|
|
12
|
+
</html>`}async function _c(s,e={}){let r=R(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(h(r)){let n=await b(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=R(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:g,injectCSS:t,...o}=e,l={...e.context||{}};Pn(l);let d=await w(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),u=await p.text(),f={...l,content:d},x={...o,context:f,injectCSS:t};return w(u,n,x)}return w(c,r,e)}async function w(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=v(s),n={...q,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...co(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await y(o,p,e);let g=new Set,t=m;if(t=await i(t,p,e,n,g),hl(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
|
|
13
13
|
${a.join(`
|
|
14
14
|
`)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=Ge(p),d=await Promise.all(a.map(async(x)=>{let _=x.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(_))return x;let S=x.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!S)return x;return await Je(S[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),f=[await br(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
|
|
15
|
-
`);t=la(t,f)}t=await Pe(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-
|
|
15
|
+
`);t=la(t,f)}t=await Pe(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-q60afqr7.js");t=await o(t)}catch{}return t}
|
|
16
16
|
export{_c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fa,ga,ma,wm,ha,ya,vm,ba,wa,ou,xm}from"./chunk-952dfmcb.js";export{fa as VideoProcessorCache,ou as analyzeVideo,wm as clearVideoCache,wa as generateDASHManifest,ba as generateHLSManifest,ha as generatePoster,vm as generateSpriteSheet,ya as generateThumbnails,ga as getCachedVideoResult,xm as processVideo,ma as setCachedVideoResult};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function
|
|
3
|
-
`)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
2
|
+
import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function Qc(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
|
|
3
|
+
`)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function el(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await Si(m,e),{config:f,graph:m}}async function Si(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function Hs(e){return O(A(e))}function Us(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
|
|
4
|
+
`)}function tl(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
|
|
5
|
+
export{Qc,el,Si,Hs,Us,tl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{au,cu}from"./chunk-da05660m.js";import"./chunk-95j8660f.js";import"./chunk-v78hjbz0.js";import"./chunk-0asdv3hk.js";import"./chunk-yc3frw0z.js";import"./chunk-3jc6yb02.js";import"./chunk-ra2tzsvz.js";import"./chunk-c13dv3wm.js";import"./chunk-ma5ptt4m.js";import"./chunk-3h4db9yb.js";import"./chunk-2f5jjxcj.js";import"./chunk-1jvt9t3r.js";import"./chunk-11c7xg1z.js";import"./chunk-wm24jx3t.js";import"./chunk-88fx8xc1.js";import"./chunk-frpsrv1e.js";import"./chunk-ar6jeqmm.js";import"./chunk-qsexsrw2.js";import"./chunk-gg715pj6.js";import"./chunk-vayzmvf5.js";import"./chunk-789yp1tg.js";import"./chunk-dwt2drzf.js";import"./chunk-m8n14s3z.js";import"./chunk-p3fepzt9.js";import"./chunk-mgj074y2.js";import"./chunk-ftvpz1j4.js";import"./chunk-yq2krsc9.js";import"./chunk-wc10m4tp.js";import"./chunk-z110bf2c.js";import"./chunk-h0aw9hmc.js";import"./chunk-0vyytd9v.js";import"./chunk-ywrpmyzj.js";import{gn}from"./chunk-f0sxbgbm.js";import{ag}from"./chunk-0atz8fjx.js";import"./chunk-0sj79ha5.js";import"./chunk-cwcmmgvz.js";import{Ue,i}from"./chunk-n4m50dpk.js";import"./chunk-ngqb22wj.js";import"./chunk-43sgpy4e.js";import"./chunk-fs43342z.js";import"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-bm6y085n.js";import"./chunk-9tv0tw7f.js";import"./chunk-9w9y84t5.js";import{Pe}from"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import{Er,Tr}from"./chunk-t65f98qv.js";import"./chunk-0adc8x2h.js";import{zs,q,a}from"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import{B,y,Je}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";import{la}from"./chunk-8tfpv6zf.js";import"./chunk-pyyda92j.js";import"./chunk-952dfmcb.js";export{zs as buildWebComponents,Tr as cacheTemplate,Er as checkCache,gn as classifyAllScripts,au as createMiddleware,cu as createRoute,q as defaultConfig,y as extractVariables,B as findSfcTemplateBlock,Pe as injectRouterScript,la as insertBeforeBodyClose,a as loadStxConfig,Je as processClientScript,i as processDirectives,Ue as readMarkdownFile,ag as withinBundlerCallback};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pu,Iu,Ou,Nu,Mu,Du,Lu,ju,Bu,Fu,gh}from"./chunk-vayzmvf5.js";export{Pu as createIslandRegistry,gh as default,Fu as generateIslandManifest,Ou as generatePartialHydrationCSS,Du as hydrateAll,Mu as hydrateByStrategy,Nu as hydrateIsland,Lu as isHydrated,ju as onHydrated,Iu as processPartialHydrationDirectives,Bu as processStaticDirectives};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ie,fo,Zg,My,Qg,Dy,Nn,g,Y,ae,Mn,Me,em,Xi,tm,Ly,P,Gi,nm,jy,N,By}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{nm as applyFilters,Dy as clearCustomFilters,em as clientLoopScopes,fo as defaultFilters,Mn as escapeAttributeValue,g as escapeHtml,Y as escapeHtmlValue,ae as escapeInterpolatedHtmlValue,N as evaluateExpression,Ie as findMustacheEnd,Qg as getAllFilters,tm as interpolateScriptAttributes,Xi as interpolateScriptExpressions,Ly as interpolateScriptsInTemplate,P as processExpressions,Gi as processExpressionsChunked,Zg as registerFilter,My as registerFilters,Nn as replaceInterpolations,jy as resetRejectedExpressionWarnings,By as unescapeHtml,Me as usesSignalsInScript};
|
|
@@ -72,7 +72,7 @@ else {
|
|
|
72
72
|
${t}
|
|
73
73
|
})();
|
|
74
74
|
</script>
|
|
75
|
-
`}function
|
|
75
|
+
`}function Th(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
|
|
76
76
|
<div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
|
|
77
77
|
${d}
|
|
78
78
|
${c}
|
|
@@ -81,4 +81,4 @@ else {
|
|
|
81
81
|
</div>
|
|
82
82
|
${h}
|
|
83
83
|
`})}
|
|
84
|
-
export{
|
|
84
|
+
export{Th};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ft}from"./chunk-
|
|
2
|
+
import{ft}from"./chunk-388xpdw5.js";import{At,or}from"./chunk-z110bf2c.js";import{ye,An,Pl,Il}from"./chunk-b5qzed8y.js";import{qr,Kr,Xr,Jr,Le}from"./chunk-4vz17ytv.js";import{z}from"./chunk-w98yt4d4.js";import{Ji}from"./chunk-p3x84jj0.js";import{S}from"./chunk-ngqb22wj.js";import{i}from"./chunk-n4m50dpk.js";import{q,a}from"./chunk-mf5cqv1k.js";import{tl}from"./chunk-jr2r2nh5.js";import{Kn,Xn,ot,Fe,ja,Ba,Gn}from"./chunk-3h4db9yb.js";import{vn,ti}from"./chunk-0sj79ha5.js";import{Jn}from"./chunk-fznjm7qt.js";import{fn,gr,mr}from"./chunk-357qjcj1.js";import{re}from"./chunk-8b8az19t.js";import m from"fs";import c from"path";import{createHash as Y}from"crypto";function I(n){return Y("sha256").update(n).digest("hex").slice(0,8)}function W(n=!1){let l=n?or():At(),o=I(l);return{content:l,filename:`runtime.${o}.js`,hash:o}}function J(){let n=ft(),l=I(n);return{content:n,filename:`router.${l}.js`,hash:l}}import U from"path";import{createHash as Q}from"crypto";function ee(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function V(n,l,o={}){let r=U.resolve(n),e=await Bun.file(r).text(),x=Q("sha256").update(e).digest("hex").slice(0,16);Pl();let _={};try{_=await a(o.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>ye(R))),{context:D}=ee({__filename:r,__dirname:U.dirname(r),__stx_serverDeclared:u}),A=new Set,T={...q,..._,...o,buildMode:"compile",strict:!1},f=await i(e,D,r,T,A),w=Kn(f)+Xn(f)+ot(f),j=Il();return{route:l,sourceFile:n,html:f,fragment:w,placeholders:j,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(A),contentHash:x,status:An(e),streamTemplates:D.__streamTemplates}}var te=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function X(n,l){let o=0,r=0;if(!m.existsSync(n))return{copied:o,bytes:r};m.mkdirSync(l,{recursive:!0});function e(x,_){let y=m.readdirSync(x,{withFileTypes:!0});for(let d of y){if(te.has(d.name))continue;let g=c.join(x,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),o++,r+=m.statSync(u).size}}}return e(n,l),{copied:o,bytes:r}}async function Bm(n={}){let l=Date.now(),o=c.resolve(n.root||process.cwd()),r=c.resolve(o,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await a(o),x=c.resolve(o,n.componentsDir??e.componentsDir??"components"),_=c.resolve(o,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(o,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",g=Le(e.app?.head,{known:Jr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",A=n.routeRules??e.routeRules??{},T=Jn(A),f=n.serverApi??e.serverApi,w=typeof f==="object"?f:{};if(f)vn(o,w);if(e.runtimeConfig)z(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let j=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of j)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=re(o,{pagesDirs:e._layerPageDirs}),Z=["components","layouts","partials"],P=R.filter((s)=>!Z.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${P.length} page routes (${R.length-P.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=W(n.debug),b=J();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",b.filename),b.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${b.filename} (${(b.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let B=[],O=[];for(let s of P){let h=T(s.pattern),M=h.rendering==="prerender";if(M&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await V(s.filePath,s.pattern,{configDir:o,componentsDir:x,partialsDir:_,layoutsDir:y,debug:n.debug});if(B.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,b.filename),t.html=Xr(t.html,g,{bodyScripts:[`<script src="/__stx/${b.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=qr(t.html,u);if(g.htmlAttrs)t.html=Kr(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let G=p[1];t.html=t.html.replace(" "+G,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${G}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await S(t.html),M){let p=await Gn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=Fe(t.html,D,!0);let N=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),K=c.join("server","pages",`${N}.compiled.json`),L=c.join("server","fragments",`${N}.html`);await Bun.write(c.join(r,K),JSON.stringify(t,null,2)),await Bun.write(c.join(r,L),t.fragment),O.push({pattern:s.pattern,compiledPath:K,fragmentPath:L,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:M}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let H=c.resolve(o,d);if(m.existsSync(H)){let{copied:s,bytes:h}=X(H,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let k=mr(o);if(k){let{copied:s,bytes:h}=X(k,c.join(r,"public",gr));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${fn}/`)}let E={runtime:v.filename,router:b.filename},C=ja(O,E,r);if(C.routeRules=A,C.routerContainer=D,f)C.apiRoutes=await ti(o,r,w);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Ji(o,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(tl(e._layerGraph),null,2));Ba(C,r);let F=Date.now()-l;return console.log(`
|
|
3
3
|
[stx build] Done in ${F}ms \u2014 ${B.length} pages compiled`),{pageCount:B.length,assets:E,outputDir:r,duration:F}}
|
|
4
|
-
export{
|
|
4
|
+
export{Bm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{n,u}from"./chunk-
|
|
2
|
+
import{n,u}from"./chunk-4vz17ytv.js";import{Oi,s,On,b}from"./chunk-b5qzed8y.js";import{ft}from"./chunk-388xpdw5.js";import{Vs,Ws}from"./chunk-xnp031ba.js";import{el,Si,Hs,Us}from"./chunk-jr2r2nh5.js";import{Yc,Zc}from"./chunk-w6ydg43d.js";import{Mt}from"./chunk-bvqgq18r.js";import{En,il,Ir,Or}from"./chunk-4e18r89n.js";import{w}from"./chunk-v6gkjg5f.js";import{Co}from"./chunk-23x3k751.js";import{c,f}from"./chunk-8tfpv6zf.js";import Q from"fs";import z from"path";import{loadConfigWithResult as Kt}from"bunfig";var K={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,t={}){let{duration:i,delay:o,ease:r,direction:l,custom:d}={...K,...t};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${l==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -234,7 +234,7 @@ else {
|
|
|
234
234
|
</script>
|
|
235
235
|
`}var Ae={name:"transition",handler:(e,t,i,o)=>{if(t.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let r=t[0],l=t.length>1?Number.parseInt(t[1],10)||K.duration:K.duration,d=t.length>2?t[2]||K.ease:K.ease,m=t.length>3?Number.parseInt(t[3],10)||K.delay:K.delay,p=t.length>4?t[4]||K.direction:K.direction,g=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(r,{duration:l,delay:m,ease:d,direction:p}),h="stx-transition",v="";if(r==="fade")v="stx-fade";else if(r==="slide")v="stx-slide";else if(r==="scale")v="stx-scale";else if(r==="flip")v="stx-flip";else if(r==="rotate")v="stx-rotate";return`<div id="${g}" class="${h} ${v} ${p==="out"?"stx-out":""}"
|
|
236
236
|
style="--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${m}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},_e={name:"scrollAnimate",handler:(e,t,i,o)=>{if(t.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let r=t[0],l=t.length>1?Number.parseInt(t[1],10)||300:300,d=t.length>2?t[2]||"ease":"ease",m=t.length>3?Number.parseFloat(t[3])||0.2:0.2,p=t.length>4?Number.parseInt(t[4],10)||0:0,g=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms; will-change: opacity, transform;`,h="stx-transition stx-observe stx-out";if(r==="fade")h+=" stx-fade";else if(r==="slide-up"||r==="slide")h+=" stx-from-bottom";else if(r==="slide-down")h+=" stx-from-top";else if(r==="slide-left")h+=" stx-from-right";else if(r==="slide-right")h+=" stx-from-left";else if(r==="scale")h+=" stx-scale";else if(r.includes("-"))h+=` stx-${r}`;else h+=` stx-${r}`;return`<div id="${g}" class="${h}" style="${y}" data-threshold="${m}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},Re={name:"animationGroup",handler:(e,t,i,o)=>{if(t.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let r=t[0],l=t.slice(1).map((g)=>g.startsWith("#")||g.startsWith(".")?g:`#${g}`),d=i.staggerDelay||50,m=i.sequence||!0,p=dt(r,l,{staggerDelay:d,sequence:m});return`${e}
|
|
237
|
-
${p}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ee={name:"motion",handler:(e,t,i,o)=>{let r=t.length>0?t[0].toLowerCase()==="true":!0,l=at();return`<div data-animate="${r?"auto":"true"}">${e}</div>${l}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function
|
|
237
|
+
${p}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ee={name:"motion",handler:(e,t,i,o)=>{let r=t.length>0?t[0].toLowerCase()==="true":!0,l=at();return`<div data-animate="${r?"auto":"true"}">${e}</div>${l}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function Vc(e,t,i,o){let r=e;if(o.animation?.enabled===!1)return r;let l=i.includes("test")&&i.includes("animation");if(!ot(r)&&!l)return r;if(!r.includes('<style id="stx-animation-base">')){let m=ct();r=f(r,m)}if(r.includes("stx-observe")){if(!r.includes("Intersection Observer for scroll animations")){let p=lt(),g=c(r);if(g!==-1)r=r.slice(0,g)+p+`
|
|
238
238
|
`+r.slice(g)}}return r}async function ut(e,t,i,o){let r=t[0]?.replace(/['"]/g,"")||"main",l=ft();if(r!=="main")l=l.replace("container:'main'",`container:'${r}'`);return`<script data-stx-router>${l}</script>`}var Oe={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var mt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Ie(e){let t=e.heatmap;if(!t?.enabled)return"";let i={...mt,...t};return`
|
|
239
239
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
240
240
|
<script>
|
|
@@ -618,7 +618,7 @@ else {
|
|
|
618
618
|
};
|
|
619
619
|
})();
|
|
620
620
|
</script>
|
|
621
|
-
`}function
|
|
621
|
+
`}function Wc(e,t){let i=Ie(t);if(!i)return e;let o=c(e);if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Te={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,t,i,o)=>{let r=i.__stx_config||{};if(t.length>0){let l=gt(t.join(" "));r.heatmap={...r.heatmap,...l,enabled:!0}}return Ie(r)}};function gt(e){let t={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[r,l]=o.split("="),d=l?.replace(/["']/g,"");switch(r){case"endpoint":t.endpoint=d;break;case"samplingRate":t.samplingRate=Number.parseInt(d,10);break;case"batchSize":t.batchSize=Number.parseInt(d,10);break;case"trackMouse":t.trackMouse=d==="true";break;case"trackClicks":t.trackClicks=d==="true";break;case"trackScroll":t.trackScroll=d==="true";break;case"honorDnt":t.honorDnt=d==="true";break;case"debugOverlay":t.debugOverlay=d==="true";break}}return t}function G(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Me(e){let t=e.trim().toLowerCase();return!t.startsWith("javascript:")&&!t.startsWith("vbscript:")&&!t.startsWith("data:text/html")}function $r(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(t);if(!i)return{data:{},content:e.trim()};let o=i[1],r=e.slice(i[0].length),l={};for(let d of o.split(`
|
|
622
622
|
`)){let m=d.trim();if(!m||m.startsWith("#"))continue;let p=m.indexOf(":");if(p===-1)continue;let g=m.slice(0,p).trim(),y=m.slice(p+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}l[g]=y}return{data:l,content:r.trim()}}function pt(e,t={}){let{gfm:i=!0,breaks:o=!1}=t,r=e,l=[];if(r=r.replace(/```(\w*)\n([\s\S]*?)```/g,(y,h,v)=>{let x=l.length,C=h?` class="language-${G(h)}"`:"";return l.push(`<pre><code${C}>${G(v.trim())}</code></pre>`),`\x00CODEBLOCK${x}\x00`}),r=r.replace(/`([^`]*)`/g,(y,h)=>`<code>${G(h)}</code>`),r=r.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),r=r.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),r=r.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),r=r.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),r=r.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),r=r.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),r=r.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),r=r.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),r=r.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),r=r.replace(/__(.+?)__/g,"<strong>$1</strong>"),r=r.replace(/\*(.+?)\*/g,"<em>$1</em>"),r=r.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)r=r.replace(/~~(.+?)~~/g,"<del>$1</del>");if(r=r.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,h,v)=>`<img src="${Me(v)?G(v):""}" alt="${G(h)}" />`),r=r.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,h,v)=>`<a href="${Me(v)?G(v):""}">${h}</a>`),r=r.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),r=r.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),r=r.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
623
623
|
`),r=r.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),r=r.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),r=r.replace(/<\/ul>\n<ul>/g,""),r=r.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),r=r.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),r=r.replace(/<\/ol>\n<ol>/g,""),r=r.replace(/<li data-ul>/g,"<li>"),r=r.replace(/<li data-ol>/g,"<li>"),i)r=r.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,h,v)=>{let C=`<tr>${h.split("|").map((P)=>P.trim()).filter(Boolean).map((P)=>`<th>${G(P)}</th>`).join("")}</tr>`,A=v.trim().split(`
|
|
624
624
|
`).map((P)=>`<tr>${P.split("|").map((_)=>_.trim()).filter(Boolean).map((_)=>`<td>${G(_)}</td>`).join("")}</tr>`).join(`
|
|
@@ -636,7 +636,7 @@ ${A}
|
|
|
636
636
|
`:`
|
|
637
637
|
`)}</p>`);if(r=m.join(`
|
|
638
638
|
`),o)r=r.replace(/\n/g,`<br />
|
|
639
|
-
`);for(let y=0;y<l.length;y++)r=r.replace(`\x00CODEBLOCK${y}\x00`,l[y]);return r=r.replace(/<p>\s*<\/p>/g,""),r.trim()}async function
|
|
639
|
+
`);for(let y=0;y<l.length;y++)r=r.replace(`\x00CODEBLOCK${y}\x00`,l[y]);return r=r.replace(/<p>\s*<\/p>/g,""),r.trim()}async function qc(e,t,i=""){let o=e,r=[],l=/@markdown(?:\([^)]*\))?/g,d;while((d=l.exec(e))!==null){let m=d.index,p=d[0].match(/@markdown\(([^)]*)\)/),g=p?p[1]:"",y=m+d[0].length,h=1,v=y,x=-1;while(h>0&&v<e.length){let P=e.indexOf("@markdown",v),R=e.indexOf("@endmarkdown",v);if(R===-1)break;if(P!==-1&&P<R&&P!==m){let _=e[P+9];if(_==="("||_===`
|
|
640
640
|
`||_==="\r"||_===" "||_===void 0)h++;v=P+9}else{if(h--,h===0){x=R;break}v=R+12}}if(x===-1)continue;let C=e.slice(y,x),A=e.slice(m,x+12);r.push({fullMatch:A,options:g,content:C,index:m}),l.lastIndex=x+12}for(let{fullMatch:m,options:p,content:g,index:y}of r)try{let h={};if(p)p.split(",").forEach((C)=>{let A=C.trim();if(A)h[A]=!0});let v={gfm:h.gfm??!0,breaks:h.breaks??!1},x=pt(g.trim(),v);o=o.split(m).join(x)}catch(h){let v=h instanceof Error?h.message:String(h),x=b("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,m);o=o.split(m).join(x)}return o}async function je(e,t,i,o){let r={gfm:!0,breaks:!1};return t.forEach((l)=>{let d=l.trim().replace(/['"]/g,"");if(d==="breaks")r.breaks=!0;if(d==="no-gfm")r.gfm=!1}),pt(e.trim(),r)}var te=[320,480,640,768,1024,1280,1536,1920,2560],ht=[1,1.5,2,3],ne=["avif","webp","jpeg"],yt={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function fe(e,t=te,i={},o){return t.sort((r,l)=>r-l).map((r)=>`${se(e,{...i,w:r,fm:o})} ${r}w`).join(", ")}function Ne(e,t,i=ht,o={},r){return i.sort((l,d)=>l-d).map((l)=>{let d=Math.round(t*l);return`${se(e,{...o,w:d,dpr:l,fm:r})} ${l}x`}).join(", ")}function he(e,t="100vw"){if(!e||Object.keys(e).length===0)return t;let o=Object.entries(e).map(([r,l])=>{let d=/^\d+$/.test(r)?`${r}px`:r;return{bp:d,size:l,numericBp:Number.parseInt(d)||0}}).sort((r,l)=>r.numericBp-l.numericBp).map(({bp:r,size:l})=>`(max-width: ${r}) ${l}`);return o.push(t),o.join(", ")}function se(e,t={}){let i=Object.entries(t).filter(([,l])=>l!==void 0&&l!==null).map(([l,d])=>{if(Array.isArray(d))return[l,d.join(",")];return[l,String(d)]});if(i.length===0)return e;let o=i.map(([l,d])=>`${l}=${encodeURIComponent(d)}`).join("&"),r=e.includes("?")?"&":"?";return`${e}${r}${o}`}function ye(e){return yt[e]||"application/octet-stream"}var vt={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},be=`
|
|
641
641
|
.stx-img-placeholder {
|
|
642
642
|
position: relative;
|
|
@@ -683,7 +683,7 @@ ${A}
|
|
|
683
683
|
#${e}.stx-img-loaded img {
|
|
684
684
|
opacity: 1;
|
|
685
685
|
}
|
|
686
|
-
`.trim()}var ve=new Map;async function ze(e,t={}){let i=`${e}:${JSON.stringify(t)}`;if(ve.has(i))return ve.get(i);let o=await xt(e,t);return ve.set(i,o),o}async function St(){try{return await import("./chunk-
|
|
686
|
+
`.trim()}var ve=new Map;async function ze(e,t={}){let i=`${e}:${JSON.stringify(t)}`;if(ve.has(i))return ve.get(i);let o=await xt(e,t);return ve.set(i,o),o}async function St(){try{return await import("./chunk-76mn123c.js")}catch(e){if(!Le)console.warn("[stx-media] Image processor not available, some features disabled:",e),Le=!0;return null}}var Le=!1,xe=80,de="async",ue="lazy",We=!1;async function ce(e,t={}){let i=t,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return kt(o,i)}if(i.processedResult?.processed)return Se(e,i.processedResult,t);if(i.responsiveVariants)return qe(e,i.responsiveVariants,t);let{src:r,alt:l,width:d,height:m,sizes:p,widths:g=te,dpr:y,formats:h=ne,quality:v=xe,params:x={},placeholder:C="none",placeholderOptions:A={},lazy:P=!0,priority:R=!1,loading:_=R?"eager":ue,decoding:I=de,fetchpriority:T,objectFit:k,objectPosition:D,crossorigin:S,referrerpolicy:M}=e,{class:F,style:N,id:V}=e,E=e.data||{},{isDev:L=!1,baseUrl:X=""}=t;if(L&&!t.optimize)return Pt(e);let H,O,B=V||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(C!=="none"&&!R)try{H=await ze(r,{strategy:C,...A}),O=Ve(B,H,A)}catch{}let oe=y!==void 0&&d!==void 0,ee;if(oe)ee=Dt(e,B,H,t);else ee=await Ct(e,B,H,t);let re;if(R){let ke=h.includes("webp")?"webp":h[0],nt=fe(r,g,{...x,q:v},ke),st=typeof p==="object"?he(p):p||"100vw";re=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${st}" />`}let le=[];if(!We&&C!=="none")le.push(be),We=!0;if(O)le.push(O);let rt=P?He(B):void 0;return{html:ee,preloadLink:re,css:le.length>0?le.join(`
|
|
687
687
|
`):void 0,script:rt}}async function Ct(e,t,i,o){let{src:r,alt:l,width:d,height:m,sizes:p,widths:g=te,formats:y=ne,quality:h=xe,params:v={},lazy:x=!0,priority:C=!1,loading:A=C?"eager":ue,decoding:P=de,fetchpriority:R,objectFit:_,objectPosition:I,crossorigin:T,referrerpolicy:k}=e,{class:D,style:S}=e,M=e.data||{},F=typeof p==="object"?he(p):p||"100vw",N=[];for(let L of y){let X=fe(r,g,{...v,q:h},L),H=ye(L);if(x&&!C)N.push(` <source type="${H}" data-srcset="${X}" data-sizes="${F}" />`);else N.push(` <source type="${H}" srcset="${X}" sizes="${F}" />`)}let V=we({src:se(r,{...v,q:h}),alt:l,width:d,height:m,loading:C?void 0:A,decoding:P,fetchpriority:C?"high":R,objectFit:_,objectPosition:I,crossorigin:T,referrerpolicy:k,className:Fe(D,i),style:$e(S,_,I,i),lazy:x&&!C,data:M}),E;if(i){let L=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;E=`<div id="${t}" class="stx-img-placeholder" style="${L}">
|
|
688
688
|
<picture>
|
|
689
689
|
${N.join(`
|
|
@@ -747,7 +747,7 @@ ${k.join(`
|
|
|
747
747
|
`):void 0,script:X}}async function qe(e,t,i){let o={src:t.src,processed:!0,variants:[],placeholder:t.placeholder?.dataURL,originalWidth:t.placeholder?.width,originalHeight:t.placeholder?.height};for(let[r,l]of Object.entries(t.byFormat))if(l)o.variants.push(...l);return Se(e,o,i)}function At(){return Mt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,t,i,o)=>{let{src:r,alt:l,options:d}=_t(e,t,i);if(!r)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let m={src:r,alt:l||"",widths:d.widths||te,formats:d.formats||ne,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},p=i.__isDev||!1,g=await ce(m,{isDev:p}),y=g.html;if(g.preloadLink)y=g.preloadLink+`
|
|
748
748
|
`+y;if(g.css)y+=`
|
|
749
749
|
<style>${g.css}</style>`;if(g.script)y+=`
|
|
750
|
-
<script>${g.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function _t(e,t,i){if(t.src)return{src:String(t.src),alt:String(t.alt||""),options:t.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let r=Rt(o),l=Ce(r[0],i)||"",d=Ce(r[1],i)||"",m={};if(r[2]){let p=Ce(r[2],i);if(typeof p==="object"&&p!==null)m=p;else if(typeof r[2]==="string")try{m=JSON.parse(r[2])}catch{}}return{src:l,alt:d,options:m}}function Rt(e){let t=[],i="",o=!1,r="",l=0,d=0;for(let m=0;m<e.length;m++){let p=e[m],g=m>0?e[m-1]:"";if((p==='"'||p==="'"||p==="`")&&g!=="\\"){if(!o)o=!0,r=p;else if(p===r)o=!1,r="";else i+=p;continue}if(!o){if(p==="{")l++;if(p==="}")l--;if(p==="[")d++;if(p==="]")d--;if(p===","&&l===0&&d===0){t.push(i.trim()),i="";continue}}i+=p}if(i.trim())t.push(i.trim());return t}function Ce(e,t){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=t[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Ue=At();import{existsSync as Et}from"fs";import ie from"path";function Fs(){let e=[ie.join(import.meta.dir,"primitives"),ie.join(import.meta.dir,"..","primitives"),ie.join(import.meta.dir,"native","primitives"),ie.join(import.meta.dir,"..","native","primitives")];for(let t of e)if(Et(ie.join(t,"View.stx")))return t;return e[0]}async function Je(){try{return await import("./chunk-
|
|
750
|
+
<script>${g.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function _t(e,t,i){if(t.src)return{src:String(t.src),alt:String(t.alt||""),options:t.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let r=Rt(o),l=Ce(r[0],i)||"",d=Ce(r[1],i)||"",m={};if(r[2]){let p=Ce(r[2],i);if(typeof p==="object"&&p!==null)m=p;else if(typeof r[2]==="string")try{m=JSON.parse(r[2])}catch{}}return{src:l,alt:d,options:m}}function Rt(e){let t=[],i="",o=!1,r="",l=0,d=0;for(let m=0;m<e.length;m++){let p=e[m],g=m>0?e[m-1]:"";if((p==='"'||p==="'"||p==="`")&&g!=="\\"){if(!o)o=!0,r=p;else if(p===r)o=!1,r="";else i+=p;continue}if(!o){if(p==="{")l++;if(p==="}")l--;if(p==="[")d++;if(p==="]")d--;if(p===","&&l===0&&d===0){t.push(i.trim()),i="";continue}}i+=p}if(i.trim())t.push(i.trim());return t}function Ce(e,t){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=t[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Ue=At();import{existsSync as Et}from"fs";import ie from"path";function Fs(){let e=[ie.join(import.meta.dir,"primitives"),ie.join(import.meta.dir,"..","primitives"),ie.join(import.meta.dir,"native","primitives"),ie.join(import.meta.dir,"..","native","primitives")];for(let t of e)if(Et(ie.join(t,"View.stx")))return t;return e[0]}async function Je(){try{return await import("./chunk-hxftzw0x.js")}catch(e){if(!Be)console.warn("[stx-media] Video processor not available, some features disabled:",e),Be=!0;return null}}var Be=!1,Ke=!0,Ge="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function pe(e,t={}){let i=t,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return Vt(o,i)}if(i.processedResult?.processed)return Xe(e,i.processedResult,t);let r;if(o.generatePoster&&o.src&&!e.poster)r=await zt(o,i);let{src:l,sources:d=[],poster:m,posterPlaceholder:p,controls:g=Ke,autoplay:y=!1,muted:h=!1,loop:v=!1,preload:x=Ge,playsinline:C=!0,lazy:A=!0,player:P="native",type:R,width:_,height:I,crossorigin:T,disablePictureInPicture:k=!1,disableRemotePlayback:D=!1}=e,S=r||m,{class:M,style:F}=e,N=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(P==="ts-video")return Tt(e,t);if(R&&R!=="video")return It(l||"",R,e);let V=d.length>0?d:l?[{src:l,type:Ye(l)}]:[],E=[`id="${N}"`];if(g)E.push("controls");if(y)E.push("autoplay");if(h)E.push("muted");if(v)E.push("loop");if(C)E.push("playsinline");if(k)E.push("disablepictureinpicture");if(D)E.push("disableremoteplayback");if(T)E.push(`crossorigin="${T}"`);if(A){if(E.push(`data-preload="${x}"`),E.push('preload="none"'),S)E.push(`data-poster="${W(S)}"`);E.push("data-stx-lazy")}else if(E.push(`preload="${x}"`),S)E.push(`poster="${W(S)}"`);if(_)E.push(`width="${_}"`);if(I)E.push(`height="${I}"`);if(M)E.push(`class="${W(M)}"`);if(F)E.push(`style="${W(F)}"`);let L=V.map((O)=>` <source ${A?`data-src="${W(O.src)}"`:`src="${W(O.src)}"`} type="${O.type}"${O.media?` media="${O.media}"`:""} />`).join(`
|
|
751
751
|
`),X=`<video ${E.join(" ")}>
|
|
752
752
|
${L}
|
|
753
753
|
Your browser does not support the video tag.
|
|
@@ -1306,6 +1306,6 @@ ${y}
|
|
|
1306
1306
|
customElements.define('${t}', ${d});
|
|
1307
1307
|
`}async function et(e,t,i,o){if(t.length<1)return u("WebComponent","@webcomponent directive requires at least the tag name parameter",n.INVALID_DIRECTIVE_SYNTAX);let r=t[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",m=U.isAbsolute(d)?[U.join(d,`${r}.stx`),U.join(U.dirname(o),`${r}.stx`)]:[U.join(U.dirname(o),d,`${r}.stx`),U.join(process.cwd(),d,`${r}.stx`),U.join(U.dirname(o),`${r}.stx`)],p=null;for(let h of m)if(await s(h)){p=await Bun.file(h).text();break}if(!p)return u("WebComponent",`Component file not found: ${r}.stx`,n.FILE_NOT_FOUND);let g=Bt(p,r);return`<script type="module">
|
|
1308
1308
|
${Jt(g)}
|
|
1309
|
-
</script>`}var q={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:En,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:je,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:et,hasEndTag:!1,description:"Include a web component in the template"},Gc,Jc,Vs,Ws,Ae,Re,Ee,_e,Oe,Te,Ue,De,...Co],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Gt(e,t,i){let o=t||"pages";if(e)return{root:e,pagesDir:o};let r=i||process.cwd(),l=z.join(r,"resources","views"),d=z.join(r,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=z.join(r,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,ge=["partialsDir","componentsDir","layoutsDir"],Pe=new WeakMap;function Yt(e,t){let i=t.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/");return o===r||o.startsWith(`${r}/`)}function Sg(e,t){let i=!e.root,o=Gt(e.root,e.pagesDir,t);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let r=`${t}::${o.root}`;if(!tt.has(r))tt.add(r),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Pe.has(e)){let r={};for(let l of ge){let d=e[l];if(typeof d==="string"&&d)r[l]=d}Pe.set(e,r)}if(e.root&&e.root!=="."){let r=e.root;for(let l of ge){let d=e[l];if(typeof d!=="string"||!d)continue;if(z.isAbsolute(d)||Yt(d,r))continue;e[l]=z.join(r,d)}}for(let r of ge){let l=e[r];if(typeof l!=="string"||!l||z.isAbsolute(l))continue;e[r]=z.resolve(t,l)}return e}function Xt(e,t){let i=Pe.get(e);for(let o of ge){let r=e[o];if(typeof r!=="string"||!r)continue;let l=z.isAbsolute(r)?r:z.join(t,r);if(Q.existsSync(l))continue;let d=i?.[o]??r,m=e.root,p=!!m&&m!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(p?`, resolved under root "${m}".`:"."))}}function Zt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Qt(e){if(sl(e.stateDir),e.stateDir=Ir(),e.cachePath=Or(e.cachePath),e.build)e.build.cacheDir=Or(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=Or(e.media.cache.directory);if(e.story)e.story.outDir=Or(e.story.outDir)}var Y=null,Z=new Map,me=new Map,ae=null;async function vi(e,t=Kt){try{return await t(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var er=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Wc(e,t){let i=w.resolve(e,{paths:[t]});if(er.test(i))throw Error(`${e} is not installed in ${t} (found only in Bun's install cache)`);return i}async function a(e){let t=e?z.resolve(e):process.cwd(),i=me.get(t);if(i&&i.signature!==Hs(i.graph)){let l=Z.get(t);if(Z.delete(t),me.delete(t),!e)Y=null,ae=null;let{clearComponentCache:d}=await import("./chunk-9y4gz22m.js"),{partialsCache:m}=await import("./chunk-vmn8vpp8.js");if(d(),m.clear(),l&&i.configSignature===Us(i.graph)){let p=l.then(async(g)=>{let y={...i.graph};await Si(y,t),me.set(t,{graph:y,signature:Hs(y),configSignature:Us(y)});let h={...g,_layerGraph:y};if(!e)Y=h;return h});return Z.set(t,p),p}}if(!e){if(Y)return Y;if(ae)return ae}let o=Z.get(t);if(o)return o;let r=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(z.join(t,`stx.config${v}`))),m=l.some((v)=>Q.existsSync(z.join(t,"config",`ui${v}`))),p;if(d&&m){let v=await vi({name:"ui",cwd:z.join(t,"config"),defaultConfig:q,errorPolicy:"throw",verbose:!1});p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:q,errorPolicy:"throw",verbose:!1})).config;if(p.extends!==void 0||i){let v=await Zc(t,q);p=v.config,me.set(t,{graph:v.graph,signature:Hs(v.graph),configSignature:Us(v.graph)})}if(p.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-43kz6rx9.js");v(p.runtimeConfig,{});let{generateRuntimeConfigTypes:x}=await import("./chunk-2gwgcybp.js");await x(t,p.runtimeConfig)}Zt(p),Qt(p),Sg(p,t),Xt(p,t);let g=[],y=new Set((p.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of p.componentPackages??["@stacksjs/components"]){let x=`${v}/stx-plugin`;if(y.has(x)||y.has(v))continue;try{Wc(x,t),g.push(x)}catch{}}let h=[...p.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-cqq68aw8.js"),x=[],C=[],A=new Set(p.componentPackages??["@stacksjs/components"]),P=[];for(let R of h){let _=typeof R==="string"?R:R[0],I=typeof R==="string"?{}:R[1]||{};try{let T,k;try{let S=Wc(_,t);T=await import(S),k=z.dirname(S)}catch{let S=z.resolve(t,_);T=await import(S),k=z.dirname(S)}let D=T.default||T;if(!v.has(D.name))await v.register(D,p);if(D.components){let S=Array.isArray(D.components)?D.components:[D.components],M=A.has(D.name)||A.has(_)||A.has(_.replace(/\/stx-plugin$/,""));for(let F of S){let N=z.resolve(k,F);x.push(N);let V=M;if(!V){let E=Oi(z.join(N,"package.json"));if(E)try{let L=JSON.parse(Q.readFileSync(z.join(E,"package.json"),"utf8"));V=typeof L.name==="string"&&A.has(L.name)}catch{}}if(V)C.push(N)}}if(D.pages){let S=z.resolve(k,D.pages),M=I.path||"/";P.push({dir:S,prefix:M})}if(D.setup){let S={addDirective:(M)=>{p.customDirectives=p.customDirectives||[],p.customDirectives.push(M)},addRoute:(M,F)=>{p.apiRoutes=p.apiRoutes||{},p.apiRoutes[M]=F},addMiddleware:(M)=>{p.middleware=p.middleware||[],p.middleware.push(M)},pluginDir:k,config:p};await D.setup(I,S)}process.stderr.write(`[stx] Plugin loaded: ${D.name||_}
|
|
1310
|
-
`)}catch(T){console.warn(`[stx] Failed to load plugin ${_}:`,T.message)}}p._pluginComponentDirs=x,p._componentPackageDirs=C,p._pluginPageDirs=P}if(p.nativePrimitives!==!1)p._nativePrimitivesFallback={dir:Fs(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return p})();if(Z.set(t,r),r.catch(()=>{if(Z.get(t)===r)Z.delete(t)}),!e)ae=r,r.then((l)=>{Y=l}).catch(()=>{});return r}var j=new Proxy(q,{get(e,t){if(Y&&t in Y)return Y[t];if(!ae)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[t]}});function
|
|
1311
|
-
export{
|
|
1309
|
+
</script>`}var q={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:En,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:je,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:et,hasEndTag:!1,description:"Include a web component in the template"},Yc,Zc,Vs,Ws,Ae,Re,Ee,_e,Oe,Te,Ue,De,...Co],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Gt(e,t,i){let o=t||"pages";if(e)return{root:e,pagesDir:o};let r=i||process.cwd(),l=z.join(r,"resources","views"),d=z.join(r,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=z.join(r,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,ge=["partialsDir","componentsDir","layoutsDir"],Pe=new WeakMap;function Yt(e,t){let i=t.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/");return o===r||o.startsWith(`${r}/`)}function _g(e,t){let i=!e.root,o=Gt(e.root,e.pagesDir,t);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let r=`${t}::${o.root}`;if(!tt.has(r))tt.add(r),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Pe.has(e)){let r={};for(let l of ge){let d=e[l];if(typeof d==="string"&&d)r[l]=d}Pe.set(e,r)}if(e.root&&e.root!=="."){let r=e.root;for(let l of ge){let d=e[l];if(typeof d!=="string"||!d)continue;if(z.isAbsolute(d)||Yt(d,r))continue;e[l]=z.join(r,d)}}for(let r of ge){let l=e[r];if(typeof l!=="string"||!l||z.isAbsolute(l))continue;e[r]=z.resolve(t,l)}return e}function Xt(e,t){let i=Pe.get(e);for(let o of ge){let r=e[o];if(typeof r!=="string"||!r)continue;let l=z.isAbsolute(r)?r:z.join(t,r);if(Q.existsSync(l))continue;let d=i?.[o]??r,m=e.root,p=!!m&&m!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(p?`, resolved under root "${m}".`:"."))}}function Zt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Qt(e){if(il(e.stateDir),e.stateDir=Ir(),e.cachePath=Or(e.cachePath),e.build)e.build.cacheDir=Or(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=Or(e.media.cache.directory);if(e.story)e.story.outDir=Or(e.story.outDir)}var Y=null,Z=new Map,me=new Map,ae=null;async function vi(e,t=Kt){try{return await t(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var er=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Kc(e,t){let i=w.resolve(e,{paths:[t]});if(er.test(i))throw Error(`${e} is not installed in ${t} (found only in Bun's install cache)`);return i}async function a(e){let t=e?z.resolve(e):process.cwd(),i=me.get(t);if(i&&i.signature!==Hs(i.graph)){let l=Z.get(t);if(Z.delete(t),me.delete(t),!e)Y=null,ae=null;let{clearComponentCache:d}=await import("./chunk-wcxa8xy2.js"),{partialsCache:m}=await import("./chunk-67yr4m5h.js");if(d(),m.clear(),l&&i.configSignature===Us(i.graph)){let p=l.then(async(g)=>{let y={...i.graph};await Si(y,t),me.set(t,{graph:y,signature:Hs(y),configSignature:Us(y)});let h={...g,_layerGraph:y};if(!e)Y=h;return h});return Z.set(t,p),p}}if(!e){if(Y)return Y;if(ae)return ae}let o=Z.get(t);if(o)return o;let r=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(z.join(t,`stx.config${v}`))),m=l.some((v)=>Q.existsSync(z.join(t,"config",`ui${v}`))),p;if(d&&m){let v=await vi({name:"ui",cwd:z.join(t,"config"),defaultConfig:q,errorPolicy:"throw",verbose:!1});p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:q,errorPolicy:"throw",verbose:!1})).config;if(p.extends!==void 0||i){let v=await el(t,q);p=v.config,me.set(t,{graph:v.graph,signature:Hs(v.graph),configSignature:Us(v.graph)})}if(p.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-43kz6rx9.js");v(p.runtimeConfig,{});let{generateRuntimeConfigTypes:x}=await import("./chunk-9kn81bmp.js");await x(t,p.runtimeConfig)}Zt(p),Qt(p),_g(p,t),Xt(p,t);let g=[],y=new Set((p.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of p.componentPackages??["@stacksjs/components"]){let x=`${v}/stx-plugin`;if(y.has(x)||y.has(v))continue;try{Kc(x,t),g.push(x)}catch{}}let h=[...p.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-8egbh6z1.js"),x=[],C=[],A=new Set(p.componentPackages??["@stacksjs/components"]),P=[];for(let R of h){let _=typeof R==="string"?R:R[0],I=typeof R==="string"?{}:R[1]||{};try{let T,k;try{let S=Kc(_,t);T=await import(S),k=z.dirname(S)}catch{let S=z.resolve(t,_);T=await import(S),k=z.dirname(S)}let D=T.default||T;if(!v.has(D.name))await v.register(D,p);if(D.components){let S=Array.isArray(D.components)?D.components:[D.components],M=A.has(D.name)||A.has(_)||A.has(_.replace(/\/stx-plugin$/,""));for(let F of S){let N=z.resolve(k,F);x.push(N);let V=M;if(!V){let E=Oi(z.join(N,"package.json"));if(E)try{let L=JSON.parse(Q.readFileSync(z.join(E,"package.json"),"utf8"));V=typeof L.name==="string"&&A.has(L.name)}catch{}}if(V)C.push(N)}}if(D.pages){let S=z.resolve(k,D.pages),M=I.path||"/";P.push({dir:S,prefix:M})}if(D.setup){let S={addDirective:(M)=>{p.customDirectives=p.customDirectives||[],p.customDirectives.push(M)},addRoute:(M,F)=>{p.apiRoutes=p.apiRoutes||{},p.apiRoutes[M]=F},addMiddleware:(M)=>{p.middleware=p.middleware||[],p.middleware.push(M)},pluginDir:k,config:p};await D.setup(I,S)}process.stderr.write(`[stx] Plugin loaded: ${D.name||_}
|
|
1310
|
+
`)}catch(T){console.warn(`[stx] Failed to load plugin ${_}:`,T.message)}}p._pluginComponentDirs=x,p._componentPackageDirs=C,p._pluginPageDirs=P}if(p.nativePrimitives!==!1)p._nativePrimitivesFallback={dir:Fs(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return p})();if(Z.set(t,r),r.catch(()=>{if(Z.get(t)===r)Z.delete(t)}),!e)ae=r,r.then((l)=>{Y=l}).catch(()=>{});return r}var j=new Proxy(q,{get(e,t){if(Y&&t in Y)return Y[t];if(!ae)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[t]}});function Ey(e){return e}function Ty(e){let t=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")t.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")t.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")t.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")t.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)t.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)t.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))t.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))t.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)t.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)t.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))t.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))t.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))t.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))t.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,r)=>{if(!o.name||typeof o.name!=="string")t.push({path:`customDirectives[${r}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")t.push({path:`customDirectives[${r}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))t.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,r)=>{if(!o.name||typeof o.name!=="string")t.push({path:`middleware[${r}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")t.push({path:`middleware[${r}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))t.push({path:`middleware[${r}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)t.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))t.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))t.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((r,l)=>{if(!r.pattern||typeof r.pattern!=="string")t.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(r.strategy))t.push({path:`pwa.routes[${l}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(r.maxAgeSeconds!==void 0&&(typeof r.maxAgeSeconds!=="number"||r.maxAgeSeconds<0))t.push({path:`pwa.routes[${l}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(r.maxEntries!==void 0&&(typeof r.maxEntries!=="number"||r.maxEntries<1))t.push({path:`pwa.routes[${l}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))t.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((r)=>typeof r!=="number"||r<16||r>1024).length>0)t.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((l)=>!o.includes(l)).length>0)t.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:t.length===0,errors:t,warnings:i}}
|
|
1311
|
+
export{Vc,Wc,$r,pt,qc,Fs,zs,q,_g,vi,Kc,a,j,Ey,Ty};
|
|
@@ -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 Ah(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 Ph(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 Ih(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 Oh(){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 Nh(){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 Mh(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{Ah,Ph,Ih,Oh,Nh,Mh};
|