@stacksjs/stx 0.2.802 → 0.2.803
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-bbt09ebh.js → chunk-0ekdbagy.js} +3 -3
- package/dist/{chunk-brhas9mp.js → chunk-0rjcbqk3.js} +2 -2
- package/dist/{chunk-p4aaxpaw.js → chunk-0svj1nfa.js} +4 -4
- package/dist/chunk-0xqec4yj.js +2 -0
- package/dist/{chunk-wes7vsze.js → chunk-16362f43.js} +1 -1
- package/dist/chunk-19nnq90g.js +2 -0
- package/dist/{chunk-1pz11ez9.js → chunk-1carv1dw.js} +1 -1
- package/dist/{chunk-enpx5t99.js → chunk-1ydz2w3t.js} +1 -1
- package/dist/{chunk-9gwhs0gk.js → chunk-2ws2qe1k.js} +2 -2
- package/dist/chunk-36zj3myn.js +2 -0
- package/dist/chunk-3e85etrf.js +2 -0
- package/dist/{chunk-hzhsg5j7.js → chunk-3ebwrpax.js} +5 -5
- package/dist/{chunk-bs02d6mm.js → chunk-3ec6jf9b.js} +30 -30
- package/dist/{chunk-m4w61tyq.js → chunk-3es17qjn.js} +9 -9
- package/dist/{chunk-xndhzwdj.js → chunk-3k4xb05m.js} +5 -5
- package/dist/{chunk-b9d70mgr.js → chunk-3vpgr6nk.js} +3 -3
- package/dist/{chunk-xrvdef6x.js → chunk-3z0e637x.js} +1 -1
- package/dist/{chunk-wy0gghvh.js → chunk-427mhgje.js} +1 -1
- package/dist/{chunk-g02jnsz5.js → chunk-4jrf6gsk.js} +1 -1
- package/dist/chunk-4mb75g61.js +2 -0
- package/dist/chunk-4n7yqb9w.js +2 -0
- package/dist/chunk-5eqna31h.js +2 -0
- package/dist/{chunk-7tkxshah.js → chunk-5s31y4m0.js} +11 -11
- package/dist/{chunk-dxemdr58.js → chunk-5vxk8bz9.js} +13 -13
- package/dist/{chunk-ved3r01r.js → chunk-69cphbrz.js} +86 -86
- package/dist/chunk-6a97a9wk.js +2 -0
- package/dist/{chunk-h1dwth11.js → chunk-6dcc4ezx.js} +1 -1
- package/dist/{chunk-7yb82rm6.js → chunk-6s9bk98p.js} +2 -2
- package/dist/chunk-72cm91wm.js +2 -0
- package/dist/{chunk-gk214p91.js → chunk-77a2hse0.js} +6 -6
- package/dist/{chunk-mt95md1e.js → chunk-7agp0wj2.js} +1 -1
- package/dist/{chunk-cs38hg43.js → chunk-7v1pwjke.js} +4 -4
- package/dist/{chunk-y9bj3566.js → chunk-7xs45trj.js} +2 -2
- package/dist/{chunk-xbvx8j82.js → chunk-85w7kf2j.js} +1 -1
- package/dist/chunk-87g1ryzs.js +2 -0
- package/dist/chunk-8g3bgcac.js +2 -0
- package/dist/{chunk-0vztrb90.js → chunk-8je2zse3.js} +15 -15
- package/dist/chunk-8m5w99f3.js +2 -0
- package/dist/chunk-8wd83rnz.js +2 -0
- package/dist/chunk-97daxgfk.js +2 -0
- package/dist/{chunk-c36bj74x.js → chunk-9h72drk3.js} +1 -1
- package/dist/chunk-9wmjmas8.js +2 -0
- package/dist/{chunk-x82zksaj.js → chunk-a0r4dpzs.js} +2 -2
- package/dist/{chunk-e5fszb5z.js → chunk-amewvsn1.js} +2 -2
- package/dist/chunk-aqydav9y.js +2 -0
- package/dist/chunk-aznnh6cy.js +3 -0
- package/dist/{chunk-n7arptzc.js → chunk-baj6w8ja.js} +2 -2
- package/dist/{chunk-8fvgsd9v.js → chunk-bejj0gra.js} +3 -3
- package/dist/{chunk-wpendr22.js → chunk-c5vzr1va.js} +2 -2
- package/dist/{chunk-eayewa2s.js → chunk-cfbpvm5e.js} +2 -2
- package/dist/{chunk-qx5jhe7h.js → chunk-cwnx4rxk.js} +2 -2
- package/dist/chunk-cxahdpzz.js +2 -0
- package/dist/{chunk-d8rcba53.js → chunk-d47m4qat.js} +2 -2
- package/dist/{chunk-s81y1dw3.js → chunk-d98hgxky.js} +1 -1
- package/dist/chunk-da886asf.js +2 -0
- package/dist/{chunk-24x7s0x5.js → chunk-dc584r4z.js} +4 -4
- package/dist/{chunk-casq5t61.js → chunk-dqa1g676.js} +2 -2
- package/dist/{chunk-antc6crh.js → chunk-dvbd5fxe.js} +1 -1
- package/dist/{chunk-rxhymzj8.js → chunk-e39nkbt4.js} +3 -3
- package/dist/chunk-e6snnz4t.js +2 -0
- package/dist/chunk-e848m5tj.js +2 -0
- package/dist/chunk-et8n16k2.js +2 -0
- package/dist/{chunk-fy6sdbak.js → chunk-evmxrmjb.js} +8 -8
- package/dist/chunk-ewzdsksb.js +2 -0
- package/dist/chunk-fsjkavq5.js +2 -0
- package/dist/{chunk-x0ttkvr7.js → chunk-g9xx8qh1.js} +3 -3
- package/dist/{chunk-6n5cbyes.js → chunk-gb3tv53p.js} +2 -2
- package/dist/{chunk-ewhkvqce.js → chunk-gebb12ak.js} +11 -11
- package/dist/{chunk-3vfxn6g5.js → chunk-gmme8c1s.js} +1 -1
- package/dist/{chunk-pamtcna7.js → chunk-gq5ffpq0.js} +1 -1
- package/dist/{chunk-7j4tf0ba.js → chunk-gzs0ertq.js} +1 -1
- package/dist/chunk-h9yvb9qn.js +2 -0
- package/dist/{chunk-dbbc84mj.js → chunk-hn2me1qx.js} +2 -2
- package/dist/{chunk-rs0ejvjm.js → chunk-hpqrcpjb.js} +1 -1
- package/dist/{chunk-gjf8cjdt.js → chunk-hwcfgs3e.js} +3 -3
- package/dist/chunk-j49t3p7e.js +2 -0
- package/dist/chunk-jjcw2pa9.js +2 -0
- package/dist/{chunk-wvnzq8w8.js → chunk-k4csq6pk.js} +4 -4
- package/dist/{chunk-4gf3khd9.js → chunk-k5xyb0dq.js} +1 -1
- package/dist/{chunk-mz1kffvs.js → chunk-k86573fe.js} +4 -4
- package/dist/chunk-kn84qg00.js +2 -0
- package/dist/{chunk-3j9zzpbd.js → chunk-kq0cee7k.js} +3 -3
- package/dist/{chunk-v18816jj.js → chunk-m1mrq876.js} +5 -5
- package/dist/chunk-m5cdkb11.js +2 -0
- package/dist/{chunk-2vqpz4qv.js → chunk-m7hfcxt3.js} +2 -2
- package/dist/{chunk-ddk34ppv.js → chunk-mmh2k7ab.js} +3 -3
- package/dist/chunk-mrc7hc4a.js +2 -0
- package/dist/{chunk-nya33asw.js → chunk-ncptqa8v.js} +5 -5
- package/dist/{chunk-sxee2rxz.js → chunk-ncyjaxyz.js} +1 -1
- package/dist/chunk-nmc1vj8f.js +2 -0
- package/dist/chunk-nrqv8s48.js +2 -0
- package/dist/{chunk-06hc6rs6.js → chunk-nsxjt6h3.js} +1 -1
- package/dist/chunk-pr6nrg6x.js +2 -0
- package/dist/{chunk-zwptpjjt.js → chunk-ps5by9sq.js} +6 -6
- package/dist/{chunk-aj5na3d3.js → chunk-qeyzgyhk.js} +1 -1
- package/dist/{chunk-e1g3ns8y.js → chunk-qm3hkrcw.js} +4 -4
- package/dist/{chunk-we6jnjjp.js → chunk-r1vkk7qp.js} +2 -2
- package/dist/chunk-rmpgtyqh.js +2 -0
- package/dist/chunk-rnz6g3xv.js +2 -0
- package/dist/{chunk-q7zwv88b.js → chunk-rpen41w3.js} +2 -2
- package/dist/{chunk-byatzyvf.js → chunk-rssxm2jw.js} +2 -2
- package/dist/chunk-s1k2sc69.js +2 -0
- package/dist/chunk-s3z8jtfj.js +2 -0
- package/dist/{chunk-esm9sdyf.js → chunk-s9xs2ff4.js} +6 -6
- package/dist/{chunk-znx5m1jv.js → chunk-sphc7xzx.js} +1 -1
- package/dist/chunk-syvsj91a.js +2 -0
- package/dist/{chunk-kzny87pz.js → chunk-tdcgskyy.js} +1 -1
- package/dist/chunk-tzb0n60s.js +2 -0
- package/dist/chunk-va9w63nh.js +2 -0
- package/dist/{chunk-qpvwxppw.js → chunk-vbc8a8fh.js} +4 -4
- package/dist/{chunk-s9b6abkb.js → chunk-vkn133cs.js} +2 -2
- package/dist/{chunk-nhfksrce.js → chunk-w3dsj0a6.js} +1 -1
- package/dist/chunk-w5xq1217.js +2 -0
- package/dist/{chunk-hrrrf46j.js → chunk-w6n4y2xg.js} +2 -2
- package/dist/chunk-wwbng2jf.js +2 -0
- package/dist/chunk-x2hc3zth.js +2 -0
- package/dist/chunk-x7qctqj2.js +2 -0
- package/dist/{chunk-c1bsagbe.js → chunk-xrd1md4j.js} +6 -6
- package/dist/{chunk-3dtp59r9.js → chunk-y2q46m8b.js} +3 -3
- package/dist/{chunk-a5byhf8f.js → chunk-y7sf7aj0.js} +1 -1
- package/dist/{chunk-t65tn8ee.js → chunk-ybjfr7e8.js} +2 -2
- package/dist/{chunk-m0c64sna.js → chunk-ycr9bkww.js} +1 -1
- package/dist/{chunk-r9eyepbk.js → chunk-yhfrs6yn.js} +6 -6
- package/dist/chunk-yjezsy4p.js +2 -0
- package/dist/{chunk-fsfj0s13.js → chunk-zmckz1eq.js} +3 -3
- package/dist/cli.js +19 -19
- package/dist/client-script.js +11 -10
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-077dwzpp.js +0 -2
- package/dist/chunk-1338vj5g.js +0 -2
- package/dist/chunk-14qhn86r.js +0 -2
- package/dist/chunk-27p6cxa2.js +0 -2
- package/dist/chunk-2jwmtbsj.js +0 -2
- package/dist/chunk-4q2fh4r4.js +0 -2
- package/dist/chunk-50be1xy0.js +0 -2
- package/dist/chunk-5hgghq24.js +0 -2
- package/dist/chunk-6cgak0k1.js +0 -2
- package/dist/chunk-6fq522rd.js +0 -2
- package/dist/chunk-77v7g18n.js +0 -2
- package/dist/chunk-8fnhv8jq.js +0 -2
- package/dist/chunk-8hm4a8p2.js +0 -2
- package/dist/chunk-9736003n.js +0 -2
- package/dist/chunk-9767yz39.js +0 -2
- package/dist/chunk-a0xxm3eh.js +0 -2
- package/dist/chunk-b22yj5j5.js +0 -2
- package/dist/chunk-b29x9hsz.js +0 -2
- package/dist/chunk-bz3papjy.js +0 -2
- package/dist/chunk-d1c1qggs.js +0 -2
- package/dist/chunk-dwn8ye99.js +0 -2
- package/dist/chunk-e88bsw36.js +0 -2
- package/dist/chunk-fq1dw4ph.js +0 -3
- package/dist/chunk-gabw11g3.js +0 -2
- package/dist/chunk-gxrpf87x.js +0 -2
- package/dist/chunk-j0jgc426.js +0 -2
- package/dist/chunk-jdjv5x6q.js +0 -2
- package/dist/chunk-jkn9garq.js +0 -2
- package/dist/chunk-jn6g5n02.js +0 -2
- package/dist/chunk-jy9qmwpm.js +0 -2
- package/dist/chunk-krqj3cx9.js +0 -2
- package/dist/chunk-kzt46v41.js +0 -2
- package/dist/chunk-md55r6zp.js +0 -2
- package/dist/chunk-mv9k42dn.js +0 -2
- package/dist/chunk-ntwgk0tf.js +0 -2
- package/dist/chunk-sfvdj9dj.js +0 -2
- package/dist/chunk-szma9dby.js +0 -2
- package/dist/chunk-tkb335d7.js +0 -2
- package/dist/chunk-txyyvtdp.js +0 -2
- package/dist/chunk-vxd3akt4.js +0 -2
- package/dist/chunk-wf6vjd41.js +0 -2
- package/dist/chunk-wghv9vr6.js +0 -2
- package/dist/chunk-whq40bdm.js +0 -2
- package/dist/chunk-yxsrerew.js +0 -2
- package/dist/chunk-z0kx564w.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,l}from"./chunk-
|
|
2
|
+
import{t,l}from"./chunk-gebb12ak.js";import{s,bn,h}from"./chunk-69cphbrz.js";import{tt}from"./chunk-hn2me1qx.js";import{Cs,Es}from"./chunk-3z0e637x.js";import{xc,Yo,ks,_s}from"./chunk-vbc8a8fh.js";import{bc,wc}from"./chunk-g9xx8qh1.js";import{xt}from"./chunk-mv3yhspn.js";import{un,Tc,mr,hr}from"./chunk-0rjcbqk3.js";import{g}from"./chunk-0dve54ne.js";import{to}from"./chunk-gqjb1y7c.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Bt}from"bunfig";var U={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,r={}){let{duration:i,delay:o,ease:n,direction:c,custom:d}={...U,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -234,7 +234,7 @@ else {
|
|
|
234
234
|
</script>
|
|
235
235
|
`}var Pe={name:"transition",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let n=r[0],c=r.length>1?Number.parseInt(r[1],10)||U.duration:U.duration,d=r.length>2?r[2]||U.ease:U.ease,p=r.length>3?Number.parseInt(r[3],10)||U.delay:U.delay,u=r.length>4?r[4]||U.direction:U.direction,m=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(n,{duration:c,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
236
|
style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},ke={name:"scrollAnimate",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let n=r[0],c=r.length>1?Number.parseInt(r[1],10)||300:300,d=r.length>2?r[2]||"ease":"ease",p=r.length>3?Number.parseFloat(r[3])||0.2:0.2,u=r.length>4?Number.parseInt(r[4],10)||0:0,m=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}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"},Ae={name:"animationGroup",handler:(e,r,i,o)=>{if(r.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let n=r[0],c=r.slice(1).map((m)=>m.startsWith("#")||m.startsWith(".")?m:`#${m}`),d=i.staggerDelay||50,p=i.sequence||!0,u=dt(n,c,{staggerDelay:d,sequence:p});return`${e}
|
|
237
|
-
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,r,i,o)=>{let n=r.length>0?r[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${n?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function
|
|
237
|
+
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,r,i,o)=>{let n=r.length>0?r[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${n?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function pc(e,r,i,o){let n=e;if(o.animation?.enabled===!1)return n;let c=i.includes("test")&&i.includes("animation");if(!ot(n)&&!c)return n;if(!n.includes('<style id="stx-animation-base">')){let p=ct();n=n.replace("</head>",`${p}
|
|
238
238
|
</head>`)}if(n.includes("stx-observe")){if(!n.includes("Intersection Observer for scroll animations")){let u=lt(),m=n.lastIndexOf("</body>");if(m!==-1)n=n.slice(0,m)+u+`
|
|
239
239
|
`+n.slice(m)}}return n}async function ut(e,r,i,o){let n=r[0]?.replace(/['"]/g,"")||"main",c=tt();if(n!=="main")c=c.replace("container:'main'",`container:'${n}'`);return`<script data-stx-router>${c}</script>`}var Re={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var pt={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 Oe(e){let r=e.heatmap;if(!r?.enabled)return"";let i={...pt,...r};return`
|
|
240
240
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
@@ -619,7 +619,7 @@ else {
|
|
|
619
619
|
};
|
|
620
620
|
})();
|
|
621
621
|
</script>
|
|
622
|
-
`}function
|
|
622
|
+
`}function fc(e,r){let i=Oe(r);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 Ee={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,i,o)=>{let n=i.__stx_config||{};if(r.length>0){let c=mt(r.join(" "));n.heatmap={...n.heatmap,...c,enabled:!0}}return Oe(n)}};function mt(e){let r={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[n,c]=o.split("="),d=c?.replace(/["']/g,"");switch(n){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function dr(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(r);if(!i)return{data:{},content:e.trim()};let o=i[1],n=e.slice(i[0].length),c={};for(let d of o.split(`
|
|
623
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)}c[m]=y}return{data:c,content:n.trim()}}function Qe(e,r={}){let{gfm:i=!0,breaks:o=!1}=r,n=e,c=[];if(n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=c.length,x=f?` class="language-${J(f)}"`:"";return c.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="${Ie(v)?J(v):""}" alt="${J(f)}" />`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ie(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
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>`,P=v.trim().split(`
|
|
625
625
|
`).map((S)=>`<tr>${S.split("|").map((k)=>k.trim()).filter(Boolean).map((k)=>`<td>${J(k)}</td>`).join("")}</tr>`).join(`
|
|
@@ -637,7 +637,7 @@ ${P}
|
|
|
637
637
|
`:`
|
|
638
638
|
`)}</p>`);if(n=p.join(`
|
|
639
639
|
`),o)n=n.replace(/\n/g,`<br />
|
|
640
|
-
`);for(let y=0;y<c.length;y++)n=n.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function
|
|
640
|
+
`);for(let y=0;y<c.length;y++)n=n.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function gc(e,r,i=""){let o=e,n=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.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),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(S!==-1&&S<A&&S!==p){let k=e[S+9];if(k==="("||k===`
|
|
641
641
|
`||k==="\r"||k===" "||k===void 0)f++;v=S+9}else{if(f--,f===0){b=A;break}v=A+12}}if(b===-1)continue;let x=e.slice(y,b),P=e.slice(p,b+12);n.push({fullMatch:P,options:m,content:x,index:p}),c.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 P=x.trim();if(P)f[P]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=Qe(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 Te(e,r,i,o){let n={gfm:!0,breaks:!1};return r.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")n.breaks=!0;if(d==="no-gfm")n.gfm=!1}),Qe(e.trim(),n)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],gt=[1,1.5,2,3],te=["avif","webp","jpeg"],ft={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function me(e,r=Z,i={},o){return r.sort((n,c)=>n-c).map((n)=>`${re(e,{...i,w:n,fm:o})} ${n}w`).join(", ")}function Me(e,r,i=gt,o={},n){return i.sort((c,d)=>c-d).map((c)=>{let d=Math.round(r*c);return`${re(e,{...o,w:d,dpr:c,fm:n})} ${c}x`}).join(", ")}function ge(e,r="100vw"){if(!e||Object.keys(e).length===0)return r;let o=Object.entries(e).map(([n,c])=>{let d=/^\d+$/.test(n)?`${n}px`:n;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((n,c)=>n.numericBp-c.numericBp).map(({bp:n,size:c})=>`(max-width: ${n}) ${c}`);return o.push(r),o.join(", ")}function re(e,r={}){let i=Object.entries(r).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(i.length===0)return e;let o=i.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),n=e.includes("?")?"&":"?";return`${e}${n}${o}`}function fe(e){return ft[e]||"application/octet-stream"}var ht={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},ye=`
|
|
642
642
|
.stx-img-placeholder {
|
|
643
643
|
position: relative;
|
|
@@ -684,7 +684,7 @@ ${P}
|
|
|
684
684
|
#${e}.stx-img-loaded img {
|
|
685
685
|
opacity: 1;
|
|
686
686
|
}
|
|
687
|
-
`.trim()}var he=new Map;async function Ne(e,r={}){let i=`${e}:${JSON.stringify(r)}`;if(he.has(i))return he.get(i);let o=await vt(e,r);return he.set(i,o),o}async function $t(){try{return await import("./chunk-
|
|
687
|
+
`.trim()}var he=new Map;async function Ne(e,r={}){let i=`${e}:${JSON.stringify(r)}`;if(he.has(i))return he.get(i);let o=await vt(e,r);return he.set(i,o),o}async function $t(){try{return await import("./chunk-w5xq1217.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,r={}){let i=r,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Pt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,r);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,r);let{src:n,alt:c,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:P={},lazy:S=!0,priority:A=!1,loading:k=A?"eager":ce,decoding:O=le,fetchpriority:E,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:z}=e,{class:L,style:T,id:N}=e,_=e.data||{},{isDev:V=!1,baseUrl:G=""}=r;if(V&&!r.optimize)return Dt(e);let W,R,q=N||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!A)try{W=await Ne(n,{strategy:x,...P}),R=je(q,W,P)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,q,W,r);else X=await St(e,q,W,r);let ee;if(A){let De=f.includes("webp")?"webp":f[0],nt=me(n,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(R)ae.push(R);let rt=S?We(q):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
|
|
688
688
|
`):void 0,script:rt}}async function St(e,r,i,o){let{src:n,alt:c,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:x=!1,loading:P=x?"eager":ce,decoding:S=le,fetchpriority:A,objectFit:k,objectPosition:O,crossorigin:E,referrerpolicy:w}=e,{class:C,style:D}=e,z=e.data||{},L=typeof u==="object"?ge(u):u||"100vw",T=[];for(let V of y){let G=me(n,m,{...v,q:f},V),W=fe(V);if(b&&!x)T.push(` <source type="${W}" data-srcset="${G}" data-sizes="${L}" />`);else T.push(` <source type="${W}" srcset="${G}" sizes="${L}" />`)}let N=be({src:re(n,{...v,q:f}),alt:c,width:d,height:p,loading:x?void 0:P,decoding:S,fetchpriority:x?"high":A,objectFit:k,objectPosition:O,crossorigin:E,referrerpolicy:w,className:Le(C,i),style:xe(D,k,O,i),lazy:b&&!x,data:z}),_;if(i){let V=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${r}" class="stx-img-placeholder" style="${V}">
|
|
689
689
|
<picture>
|
|
690
690
|
${T.join(`
|
|
@@ -748,7 +748,7 @@ ${w.join(`
|
|
|
748
748
|
`):void 0,script:G}}async function Fe(e,r,i){let o={src:r.src,processed:!0,variants:[],placeholder:r.placeholder?.dataURL,originalWidth:r.placeholder?.width,originalHeight:r.placeholder?.height};for(let[n,c]of Object.entries(r.byFormat))if(c)o.variants.push(...c);return we(e,o,i)}function kt(){return xt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,r,i,o)=>{let{src:n,alt:c,options:d}=At(e,r,i);if(!n)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:n,alt:c||"",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 oe(p,{isDev:u}),y=m.html;if(m.preloadLink)y=m.preloadLink+`
|
|
749
749
|
`+y;if(m.css)y+=`
|
|
750
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 At(e,r,i){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=_t(o),c=$e(n[0],i)||"",d=$e(n[1],i)||"",p={};if(n[2]){let u=$e(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:c,alt:d,options:p}}function _t(e){let r=[],i="",o=!1,n="",c=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==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function $e(e,r){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=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function xs(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let r of e)if(Rt(ne.join(r,"View.stx")))return r;return e[0]}async function Ue(){try{return await import("./chunk-
|
|
751
|
+
<script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,r,i){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=_t(o),c=$e(n[0],i)||"",d=$e(n[1],i)||"",p={};if(n[2]){let u=$e(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:c,alt:d,options:p}}function _t(e){let r=[],i="",o=!1,n="",c=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==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function $e(e,r){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=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function xs(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let r of e)if(Rt(ne.join(r,"View.stx")))return r;return e[0]}async function Ue(){try{return await import("./chunk-x2hc3zth.js")}catch(e){if(!He)console.warn("[stx-media] Video processor not available, some features disabled:",e),He=!0;return null}}var He=!1,Be=!0,Je="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,r={}){let i=r,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,r);let n;if(o.generatePoster&&o.src&&!e.poster)n=await Nt(o,i);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:x=!0,lazy:P=!0,player:S="native",type:A,width:k,height:O,crossorigin:E,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=n||p,{class:z,style:L}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,r);if(A&&A!=="video")return Et(c||"",A,e);let N=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${T}"`];if(m)_.push("controls");if(y)_.push("autoplay");if(f)_.push("muted");if(v)_.push("loop");if(x)_.push("playsinline");if(w)_.push("disablepictureinpicture");if(C)_.push("disableremoteplayback");if(E)_.push(`crossorigin="${E}"`);if(P){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),D)_.push(`data-poster="${M(D)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),D)_.push(`poster="${M(D)}"`);if(k)_.push(`width="${k}"`);if(O)_.push(`height="${O}"`);if(z)_.push(`class="${M(z)}"`);if(L)_.push(`style="${M(L)}"`);let V=N.map((R)=>` <source ${P?`data-src="${M(R.src)}"`:`src="${M(R.src)}"`} type="${R.type}"${R.media?` media="${R.media}"`:""} />`).join(`
|
|
752
752
|
`),G=`<video ${_.join(" ")}>
|
|
753
753
|
${V}
|
|
754
754
|
Your browser does not support the video tag.
|
|
@@ -1307,6 +1307,6 @@ ${y}
|
|
|
1307
1307
|
customElements.define('${r}', ${d});
|
|
1308
1308
|
`}async function Ze(e,r,i,o){if(r.length<1)return l("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let n=r[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=F.isAbsolute(d)?[F.join(d,`${n}.stx`),F.join(F.dirname(o),`${n}.stx`)]:[F.join(F.dirname(o),d,`${n}.stx`),F.join(process.cwd(),d,`${n}.stx`),F.join(F.dirname(o),`${n}.stx`)],u=null;for(let f of p)if(await s(f)){u=await Bun.file(f).text();break}if(!u)return l("WebComponent",`Component file not found: ${n}.stx`,t.FILE_NOT_FOUND);let m=Ht(u,n);return`<script type="module">
|
|
1309
1309
|
${Ut(m)}
|
|
1310
|
-
</script>`}var B={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:un,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:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},wc,vc,Cs,Es,Pe,Ae,_e,ke,Re,Ee,qe,Se,...to],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 Jt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),c=j.join(n,"resources","views"),d=j.join(n,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var et=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function Ff(e,r){let i=!e.root,o=Jt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${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(!Ce.has(e)){let n={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)n[c]=d}Ce.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Kt(d,n))continue;e[c]=j.join(n,d)}}for(let n of pe){let c=e[n];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[n]=j.resolve(r,c)}return e}function Gt(e,r){let i=Ce.get(e);for(let o of pe){let n=e[o];if(typeof n!=="string"||!n)continue;let c=j.isAbsolute(n)?n:j.join(r,n);if(Q.existsSync(c))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if($c(e.stateDir),e.stateDir=mr(),e.cachePath=hr(e.cachePath),e.build)e.build.cacheDir=hr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=hr(e.media.cache.directory);if(e.story)e.story.outDir=hr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Go(e,r=Bt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let r=e?j.resolve(e):process.cwd(),i=ue.get(r);if(i&&i.signature!==ks(i.graph)){let c=Y.get(r);if(Y.delete(r),ue.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-kzt46v41.js"),{partialsCache:p}=await import("./chunk-1338vj5g.js");if(d(),p.clear(),c&&i.configSignature===_s(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await Yo(y,r),ue.set(r,{graph:y,signature:ks(y),configSignature:_s(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(r);if(o)return o;let n=(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 Go({name:"ui",cwd:j.join(r,"config"),defaultConfig:B,errorPolicy:"throw",verbose:!1});u=(await Go({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Go({name:"stx",alias:"ui",cwd:r,defaultConfig:B,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await Sc(r,B);u=v.config,ue.set(r,{graph:v.graph,signature:ks(v.graph),configSignature:_s(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-b22yj5j5.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-077dwzpp.js");await b(r,u.runtimeConfig)}Yt(u),Xt(u),Ff(u,r),Gt(u,r);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:[r]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-tkb335d7.js"),b=[],x=[];for(let P of f){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,O;try{let w=g.resolve(S,{paths:[r]});k=await import(w),O=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),O=j.dirname(w)}let E=k.default||k;if(!v.has(E.name))await v.register(E,u);if(E.components){let w=Array.isArray(E.components)?E.components:[E.components];for(let C of w)b.push(j.resolve(O,C))}if(E.pages){let w=j.resolve(O,E.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(E.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:O,config:u};await E.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${E.name||S}
|
|
1310
|
+
</script>`}var B={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:un,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:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},bc,wc,Cs,Es,Pe,Ae,_e,ke,Re,Ee,qe,Se,...to],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 Jt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),c=j.join(n,"resources","views"),d=j.join(n,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var et=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function Bf(e,r){let i=!e.root,o=Jt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${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(!Ce.has(e)){let n={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)n[c]=d}Ce.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Kt(d,n))continue;e[c]=j.join(n,d)}}for(let n of pe){let c=e[n];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[n]=j.resolve(r,c)}return e}function Gt(e,r){let i=Ce.get(e);for(let o of pe){let n=e[o];if(typeof n!=="string"||!n)continue;let c=j.isAbsolute(n)?n:j.join(r,n);if(Q.existsSync(c))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Tc(e.stateDir),e.stateDir=mr(),e.cachePath=hr(e.cachePath),e.build)e.build.cacheDir=hr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=hr(e.media.cache.directory);if(e.story)e.story.outDir=hr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Go(e,r=Bt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let r=e?j.resolve(e):process.cwd(),i=ue.get(r);if(i&&i.signature!==ks(i.graph)){let c=Y.get(r);if(Y.delete(r),ue.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-va9w63nh.js"),{partialsCache:p}=await import("./chunk-8wd83rnz.js");if(d(),p.clear(),c&&i.configSignature===_s(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await Yo(y,r),ue.set(r,{graph:y,signature:ks(y),configSignature:_s(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(r);if(o)return o;let n=(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 Go({name:"ui",cwd:j.join(r,"config"),defaultConfig:B,errorPolicy:"throw",verbose:!1});u=(await Go({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Go({name:"stx",alias:"ui",cwd:r,defaultConfig:B,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await xc(r,B);u=v.config,ue.set(r,{graph:v.graph,signature:ks(v.graph),configSignature:_s(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-m5cdkb11.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-jjcw2pa9.js");await b(r,u.runtimeConfig)}Yt(u),Xt(u),Bf(u,r),Gt(u,r);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:[r]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-3e85etrf.js"),b=[],x=[];for(let P of f){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,O;try{let w=g.resolve(S,{paths:[r]});k=await import(w),O=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),O=j.dirname(w)}let E=k.default||k;if(!v.has(E.name))await v.register(E,u);if(E.components){let w=Array.isArray(E.components)?E.components:[E.components];for(let C of w)b.push(j.resolve(O,C))}if(E.pages){let w=j.resolve(O,E.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(E.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:O,config:u};await E.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${E.name||S}
|
|
1311
1311
|
`)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:xs(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(r,n),n.catch(()=>{if(Y.get(r)===n)Y.delete(r)}),!e)se=n,n.then((c)=>{K=c}).catch(()=>{});return n}var I=new Proxy(B,{get(e,r){if(K&&r in K)return K[r];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[r]}});function Fh(e){return e}function zh(e){let r=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.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)r.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)r.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))r.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))r.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)r.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)r.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))r.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))r.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))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`customDirectives[${n}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`customDirectives[${n}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`middleware[${n}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`middleware[${n}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))r.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)r.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))r.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))r.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,c)=>{if(!n.pattern||typeof n.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(n.strategy))r.push({path:`pwa.routes[${c}].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))r.push({path:`pwa.routes[${c}].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))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.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)r.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((c)=>!o.includes(c)).length>0)r.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:r.length===0,errors:r,warnings:i}}
|
|
1312
|
-
export{fc,
|
|
1312
|
+
export{pc,fc,dr,Qe,gc,xs,Ss,B,Bf,Go,a,I,Fh,zh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{If,ds}from"./chunk-zmckz1eq.js";import"./chunk-aznnh6cy.js";import"./chunk-y7sf7aj0.js";import"./chunk-1carv1dw.js";import{kr}from"./chunk-69cphbrz.js";import"./chunk-dqa1g676.js";import"./chunk-m7hfcxt3.js";import{st}from"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{st as freeIdentifiers,ds as processComponents,If as processESImports,kr as rendersAsElement};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{A,t,l}from"./chunk-
|
|
3
|
-
`),n=[{obj:s,indent:-1}];for(let r of i){let o=r.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let c=o.search(/\S/);if(c===-1)continue;while(n.length>1&&n[n.length-1].indent>=c)n.pop();let u=n[n.length-1].obj,a=o.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(a){let[,,g,p]=a,f=g.trim(),m=p.trim();if(m==="")u[f]={},n.push({obj:u[f],indent:c});else u[f]=ee(m)}}return s}function ee(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let s=e.toLowerCase();if(s==="true"||s==="yes")return!0;if(s==="false"||s==="no")return!1;if(s==="null"||s==="~")return null;let i=Number(e);if(!Number.isNaN(i)&&e!=="")return i;return e}function te(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function re(e,s){return G(e,s)}function ne(e,s){for(let i of e){let n=i.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let c=Number.parseInt(r[1],10);if(s===c)return r[2];continue}let o=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(o){let c=Number.parseInt(o[1],10),u=o[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(o[2],10);if(s>=c&&s<=u)return o[3];continue}}if(e.length===2)return s===1?e[0].trim():e[1].trim();if(s<e.length)return e[s].trim();return e[e.length-1].trim()}function ie(e,s={}){return j(e,s)}function j(e,s){let i="",n=0;while(n<e.length)if(e[n]==="{"){let r=se(e,n);if(r===-1){i+=e[n],n++;continue}let o=e.slice(n+1,r);i+=ae(o,s),n=r+1}else if(e[n]==="'"&&n+1<e.length)if(e[n+1]==="'")i+="'",n+=2;else if(e[n+1]==="{"||e[n+1]==="}")i+=e[n+1],n+=2;else i+=e[n],n++;else i+=e[n],n++;return i}function se(e,s){let i=0;for(let n=s;n<e.length;n++)if(e[n]==="{")i++;else if(e[n]==="}"){if(i--,i===0)return n}return-1}function ae(e,s){let i=oe(e);if(i.length===0)return`{${e}}`;let n=i[0].trim(),r=s[n];if(i.length===1)return r!==void 0?String(r):`{${n}}`;switch(i[1].trim().toLowerCase()){case"plural":return le(r,i.slice(2).join(","),s);case"select":return ue(r,i.slice(2).join(","));case"selectordinal":return de(r,i.slice(2).join(","));case"number":return pe(r,i[2]?.trim());case"date":return fe(r,i[2]?.trim());case"time":return me(r,i[2]?.trim());default:return r!==void 0?String(r):`{${e}}`}}function oe(e){let s=[],i="",n=0;for(let r=0;r<e.length;r++){let o=e[r];if(o==="{")n++,i+=o;else if(o==="}")n--,i+=o;else if(o===","&&n===0)s.push(i),i="";else i+=o}if(i)s.push(i);return s}function le(e,s,i){let n=Number(e)||0,r=I(s),o=`=${n}`;if(r[o])return E(r[o],n,i);let c=ce(n);if(r[c])return E(r[c],n,i);if(r.other)return E(r.other,n,i);return String(n)}function E(e,s,i){let n=e.replace(/#/g,String(s));return j(n,i)}function ce(e){let s=Math.abs(e),i=Math.floor(s),n=String(e).includes(".")?String(e).split(".")[1].length:0;if(i===1&&n===0)return"one";return"other"}function ue(e,s){let i=String(e||""),n=I(s);if(n[i])return n[i];return n.other||String(e)}function de(e,s){let i=Number(e)||0,n=I(s),r=ge(i);if(n[r])return n[r].replace(/#/g,String(i));if(n.other)return n.other.replace(/#/g,String(i));return String(i)}function ge(e){let s=Math.abs(e),i=s%10,n=s%100;if(i===1&&n!==11)return"one";if(i===2&&n!==12)return"two";if(i===3&&n!==13)return"few";return"other"}function I(e){let s={},i=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,n=i.exec(e);while(n!==null)s[n[1]]=n[2],n=i.exec(e);return s}function pe(e,s){let i=Number(e);if(Number.isNaN(i))return String(e);switch(s){case"integer":return Math.floor(i).toLocaleString();case"percent":return`${(i*100).toFixed(0)}%`;case"currency":return i.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return i.toLocaleString()}}function fe(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.dateStyle="short";break;case"medium":n.dateStyle="medium";break;case"long":n.dateStyle="long";break;case"full":n.dateStyle="full";break;default:n.dateStyle="medium"}return i.toLocaleDateString(void 0,n)}function me(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.timeStyle="short";break;case"medium":n.timeStyle="medium";break;case"long":n.timeStyle="long";break;case"full":n.timeStyle="full";break;default:n.timeStyle="short"}return i.toLocaleTimeString(void 0,n)}function be(e){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(e)}function O(e,s,i=!0,n={}){let r=e.split("."),o=s;for(let u of r){if(o===void 0||o===null)break;o=o[u]}if(o===void 0||o===null)return i?e:"";let c=String(o);if(be(c))return ie(c,n);if(c.includes("|")&&"count"in n){let u=Number(n.count),a=c.split("|");c=ne(a,u)}for(let[u,a]of Object.entries(n)){let g=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`:${g}`,"g"),()=>String(a))}return c}var D=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),he=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function q(e){if(!e)return"ltr";let s=e.trim().toLowerCase().replace(/_/g,"-").split("-"),i=s[0];if(!i)return"ltr";let n=s[1]?.length===4?s[1]:void 0;if(n)return he.has(n)?"rtl":"ltr";if(s.length>1&&D.has(`${i}-${s[1]}`))return"rtl";return D.has(i)?"rtl":"ltr"}async function hc(e,s,i,n){let r=e,o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,c={...P,...n.i18n},u=await re(c.locale,n);s.__translations=u,s.__locale=c.locale,s.__i18nConfig=c,r=await F(r,o,async(p,f,m,w,h)=>{try{let b={};if(m)try{let d=[()=>JSON.parse(m),()=>{let x=`{"data":${m}}`,S=JSON.parse(x);return typeof S.data==="object"?S.data:{}},()=>A(m,s)];for(let x of d)try{if(b=x(),Object.keys(b).length>0)break}catch{}}catch(d){if(n.debug)console.error("Error parsing parameters for @translate directive:",d)}let y=O(f,u,c.fallbackToKey,b);return y?Z(r,h,y,!1,p.length):w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return l("Translate",`Error in @translate('${f}'): ${b instanceof Error?b.message:String(b)}`,t.EVALUATION_ERROR)}});let a=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(n.debug){console.warn(`Processing translations in template. Sections: ${r.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let p=[...r.matchAll(a)];console.warn(`Found ${p.length} @translate matches`),p.forEach((f,m)=>console.warn(`Match ${m}: ${f[0]}, Key: ${f[1]}, Params: ${f[2]||"none"}`))}return r=await F(r,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(p,f,m,w)=>{try{let h={};if(m)try{let b=[()=>JSON.parse(m),()=>{let y=`{"data":${m}}`,d=JSON.parse(y);return typeof d.data==="object"?d.data:{}},()=>A(m,s)];for(let y of b)try{if(h=y(),Object.keys(h).length>0)break}catch{}}catch(b){if(n.debug)console.error("Error parsing parameters for @translate directive:",b)}return Z(r,w,O(f,u,c.fallbackToKey,h),!1,p.length)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return l("Translate",`Error in @translate('${f}'): ${h instanceof Error?h.message:String(h)}`,t.EVALUATION_ERROR)}}),r}async function F(e,s,i){let n=[];return e.replace(s,(o,...c)=>{let u=i(o,...c).then((a)=>({match:o,replacement:a}));return n.push(u),o}),(await Promise.all(n)).reduce((o,{match:c,replacement:u})=>o.replace(c,()=>u),e)}function _(e,s){if(!e||q(e)!=="rtl")return!1;return!s||s.trim().toLowerCase()!=="rtl"}function V(e){if(!e)return!1;return e.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||e.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function U(e,s){let i=new RegExp(`\\b${s}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);if(!i)return null;return i[2]??i[3]??i[4]??null}function yc(e,s,i,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,u,a)=>{let p={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[u]||"Make this element accessible";return`<!-- a11y-hint: ${a||p} -->`});let o=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(o,(c,u)=>`<span class="sr-only">${u.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(c,u,a)=>`<span id="${`desc-${u}`}" class="sr-only">${a}</span>`),r}function ye(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function xe(e){let s=new Map,i=e.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(r,o,c)=>{let u=s.get(c);if(!u)u=`stx-a11y-component-${s.size}`,s.set(c,u);return`<${o}${u}`}),n=new Map([...s.entries()].map(([r,o])=>[o,r]));return{protectedSource:i,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(o,c,u)=>{let a=n.get(u);return a?`<${c}${a}`:o})}}function we(e,s){let i=[],n=/<img\s+([^>]*)>/gi,r;r=n.exec(e);while(r!==null){let d=r[1];if(!/\balt\s*=/i.test(d))i.push({type:"missing-alt",element:r[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});r=n.exec(e)}let o=/<button([^>]*)>\s*<\/button>/gi;r=o.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"missing-accessible-name",element:r[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});r=o.exec(e)}let c=/<a\s+([^>]*)>\s*<\/a>/gi;r=c.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"link-missing-text",element:r[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});r=c.exec(e)}let u=/<(input|select|textarea)\s+([^>]*)>/gi;r=u.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=u.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),S=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=S&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${S[1]}["']`,"i").test(e),M=r.index,N=e.substring(0,M),Se=e.substring(M),H=(N.match(/<label\b/gi)||[]).length,z=(N.match(/<\/label>/gi)||[]).length,K=H>z;if(!B&&!K)i.push({type:"input-missing-label",element:r[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}r=u.exec(e)}let a=/<h([1-6])[^>]*>/gi,g=[];r=a.exec(e);while(r!==null)g.push(Number.parseInt(r[1],10)),r=a.exec(e);let p=0;for(let d of g){if(p>0&&d>p+1)i.push({type:"heading-skip",element:`<h${d}>`,message:`Heading level skipped from h${p} to h${d}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});p=d}if(/<html\b/i.test(e)&&!/<html[^>]*\slang\s*=/i.test(e))i.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let f=e.match(/<html\b([^>]*)>/i);if(f&&_(U(f[1],"lang"),U(f[1],"dir")))i.push({type:"missing-dir",element:f[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let m=/<table([^>]*)>([\s\S]*?)<\/table>/gi;r=m.exec(e);while(r!==null){let d=r[2];if(!V(U(r[1],"role"))&&!/<th\b/i.test(d))i.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});r=m.exec(e)}let w=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;r=w.exec(e);while(r!==null){if(!/\bmuted\b/i.test(r[0]))i.push({type:"autoplay-audio",element:`<${r[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});r=w.exec(e)}let h=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;r=h.exec(e);while(r!==null)i.push({type:"positive-tabindex",element:`tabindex="${r[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),r=h.exec(e);let b=/<iframe\s+([^>]*)>/gi;r=b.exec(e);while(r!==null){let d=r[1];if(!/\btitle\s*=/i.test(d)&&!/\baria-label\s*=/i.test(d))i.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});r=b.exec(e)}let y=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;r=y.exec(e);while(r!==null){let d=r[1].toLowerCase(),x=r[2];if(d!=="button"&&!/\btabindex\s*=/i.test(x))i.push({type:"button-not-focusable",element:r[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});r=y.exec(e)}return i}async function Ae(e,s){let{protectedSource:i}=xe(e);if(!ye())return we(i,s);let n=[];try{let r=globalThis.document.createElement("div");r.innerHTML=i,r.querySelectorAll("img").forEach((a)=>{if(!a.hasAttribute("alt"))n.push({type:"missing-alt",element:`<${a.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),r.querySelectorAll('button, a, [role="button"]').forEach((a)=>{if(!(a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby")||a.textContent&&a.textContent.trim().length>0))n.push({type:"missing-accessible-name",element:`<${a.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),r.querySelectorAll("input, select, textarea").forEach((a)=>{let g=a.getAttribute("id"),p=g&&r.querySelector(`label[for="${g}"]`),f=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),m=a.closest("label")!==null;if(!p&&!f&&!m)n.push({type:"input-missing-label",element:`<${a.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let o=Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")),c=0;for(let a of o){let g=Number.parseInt(a.tagName.charAt(1));if(c>0&&g>c+1)n.push({type:"heading-skip",element:`<${a.outerHTML}>`,message:`Heading level skipped from h${c} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});c=g}let u=r.querySelector("html");if(i.includes("<html")&&u&&!u.hasAttribute("lang"))n.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(u&&_(u.getAttribute("lang"),u.getAttribute("dir")))n.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(r.querySelectorAll("a").forEach((a)=>{let g=a.textContent&&a.textContent.trim().length>0,p=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),f=a.hasAttribute("title"),m=a.querySelector("img[alt]");if(!g&&!p&&!f&&!m)n.push({type:"link-missing-text",element:`<${a.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),i.includes("<nav")||i.includes("<header")){if(!r.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&r.querySelectorAll("a").length>5)n.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(r.querySelectorAll("table").forEach((a)=>{if(V(a.getAttribute("role")))return;let g=a.querySelector("caption");if(!a.querySelector("th"))n.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!g&&!a.hasAttribute("aria-label")&&!a.hasAttribute("aria-labelledby"))n.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),r.querySelectorAll('[style*="color"]').forEach((a)=>{let g=a.getAttribute("style")||"";if(g.includes("color:")&&!g.includes("background"))n.push({type:"potential-contrast-issue",element:`<${a.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),r.querySelectorAll("video[autoplay], audio[autoplay]").forEach((a)=>{if(!a.hasAttribute("muted"))n.push({type:"autoplay-audio",element:`<${a.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),r.querySelectorAll("[tabindex]").forEach((a)=>{if(Number.parseInt(a.getAttribute("tabindex")||"0")>0)n.push({type:"positive-tabindex",element:`<${a.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),r.querySelectorAll('[role="button"]').forEach((a)=>{if(!a.hasAttribute("tabindex"))n.push({type:"button-not-focusable",element:`<${a.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),i.includes("<body")&&!r.querySelector('main, [role="main"]'))n.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});r.querySelectorAll("iframe").forEach((a)=>{if(!a.hasAttribute("title")&&!a.hasAttribute("aria-label"))n.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(r){console.error(`Error checking accessibility in ${s}:`,r)}return n}async function bc(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,o=Array.isArray(e)?e:[e],c=await Jo(o,{recursive:n,ignorePaths:r}),u=[];for(let a of c)try{let g=await Bun.file(a).text();if(a.endsWith("good-a11y.stx"))continue;let p=await Ae(g,a);if(u.push(a),p.length>0)i[a]=p}catch(g){console.error(`Error scanning ${a}:`,g)}return{results:i,scannedFiles:u}}var wc={name:"a11y",handler:(e,s,i,n)=>{if(!s.length)return e;let r=s[0].replace(/['"]/g,""),o=s.length>1?s[1].replace(/['"]/g,""):"",u={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[r]||"Make this element accessible";return`<!-- a11y-hint: ${o||u} -->${e}`},hasEndTag:!1},vc={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
|
|
4
|
-
export{hc,yc,bc,wc
|
|
2
|
+
import{A,t,l}from"./chunk-gebb12ak.js";import{Z}from"./chunk-69cphbrz.js";import{Jo}from"./chunk-2ws2qe1k.js";import C from"path";var L;async function W(){if(L!==void 0)return L;try{let e=await import("@stacksjs/ts-i18n");L=e.loadLocale??null}catch{L=null}return L}var P={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},k={},v={},R={};function J(e,s=0){if(s<=0)return!1;return Date.now()-e.loadedAt>s}async function G(e,s){if({...P,...s.i18n}.cache&&k[e]){let r=k[e],o=s.i18n?.cacheMaxAge??0;if(!J(r,o))return r.translations}if(v[e]?.state==="loading")return v[e].promise;R[e]="loading";let n=T(e,s).then((r)=>(R[e]="loaded",delete v[e],r)).catch((r)=>{throw R[e]="error",v[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return v[e]={promise:n,state:"loading"},n}async function T(e,s){let i={...P,...s.i18n},n=C.isAbsolute(i.translationsDir)?i.translationsDir:C.resolve(s.root||process.cwd(),i.translationsDir);try{let r=await W(),o=r?await r(e,{translationsDir:n,defaultLocale:i.defaultLocale,sources:te(i.format)}):await Y(e,i,n);if(o===void 0){let u=e!==i.defaultLocale?await T(i.defaultLocale,s):{};if(i.cache)k[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=o;if(i.cache)k[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(s.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==i.defaultLocale)return T(i.defaultLocale,s);return{}}}async function Y(e,s,i){let n=C.join(i,`${e}${Q(s.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let o=await Bun.file(n).text();if(s.format==="yaml"||s.format==="yml")return X(o);if(s.format==="json")return JSON.parse(o);throw r}catch{return}}}function Q(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function X(e){let s={},i=e.split(`
|
|
3
|
+
`),n=[{obj:s,indent:-1}];for(let r of i){let o=r.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let c=o.search(/\S/);if(c===-1)continue;while(n.length>1&&n[n.length-1].indent>=c)n.pop();let u=n[n.length-1].obj,a=o.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(a){let[,,g,p]=a,f=g.trim(),m=p.trim();if(m==="")u[f]={},n.push({obj:u[f],indent:c});else u[f]=ee(m)}}return s}function ee(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let s=e.toLowerCase();if(s==="true"||s==="yes")return!0;if(s==="false"||s==="no")return!1;if(s==="null"||s==="~")return null;let i=Number(e);if(!Number.isNaN(i)&&e!=="")return i;return e}function te(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function re(e,s){return G(e,s)}function ne(e,s){for(let i of e){let n=i.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let c=Number.parseInt(r[1],10);if(s===c)return r[2];continue}let o=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(o){let c=Number.parseInt(o[1],10),u=o[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(o[2],10);if(s>=c&&s<=u)return o[3];continue}}if(e.length===2)return s===1?e[0].trim():e[1].trim();if(s<e.length)return e[s].trim();return e[e.length-1].trim()}function ie(e,s={}){return j(e,s)}function j(e,s){let i="",n=0;while(n<e.length)if(e[n]==="{"){let r=se(e,n);if(r===-1){i+=e[n],n++;continue}let o=e.slice(n+1,r);i+=ae(o,s),n=r+1}else if(e[n]==="'"&&n+1<e.length)if(e[n+1]==="'")i+="'",n+=2;else if(e[n+1]==="{"||e[n+1]==="}")i+=e[n+1],n+=2;else i+=e[n],n++;else i+=e[n],n++;return i}function se(e,s){let i=0;for(let n=s;n<e.length;n++)if(e[n]==="{")i++;else if(e[n]==="}"){if(i--,i===0)return n}return-1}function ae(e,s){let i=oe(e);if(i.length===0)return`{${e}}`;let n=i[0].trim(),r=s[n];if(i.length===1)return r!==void 0?String(r):`{${n}}`;switch(i[1].trim().toLowerCase()){case"plural":return le(r,i.slice(2).join(","),s);case"select":return ue(r,i.slice(2).join(","));case"selectordinal":return de(r,i.slice(2).join(","));case"number":return pe(r,i[2]?.trim());case"date":return fe(r,i[2]?.trim());case"time":return me(r,i[2]?.trim());default:return r!==void 0?String(r):`{${e}}`}}function oe(e){let s=[],i="",n=0;for(let r=0;r<e.length;r++){let o=e[r];if(o==="{")n++,i+=o;else if(o==="}")n--,i+=o;else if(o===","&&n===0)s.push(i),i="";else i+=o}if(i)s.push(i);return s}function le(e,s,i){let n=Number(e)||0,r=I(s),o=`=${n}`;if(r[o])return E(r[o],n,i);let c=ce(n);if(r[c])return E(r[c],n,i);if(r.other)return E(r.other,n,i);return String(n)}function E(e,s,i){let n=e.replace(/#/g,String(s));return j(n,i)}function ce(e){let s=Math.abs(e),i=Math.floor(s),n=String(e).includes(".")?String(e).split(".")[1].length:0;if(i===1&&n===0)return"one";return"other"}function ue(e,s){let i=String(e||""),n=I(s);if(n[i])return n[i];return n.other||String(e)}function de(e,s){let i=Number(e)||0,n=I(s),r=ge(i);if(n[r])return n[r].replace(/#/g,String(i));if(n.other)return n.other.replace(/#/g,String(i));return String(i)}function ge(e){let s=Math.abs(e),i=s%10,n=s%100;if(i===1&&n!==11)return"one";if(i===2&&n!==12)return"two";if(i===3&&n!==13)return"few";return"other"}function I(e){let s={},i=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,n=i.exec(e);while(n!==null)s[n[1]]=n[2],n=i.exec(e);return s}function pe(e,s){let i=Number(e);if(Number.isNaN(i))return String(e);switch(s){case"integer":return Math.floor(i).toLocaleString();case"percent":return`${(i*100).toFixed(0)}%`;case"currency":return i.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return i.toLocaleString()}}function fe(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.dateStyle="short";break;case"medium":n.dateStyle="medium";break;case"long":n.dateStyle="long";break;case"full":n.dateStyle="full";break;default:n.dateStyle="medium"}return i.toLocaleDateString(void 0,n)}function me(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.timeStyle="short";break;case"medium":n.timeStyle="medium";break;case"long":n.timeStyle="long";break;case"full":n.timeStyle="full";break;default:n.timeStyle="short"}return i.toLocaleTimeString(void 0,n)}function be(e){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(e)}function O(e,s,i=!0,n={}){let r=e.split("."),o=s;for(let u of r){if(o===void 0||o===null)break;o=o[u]}if(o===void 0||o===null)return i?e:"";let c=String(o);if(be(c))return ie(c,n);if(c.includes("|")&&"count"in n){let u=Number(n.count),a=c.split("|");c=ne(a,u)}for(let[u,a]of Object.entries(n)){let g=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`:${g}`,"g"),()=>String(a))}return c}var D=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),he=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function q(e){if(!e)return"ltr";let s=e.trim().toLowerCase().replace(/_/g,"-").split("-"),i=s[0];if(!i)return"ltr";let n=s[1]?.length===4?s[1]:void 0;if(n)return he.has(n)?"rtl":"ltr";if(s.length>1&&D.has(`${i}-${s[1]}`))return"rtl";return D.has(i)?"rtl":"ltr"}async function mc(e,s,i,n){let r=e,o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,c={...P,...n.i18n},u=await re(c.locale,n);s.__translations=u,s.__locale=c.locale,s.__i18nConfig=c,r=await F(r,o,async(p,f,m,w,h)=>{try{let b={};if(m)try{let d=[()=>JSON.parse(m),()=>{let x=`{"data":${m}}`,S=JSON.parse(x);return typeof S.data==="object"?S.data:{}},()=>A(m,s)];for(let x of d)try{if(b=x(),Object.keys(b).length>0)break}catch{}}catch(d){if(n.debug)console.error("Error parsing parameters for @translate directive:",d)}let y=O(f,u,c.fallbackToKey,b);return y?Z(r,h,y,!1,p.length):w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return l("Translate",`Error in @translate('${f}'): ${b instanceof Error?b.message:String(b)}`,t.EVALUATION_ERROR)}});let a=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(n.debug){console.warn(`Processing translations in template. Sections: ${r.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let p=[...r.matchAll(a)];console.warn(`Found ${p.length} @translate matches`),p.forEach((f,m)=>console.warn(`Match ${m}: ${f[0]}, Key: ${f[1]}, Params: ${f[2]||"none"}`))}return r=await F(r,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(p,f,m,w)=>{try{let h={};if(m)try{let b=[()=>JSON.parse(m),()=>{let y=`{"data":${m}}`,d=JSON.parse(y);return typeof d.data==="object"?d.data:{}},()=>A(m,s)];for(let y of b)try{if(h=y(),Object.keys(h).length>0)break}catch{}}catch(b){if(n.debug)console.error("Error parsing parameters for @translate directive:",b)}return Z(r,w,O(f,u,c.fallbackToKey,h),!1,p.length)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return l("Translate",`Error in @translate('${f}'): ${h instanceof Error?h.message:String(h)}`,t.EVALUATION_ERROR)}}),r}async function F(e,s,i){let n=[];return e.replace(s,(o,...c)=>{let u=i(o,...c).then((a)=>({match:o,replacement:a}));return n.push(u),o}),(await Promise.all(n)).reduce((o,{match:c,replacement:u})=>o.replace(c,()=>u),e)}function _(e,s){if(!e||q(e)!=="rtl")return!1;return!s||s.trim().toLowerCase()!=="rtl"}function V(e){if(!e)return!1;return e.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||e.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function U(e,s){let i=new RegExp(`\\b${s}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);if(!i)return null;return i[2]??i[3]??i[4]??null}function hc(e,s,i,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,u,a)=>{let p={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[u]||"Make this element accessible";return`<!-- a11y-hint: ${a||p} -->`});let o=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(o,(c,u)=>`<span class="sr-only">${u.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(c,u,a)=>`<span id="${`desc-${u}`}" class="sr-only">${a}</span>`),r}function ye(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function xe(e){let s=new Map,i=e.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(r,o,c)=>{let u=s.get(c);if(!u)u=`stx-a11y-component-${s.size}`,s.set(c,u);return`<${o}${u}`}),n=new Map([...s.entries()].map(([r,o])=>[o,r]));return{protectedSource:i,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(o,c,u)=>{let a=n.get(u);return a?`<${c}${a}`:o})}}function we(e,s){let i=[],n=/<img\s+([^>]*)>/gi,r;r=n.exec(e);while(r!==null){let d=r[1];if(!/\balt\s*=/i.test(d))i.push({type:"missing-alt",element:r[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});r=n.exec(e)}let o=/<button([^>]*)>\s*<\/button>/gi;r=o.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"missing-accessible-name",element:r[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});r=o.exec(e)}let c=/<a\s+([^>]*)>\s*<\/a>/gi;r=c.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"link-missing-text",element:r[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});r=c.exec(e)}let u=/<(input|select|textarea)\s+([^>]*)>/gi;r=u.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=u.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),S=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=S&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${S[1]}["']`,"i").test(e),M=r.index,N=e.substring(0,M),Se=e.substring(M),H=(N.match(/<label\b/gi)||[]).length,z=(N.match(/<\/label>/gi)||[]).length,K=H>z;if(!B&&!K)i.push({type:"input-missing-label",element:r[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}r=u.exec(e)}let a=/<h([1-6])[^>]*>/gi,g=[];r=a.exec(e);while(r!==null)g.push(Number.parseInt(r[1],10)),r=a.exec(e);let p=0;for(let d of g){if(p>0&&d>p+1)i.push({type:"heading-skip",element:`<h${d}>`,message:`Heading level skipped from h${p} to h${d}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});p=d}if(/<html\b/i.test(e)&&!/<html[^>]*\slang\s*=/i.test(e))i.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let f=e.match(/<html\b([^>]*)>/i);if(f&&_(U(f[1],"lang"),U(f[1],"dir")))i.push({type:"missing-dir",element:f[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let m=/<table([^>]*)>([\s\S]*?)<\/table>/gi;r=m.exec(e);while(r!==null){let d=r[2];if(!V(U(r[1],"role"))&&!/<th\b/i.test(d))i.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});r=m.exec(e)}let w=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;r=w.exec(e);while(r!==null){if(!/\bmuted\b/i.test(r[0]))i.push({type:"autoplay-audio",element:`<${r[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});r=w.exec(e)}let h=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;r=h.exec(e);while(r!==null)i.push({type:"positive-tabindex",element:`tabindex="${r[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),r=h.exec(e);let b=/<iframe\s+([^>]*)>/gi;r=b.exec(e);while(r!==null){let d=r[1];if(!/\btitle\s*=/i.test(d)&&!/\baria-label\s*=/i.test(d))i.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});r=b.exec(e)}let y=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;r=y.exec(e);while(r!==null){let d=r[1].toLowerCase(),x=r[2];if(d!=="button"&&!/\btabindex\s*=/i.test(x))i.push({type:"button-not-focusable",element:r[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});r=y.exec(e)}return i}async function Ae(e,s){let{protectedSource:i}=xe(e);if(!ye())return we(i,s);let n=[];try{let r=globalThis.document.createElement("div");r.innerHTML=i,r.querySelectorAll("img").forEach((a)=>{if(!a.hasAttribute("alt"))n.push({type:"missing-alt",element:`<${a.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),r.querySelectorAll('button, a, [role="button"]').forEach((a)=>{if(!(a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby")||a.textContent&&a.textContent.trim().length>0))n.push({type:"missing-accessible-name",element:`<${a.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),r.querySelectorAll("input, select, textarea").forEach((a)=>{let g=a.getAttribute("id"),p=g&&r.querySelector(`label[for="${g}"]`),f=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),m=a.closest("label")!==null;if(!p&&!f&&!m)n.push({type:"input-missing-label",element:`<${a.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let o=Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")),c=0;for(let a of o){let g=Number.parseInt(a.tagName.charAt(1));if(c>0&&g>c+1)n.push({type:"heading-skip",element:`<${a.outerHTML}>`,message:`Heading level skipped from h${c} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});c=g}let u=r.querySelector("html");if(i.includes("<html")&&u&&!u.hasAttribute("lang"))n.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(u&&_(u.getAttribute("lang"),u.getAttribute("dir")))n.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(r.querySelectorAll("a").forEach((a)=>{let g=a.textContent&&a.textContent.trim().length>0,p=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),f=a.hasAttribute("title"),m=a.querySelector("img[alt]");if(!g&&!p&&!f&&!m)n.push({type:"link-missing-text",element:`<${a.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),i.includes("<nav")||i.includes("<header")){if(!r.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&r.querySelectorAll("a").length>5)n.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(r.querySelectorAll("table").forEach((a)=>{if(V(a.getAttribute("role")))return;let g=a.querySelector("caption");if(!a.querySelector("th"))n.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!g&&!a.hasAttribute("aria-label")&&!a.hasAttribute("aria-labelledby"))n.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),r.querySelectorAll('[style*="color"]').forEach((a)=>{let g=a.getAttribute("style")||"";if(g.includes("color:")&&!g.includes("background"))n.push({type:"potential-contrast-issue",element:`<${a.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),r.querySelectorAll("video[autoplay], audio[autoplay]").forEach((a)=>{if(!a.hasAttribute("muted"))n.push({type:"autoplay-audio",element:`<${a.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),r.querySelectorAll("[tabindex]").forEach((a)=>{if(Number.parseInt(a.getAttribute("tabindex")||"0")>0)n.push({type:"positive-tabindex",element:`<${a.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),r.querySelectorAll('[role="button"]').forEach((a)=>{if(!a.hasAttribute("tabindex"))n.push({type:"button-not-focusable",element:`<${a.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),i.includes("<body")&&!r.querySelector('main, [role="main"]'))n.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});r.querySelectorAll("iframe").forEach((a)=>{if(!a.hasAttribute("title")&&!a.hasAttribute("aria-label"))n.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(r){console.error(`Error checking accessibility in ${s}:`,r)}return n}async function yc(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,o=Array.isArray(e)?e:[e],c=await Jo(o,{recursive:n,ignorePaths:r}),u=[];for(let a of c)try{let g=await Bun.file(a).text();if(a.endsWith("good-a11y.stx"))continue;let p=await Ae(g,a);if(u.push(a),p.length>0)i[a]=p}catch(g){console.error(`Error scanning ${a}:`,g)}return{results:i,scannedFiles:u}}var bc={name:"a11y",handler:(e,s,i,n)=>{if(!s.length)return e;let r=s[0].replace(/['"]/g,""),o=s.length>1?s[1].replace(/['"]/g,""):"",u={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[r]||"Make this element accessible";return`<!-- a11y-hint: ${o||u} -->${e}`},hasEndTag:!1},wc={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
|
|
4
|
+
export{mc,hc,yc,bc,wc};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ml,hl,yl}from"./chunk-t65tn8ee.js";import{le,Vn,Un,vo,Jr,Yr,Wn,qn,xo,Zr}from"./chunk-kvz01wzc.js";function z(e,o,l,r,d,y){let s=!0,u=new Set,h=(p)=>r.get?r.get(p):p,a=()=>h(e());return Object.defineProperty(a,"_isSignal",{value:!0}),Object.defineProperty(a,"modifiers",{get:o}),a.set=(p)=>{if(!s)return;let f=o(),t=r.set?r.set(p,f):p;if(f.trim&&typeof t==="string")t=t.trim();if(f.number&&typeof t==="string"&&t!==""){let i=Number(t);if(!Number.isNaN(i))t=i}if(Object.is(e(),t))return;e.set(t),l(t)},a.update=(p)=>a.set(p(a())),a.input=(p)=>{if(!o().lazy)a.set(p)},a.change=(p)=>{if(o().lazy)a.set(p)},a.subscribe=(p)=>{if(!s)return()=>{};let f=e.subscribe((t,i)=>p(h(t),h(i)));return u.add(f),()=>{f(),u.delete(f)}},Object.defineProperty(a,"value",{get:a,set:a.set}),d(()=>{s=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{s=!0}),a}function X(e,o=!0,l){if(!o||!e||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:l?l(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let o=window;if(e===void 0)o.__STX_DATA__={};else{if(!o.__STX_DATA__)try{let l=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");o.__STX_DATA__=l&&typeof l==="object"&&!Array.isArray(l)?l:{}}catch{o.__STX_DATA__={}}if(o.__STX_DATA__)delete o.__STX_DATA__[e]}}function Y(e){let o=null;try{o=typeof indexedDB<"u"?indexedDB:null}catch{o=null}if(!o)return null;let l=o,r=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,h)=>{let a=l.open(r,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>u(a.result),a.onerror=()=>h(a.error),a.onblocked=()=>h(Error("blocked"))}),d.catch(()=>{d=null});return d},s=(u,h)=>y().then((a)=>new Promise((p,f)=>{let t=a.transaction("kv",u),i=h(t.objectStore("kv"));t.oncomplete=()=>p(i?i.result:void 0),t.onerror=()=>f(t.error),t.onabort=()=>f(t.error)}));return{get:(u)=>s("readonly",(h)=>h.get(u)),set:(u,h)=>s("readwrite",(a)=>{a.put(h,u)}),remove:(u)=>s("readwrite",(h)=>{h.delete(u)}),removePrefix:(u)=>s("readwrite",(h)=>{h.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,o){let l=e||{},r=null;if(l.storage!==void 0)r=l.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=l.backend!==void 0;if(y)d=l.backend||null;let s=()=>{if(y)return d;y=!0;try{d=o?o():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=l.limit||32768,h=l.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),a=new Map,p=new Set,f=new Map,t=!1,i=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(r)r.removeItem(n)}catch{}},k=()=>{if(t=!1,!f.size)return i;let n=Array.from(f.entries());return f.clear(),i=i.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),i},N=(n,c)=>{if(f.set(n,c),p.add(n),t)return;t=!0,h(()=>{k()})},P=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(a.has(n))return{value:a.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return a.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:s();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(a.has(n))return{value:a.get(n)};let S=P(x);if(S)a.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(a.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!s()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(a.keys()))if(v.indexOf(n)===0)a.delete(v);for(let v of Array.from(f.keys()))if(v.indexOf(n)===0)f.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(r)for(let v=r.length-1;v>=0;v--){let x=r.key(v);if(x&&x.indexOf(n)===0)r.removeItem(x)}}catch{}let c=s();if(!c)return i;return i=i.then(()=>c.removePrefix(n)).catch(()=>{}),i},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,o){if(!e)return!1;if(e===o.key)return!0;if(!o.url)return!1;if(e===o.url)return!0;try{let l=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(e,l),d=new URL(o.url,l);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(e){let o=e.prefix||"stx:kept:",l=e.matches||((t,i)=>t===i.key||t===i.url),r=new Set,d=new Map,y,s=(t)=>t===void 0?y:t,u=(t,i)=>{let g=s(i);if(g===!1||g===null||g==="")return null;return`${o}${g===void 0?"":`${g}:`}query:${t}`},h=(t)=>{let i=t&&t.value;if(!i||typeof i!=="object"||!("d"in i))return;return{data:i.d,at:Number(i.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,i){let g=u(t,i);return g?h(e.kept.peek(g)):void 0},restore(t,i){let g=u(t,i);return g?e.kept.load(g).then(h):Promise.resolve(void 0)},persist(t,i,g){let m=u(t,g);if(m)e.kept.set(m,{d:i,at:Date.now()})},overlay(t,i,g){let m=a();if(!m||!m.size)return i;let _=i;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return r.add(t),()=>{r.delete(t)}},cachedQuery(t,i){let g=d.get(t);if(g){if(i&&g.__options)g.__options(i);return g}let m=i||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,P=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let C=e.state(p.overlay(P(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),M=e.state(S?S.at:0),R=0,V=()=>{C.set(p.overlay(P(),n))},W=(w)=>{let b=R;p.restore(t,w).then((T)=>{if(!T||b!==R||c)return;n=T.data,M.set(T.at),V()})};if(!S)W(E);let xt=()=>{let w=k();if(w===E)return;E=w,R++,x=0,q.set(!1),U.set(!1),c=0;let b=p.seed(t,E);if(n=b?b.data:_,M.set(b?b.at:0),V(),!b)W(E)},St=(w,b)=>{let T=m.timeoutMs||15000,I=typeof AbortController<"u"?new AbortController:null,O=null,H=new Promise((D,F)=>{O=setTimeout(()=>{if(I)I.abort();F(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:w,url:b,signal:I?I.signal:void 0});else if(b){let D=m.fetch||((L,j)=>fetch(L,j)),F={method:"GET",headers:{Accept:"application/json"}};if(w)F.cache="no-cache";if(I)F.signal=I.signal;A=D(b,F).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((j)=>{throw Error(j&&(j.error||j.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(C());return Promise.race([A,H]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(w)=>{let b=R,T=N(),I=()=>{if(b!==R)return Promise.resolve(C());if(x++,q.set(!0),c===0&&!M())U.set(!0);let H=()=>{if(b!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return St(w,T).then((A)=>{if(b!==R||T!==N())return H(),C();return n=A,c=Date.now(),M.set(c),K.set(null),p.persist(t,A,E),V(),H(),C()},(A)=>{if(b===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return H(),C()})},O=`${b} ${T||""}`;return w?v.fresh(O,I):v.run(O,I)},B={data:C,loading:U,isFetching:q,error:K,updatedAt:M,get key(){return t},load(w){if(xt(),!w&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(C());return G(!!w)},refresh(){return B.load(!0)},set(w){n=typeof w==="function"?w(n):w,p.persist(t,n,E),V()},invalidate(){c=0},__options(w){m={...m,...w}}};if(r.add({target:P,updated:()=>{if(c||M())G(!1)},outbox:(w)=>{if(w)n=p.overlay(P(),n,w.id),c=0,G(!0);V()}}),d.set(t,B),m.immediate)B.load();return B}},f=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&f&&typeof f.addEventListener==="function")f.addEventListener("stx:updated",(t)=>{let i=t.detail||{};if(i.kind!=="api"||typeof i.url!=="string")return;r.forEach((g)=>{if(l(i.url,g.target()))g.updated()})}),f.addEventListener("stx:outbox",(t)=>{let i=t.detail||{},g=i.sent&&typeof i.sent.id==="string"?i.sent:null;r.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>l(N,k)))return}m.outbox(g)})});return p}function te(e){let o=e&&e.covers||((s,u)=>Object.is(s,u)),l=[],r=[],d=0,y=(s,u)=>{let h;try{h=Promise.resolve(u())}catch(f){h=Promise.reject(f)}let a={key:s,promise:h};l.push(a);let p=()=>{let f=l.indexOf(a);if(f!==-1)l.splice(f,1)};return h.then(p,p),h};return{run(s,u){for(let h of l)if(o(h.key,s))return h.promise;for(let h of r)if(o(h.key,s))return h.promise;return y(s,u)},fresh(s,u){for(let f of r)if(o(f.key,s))return f.promise;let h=l.filter((f)=>o(f.key,s)).map((f)=>f.promise);if(!h.length)return y(s,u);let a={key:s,promise:null},p=()=>{};return a.promise=Promise.all(h.map((f)=>f.then(p,p))).then(()=>{let f=r.indexOf(a);if(f!==-1)r.splice(f,1);return y(s,u)}),r.push(a),a.promise},latest(){let s=++d;return()=>s===d},get busy(){return l.length>0||r.length>0}}}function ne(e){let o=!1,l=null,r=null,d=0;async function y(){if(o)return;l=new AbortController;try{let s=await e.request(e.endpoint,{signal:l.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!s.ok||!s.body||!s.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(o){await s.body.cancel();return}let u=s.body.getReader(),h=new TextDecoder,a="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!o){let{done:p,value:f}=await u.read();if(p)break;if(a+=h.decode(f,{stream:!0}).replace(/\r\n/g,`
|
|
2
|
+
import{gl,ml,hl}from"./chunk-ybjfr7e8.js";import{le,Vn,Un,vo,Jr,Yr,Wn,qn,xo,Zr}from"./chunk-kvz01wzc.js";function z(e,o,l,r,d,y){let s=!0,u=new Set,h=(p)=>r.get?r.get(p):p,a=()=>h(e());return Object.defineProperty(a,"_isSignal",{value:!0}),Object.defineProperty(a,"modifiers",{get:o}),a.set=(p)=>{if(!s)return;let f=o(),t=r.set?r.set(p,f):p;if(f.trim&&typeof t==="string")t=t.trim();if(f.number&&typeof t==="string"&&t!==""){let i=Number(t);if(!Number.isNaN(i))t=i}if(Object.is(e(),t))return;e.set(t),l(t)},a.update=(p)=>a.set(p(a())),a.input=(p)=>{if(!o().lazy)a.set(p)},a.change=(p)=>{if(o().lazy)a.set(p)},a.subscribe=(p)=>{if(!s)return()=>{};let f=e.subscribe((t,i)=>p(h(t),h(i)));return u.add(f),()=>{f(),u.delete(f)}},Object.defineProperty(a,"value",{get:a,set:a.set}),d(()=>{s=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{s=!0}),a}function X(e,o=!0,l){if(!o||!e||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:l?l(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let o=window;if(e===void 0)o.__STX_DATA__={};else{if(!o.__STX_DATA__)try{let l=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");o.__STX_DATA__=l&&typeof l==="object"&&!Array.isArray(l)?l:{}}catch{o.__STX_DATA__={}}if(o.__STX_DATA__)delete o.__STX_DATA__[e]}}function Y(e){let o=null;try{o=typeof indexedDB<"u"?indexedDB:null}catch{o=null}if(!o)return null;let l=o,r=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,h)=>{let a=l.open(r,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>u(a.result),a.onerror=()=>h(a.error),a.onblocked=()=>h(Error("blocked"))}),d.catch(()=>{d=null});return d},s=(u,h)=>y().then((a)=>new Promise((p,f)=>{let t=a.transaction("kv",u),i=h(t.objectStore("kv"));t.oncomplete=()=>p(i?i.result:void 0),t.onerror=()=>f(t.error),t.onabort=()=>f(t.error)}));return{get:(u)=>s("readonly",(h)=>h.get(u)),set:(u,h)=>s("readwrite",(a)=>{a.put(h,u)}),remove:(u)=>s("readwrite",(h)=>{h.delete(u)}),removePrefix:(u)=>s("readwrite",(h)=>{h.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,o){let l=e||{},r=null;if(l.storage!==void 0)r=l.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=l.backend!==void 0;if(y)d=l.backend||null;let s=()=>{if(y)return d;y=!0;try{d=o?o():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=l.limit||32768,h=l.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),a=new Map,p=new Set,f=new Map,t=!1,i=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(r)r.removeItem(n)}catch{}},k=()=>{if(t=!1,!f.size)return i;let n=Array.from(f.entries());return f.clear(),i=i.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),i},N=(n,c)=>{if(f.set(n,c),p.add(n),t)return;t=!0,h(()=>{k()})},P=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(a.has(n))return{value:a.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return a.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:s();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(a.has(n))return{value:a.get(n)};let S=P(x);if(S)a.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(a.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!s()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(a.keys()))if(v.indexOf(n)===0)a.delete(v);for(let v of Array.from(f.keys()))if(v.indexOf(n)===0)f.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(r)for(let v=r.length-1;v>=0;v--){let x=r.key(v);if(x&&x.indexOf(n)===0)r.removeItem(x)}}catch{}let c=s();if(!c)return i;return i=i.then(()=>c.removePrefix(n)).catch(()=>{}),i},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,o){if(!e)return!1;if(e===o.key)return!0;if(!o.url)return!1;if(e===o.url)return!0;try{let l=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(e,l),d=new URL(o.url,l);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(e){let o=e.prefix||"stx:kept:",l=e.matches||((t,i)=>t===i.key||t===i.url),r=new Set,d=new Map,y,s=(t)=>t===void 0?y:t,u=(t,i)=>{let g=s(i);if(g===!1||g===null||g==="")return null;return`${o}${g===void 0?"":`${g}:`}query:${t}`},h=(t)=>{let i=t&&t.value;if(!i||typeof i!=="object"||!("d"in i))return;return{data:i.d,at:Number(i.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,i){let g=u(t,i);return g?h(e.kept.peek(g)):void 0},restore(t,i){let g=u(t,i);return g?e.kept.load(g).then(h):Promise.resolve(void 0)},persist(t,i,g){let m=u(t,g);if(m)e.kept.set(m,{d:i,at:Date.now()})},overlay(t,i,g){let m=a();if(!m||!m.size)return i;let _=i;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return r.add(t),()=>{r.delete(t)}},cachedQuery(t,i){let g=d.get(t);if(g){if(i&&g.__options)g.__options(i);return g}let m=i||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,P=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let C=e.state(p.overlay(P(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),M=e.state(S?S.at:0),R=0,V=()=>{C.set(p.overlay(P(),n))},W=(w)=>{let b=R;p.restore(t,w).then((T)=>{if(!T||b!==R||c)return;n=T.data,M.set(T.at),V()})};if(!S)W(E);let xt=()=>{let w=k();if(w===E)return;E=w,R++,x=0,q.set(!1),U.set(!1),c=0;let b=p.seed(t,E);if(n=b?b.data:_,M.set(b?b.at:0),V(),!b)W(E)},St=(w,b)=>{let T=m.timeoutMs||15000,I=typeof AbortController<"u"?new AbortController:null,O=null,H=new Promise((D,F)=>{O=setTimeout(()=>{if(I)I.abort();F(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:w,url:b,signal:I?I.signal:void 0});else if(b){let D=m.fetch||((L,j)=>fetch(L,j)),F={method:"GET",headers:{Accept:"application/json"}};if(w)F.cache="no-cache";if(I)F.signal=I.signal;A=D(b,F).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((j)=>{throw Error(j&&(j.error||j.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(C());return Promise.race([A,H]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(w)=>{let b=R,T=N(),I=()=>{if(b!==R)return Promise.resolve(C());if(x++,q.set(!0),c===0&&!M())U.set(!0);let H=()=>{if(b!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return St(w,T).then((A)=>{if(b!==R||T!==N())return H(),C();return n=A,c=Date.now(),M.set(c),K.set(null),p.persist(t,A,E),V(),H(),C()},(A)=>{if(b===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return H(),C()})},O=`${b} ${T||""}`;return w?v.fresh(O,I):v.run(O,I)},B={data:C,loading:U,isFetching:q,error:K,updatedAt:M,get key(){return t},load(w){if(xt(),!w&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(C());return G(!!w)},refresh(){return B.load(!0)},set(w){n=typeof w==="function"?w(n):w,p.persist(t,n,E),V()},invalidate(){c=0},__options(w){m={...m,...w}}};if(r.add({target:P,updated:()=>{if(c||M())G(!1)},outbox:(w)=>{if(w)n=p.overlay(P(),n,w.id),c=0,G(!0);V()}}),d.set(t,B),m.immediate)B.load();return B}},f=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&f&&typeof f.addEventListener==="function")f.addEventListener("stx:updated",(t)=>{let i=t.detail||{};if(i.kind!=="api"||typeof i.url!=="string")return;r.forEach((g)=>{if(l(i.url,g.target()))g.updated()})}),f.addEventListener("stx:outbox",(t)=>{let i=t.detail||{},g=i.sent&&typeof i.sent.id==="string"?i.sent:null;r.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>l(N,k)))return}m.outbox(g)})});return p}function te(e){let o=e&&e.covers||((s,u)=>Object.is(s,u)),l=[],r=[],d=0,y=(s,u)=>{let h;try{h=Promise.resolve(u())}catch(f){h=Promise.reject(f)}let a={key:s,promise:h};l.push(a);let p=()=>{let f=l.indexOf(a);if(f!==-1)l.splice(f,1)};return h.then(p,p),h};return{run(s,u){for(let h of l)if(o(h.key,s))return h.promise;for(let h of r)if(o(h.key,s))return h.promise;return y(s,u)},fresh(s,u){for(let f of r)if(o(f.key,s))return f.promise;let h=l.filter((f)=>o(f.key,s)).map((f)=>f.promise);if(!h.length)return y(s,u);let a={key:s,promise:null},p=()=>{};return a.promise=Promise.all(h.map((f)=>f.then(p,p))).then(()=>{let f=r.indexOf(a);if(f!==-1)r.splice(f,1);return y(s,u)}),r.push(a),a.promise},latest(){let s=++d;return()=>s===d},get busy(){return l.length>0||r.length>0}}}function ne(e){let o=!1,l=null,r=null,d=0;async function y(){if(o)return;l=new AbortController;try{let s=await e.request(e.endpoint,{signal:l.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!s.ok||!s.body||!s.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(o){await s.body.cancel();return}let u=s.body.getReader(),h=new TextDecoder,a="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!o){let{done:p,value:f}=await u.read();if(p)break;if(a+=h.decode(f,{stream:!0}).replace(/\r\n/g,`
|
|
3
3
|
`),a.length>1048576)throw Error("Broadcast frame too large");let t;while((t=a.indexOf(`
|
|
4
4
|
|
|
5
5
|
`))!==-1){let i=a.slice(0,t);a=a.slice(t+2);let g=i.split(`
|
|
@@ -11747,7 +11747,7 @@ ${se}
|
|
|
11747
11747
|
${ue}
|
|
11748
11748
|
${me}
|
|
11749
11749
|
${Ge}
|
|
11750
|
-
${nt(
|
|
11750
|
+
${nt(ml(),hl(),gl())}
|
|
11751
11751
|
|
|
11752
11752
|
${gt}
|
|
11753
11753
|
${lt}
|