@stacksjs/stx 0.2.706 → 0.2.708
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-shell.d.ts +2 -1
- package/dist/app-shell.js +5 -2
- package/dist/{chunk-e3yhx053.js → chunk-029qng4p.js} +5 -5
- package/dist/chunk-03p4w958.js +2 -0
- package/dist/chunk-0dve54ne.js +3 -0
- package/dist/chunk-0jtrdgyv.js +422 -0
- package/dist/{chunk-m4j9gedb.js → chunk-0myrwz84.js} +48 -8
- package/dist/chunk-12vjp2gr.js +2 -0
- package/dist/chunk-18fr730w.js +2 -0
- package/dist/chunk-19knw8c6.js +2 -0
- package/dist/{chunk-5bgkb4vm.js → chunk-1kwsnqr1.js} +3 -3
- package/dist/{chunk-n2ema4wf.js → chunk-1xjv71dw.js} +2 -2
- package/dist/chunk-27catnpa.js +2 -0
- package/dist/chunk-29sapda2.js +2 -0
- package/dist/{chunk-d597d0dp.js → chunk-2aarvd3a.js} +6 -6
- package/dist/chunk-2k6d8s6h.js +2 -0
- package/dist/chunk-2qf6kd9r.js +2 -0
- package/dist/chunk-2snfd93r.js +2 -0
- package/dist/chunk-2srb5f7t.js +2 -0
- package/dist/{chunk-y91rz3rq.js → chunk-3457kk19.js} +7 -7
- package/dist/chunk-3907sad1.js +2 -0
- package/dist/chunk-3nsdb1fg.js +2 -0
- package/dist/chunk-3qnke2jb.js +2 -0
- package/dist/chunk-3sg2ardr.js +2 -0
- package/dist/chunk-3t3p2c1t.js +65 -0
- package/dist/chunk-3vsnnr1b.js +2 -0
- package/dist/{chunk-3850m7ab.js → chunk-3wkgd883.js} +1 -1
- package/dist/{chunk-epnpst9q.js → chunk-3xmt01wr.js} +11 -11
- package/dist/{chunk-t27fecet.js → chunk-42w6snem.js} +4 -4
- package/dist/chunk-48936paw.js +2 -0
- package/dist/chunk-4c1fbthr.js +2 -0
- package/dist/{chunk-zggdhtmn.js → chunk-4ckxs446.js} +3 -3
- package/dist/chunk-4cs5t287.js +2 -0
- package/dist/chunk-4fxg20je.js +2 -0
- package/dist/chunk-58v34kba.js +2 -0
- package/dist/chunk-5n4qg8za.js +3 -0
- package/dist/{chunk-j9h41w8b.js → chunk-609pekf5.js} +2 -2
- package/dist/chunk-65fcex5r.js +42 -0
- package/dist/{chunk-1kr1mpft.js → chunk-67abad76.js} +1 -1
- package/dist/{chunk-7smgebdq.js → chunk-6cz1sbb1.js} +3 -3
- package/dist/{chunk-4sesw88b.js → chunk-6n11z33h.js} +5 -5
- package/dist/chunk-6ndeycxk.js +2 -0
- package/dist/{chunk-tp4eqfxq.js → chunk-6ts3sthp.js} +2 -2
- package/dist/chunk-75n3vbtk.js +2 -0
- package/dist/{chunk-8w4y3dx3.js → chunk-768evhvm.js} +2 -2
- package/dist/chunk-7dc3n69c.js +3 -0
- package/dist/{chunk-66cfnzem.js → chunk-7kaadsd1.js} +5 -5
- package/dist/{chunk-ccqe741j.js → chunk-83p5k4eb.js} +2 -2
- package/dist/chunk-86775qk0.js +2 -0
- package/dist/chunk-8c4zbq1k.js +2 -0
- package/dist/chunk-8s4rxgs8.js +2 -0
- package/dist/chunk-8t9em8md.js +2 -0
- package/dist/{chunk-vfjenjez.js → chunk-8v2vbc4y.js} +1 -1
- package/dist/chunk-8z469777.js +2 -0
- package/dist/{chunk-9p452mq6.js → chunk-90kfvtf6.js} +114 -114
- package/dist/{chunk-rcdjse0z.js → chunk-93y8zwcz.js} +5 -5
- package/dist/chunk-9736003n.js +2 -0
- package/dist/chunk-97r557ws.js +2 -0
- package/dist/chunk-9adx6f4k.js +3 -0
- package/dist/{chunk-5w1erc2m.js → chunk-9dg5ja4w.js} +1 -1
- package/dist/chunk-9nvywf05.js +3 -0
- package/dist/chunk-9wgvn5rn.js +24 -0
- package/dist/chunk-9whmbfwx.js +2 -0
- package/dist/{chunk-2e2qnce5.js → chunk-9xb33nz0.js} +2 -2
- package/dist/chunk-a32xsr61.js +11 -0
- package/dist/{chunk-3hxd5td3.js → chunk-am4wadh7.js} +2 -2
- package/dist/{chunk-wqe98032.js → chunk-an387127.js} +2 -2
- package/dist/{chunk-bsr9wnq4.js → chunk-ap30qs8p.js} +2 -2
- package/dist/chunk-avr65xra.js +2 -0
- package/dist/chunk-axwwhdtt.js +2 -0
- package/dist/chunk-b6318vv3.js +2 -0
- package/dist/{chunk-7kn0d1f1.js → chunk-b7j48bq9.js} +2 -2
- package/dist/chunk-bcr8sq50.js +2 -0
- package/dist/chunk-bhpsr1mt.js +20 -0
- package/dist/{chunk-3ja845kw.js → chunk-c2b5p621.js} +171 -171
- package/dist/{chunk-11mjqfde.js → chunk-c71f6mfr.js} +45 -45
- package/dist/chunk-ccty08sm.js +32 -0
- package/dist/chunk-cjx11tgd.js +2 -0
- package/dist/{chunk-njhd845r.js → chunk-ckrmrdjp.js} +5 -5
- package/dist/chunk-cqnpjdc9.js +2 -0
- package/dist/{chunk-k296qq0p.js → chunk-cwhzk2n3.js} +2 -2
- package/dist/{chunk-nv886zy6.js → chunk-d2xnkt8m.js} +10 -10
- package/dist/chunk-dedmk383.js +2 -0
- package/dist/chunk-dhdt7e54.js +2 -0
- package/dist/chunk-dxqvv686.js +3 -0
- package/dist/chunk-e5vsw0fw.js +4 -0
- package/dist/{chunk-qef5mz20.js → chunk-e8brwwp1.js} +105 -105
- package/dist/{chunk-b3sw5ykg.js → chunk-edka95zp.js} +3 -3
- package/dist/{chunk-y7xsjr28.js → chunk-erqsgfdj.js} +1 -1
- package/dist/chunk-eywx2f4h.js +2 -0
- package/dist/chunk-f6ybdjt0.js +14 -0
- package/dist/{chunk-0qtygx7m.js → chunk-f9b7847f.js} +4 -4
- package/dist/{chunk-44c1mbye.js → chunk-fcbd7kwj.js} +3 -3
- package/dist/chunk-fj3pct59.js +2 -0
- package/dist/chunk-fvk1xr5a.js +2 -0
- package/dist/{chunk-b2j7s1a2.js → chunk-g1tq4xdb.js} +2 -2
- package/dist/chunk-g6wd49b5.js +2 -0
- package/dist/chunk-gk0nq2ky.js +2 -0
- package/dist/{chunk-z9csfarm.js → chunk-gvs17jd0.js} +11 -11
- package/dist/chunk-h6pmg82p.js +4 -0
- package/dist/chunk-h8kbcz9t.js +2 -0
- package/dist/chunk-h9n71rdn.js +2 -0
- package/dist/{chunk-eb3xg8an.js → chunk-hb77kw66.js} +1 -1
- package/dist/{chunk-a8erwxng.js → chunk-hmkg3xy0.js} +3 -3
- package/dist/{chunk-yn9kvsk1.js → chunk-j2mpqa4p.js} +2 -2
- package/dist/chunk-j7gg6xrc.js +2 -0
- package/dist/{chunk-gp9k0t3g.js → chunk-jb5sftzz.js} +2 -2
- package/dist/{chunk-t8d33x9w.js → chunk-khrckvwn.js} +4 -4
- package/dist/{chunk-4x2gnvz1.js → chunk-kxf8z7vp.js} +2 -2
- package/dist/{chunk-ygtfjnqj.js → chunk-kxwfrdt3.js} +2 -2
- package/dist/{chunk-ah5ch04j.js → chunk-mr3r8crk.js} +2 -2
- package/dist/chunk-mzwa2478.js +2 -0
- package/dist/chunk-n6carvxa.js +2 -0
- package/dist/chunk-ncs2j5kc.js +3 -0
- package/dist/{chunk-b1a79hgk.js → chunk-nde9yj3n.js} +2 -2
- package/dist/{chunk-2gzrx4ma.js → chunk-p3dkhz9v.js} +56 -56
- package/dist/{chunk-3ys3sa08.js → chunk-qa9t9k6z.js} +1 -1
- package/dist/{chunk-p4czdmrr.js → chunk-qcw1neka.js} +2 -2
- package/dist/chunk-r5k21k3x.js +54 -0
- package/dist/chunk-r6bc2q44.js +2 -0
- package/dist/{chunk-sxf17xfc.js → chunk-rb2a1qxb.js} +6 -6
- package/dist/chunk-rdj74dqc.js +2 -0
- package/dist/chunk-rswg7xsg.js +18 -0
- package/dist/chunk-rtbkjq0y.js +2 -0
- package/dist/chunk-rwjgpmrw.js +2 -0
- package/dist/chunk-s1vj8gtz.js +21 -0
- package/dist/{chunk-416jy1m5.js → chunk-s9b6abkb.js} +2 -2
- package/dist/{chunk-2p34qf9c.js → chunk-stvw8y3c.js} +2 -2
- package/dist/chunk-sy1btryy.js +2 -0
- package/dist/chunk-sz0e6tpq.js +20 -0
- package/dist/{chunk-9ra3ne11.js → chunk-t63f15yh.js} +3 -3
- package/dist/{chunk-2v7t87n8.js → chunk-t6ayy0t5.js} +2 -2
- package/dist/chunk-t7mbaf69.js +2 -0
- package/dist/{chunk-x7rtrdqq.js → chunk-tvcr9sct.js} +3 -3
- package/dist/chunk-v5s6r2b3.js +130 -0
- package/dist/chunk-vqratjvb.js +33 -0
- package/dist/chunk-vstvadc2.js +12 -0
- package/dist/chunk-w2h6nn70.js +2 -0
- package/dist/chunk-w8yv9hnf.js +2 -0
- package/dist/{chunk-ktkmv1j8.js → chunk-wbfg7p3k.js} +4 -4
- package/dist/chunk-weaxr0qe.js +2 -0
- package/dist/{chunk-3392k9vm.js → chunk-wp6q0geg.js} +2 -2
- package/dist/{chunk-2nqt1m3m.js → chunk-wt18wv6x.js} +2 -2
- package/dist/{chunk-jkywbfb0.js → chunk-x2gxx8eg.js} +2 -2
- package/dist/chunk-xw8wwcr8.js +25 -0
- package/dist/{chunk-xc03cdet.js → chunk-xyyt8v1r.js} +28 -28
- package/dist/chunk-ykmcnk3x.js +2 -0
- package/dist/chunk-yw66yks2.js +43 -0
- package/dist/chunk-z05dbey1.js +2 -0
- package/dist/chunk-zaj3gzet.js +2 -0
- package/dist/{chunk-w7e28p74.js → chunk-zav8yrtp.js} +9 -9
- package/dist/{chunk-ywzh979k.js → chunk-zecgd1wz.js} +4 -4
- package/dist/{chunk-c3hr5mm2.js → chunk-zjaw79zp.js} +2 -2
- package/dist/chunk-zjcmybab.js +3 -0
- package/dist/{chunk-fgr56q3w.js → chunk-zjw6j2x0.js} +4 -4
- package/dist/{chunk-k7pmzreg.js → chunk-zn3c0ew5.js} +3 -3
- package/dist/chunk-ztckg7a3.js +2 -0
- package/dist/cli.js +46 -46
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/serve-app.js +1 -1
- package/dist/expressions.js +6 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/island-chunking.js +5 -1
- package/dist/native/accessibility.d.ts +2 -2
- package/dist/native/accessibility.js +5 -3
- package/dist/native/compiler/html-to-ir.js +1 -1
- package/dist/native/runtime/native-host.js +5 -5
- package/dist/page-head.d.ts +2 -0
- package/dist/page-head.js +35 -0
- package/dist/production-builder.js +1 -1
- package/dist/production-server.js +2 -2
- package/dist/pwa.js +3 -3
- package/dist/site-builder/i18n.js +1 -1
- package/dist/ssg.js +36 -36
- package/dist/template-compiler.js +2 -1
- package/dist/utils.js +41 -0
- package/package.json +5 -5
- package/dist/chunk-09801kkv.js +0 -2
- package/dist/chunk-0s55c880.js +0 -2
- package/dist/chunk-0ys97vq8.js +0 -2
- package/dist/chunk-13jg9qpq.js +0 -2
- package/dist/chunk-1e79xcc8.js +0 -2
- package/dist/chunk-1yt4ynxh.js +0 -2
- package/dist/chunk-2whqx2c0.js +0 -2
- package/dist/chunk-2xtzzx00.js +0 -2
- package/dist/chunk-4t9cggwf.js +0 -2
- package/dist/chunk-5g7m27e1.js +0 -21
- package/dist/chunk-5h1ahj7m.js +0 -2
- package/dist/chunk-5zqxzyxk.js +0 -2
- package/dist/chunk-68wezwr7.js +0 -2
- package/dist/chunk-7gw96jpj.js +0 -2
- package/dist/chunk-7w2mrg3s.js +0 -2
- package/dist/chunk-8hhyp9p6.js +0 -2
- package/dist/chunk-926fs6g7.js +0 -2
- package/dist/chunk-93ft5jea.js +0 -3
- package/dist/chunk-94gp1g2f.js +0 -2
- package/dist/chunk-983zpa57.js +0 -3
- package/dist/chunk-98yf0aq9.js +0 -4
- package/dist/chunk-9wq145yr.js +0 -2
- package/dist/chunk-a4r93m1q.js +0 -2
- package/dist/chunk-aea12k73.js +0 -2
- package/dist/chunk-b378jpbp.js +0 -2
- package/dist/chunk-b7e07ybq.js +0 -3
- package/dist/chunk-bfhks7zf.js +0 -43
- package/dist/chunk-bhnq6xr5.js +0 -2
- package/dist/chunk-bksjh409.js +0 -2
- package/dist/chunk-c4sskkv6.js +0 -421
- package/dist/chunk-ca0vn95n.js +0 -18
- package/dist/chunk-cbdyns7r.js +0 -3
- package/dist/chunk-cknbhyw6.js +0 -2
- package/dist/chunk-csx3zne1.js +0 -3
- package/dist/chunk-d7vmzkjy.js +0 -2
- package/dist/chunk-djwat8vn.js +0 -2
- package/dist/chunk-dm7am3p3.js +0 -2
- package/dist/chunk-dpjs0ajs.js +0 -2
- package/dist/chunk-e41h5yrz.js +0 -11
- package/dist/chunk-f498cdg5.js +0 -2
- package/dist/chunk-fazw6sxz.js +0 -2
- package/dist/chunk-ffddd2t8.js +0 -14
- package/dist/chunk-fk71r3h6.js +0 -2
- package/dist/chunk-g1bed7se.js +0 -2
- package/dist/chunk-gbgbhpms.js +0 -2
- package/dist/chunk-gxtmq5r2.js +0 -130
- package/dist/chunk-h1fpjmr8.js +0 -2
- package/dist/chunk-ha4vb9a6.js +0 -2
- package/dist/chunk-hadbgke6.js +0 -2
- package/dist/chunk-hkmewh5h.js +0 -12
- package/dist/chunk-hmnj2hrh.js +0 -20
- package/dist/chunk-htyee0b7.js +0 -3
- package/dist/chunk-hz5vabap.js +0 -25
- package/dist/chunk-j10dhha2.js +0 -2
- package/dist/chunk-kjc1f6af.js +0 -2
- package/dist/chunk-m28d7w2s.js +0 -54
- package/dist/chunk-mv4wfsc5.js +0 -2
- package/dist/chunk-mwwd425n.js +0 -33
- package/dist/chunk-nbzy9m6a.js +0 -2
- package/dist/chunk-nmcgyxcg.js +0 -2
- package/dist/chunk-p4e7x4f6.js +0 -2
- package/dist/chunk-p6sdrq1y.js +0 -2
- package/dist/chunk-p78v88ng.js +0 -65
- package/dist/chunk-pbtr7w5e.js +0 -2
- package/dist/chunk-q13cp39b.js +0 -42
- package/dist/chunk-qfk2gh5y.js +0 -20
- package/dist/chunk-qqj8n8s9.js +0 -4
- package/dist/chunk-qtr1660m.js +0 -2
- package/dist/chunk-r0nm6sz0.js +0 -2
- package/dist/chunk-rb8g9nnc.js +0 -2
- package/dist/chunk-rhm7wg6p.js +0 -2
- package/dist/chunk-tjf1eajh.js +0 -2
- package/dist/chunk-ttn2hvze.js +0 -24
- package/dist/chunk-w42v5j1j.js +0 -2
- package/dist/chunk-w9kak6aj.js +0 -2
- package/dist/chunk-wr6z8z70.js +0 -2
- package/dist/chunk-xy3p6d2m.js +0 -2
- package/dist/chunk-yfppczrm.js +0 -2
- package/dist/chunk-yhf7pj12.js +0 -2
- package/dist/chunk-ympp4tja.js +0 -2
- package/dist/chunk-yyx89zxs.js +0 -2
- package/dist/chunk-z00ysspf.js +0 -31
- package/dist/chunk-z0x54ynx.js +0 -3
- package/dist/chunk-za6teyn1.js +0 -2
- package/dist/chunk-zgyw04pj.js +0 -2
- package/dist/chunk-zmnqha0x.js +0 -2
- package/dist/chunk-zw924mfr.js +0 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,
|
|
2
|
+
import{t,c}from"./chunk-xyyt8v1r.js";import{r,hn,h}from"./chunk-0jtrdgyv.js";import{Qe}from"./chunk-0myrwz84.js";import{ds,ps}from"./chunk-3t3p2c1t.js";import{sc,Mo,ls,us}from"./chunk-zjw6j2x0.js";import{tc,nc}from"./chunk-hmkg3xy0.js";import{vt}from"./chunk-am4wadh7.js";import{an,uc,pr,fr}from"./chunk-5n4qg8za.js";import{g}from"./chunk-0dve54ne.js";import{Vs}from"./chunk-zjaw79zp.js";import Q from"fs";import N from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,s={}){let{duration:i,delay:o,ease:n,direction:l,custom:d}={...B,...s};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
|
-
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${
|
|
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; } }
|
|
6
|
-
@keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }`;case"scale":return`${
|
|
6
|
+
@keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }`;case"scale":return`${l==="in"?"transform: scale(0.95); opacity: 0; animation: scaleIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: scale(1); opacity: 1; animation: scaleOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: scale(1); 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);"}
|
|
7
7
|
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
|
|
8
|
-
@keyframes scaleOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.95); opacity: 0; } }`;case"flip":return`${
|
|
8
|
+
@keyframes scaleOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.95); opacity: 0; } }`;case"flip":return`${l==="in"?"transform: perspective(400px) rotateX(-90deg); opacity: 0; animation: flipIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: perspective(400px) rotateX(0); opacity: 1; animation: flipOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: perspective(400px) rotateX(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);"}
|
|
9
9
|
@keyframes flipIn { from { transform: perspective(400px) rotateX(-90deg); opacity: 0; } to { transform: perspective(400px) rotateX(0); opacity: 1; } }
|
|
10
|
-
@keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${
|
|
10
|
+
@keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${l==="in"?"transform: rotate(-90deg); opacity: 0; animation: rotateIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: rotate(0); opacity: 1; animation: rotateOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: rotate(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);"}
|
|
11
11
|
@keyframes rotateIn { from { transform: rotate(-90deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
|
|
12
12
|
@keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function it(){return`
|
|
13
13
|
<script data-stx-scoped data-stx-run="once">
|
|
@@ -37,7 +37,7 @@ else {
|
|
|
37
37
|
});
|
|
38
38
|
})();
|
|
39
39
|
</script>
|
|
40
|
-
`}function at(e){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((
|
|
40
|
+
`}function at(e){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((i)=>i.test(e))}function ot(e=0.1,s="0px"){return`
|
|
41
41
|
<script data-stx-scoped data-stx-run="always">
|
|
42
42
|
// Intersection Observer for scroll animations
|
|
43
43
|
(function() {
|
|
@@ -52,7 +52,7 @@ else {
|
|
|
52
52
|
// Create the observer
|
|
53
53
|
const options = {
|
|
54
54
|
root: null, // Use viewport
|
|
55
|
-
rootMargin: '${
|
|
55
|
+
rootMargin: '${s}',
|
|
56
56
|
threshold: ${e}
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -195,13 +195,13 @@ else {
|
|
|
195
195
|
transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
|
|
196
196
|
}
|
|
197
197
|
</style>
|
|
198
|
-
`}function ct(e,
|
|
198
|
+
`}function ct(e,s,i={}){let{staggerDelay:o=50,sequence:n=!1}=i;return`
|
|
199
199
|
<script data-stx-scoped data-stx-run="always">
|
|
200
200
|
// Animation Group: ${e}
|
|
201
201
|
(function() {
|
|
202
|
-
const elements = ${JSON.stringify(
|
|
203
|
-
const staggerDelay = ${
|
|
204
|
-
const sequence = ${
|
|
202
|
+
const elements = ${JSON.stringify(s)};
|
|
203
|
+
const staggerDelay = ${o};
|
|
204
|
+
const sequence = ${n};
|
|
205
205
|
|
|
206
206
|
function animateGroup() {
|
|
207
207
|
elements.forEach((selector, index) => {
|
|
@@ -232,18 +232,18 @@ else {
|
|
|
232
232
|
}
|
|
233
233
|
})();
|
|
234
234
|
</script>
|
|
235
|
-
`}var De={name:"transition",handler:(e,
|
|
236
|
-
style="--stx-transition-duration: ${
|
|
237
|
-
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ae={name:"motion",handler:(e,
|
|
238
|
-
</head>`)}if(
|
|
239
|
-
`+
|
|
235
|
+
`}var De={name:"transition",handler:(e,s,i,o)=>{if(s.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let n=s[0],l=s.length>1?Number.parseInt(s[1],10)||B.duration:B.duration,d=s.length>2?s[2]||B.ease:B.ease,p=s.length>3?Number.parseInt(s[3],10)||B.delay:B.delay,u=s.length>4?s[4]||B.direction:B.direction,m=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=nt(n,{duration:l,delay:p,ease:d,direction:u}),f="stx-transition",v="";if(n==="fade")v="stx-fade";else if(n==="slide")v="stx-slide";else if(n==="scale")v="stx-scale";else if(n==="flip")v="stx-flip";else if(n==="rotate")v="stx-rotate";return`<div id="${m}" class="${f} ${v} ${u==="out"?"stx-out":""}"
|
|
236
|
+
style="--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},Pe={name:"scrollAnimate",handler:(e,s,i,o)=>{if(s.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let n=s[0],l=s.length>1?Number.parseInt(s[1],10)||300:300,d=s.length>2?s[2]||"ease":"ease",p=s.length>3?Number.parseFloat(s[3])||0.2:0.2,u=s.length>4?Number.parseInt(s[4],10)||0:0,m=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,f="stx-transition stx-observe stx-out";if(n==="fade")f+=" stx-fade";else if(n==="slide-up"||n==="slide")f+=" stx-from-bottom";else if(n==="slide-down")f+=" stx-from-top";else if(n==="slide-left")f+=" stx-from-right";else if(n==="slide-right")f+=" stx-from-left";else if(n==="scale")f+=" stx-scale";else if(n.includes("-"))f+=` stx-${n}`;else f+=` stx-${n}`;return`<div id="${m}" class="${f}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},ke={name:"animationGroup",handler:(e,s,i,o)=>{if(s.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let n=s[0],l=s.slice(1).map((m)=>m.startsWith("#")||m.startsWith(".")?m:`#${m}`),d=i.staggerDelay||50,p=i.sequence||!0,u=ct(n,l,{staggerDelay:d,sequence:p});return`${e}
|
|
237
|
+
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ae={name:"motion",handler:(e,s,i,o)=>{let n=s.length>0?s[0].toLowerCase()==="true":!0,l=it();return`<div data-animate="${n?"auto":"true"}">${e}</div>${l}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function Xa(e,s,i,o){let n=e;if(o.animation?.enabled===!1)return n;let l=i.includes("test")&&i.includes("animation");if(!at(n)&&!l)return n;if(!n.includes('<style id="stx-animation-base">')){let p=lt();n=n.replace("</head>",`${p}
|
|
238
|
+
</head>`)}if(n.includes("stx-observe")){if(!n.includes("Intersection Observer for scroll animations")){let u=ot(),m=n.lastIndexOf("</body>");if(m!==-1)n=n.slice(0,m)+u+`
|
|
239
|
+
`+n.slice(m)}}return n}async function dt(e,s,i,o){let n=s[0]?.replace(/['"]/g,"")||"main",l=Qe();if(n!=="main")l=l.replace("container:'main'",`container:'${n}'`);return`<script data-stx-router>${l}</script>`}var _e={name:"stxRouter",handler:dt,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var ut={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 Re(e){let s=e.heatmap;if(!s?.enabled)return"";let i={...ut,...s};return`
|
|
240
240
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
241
241
|
<script>
|
|
242
242
|
(function() {
|
|
243
243
|
'use strict';
|
|
244
244
|
|
|
245
245
|
// Configuration
|
|
246
|
-
var config = ${JSON.stringify({trackMouse:
|
|
246
|
+
var config = ${JSON.stringify({trackMouse:i.trackMouse,trackClicks:i.trackClicks,trackScroll:i.trackScroll,samplingRate:i.samplingRate,honorDnt:i.honorDnt,endpoint:i.endpoint,batchSize:i.batchSize,maxDataPoints:i.maxDataPoints,sessionTimeout:i.sessionTimeout,persistData:i.persistData,storagePrefix:i.storagePrefix,captureAttributes:i.captureAttributes,ignoreSelectors:i.ignoreSelectors,zones:i.zones,debugOverlay:i.debugOverlay,minViewportWidth:i.minViewportWidth,maxViewportWidth:i.maxViewportWidth})};
|
|
247
247
|
|
|
248
248
|
// Check Do Not Track
|
|
249
249
|
if (config.honorDnt && navigator.doNotTrack === '1') {
|
|
@@ -619,26 +619,26 @@ else {
|
|
|
619
619
|
};
|
|
620
620
|
})();
|
|
621
621
|
</script>
|
|
622
|
-
`}function
|
|
623
|
-
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let
|
|
624
|
-
`),
|
|
625
|
-
`).map((S)=>`<tr>${S.split("|").map((
|
|
622
|
+
`}function Ja(e,s){let i=Re(s);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Oe={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,s,i,o)=>{let n=i.__stx_config||{};if(s.length>0){let l=pt(s.join(" "));n.heatmap={...n.heatmap,...l,enabled:!0}}return Re(n)}};function pt(e){let s={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[n,l]=o.split("="),d=l?.replace(/["']/g,"");switch(n){case"endpoint":s.endpoint=d;break;case"samplingRate":s.samplingRate=Number.parseInt(d,10);break;case"batchSize":s.batchSize=Number.parseInt(d,10);break;case"trackMouse":s.trackMouse=d==="true";break;case"trackClicks":s.trackClicks=d==="true";break;case"trackScroll":s.trackScroll=d==="true";break;case"honorDnt":s.honorDnt=d==="true";break;case"debugOverlay":s.debugOverlay=d==="true";break}}return s}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ee(e){let s=e.trim().toLowerCase();return!s.startsWith("javascript:")&&!s.startsWith("vbscript:")&&!s.startsWith("data:text/html")}function cr(e){let s=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(s);if(!i)return{data:{},content:e.trim()};let o=i[1],n=e.slice(i[0].length),l={};for(let d of o.split(`
|
|
623
|
+
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let m=p.slice(0,u).trim(),y=p.slice(u+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[m]=y}return{data:l,content:n.trim()}}function Ye(e,s={}){let{gfm:i=!0,breaks:o=!1}=s,n=e,l=[];if(n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=l.length,x=f?` class="language-${J(f)}"`:"";return l.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),n=n.replace(/`([^`]*)`/g,(y,f)=>`<code>${J(f)}</code>`),n=n.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),n=n.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),n=n.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),n=n.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),n=n.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),n=n.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),n=n.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),n=n.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),n=n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),n=n.replace(/__(.+?)__/g,"<strong>$1</strong>"),n=n.replace(/\*(.+?)\*/g,"<em>$1</em>"),n=n.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)n=n.replace(/~~(.+?)~~/g,"<del>$1</del>");if(n=n.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,f,v)=>`<img src="${Ee(v)?J(v):""}" alt="${J(f)}" />`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ee(v)?J(v):""}">${f}</a>`),n=n.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),n=n.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),n=n.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
624
|
+
`),n=n.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),n=n.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),n=n.replace(/<\/ul>\n<ul>/g,""),n=n.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),n=n.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),n=n.replace(/<\/ol>\n<ol>/g,""),n=n.replace(/<li data-ul>/g,"<li>"),n=n.replace(/<li data-ol>/g,"<li>"),i)n=n.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,f,v)=>{let x=`<tr>${f.split("|").map((S)=>S.trim()).filter(Boolean).map((S)=>`<th>${J(S)}</th>`).join("")}</tr>`,k=v.trim().split(`
|
|
625
|
+
`).map((S)=>`<tr>${S.split("|").map((A)=>A.trim()).filter(Boolean).map((A)=>`<td>${J(A)}</td>`).join("")}</tr>`).join(`
|
|
626
626
|
`);return`<table>
|
|
627
627
|
<thead>
|
|
628
628
|
${x}
|
|
629
629
|
</thead>
|
|
630
630
|
<tbody>
|
|
631
|
-
${
|
|
631
|
+
${k}
|
|
632
632
|
</tbody>
|
|
633
|
-
</table>`});if(
|
|
634
|
-
`),p=[],u=!1,
|
|
633
|
+
</table>`});if(i)n=n.replace(/<li>\s*\[\s*\]\s*/g,'<li><input type="checkbox" disabled /> '),n=n.replace(/<li>\s*\[x\]\s*/gi,'<li><input type="checkbox" checked disabled /> ');let d=n.split(`
|
|
634
|
+
`),p=[],u=!1,m=[];for(let y of d){let f=y.trim();if(/^<(?:h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|th|td|hr|div|p)/.test(f)||/^\0CODEBLOCK\d+\0$/.test(f)||f===""){if(u&&m.length>0)p.push(`<p>${m.join(o?`<br />
|
|
635
635
|
`:`
|
|
636
|
-
`)}</p>`),
|
|
636
|
+
`)}</p>`),m=[],u=!1;p.push(y)}else u=!0,m.push(f)}if(u&&m.length>0)p.push(`<p>${m.join(o?`<br />
|
|
637
637
|
`:`
|
|
638
|
-
`)}</p>`);if(
|
|
639
|
-
`),
|
|
640
|
-
`);for(let y=0;y<
|
|
641
|
-
`||
|
|
638
|
+
`)}</p>`);if(n=p.join(`
|
|
639
|
+
`),o)n=n.replace(/\n/g,`<br />
|
|
640
|
+
`);for(let y=0;y<l.length;y++)n=n.replace(`\x00CODEBLOCK${y}\x00`,l[y]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function Ya(e,s,i=""){let o=e,n=[],l=/@markdown(?:\([^)]*\))?/g,d;while((d=l.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),m=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let S=e.indexOf("@markdown",v),_=e.indexOf("@endmarkdown",v);if(_===-1)break;if(S!==-1&&S<_&&S!==p){let A=e[S+9];if(A==="("||A===`
|
|
641
|
+
`||A==="\r"||A===" "||A===void 0)f++;v=S+9}else{if(f--,f===0){b=_;break}v=_+12}}if(b===-1)continue;let x=e.slice(y,b),k=e.slice(p,b+12);n.push({fullMatch:k,options:m,content:x,index:p}),l.lastIndex=b+12}for(let{fullMatch:p,options:u,content:m,index:y}of n)try{let f={};if(u)u.split(",").forEach((x)=>{let k=x.trim();if(k)f[k]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=Ye(m.trim(),v);o=o.split(p).join(b)}catch(f){let v=f instanceof Error?f.message:String(f),b=h("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,p);o=o.split(p).join(b)}return o}async function Ie(e,s,i,o){let n={gfm:!0,breaks:!1};return s.forEach((l)=>{let d=l.trim().replace(/['"]/g,"");if(d==="breaks")n.breaks=!0;if(d==="no-gfm")n.gfm=!1}),Ye(e.trim(),n)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],mt=[1,1.5,2,3],te=["avif","webp","jpeg"],gt={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function pe(e,s=Z,i={},o){return s.sort((n,l)=>n-l).map((n)=>`${re(e,{...i,w:n,fm:o})} ${n}w`).join(", ")}function Te(e,s,i=mt,o={},n){return i.sort((l,d)=>l-d).map((l)=>{let d=Math.round(s*l);return`${re(e,{...o,w:d,dpr:l,fm:n})} ${l}x`}).join(", ")}function me(e,s="100vw"){if(!e||Object.keys(e).length===0)return s;let o=Object.entries(e).map(([n,l])=>{let d=/^\d+$/.test(n)?`${n}px`:n;return{bp:d,size:l,numericBp:Number.parseInt(d)||0}}).sort((n,l)=>n.numericBp-l.numericBp).map(({bp:n,size:l})=>`(max-width: ${n}) ${l}`);return o.push(s),o.join(", ")}function re(e,s={}){let i=Object.entries(s).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("&"),n=e.includes("?")?"&":"?";return`${e}${n}${o}`}function ge(e){return gt[e]||"application/octet-stream"}var ft={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},he=`
|
|
642
642
|
.stx-img-placeholder {
|
|
643
643
|
position: relative;
|
|
644
644
|
overflow: hidden;
|
|
@@ -667,11 +667,11 @@ ${P}
|
|
|
667
667
|
filter: blur(0);
|
|
668
668
|
transform: scale(1);
|
|
669
669
|
}
|
|
670
|
-
`.trim();async function ht(){try{return await import("ts-images")}catch{return null}}async function yt(e,
|
|
670
|
+
`.trim();async function ht(){try{return await import("ts-images")}catch{return null}}async function yt(e,s={}){let i={...ft,...s},o=await ht();if(o)try{return await bt(e,i,o)}catch(n){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${n}`)}return xt(e,i)}async function bt(e,s,i){let{generatePlaceholder:o,generateThumbHash:n}=i,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[s.strategy]||"blur";if(s.strategy==="thumbhash")return{dataURL:(await n(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let p=await o(e,{width:s.width,height:s.height,quality:s.quality,blurLevel:s.blurLevel,strategy:d,base64Encode:!0});return{dataURL:p.dataURL,width:p.width,height:p.height,aspectRatio:p.aspectRatio,originalWidth:p.originalWidth,originalHeight:p.originalHeight,strategy:s.strategy,dominantColor:p.dominantColor,css:p.css}}function xt(e,s){let i=s.width||20,o=s.height||i,n="#e5e7eb",l=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}" viewBox="0 0 ${i} ${o}"><rect fill="#e5e7eb" width="${i}" height="${o}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l)}`,width:i,height:o,aspectRatio:i/o,originalWidth:0,originalHeight:0,strategy:s.strategy,dominantColor:"#e5e7eb"}}function Me(e,s,i={}){let o=i.transitionDuration||300,n=i.easing||"ease-out";return`
|
|
671
671
|
#${e} {
|
|
672
|
-
--stx-img-transition-duration: ${
|
|
673
|
-
--stx-img-transition-easing: ${
|
|
674
|
-
background-image: url('${
|
|
672
|
+
--stx-img-transition-duration: ${o}ms;
|
|
673
|
+
--stx-img-transition-easing: ${n};
|
|
674
|
+
background-image: url('${s.dataURL}');
|
|
675
675
|
background-size: cover;
|
|
676
676
|
background-position: center;
|
|
677
677
|
}
|
|
@@ -684,20 +684,20 @@ ${P}
|
|
|
684
684
|
#${e}.stx-img-loaded img {
|
|
685
685
|
opacity: 1;
|
|
686
686
|
}
|
|
687
|
-
`.trim()}var fe=new Map;async function Ne(e,
|
|
688
|
-
`):void 0,script:tt}}async function $t(e,
|
|
687
|
+
`.trim()}var fe=new Map;async function Ne(e,s={}){let i=`${e}:${JSON.stringify(s)}`;if(fe.has(i))return fe.get(i);let o=await yt(e,s);return fe.set(i,o),o}async function wt(){try{return await import("./chunk-z05dbey1.js")}catch(e){if(!je)console.warn("[stx-media] Image processor not available, some features disabled:",e),je=!0;return null}}var je=!1,ye=80,oe="async",le="lazy",Ve=!1;async function ae(e,s={}){let i=s,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Dt(o,i)}if(i.processedResult?.processed)return xe(e,i.processedResult,s);if(i.responsiveVariants)return We(e,i.responsiveVariants,s);let{src:n,alt:l,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ye,params:b={},placeholder:x="none",placeholderOptions:k={},lazy:S=!0,priority:_=!1,loading:A=_?"eager":le,decoding:E=oe,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:z}=e,{class:W,style:T,id:j}=e,R=e.data||{},{isDev:V=!1,baseUrl:G=""}=s;if(V&&!s.optimize)return Ct(e);let F,O,H=j||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!_)try{F=await Ne(n,{strategy:x,...k}),O=Me(H,F,k)}catch{}let ne=y!==void 0&&d!==void 0,X;if(ne)X=St(e,H,F,s);else X=await $t(e,H,F,s);let ee;if(_){let Ce=f.includes("webp")?"webp":f[0],rt=pe(n,m,{...b,q:v},Ce),st=typeof u==="object"?me(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${rt}" imagesizes="${st}" />`}let ie=[];if(!Ve&&x!=="none")ie.push(he),Ve=!0;if(O)ie.push(O);let tt=S?Le(H):void 0;return{html:X,preloadLink:ee,css:ie.length>0?ie.join(`
|
|
688
|
+
`):void 0,script:tt}}async function $t(e,s,i,o){let{src:n,alt:l,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ye,params:v={},lazy:b=!0,priority:x=!1,loading:k=x?"eager":le,decoding:S=oe,fetchpriority:_,objectFit:A,objectPosition:E,crossorigin:I,referrerpolicy:w}=e,{class:C,style:D}=e,z=e.data||{},W=typeof u==="object"?me(u):u||"100vw",T=[];for(let V of y){let G=pe(n,m,{...v,q:f},V),F=ge(V);if(b&&!x)T.push(` <source type="${F}" data-srcset="${G}" data-sizes="${W}" />`);else T.push(` <source type="${F}" srcset="${G}" sizes="${W}" />`)}let j=ve({src:re(n,{...v,q:f}),alt:l,width:d,height:p,loading:x?void 0:k,decoding:S,fetchpriority:x?"high":_,objectFit:A,objectPosition:E,crossorigin:I,referrerpolicy:w,className:ze(C,i),style:be(D,A,E,i),lazy:b&&!x,data:z}),R;if(i){let V=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;R=`<div id="${s}" class="stx-img-placeholder" style="${V}">
|
|
689
689
|
<picture>
|
|
690
690
|
${T.join(`
|
|
691
691
|
`)}
|
|
692
|
-
<img ${
|
|
692
|
+
<img ${j} />
|
|
693
693
|
</picture>
|
|
694
|
-
</div>`}else
|
|
694
|
+
</div>`}else R=`<picture${s?` id="${s}"`:""}>
|
|
695
695
|
${T.join(`
|
|
696
696
|
`)}
|
|
697
|
-
<img ${
|
|
698
|
-
</picture>`;return
|
|
697
|
+
<img ${j} />
|
|
698
|
+
</picture>`;return R}function St(e,s,i,o){let{src:n,alt:l,width:d,height:p,dpr:u=[1,2,3],quality:m=ye,params:y={},lazy:f=!0,priority:v=!1,loading:b=v?"eager":le,decoding:x=oe,fetchpriority:k,objectFit:S,objectPosition:_,crossorigin:A,referrerpolicy:E}=e,{class:I,style:w}=e,C=e.data||{},D=typeof d==="number"?d:Number.parseInt(String(d),10),z=Te(n,D,u,{...y,q:m}),W=ve({src:re(n,{...y,w:D,q:m}),alt:l,width:d,height:p,loading:v?void 0:b,decoding:x,fetchpriority:v?"high":k,objectFit:S,objectPosition:_,crossorigin:A,referrerpolicy:E,className:ze(I,i),style:be(w,S,_,i),lazy:f&&!v,data:C}),T=f&&!v?`data-srcset="${z}"`:`srcset="${z}"`;if(i){let j=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${s}" class="stx-img-placeholder" style="${j}">
|
|
699
699
|
<img ${W} ${T} />
|
|
700
|
-
</div>`}return`<img ${
|
|
700
|
+
</div>`}return`<img ${s?`id="${s}" `:""}${W} ${T} />`}function Ct(e){let{src:s,alt:i,width:o,height:n,loading:l=le,decoding:d=oe,fetchpriority:p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,priority:v=!1}=e,{class:b,style:x,id:k}=e,S=e.data||{};return{html:`<img ${ve({src:s,alt:i,width:o,height:n,loading:v?"eager":l,decoding:d,fetchpriority:v?"high":p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,className:b,style:be(x,u,m),id:k,data:S})} />`}}function ve(e){let s=[];if(e.lazy)s.push(`data-src="${U(e.src)}"`),s.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else s.push(`src="${U(e.src)}"`);if(s.push(`alt="${U(e.alt)}"`),e.width)s.push(`width="${e.width}"`);if(e.height)s.push(`height="${e.height}"`);if(e.loading)s.push(`loading="${e.loading}"`);if(e.decoding)s.push(`decoding="${e.decoding}"`);if(e.fetchpriority)s.push(`fetchpriority="${e.fetchpriority}"`);if(e.crossorigin)s.push(`crossorigin="${e.crossorigin}"`);if(e.referrerpolicy)s.push(`referrerpolicy="${e.referrerpolicy}"`);if(e.className)s.push(`class="${U(e.className)}"`);if(e.style)s.push(`style="${U(e.style)}"`);if(e.id)s.push(`id="${U(e.id)}"`);if(e.data)for(let[i,o]of Object.entries(e.data))s.push(`data-${i}="${U(o)}"`);if(e.lazy)s.push("data-stx-lazy");return s.join(" ")}function ze(e,s){let i=[];if(e)i.push(e);if(s)i.push("stx-img-blur");return i.join(" ")||""}function be(e,s,i,o){let n=[];if(s)n.push(`object-fit: ${s}`);if(i)n.push(`object-position: ${i}`);if(o)n.push("opacity: 0; transition: opacity 300ms ease-out");if(e)n.push(e);return n.join("; ")}function U(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Le(e){return`
|
|
701
701
|
(function() {
|
|
702
702
|
const container = document.getElementById('${e}');
|
|
703
703
|
if (!container) return;
|
|
@@ -734,25 +734,25 @@ ${T.join(`
|
|
|
734
734
|
|
|
735
735
|
observer.observe(container);
|
|
736
736
|
})();
|
|
737
|
-
`.trim()}async function Dt(e,
|
|
737
|
+
`.trim()}async function Dt(e,s){let i=await wt();if(!i)return ae({...e,process:!1},s);let o=s.tsImagesConfig;if(e.responsiveWidths&&e.responsiveWidths.length>0||e.widths&&e.widths.length>0||!e.width&&!e.dpr){let l=await i.generateResponsiveVariants(e.src,e,o);if(l)return We(e,l,s)}else{let l=await i.processImage(e.src,e,o);if(l.processed)return xe(e,l,s)}return ae({...e,process:!1},s)}async function xe(e,s,i){let{alt:o,width:n,height:l,lazy:d=!0,priority:p=!1,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f}=e,{class:v,style:b}=e,x=e.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,k=e.data||{},S=s.variants||[],_=S.find((O)=>O.format==="jpeg")||S.find((O)=>O.format==="webp")||S[0],A=_?.url||e.src,E=S.filter((O)=>O.format===(_?.format||"jpeg")).map((O)=>`${O.url} ${O.width}w`).join(", "),I=new Map;for(let O of S){if(!I.has(O.format))I.set(O.format,[]);I.get(O.format).push(O)}let w=[],C=["avif","webp","jpeg","png"];for(let O of C){let H=I.get(O);if(H&&H.length>0){let ne=H.map((ee)=>`${ee.url} ${ee.width}w`).join(", "),X=ge(O);if(d&&!p)w.push(` <source type="${X}" data-srcset="${ne}" />`);else w.push(` <source type="${X}" srcset="${ne}" />`)}}let D=[];if(d&&!p){if(D.push(`data-src="${U(A)}"`),D.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),E)D.push(`data-srcset="${E}"`)}else if(D.push(`src="${U(A)}"`),E)D.push(`srcset="${E}"`);D.push(`alt="${U(o)}"`);let z=n||s.originalWidth,W=l||s.originalHeight;if(z)D.push(`width="${z}"`);if(W)D.push(`height="${W}"`);if(!p)D.push(`loading="${d?"lazy":"eager"}"`);if(D.push('decoding="async"'),p)D.push('fetchpriority="high"');if(y)D.push(`crossorigin="${y}"`);if(f)D.push(`referrerpolicy="${f}"`);let T=[];if(u)T.push(`object-fit: ${u}`);if(m)T.push(`object-position: ${m}`);if(s.placeholder&&d)T.push("opacity: 0; transition: opacity 300ms ease-out");if(b)T.push(b);if(T.length>0)D.push(`style="${T.join("; ")}"`);let j=[];if(v)j.push(v);if(s.placeholder)j.push("stx-img-blur");if(j.length>0)D.push(`class="${j.join(" ")}"`);if(d&&!p)D.push("data-stx-lazy");for(let[O,H]of Object.entries(k))D.push(`data-${O}="${U(H)}"`);let R;if(s.placeholder||s.dominantColor&&e.useDominantColor){let O=s.placeholder?`background-image: url('${s.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${s.dominantColor};`;R=`<div id="${x}" class="stx-img-placeholder" style="${O}">
|
|
738
738
|
<picture>
|
|
739
739
|
${w.join(`
|
|
740
740
|
`)}
|
|
741
741
|
<img ${D.join(" ")} />
|
|
742
742
|
</picture>
|
|
743
|
-
</div>`}else
|
|
743
|
+
</div>`}else R=`<picture${x?` id="${x}"`:""}>
|
|
744
744
|
${w.join(`
|
|
745
745
|
`)}
|
|
746
746
|
<img ${D.join(" ")} />
|
|
747
|
-
</picture>`;let
|
|
748
|
-
`):void 0,script:G}}async function We(e,
|
|
749
|
-
`+y;if(
|
|
750
|
-
<style>${
|
|
751
|
-
<script>${
|
|
752
|
-
`),G=`<video ${
|
|
753
|
-
${
|
|
747
|
+
</picture>`;let V=[];if(s.placeholder)V.push(he);let G=d?Le(x):void 0,F;if(p&&E)F=`<link rel="preload" as="image" imagesrcset="${E}" />`;return{html:R,preloadLink:F,css:V.length>0?V.join(`
|
|
748
|
+
`):void 0,script:G}}async function We(e,s,i){let o={src:s.src,processed:!0,variants:[],placeholder:s.placeholder?.dataURL,originalWidth:s.placeholder?.width,originalHeight:s.placeholder?.height};for(let[n,l]of Object.entries(s.byFormat))if(l)o.variants.push(...l);return xe(e,o,i)}function Pt(){return vt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,s,i,o)=>{let{src:n,alt:l,options:d}=kt(e,s,i);if(!n)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:n,alt:l||"",widths:d.widths||Z,formats:d.formats||te,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},u=i.__isDev||!1,m=await ae(p,{isDev:u}),y=m.html;if(m.preloadLink)y=m.preloadLink+`
|
|
749
|
+
`+y;if(m.css)y+=`
|
|
750
|
+
<style>${m.css}</style>`;if(m.script)y+=`
|
|
751
|
+
<script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function kt(e,s,i){if(s.src)return{src:String(s.src),alt:String(s.alt||""),options:s.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=At(o),l=we(n[0],i)||"",d=we(n[1],i)||"",p={};if(n[2]){let u=we(n[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof n[2]==="string")try{p=JSON.parse(n[2])}catch{}}return{src:l,alt:d,options:p}}function At(e){let s=[],i="",o=!1,n="",l=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===0&&d===0){s.push(i.trim()),i="";continue}}i+=u}if(i.trim())s.push(i.trim());return s}function we(e,s){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=s[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Fe=Pt();async function He(){try{return await import("./chunk-97r557ws.js")}catch(e){if(!qe)console.warn("[stx-media] Video processor not available, some features disabled:",e),qe=!0;return null}}var qe=!1,Ue=!0,Be="metadata",_t="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function ce(e,s={}){let i=s,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return Tt(o,i)}if(i.processedResult?.processed)return Ke(e,i.processedResult,s);let n;if(o.generatePoster&&o.src&&!e.poster)n=await Mt(o,i);let{src:l,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Ue,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Be,playsinline:x=!0,lazy:k=!0,player:S="native",type:_,width:A,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=n||p,{class:z,style:W}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return Ot(e,s);if(_&&_!=="video")return Rt(l||"",_,e);let j=d.length>0?d:l?[{src:l,type:Je(l)}]:[],R=[`id="${T}"`];if(m)R.push("controls");if(y)R.push("autoplay");if(f)R.push("muted");if(v)R.push("loop");if(x)R.push("playsinline");if(w)R.push("disablepictureinpicture");if(C)R.push("disableremoteplayback");if(I)R.push(`crossorigin="${I}"`);if(k){if(R.push(`data-preload="${b}"`),R.push('preload="none"'),D)R.push(`data-poster="${M(D)}"`);R.push("data-stx-lazy")}else if(R.push(`preload="${b}"`),D)R.push(`poster="${M(D)}"`);if(A)R.push(`width="${A}"`);if(E)R.push(`height="${E}"`);if(z)R.push(`class="${M(z)}"`);if(W)R.push(`style="${M(W)}"`);let V=j.map((O)=>` <source ${k?`data-src="${M(O.src)}"`:`src="${M(O.src)}"`} type="${O.type}"${O.media?` media="${O.media}"`:""} />`).join(`
|
|
752
|
+
`),G=`<video ${R.join(" ")}>
|
|
753
|
+
${V}
|
|
754
754
|
Your browser does not support the video tag.
|
|
755
|
-
</video>`,F;if(
|
|
755
|
+
</video>`,F;if(k)F=`
|
|
756
756
|
(function() {
|
|
757
757
|
var video = document.getElementById('${T}');
|
|
758
758
|
if (!video) return;
|
|
@@ -787,20 +787,20 @@ ${z}
|
|
|
787
787
|
|
|
788
788
|
observer.observe(video);
|
|
789
789
|
})();
|
|
790
|
-
`.trim();return{html:G,script:F}}function Rt(e,
|
|
790
|
+
`.trim();return{html:G,script:F}}function Rt(e,s,i){let{width:o=640,height:n=360}=i,{class:l,style:d}=i,p=i.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,u,m=null;switch(s){case"youtube":m=Et(e),u=m?`https://www.youtube-nocookie.com/embed/${m}`:e;break;case"vimeo":m=It(e),u=m?`https://player.vimeo.com/video/${m}`:e;break;case"dailymotion":m=e.split("/").pop()||"",u=`https://www.dailymotion.com/embed/video/${m}`;break;case"twitch":m=e.split("/").pop()||"",u=`https://player.twitch.tv/?video=${m}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:u=e}let y=[`id="${p}"`,`src="${M(u)}"`,`width="${o}"`,`height="${n}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(l)y.push(`class="${M(l)}"`);if(d)y.push(`style="${M(d)}"`);if(i.lazy)y.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
791
791
|
<iframe ${y.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
|
|
792
|
-
</div>`}}function Ot(e,
|
|
792
|
+
</div>`}}function Ot(e,s={}){let{src:i,sources:o=[],poster:n,controls:l=!0,autoplay:d=!1,muted:p=!1,loop:u=!1,preload:m="metadata",playsinline:y=!0,lazy:f=!0,width:v,height:b}=e,{class:x,style:k}=e,S=e.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,_={src:o.length>0?o:i,autoplay:d,loop:u,muted:p,playsinline:y,preload:m,poster:n,controls:l,title:e.title},A=["position: relative",v?`width: ${typeof v==="number"?v+"px":v}`:"width: 100%",b?`height: ${typeof b==="number"?b+"px":b}`:"",k||""].filter(Boolean).join("; "),E=`
|
|
793
793
|
<div
|
|
794
794
|
id="${S}"
|
|
795
795
|
class="ts-video-player${x?" "+M(x):""}"
|
|
796
|
-
style="${
|
|
796
|
+
style="${A}"
|
|
797
797
|
data-ts-video-player
|
|
798
|
-
data-config='${JSON.stringify(
|
|
799
|
-
${
|
|
798
|
+
data-config='${JSON.stringify(_)}'
|
|
799
|
+
${f?"data-lazy":""}
|
|
800
800
|
>
|
|
801
801
|
<div class="ts-video-player__container">
|
|
802
|
-
${
|
|
803
|
-
<div class="ts-video-player__placeholder" style="background-image: url('${M(
|
|
802
|
+
${n?`
|
|
803
|
+
<div class="ts-video-player__placeholder" style="background-image: url('${M(n)}');">
|
|
804
804
|
<button class="ts-video-player__play-button" aria-label="Play video">
|
|
805
805
|
<svg viewBox="0 0 24 24" fill="currentColor" width="64" height="64">
|
|
806
806
|
<path d="M8 5v14l11-7z"/>
|
|
@@ -956,14 +956,14 @@ else {
|
|
|
956
956
|
.ts-video-player__play-button svg {
|
|
957
957
|
margin-left: 4px;
|
|
958
958
|
}
|
|
959
|
-
`.trim();return{html:E,script:I,css:w}}function
|
|
959
|
+
`.trim();return{html:E,script:I,css:w}}function Je(e){switch(e.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function Et(e){let s=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let i of s){let o=e.match(i);if(o)return o[1]}return null}function It(e){let s=e.match(/vimeo\.com\/(\d+)/);return s?s[1]:null}function M(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}async function Tt(e,s){let i=await He();if(!i)return ce({...e,process:!1},s);let o=s.tsVideosConfig,n=await i.processVideo(e.src,e,o,e.onProcessProgress);if(n.processed)return Ke(e,n,s);return ce({...e,process:!1},s)}async function Mt(e,s){let i=await He();if(!i||!e.src)return;let o=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},n=s.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await i.generatePoster(e.src,o,n.outputDir,n.baseUrl||"/videos"))?.url}function Ke(e,s,i){let{controls:o=Ue,autoplay:n=!1,muted:l=!1,loop:d=!1,preload:p=Be,playsinline:u=!0,lazy:m=!0,width:y,height:f,crossorigin:v,disablePictureInPicture:b=!1,disableRemotePlayback:x=!1}=e,{class:k,style:S}=e,_=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,A=e.src,E=Je(A);if(s.transcoded)A=s.transcoded.url,E="video/mp4";let I=s.streaming?.hls||s.streaming?.dash;if(I){if(s.streaming?.hls)A=s.streaming.hls.manifestUrl,E="application/x-mpegURL";else if(s.streaming?.dash)A=s.streaming.dash.manifestUrl,E="application/dash+xml"}let w=s.poster?.url||e.poster,C=[`id="${_}"`];if(o)C.push("controls");if(n)C.push("autoplay");if(l)C.push("muted");if(d)C.push("loop");if(u)C.push("playsinline");if(b)C.push("disablepictureinpicture");if(x)C.push("disableremoteplayback");if(v)C.push(`crossorigin="${v}"`);if(m){if(C.push(`data-preload="${p}"`),C.push('preload="none"'),w)C.push(`data-poster="${M(w)}"`);C.push("data-stx-lazy")}else if(C.push(`preload="${p}"`),w)C.push(`poster="${M(w)}"`);let D=y||s.metadata?.width,z=f||s.metadata?.height;if(D)C.push(`width="${D}"`);if(z)C.push(`height="${z}"`);if(k)C.push(`class="${M(k)}"`);if(S)C.push(`style="${M(S)}"`);let T=` <source ${m?`data-src="${M(A)}"`:`src="${M(A)}"`} type="${E}" />`,j=`<video ${C.join(" ")}>
|
|
960
960
|
${T}
|
|
961
961
|
Your browser does not support the video tag.
|
|
962
|
-
</video>`;if(
|
|
963
|
-
${
|
|
964
|
-
</div>`;let
|
|
962
|
+
</video>`;if(s.spriteSheet)j=`<div class="stx-video-wrapper" data-sprite-sheet="${M(s.spriteSheet.url)}" data-sprite-cols="${s.spriteSheet.columns}" data-sprite-interval="${s.spriteSheet.interval}">
|
|
963
|
+
${j}
|
|
964
|
+
</div>`;let R;if(m)R=`
|
|
965
965
|
(function() {
|
|
966
|
-
var video = document.getElementById('${
|
|
966
|
+
var video = document.getElementById('${_}');
|
|
967
967
|
if (!video) return;
|
|
968
968
|
|
|
969
969
|
var observer = new IntersectionObserver(function(entries) {
|
|
@@ -996,7 +996,7 @@ ${V}
|
|
|
996
996
|
|
|
997
997
|
observer.observe(video);
|
|
998
998
|
})();
|
|
999
|
-
`.trim();let
|
|
999
|
+
`.trim();let V;if(I)V=`
|
|
1000
1000
|
.stx-video-wrapper {
|
|
1001
1001
|
position: relative;
|
|
1002
1002
|
width: 100%;
|
|
@@ -1005,36 +1005,36 @@ ${V}
|
|
|
1005
1005
|
width: 100%;
|
|
1006
1006
|
height: auto;
|
|
1007
1007
|
}
|
|
1008
|
-
`.trim();return{html:
|
|
1009
|
-
<style>${
|
|
1010
|
-
<script>${
|
|
1011
|
-
* ${
|
|
1008
|
+
`.trim();return{html:j,script:R,css:V}}function Ge(){return vt({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,s,i,o)=>{let{src:n,options:l}=Nt(e,s,i);if(!n)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:n,poster:l.poster,controls:l.controls!==!1,autoplay:l.autoplay||!1,muted:l.muted||!1,loop:l.loop||!1,preload:l.preload||"metadata",playsinline:l.playsinline!==!1,lazy:l.lazy!==!1,player:l.player||"native",type:l.type,width:l.width,height:l.height,class:l.class,style:l.style,id:l.id,crossorigin:l.crossorigin,disablePictureInPicture:l.disablePictureInPicture,disableRemotePlayback:l.disableRemotePlayback,title:l.title,quality:l.quality,platform:l.platform,process:l.process,generatePoster:l.generatePoster,streaming:l.streaming,transcode:l.transcode,spriteSheet:l.spriteSheet,waveform:l.waveform},u={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},m=await ce(d,u),y=m.html;if(m.css)y+=`
|
|
1009
|
+
<style>${m.css}</style>`;if(m.script)y+=`
|
|
1010
|
+
<script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Nt(e,s,i){if(s.src)return{src:String(s.src),options:s.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=jt(o),l=Xe(n[0],i)||"",d={};if(n[1]){let p=Xe(n[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof n[1]==="string")try{d=JSON.parse(n[1])}catch{}}return{src:l,options:d}}function jt(e){let s=[],i="",o=!1,n="",l=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===0&&d===0){s.push(i.trim()),i="";continue}}i+=u}if(i.trim())s.push(i.trim());return s}function Xe(e,s){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=s[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var $e=Ge();import Vt from"fs";import q from"path";async function cs(e,s){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let n of i)try{let l=await zt(n,e,s);if(l)o.push(l)}catch(l){if(console.error(`Error building web component ${n.name}:`,l),e.debug)throw l}}return o}async function zt(e,s,i){let{name:o,file:n,tag:l,extends:d}=e;if(!o||!n||!l)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(n)&&await r(n))p=n;else if(s.componentsDir){let k=q.join(s.componentsDir,n);if(await r(k))p=k}if(!p)p=await hn(n,process.cwd(),s,i);if(!p)return console.error(`Web component source file not found: ${n}`),null;let u=await Bun.file(p).text();i.add(p);let y=(e.outputFormat||"js")==="ts",f=y?Wt({name:o,tag:l,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Lt({name:o,tag:l,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=s.webComponents?.outputDir||"dist/web-components";await Vt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=q.join(v,`${l}.${b}`);if(await Bun.write(x,f),s.debug)console.log(`Built web component ${o} -> ${x}`);return x}function Lt(e){let{name:s,tag:i,baseElement:o="HTMLElement",source:n,shadowDOM:l,template:d,styleSource:p,attributes:u=[]}=e,m=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)m=m.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),m=m.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),m=m.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),m=m.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
|
|
1011
|
+
* ${s} Web Component
|
|
1012
1012
|
* Auto-generated from stx component
|
|
1013
1013
|
*/
|
|
1014
|
-
class ${
|
|
1014
|
+
class ${s.replace(/\W/g,"")} extends ${o} {
|
|
1015
1015
|
constructor() {
|
|
1016
1016
|
super()
|
|
1017
1017
|
this._initialized = false
|
|
1018
|
-
${
|
|
1019
|
-
${
|
|
1018
|
+
${l?"":"this._slotContent = []"}
|
|
1019
|
+
${l?'this.attachShadow({ mode: "open" })':""}
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
1022
|
${d?`
|
|
1023
1023
|
_createTemplate() {
|
|
1024
1024
|
const template = document.createElement('template')
|
|
1025
|
-
template.innerHTML = \`${y}${
|
|
1026
|
-
${
|
|
1025
|
+
template.innerHTML = \`${y}${m}\`
|
|
1026
|
+
${l?"this.shadowRoot.appendChild(template.content.cloneNode(true))":"this.appendChild(template.content.cloneNode(true))"}
|
|
1027
1027
|
this._processSlots()
|
|
1028
1028
|
}
|
|
1029
1029
|
`:`
|
|
1030
1030
|
_render() {
|
|
1031
|
-
${
|
|
1031
|
+
${l?"this.shadowRoot.innerHTML":"this.innerHTML"} = \`${y}${m}\`
|
|
1032
1032
|
this._processSlots()
|
|
1033
1033
|
}
|
|
1034
1034
|
`}
|
|
1035
1035
|
|
|
1036
1036
|
_processSlots() {
|
|
1037
|
-
${
|
|
1037
|
+
${l?`// Shadow DOM handles slot assignment automatically
|
|
1038
1038
|
// Listen for slot changes if needed
|
|
1039
1039
|
const slots = this.shadowRoot.querySelectorAll('slot')
|
|
1040
1040
|
slots.forEach(slot => {
|
|
@@ -1074,7 +1074,7 @@ class ${r.replace(/\W/g,"")} extends ${l} {
|
|
|
1074
1074
|
|
|
1075
1075
|
${u.length>0?`
|
|
1076
1076
|
static get observedAttributes() {
|
|
1077
|
-
return [${u.map((
|
|
1077
|
+
return [${u.map((f)=>`'${f}'`).join(", ")}]
|
|
1078
1078
|
}
|
|
1079
1079
|
|
|
1080
1080
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
@@ -1087,7 +1087,7 @@ class ${r.replace(/\W/g,"")} extends ${l} {
|
|
|
1087
1087
|
|
|
1088
1088
|
connectedCallback() {
|
|
1089
1089
|
if (this._initialized) return
|
|
1090
|
-
${
|
|
1090
|
+
${l?"":"this._slotContent = Array.from(this.childNodes)"}
|
|
1091
1091
|
this._initialized = true
|
|
1092
1092
|
${d?"this._createTemplate()":"this._render()"}
|
|
1093
1093
|
}
|
|
@@ -1098,8 +1098,8 @@ class ${r.replace(/\W/g,"")} extends ${l} {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
1100
|
// Register the web component
|
|
1101
|
-
customElements.define('${
|
|
1102
|
-
`}function Wt(e){let{name:
|
|
1101
|
+
customElements.define('${i}', ${s.replace(/\W/g,"")})
|
|
1102
|
+
`}function Wt(e){let{name:s,tag:i,baseElement:o="HTMLElement",source:n,shadowDOM:l,template:d,styleSource:p,attributes:u=[],attributeTypes:m={}}=e,y=s.replace(/\W/g,""),f=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)f=f.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),f=f.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),f=f.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),f=f.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");f=f.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let v=p?`<link rel="stylesheet" href="${p}">`:"",b=(w)=>{switch(m[w]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},x=(w)=>w.replace(/-([a-z])/g,(C,D)=>D.toUpperCase()),k=u.map((w)=>` private _${x(w)}: ${b(w)} | null = null;`).join(`
|
|
1103
1103
|
`),S=u.map((w)=>{let C=b(w),D=x(w);return`
|
|
1104
1104
|
get ${D}(): ${C} | null {
|
|
1105
1105
|
return this._${D};
|
|
@@ -1114,14 +1114,14 @@ else {
|
|
|
1114
1114
|
this.removeAttribute('${w}');
|
|
1115
1115
|
}
|
|
1116
1116
|
}`}).join(`
|
|
1117
|
-
`),
|
|
1118
|
-
* Props interface for ${
|
|
1117
|
+
`),_=u.length>0?`/**
|
|
1118
|
+
* Props interface for ${s}
|
|
1119
1119
|
*/
|
|
1120
1120
|
export interface ${y}Props {
|
|
1121
1121
|
${u.map((w)=>{let C=b(w);return` ${x(w)}?: ${C};`}).join(`
|
|
1122
1122
|
`)}
|
|
1123
1123
|
}
|
|
1124
|
-
`:"",
|
|
1124
|
+
`:"",A=u.length>0?`
|
|
1125
1125
|
static get observedAttributes(): string[] {
|
|
1126
1126
|
return [${u.map((w)=>`'${w}'`).join(", ")}];
|
|
1127
1127
|
}
|
|
@@ -1136,7 +1136,7 @@ ${u.map((w)=>{let C=b(w);return` ${x(w)}?: ${C};`}).join(`
|
|
|
1136
1136
|
|
|
1137
1137
|
private _parseAttributeValue(name: string, value: string | null): unknown {
|
|
1138
1138
|
if (value === null) return null;
|
|
1139
|
-
const typeMap: Record<string, string> = ${JSON.stringify(
|
|
1139
|
+
const typeMap: Record<string, string> = ${JSON.stringify(m)};
|
|
1140
1140
|
const type = typeMap[name] || 'string';
|
|
1141
1141
|
switch (type) {
|
|
1142
1142
|
case 'number': return Number(value);
|
|
@@ -1149,20 +1149,20 @@ catch { return value; }
|
|
|
1149
1149
|
`:"",E=d?`
|
|
1150
1150
|
private _createTemplate(): void {
|
|
1151
1151
|
const template = document.createElement('template');
|
|
1152
|
-
template.innerHTML = \`${v}${
|
|
1153
|
-
${
|
|
1152
|
+
template.innerHTML = \`${v}${f}\`;
|
|
1153
|
+
${l?"this.shadowRoot!.appendChild(template.content.cloneNode(true));":"this.appendChild(template.content.cloneNode(true));"}
|
|
1154
1154
|
this._processSlots();
|
|
1155
1155
|
}`:`
|
|
1156
1156
|
private _render(): void {
|
|
1157
|
-
${
|
|
1157
|
+
${l?"this.shadowRoot!.innerHTML":"this.innerHTML"} = \`${v}${f}\`;
|
|
1158
1158
|
this._processSlots();
|
|
1159
1159
|
}`;return`/**
|
|
1160
|
-
* ${
|
|
1160
|
+
* ${s} Web Component
|
|
1161
1161
|
* Auto-generated from stx component (TypeScript)
|
|
1162
1162
|
*
|
|
1163
1163
|
* @example
|
|
1164
1164
|
* \`\`\`html
|
|
1165
|
-
* <${
|
|
1165
|
+
* <${i}></${i}>
|
|
1166
1166
|
* \`\`\`
|
|
1167
1167
|
*/
|
|
1168
1168
|
|
|
@@ -1174,22 +1174,22 @@ interface SlotChangeDetail {
|
|
|
1174
1174
|
assignedNodes: Node[];
|
|
1175
1175
|
}
|
|
1176
1176
|
|
|
1177
|
-
${
|
|
1177
|
+
${_}
|
|
1178
1178
|
/**
|
|
1179
|
-
* ${
|
|
1180
|
-
* @customElement ${
|
|
1179
|
+
* ${s} custom element class
|
|
1180
|
+
* @customElement ${i}
|
|
1181
1181
|
*/
|
|
1182
|
-
export class ${y} extends ${
|
|
1183
|
-
${
|
|
1182
|
+
export class ${y} extends ${o} {
|
|
1183
|
+
${k}
|
|
1184
1184
|
private _initialized = false;
|
|
1185
|
-
${
|
|
1185
|
+
${l?"":"private _slotContent: Node[] = [];"}
|
|
1186
1186
|
|
|
1187
1187
|
constructor() {
|
|
1188
1188
|
super();
|
|
1189
|
-
${
|
|
1189
|
+
${l?'this.attachShadow({ mode: "open" });':""}
|
|
1190
1190
|
}
|
|
1191
1191
|
${E}
|
|
1192
|
-
${
|
|
1192
|
+
${l?`
|
|
1193
1193
|
private _processSlots(): void {
|
|
1194
1194
|
const slots = this.shadowRoot!.querySelectorAll('slot');
|
|
1195
1195
|
slots.forEach((slot) => {
|
|
@@ -1226,12 +1226,12 @@ ${c?`
|
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
1228
|
}`}
|
|
1229
|
-
${
|
|
1229
|
+
${A}
|
|
1230
1230
|
${S}
|
|
1231
1231
|
|
|
1232
1232
|
connectedCallback(): void {
|
|
1233
1233
|
if (this._initialized) return;
|
|
1234
|
-
${
|
|
1234
|
+
${l?"":"this._slotContent = Array.from(this.childNodes);"}
|
|
1235
1235
|
this._initialized = true;
|
|
1236
1236
|
${d?"this._createTemplate();":"this._render();"}
|
|
1237
1237
|
}
|
|
@@ -1248,22 +1248,22 @@ ${S}
|
|
|
1248
1248
|
// Type augmentation for HTMLElementTagNameMap
|
|
1249
1249
|
declare global {
|
|
1250
1250
|
interface HTMLElementTagNameMap {
|
|
1251
|
-
'${
|
|
1251
|
+
'${i}': ${y};
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
1255
|
// Register the web component
|
|
1256
|
-
customElements.define('${
|
|
1257
|
-
`}function Ft(e,
|
|
1258
|
-
get ${
|
|
1259
|
-
return this.getAttribute('${
|
|
1256
|
+
customElements.define('${i}', ${y});
|
|
1257
|
+
`}function Ft(e,s){let i=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),o=i?i[1].trim():"",n=s,l=[],d=!0;if(o){let f=o.match(/export\s+default\s+({[\s\S]*})/);if(f)try{let v=f[1],b=v.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(b)n=b[1];let x=v.match(/props\s*:\s*\[([\s\S]*?)\]/);if(x)l=x[1].split(",").map((S)=>S.trim().replace(/['"`]/g,"")).filter((S)=>S.length>0);let k=v.match(/shadowDOM\s*:\s*(true|false)/);if(k)d=k[1]==="true"}catch{}}let p=e.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),u=p?p[1].trim():"",m=e.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),y=m?m[1].trim():"";return{tag:n,props:l,template:u,styles:y,script:o,shadowDOM:d}}function qt(e){let{tag:s,props:i,template:o,styles:n,shadowDOM:l}=e,d=s.split("-").map((f)=>f.charAt(0).toUpperCase()+f.slice(1)).join(""),p=o.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),u=n.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),m=i.map((f)=>`'${f}'`).join(", "),y=i.map((f)=>`
|
|
1258
|
+
get ${f}() {
|
|
1259
|
+
return this.getAttribute('${f}') || '';
|
|
1260
1260
|
}
|
|
1261
|
-
set ${
|
|
1261
|
+
set ${f}(value) {
|
|
1262
1262
|
if (value) {
|
|
1263
|
-
this.setAttribute('${
|
|
1263
|
+
this.setAttribute('${f}', value);
|
|
1264
1264
|
}
|
|
1265
1265
|
else {
|
|
1266
|
-
this.removeAttribute('${
|
|
1266
|
+
this.removeAttribute('${f}');
|
|
1267
1267
|
}
|
|
1268
1268
|
}`).join(`
|
|
1269
1269
|
`);return`/**
|
|
@@ -1273,12 +1273,12 @@ else {
|
|
|
1273
1273
|
class ${d} extends HTMLElement {
|
|
1274
1274
|
constructor() {
|
|
1275
1275
|
super();
|
|
1276
|
-
${
|
|
1276
|
+
${l?"this.attachShadow({ mode: 'open' });":""}
|
|
1277
1277
|
this._render();
|
|
1278
1278
|
}
|
|
1279
1279
|
|
|
1280
1280
|
static get observedAttributes() {
|
|
1281
|
-
return [${
|
|
1281
|
+
return [${m}];
|
|
1282
1282
|
}
|
|
1283
1283
|
|
|
1284
1284
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
@@ -1296,7 +1296,7 @@ ${y}
|
|
|
1296
1296
|
return this.getAttribute(prop) || '';
|
|
1297
1297
|
});
|
|
1298
1298
|
|
|
1299
|
-
${
|
|
1299
|
+
${l?"this.shadowRoot.innerHTML = rendered;":"this.innerHTML = rendered;"}
|
|
1300
1300
|
}
|
|
1301
1301
|
|
|
1302
1302
|
connectedCallback() {
|
|
@@ -1304,9 +1304,9 @@ ${y}
|
|
|
1304
1304
|
}
|
|
1305
1305
|
}
|
|
1306
1306
|
|
|
1307
|
-
customElements.define('${
|
|
1308
|
-
`}async function
|
|
1309
|
-
${qt(
|
|
1310
|
-
</script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:on,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:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},Qa,ec,cs,ls,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Fs],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 Ut(e,r,o){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=o||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let o=r.replace(/[\\/]+$/,"");if(!o||o===".")return!0;let l=e.replace(/\\/g,"/"),s=o.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function bf(e,r){let o=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,o&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let o=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=o?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(cc(e.stateDir),e.stateDir=lr(),e.cachePath=ur(e.cachePath),e.build)e.build.cacheDir=ur(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=ur(e.media.cache.directory);if(e.story)e.story.outDir=ur(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function Po(e,r=Ht){try{return await r(e)}catch(o){if(o instanceof Error&&o.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw o}}async function i(e){let r=e?j.resolve(e):process.cwd(),o=de.get(r);if(o&&o.signature!==is(o.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-nbzy9m6a.js"),{partialsCache:p}=await import("./chunk-bhnq6xr5.js");if(d(),p.clear(),c&&o.configSignature===as(o.graph)){let u=c.then(async(g)=>{let y={...o.graph};await Oo(y,r),de.set(r,{graph:y,signature:is(y),configSignature:as(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await Po({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await Po({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Po({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||o){let v=await nc(r,N);u=v.config,de.set(r,{graph:v.graph,signature:is(v.graph),configSignature:as(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-68wezwr7.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-h1fpjmr8.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),bf(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-dpjs0ajs.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
|
-
`)}catch(
|
|
1312
|
-
export{
|
|
1307
|
+
customElements.define('${s}', ${d});
|
|
1308
|
+
`}async function Ze(e,s,i,o){if(s.length<1)return c("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let n=s[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${n}.stx`),q.join(q.dirname(o),`${n}.stx`)]:[q.join(q.dirname(o),d,`${n}.stx`),q.join(process.cwd(),d,`${n}.stx`),q.join(q.dirname(o),`${n}.stx`)],u=null;for(let f of p)if(await r(f)){u=await Bun.file(f).text();break}if(!u)return c("WebComponent",`Component file not found: ${n}.stx`,t.FILE_NOT_FOUND);let m=Ft(u,n);return`<script type="module">
|
|
1309
|
+
${qt(m)}
|
|
1310
|
+
</script>`}var L={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:an,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:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},tc,nc,ds,ps,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Vs],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 Ut(e,s,i){let o=s||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),l=N.join(n,"resources","views"),d=N.join(n,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,s){let i=s.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function wf(e,s){let i=!e.root,o=Ut(e.root,e.pagesDir,s);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${s}::${o.root}`;if(!et.has(n))et.add(n),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(!Se.has(e)){let n={};for(let l of ue){let d=e[l];if(typeof d==="string"&&d)n[l]=d}Se.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let l of ue){let d=e[l];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Bt(d,n))continue;e[l]=N.join(n,d)}}for(let n of ue){let l=e[n];if(typeof l!=="string"||!l||N.isAbsolute(l))continue;e[n]=N.resolve(s,l)}return e}function Jt(e,s){let i=Se.get(e);for(let o of ue){let n=e[o];if(typeof n!=="string"||!n)continue;let l=N.isAbsolute(n)?n:N.join(s,n);if(Q.existsSync(l))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(uc(e.stateDir),e.stateDir=pr(),e.cachePath=fr(e.cachePath),e.build)e.build.cacheDir=fr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=fr(e.media.cache.directory);if(e.story)e.story.outDir=fr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function No(e,s=Ht){try{return await s(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let s=e?N.resolve(e):process.cwd(),i=de.get(s);if(i&&i.signature!==ls(i.graph)){let l=Y.get(s);if(Y.delete(s),de.delete(s),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-3907sad1.js"),{partialsCache:p}=await import("./chunk-9whmbfwx.js");if(d(),p.clear(),l&&i.configSignature===us(i.graph)){let u=l.then(async(m)=>{let y={...i.graph};await Mo(y,s),de.set(s,{graph:y,signature:ls(y),configSignature:us(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(s,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(s);if(o)return o;let n=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(N.join(s,`stx.config${v}`))),p=l.some((v)=>Q.existsSync(N.join(s,"config",`ui${v}`))),u;if(d&&p){let v=await No({name:"ui",cwd:N.join(s,"config"),defaultConfig:L,errorPolicy:"throw",verbose:!1});u=(await No({name:"stx",alias:"ui",cwd:s,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await No({name:"stx",alias:"ui",cwd:s,defaultConfig:L,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await sc(s,L);u=v.config,de.set(s,{graph:v.graph,signature:ls(v.graph),configSignature:us(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-2snfd93r.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-w8yv9hnf.js");await b(s,u.runtimeConfig)}Kt(u),Gt(u),wf(u,s),Jt(u,s);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[s]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-sy1btryy.js"),b=[],x=[];for(let k of f){let S=typeof k==="string"?k:k[0],_=typeof k==="string"?{}:k[1]||{};try{let A,E;try{let w=g.resolve(S,{paths:[s]});A=await import(w),E=N.dirname(w)}catch{let w=N.resolve(s,S);A=await import(w),E=N.dirname(w)}let I=A.default||A;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(N.resolve(E,C))}if(I.pages){let w=N.resolve(E,I.pages),C=_.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(_,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
|
+
`)}catch(A){console.warn(`[stx] Failed to load plugin ${S}:`,A.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(s,n),n.catch(()=>{if(Y.get(s)===n)Y.delete(s)}),!e)se=n,n.then((l)=>{K=l}).catch(()=>{});return n}var P=new Proxy(L,{get(e,s){if(K&&s in K)return K[s];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[s]}});function ph(e){return e}function fh(e){let s=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")s.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")s.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")s.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")s.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)s.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)s.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))s.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))s.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)s.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)s.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))s.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))s.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))s.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))s.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")s.push({path:`customDirectives[${n}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")s.push({path:`customDirectives[${n}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))s.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")s.push({path:`middleware[${n}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")s.push({path:`middleware[${n}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))s.push({path:`middleware[${n}].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)s.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))s.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))s.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((n,l)=>{if(!n.pattern||typeof n.pattern!=="string")s.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(n.strategy))s.push({path:`pwa.routes[${l}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(n.maxAgeSeconds!==void 0&&(typeof n.maxAgeSeconds!=="number"||n.maxAgeSeconds<0))s.push({path:`pwa.routes[${l}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(n.maxEntries!==void 0&&(typeof n.maxEntries!=="number"||n.maxEntries<1))s.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))s.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((n)=>typeof n!=="number"||n<16||n>1024).length>0)s.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)s.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:s.length===0,errors:s,warnings:i}}
|
|
1312
|
+
export{Xa,Ja,cr,Ye,Ya,cs,L,wf,No,a,P,ph,fh};
|