@stacksjs/stx 0.2.862 → 0.2.863
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-2s7rmn9r.js → chunk-021tjkd6.js} +1 -1
- package/dist/{chunk-bwz2ehq9.js → chunk-15m7jnc0.js} +1 -1
- package/dist/{chunk-y3qg95wa.js → chunk-1grdbpsk.js} +2 -2
- package/dist/{chunk-9y9jecky.js → chunk-2c18y094.js} +1 -1
- package/dist/{chunk-ymjjn9pw.js → chunk-2n932qtv.js} +1 -1
- package/dist/{chunk-mjy98ppb.js → chunk-32ty2zx6.js} +1 -1
- package/dist/chunk-36j129p1.js +2 -0
- package/dist/{chunk-2srjavsn.js → chunk-58sh82aj.js} +1 -1
- package/dist/{chunk-6m63rc7m.js → chunk-5p1k2h5q.js} +1 -1
- package/dist/{chunk-2rff5mbj.js → chunk-5s1fb8z4.js} +1 -1
- package/dist/{chunk-kbdz4762.js → chunk-5zzrrxns.js} +4 -4
- package/dist/{chunk-vfx1p83g.js → chunk-85zmxbt0.js} +3 -3
- package/dist/{chunk-84ztb43k.js → chunk-a4cn8rf4.js} +1 -1
- package/dist/{chunk-12sv6b9c.js → chunk-ap84eenm.js} +1 -1
- package/dist/{chunk-czpn3n1p.js → chunk-as2ffje6.js} +1 -1
- package/dist/{chunk-2kfayg4t.js → chunk-b6w0f610.js} +6 -6
- package/dist/{chunk-jx5mss16.js → chunk-c0t2tdfk.js} +1 -1
- package/dist/chunk-caxqwrnc.js +2 -0
- package/dist/{chunk-srgpz94e.js → chunk-czca8yds.js} +1 -1
- package/dist/{chunk-y7f2x57s.js → chunk-d0afg5f7.js} +1 -1
- package/dist/chunk-d9vzfbdp.js +2 -0
- package/dist/chunk-e634vffz.js +3 -0
- package/dist/{chunk-0fpx3ctt.js → chunk-fnv94wc6.js} +1 -1
- package/dist/{chunk-g075cc67.js → chunk-g4gcf4jn.js} +1 -1
- package/dist/{chunk-mj4wbrw7.js → chunk-g65dptx2.js} +1 -1
- package/dist/{chunk-85j9qh7v.js → chunk-gjngg182.js} +1 -1
- package/dist/{chunk-gmm3kffd.js → chunk-gw7t6a3t.js} +1 -1
- package/dist/{chunk-g5xth2yx.js → chunk-h816ta81.js} +2 -2
- package/dist/{chunk-2dpessnc.js → chunk-hc6111md.js} +4 -4
- package/dist/{chunk-xsq2jf96.js → chunk-jfmj0wsy.js} +1 -1
- package/dist/{chunk-s0sad753.js → chunk-jgra00m8.js} +1 -1
- package/dist/{chunk-0fh47gp0.js → chunk-k7dxm48r.js} +1 -1
- package/dist/{chunk-dhnw2qwq.js → chunk-ks5p5w6z.js} +1 -1
- package/dist/{chunk-hf5fj7pr.js → chunk-ns04v3am.js} +1 -1
- package/dist/{chunk-c34qn4k8.js → chunk-ntbe5q5x.js} +2 -2
- package/dist/{chunk-0c9c9v03.js → chunk-nttsc0aw.js} +4 -4
- package/dist/{chunk-2jgtfjyr.js → chunk-prrvggcy.js} +1 -1
- package/dist/{chunk-rvhrtnv3.js → chunk-pyckafsb.js} +1 -1
- package/dist/{chunk-7q5h2cve.js → chunk-qmkaqjba.js} +1 -1
- package/dist/{chunk-hsp9h3jn.js → chunk-qxw9h564.js} +1 -1
- package/dist/{chunk-kyer53x3.js → chunk-r23zq8yk.js} +1 -1
- package/dist/{chunk-adb045wf.js → chunk-r4v4vswq.js} +1 -1
- package/dist/{chunk-nz9z3ct9.js → chunk-reeaknf2.js} +1 -1
- package/dist/chunk-rqmb09ss.js +2 -0
- package/dist/{chunk-7mpqfg98.js → chunk-sj3ry5ck.js} +12 -4
- package/dist/chunk-sz6d3v6b.js +2 -0
- package/dist/{chunk-x0s68p47.js → chunk-va07zs9v.js} +1 -1
- package/dist/chunk-vc42mvjn.js +2 -0
- package/dist/{chunk-bz6dg4k8.js → chunk-vwwpbhd2.js} +1 -1
- package/dist/{chunk-eeq8k81z.js → chunk-w468n41y.js} +5 -5
- package/dist/{chunk-n058hznh.js → chunk-wk4wg6sn.js} +1 -1
- package/dist/{chunk-hdjn7nw9.js → chunk-wtfamngc.js} +1 -1
- package/dist/{chunk-627hzzs3.js → chunk-x3p4emdp.js} +1 -1
- package/dist/{chunk-fa97kz5j.js → chunk-xcjvx6zt.js} +1 -1
- package/dist/{chunk-321fbxnm.js → chunk-xfd3yqgj.js} +4 -4
- package/dist/chunk-xzdkjkyp.js +2 -0
- package/dist/{chunk-fnxg6134.js → chunk-y036cwc7.js} +2 -2
- package/dist/{chunk-4ykgjewy.js → chunk-y190sh29.js} +2 -2
- package/dist/{chunk-kwk3kxrx.js → chunk-yakdcak2.js} +1 -1
- package/dist/chunk-ybkwnscv.js +2 -0
- package/dist/{chunk-4xanjv22.js → chunk-yhc1c4tr.js} +2 -2
- package/dist/{chunk-dydy9zrq.js → chunk-yr1zx78b.js} +1 -1
- package/dist/{chunk-1d3swbqw.js → chunk-z383x16t.js} +1 -1
- package/dist/chunk-z3gz5fy4.js +2 -0
- package/dist/{chunk-1crn4fv0.js → chunk-zr22gtpf.js} +1 -1
- package/dist/{chunk-z6ntmv5x.js → chunk-ztbexx3h.js} +1 -1
- package/dist/cli.js +8 -8
- package/dist/client/signals-timer-runtime.js +12 -4
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-194t5qat.js +0 -2
- package/dist/chunk-1qf07v41.js +0 -2
- package/dist/chunk-24hq8mka.js +0 -3
- package/dist/chunk-2zqh7xct.js +0 -2
- package/dist/chunk-5ertqfs3.js +0 -2
- package/dist/chunk-6fstz73t.js +0 -2
- package/dist/chunk-94wnfxnd.js +0 -2
- package/dist/chunk-9jxs8sw2.js +0 -2
- package/dist/chunk-bv7g3b3b.js +0 -2
- package/dist/chunk-jz84z19v.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Vf,yc,Vh,bc,Uf,Wf,mn,dr,Uh,qf,Kf,Wh,x}from"./chunk-
|
|
2
|
+
import{Vf,yc,Vh,bc,Uf,Wf,mn,dr,Uh,qf,Kf,Wh,x}from"./chunk-y190sh29.js";import"./chunk-021tjkd6.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{mn as buildCss,qf as extractClassNames,Wf as fingerprintConfig,Kf as generateCss,Uh as getCachedCSS,Vf as getCssServeAsset,x as injectCss,yc as loadCssEngine,bc as loadCssEngineConfig,dr as rebuildCss,Vh as resetCssCache,Uf as resolveUserCssConfig,Wh as withLinkedModuleBundles};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import R from"path";var O=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function Ur(...g){let d=new Set;for(let c of g){if(!c||!c.includes("__stxModules["))continue;for(let s of c.matchAll(O))try{d.add(JSON.parse(`"${s[1]}"`))}catch{}}return[...d].sort()}function po(...g){let d=new Map,c=(s,e)=>{let r=d.get(s);if(r===null)return;if(e===null){d.set(s,null);return}let n=r??new Set;for(let i of e)n.add(i);d.set(s,n)};for(let s of g){if(!s||!s.includes("__stxModules["))continue;let e=[];for(let n of s.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${n[2]}"`)}catch{continue}e.push({variable:n[1],id:i,start:n.index+n[0].length,end:s.length})}let r=s.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(e.length===0||r!==e.length){for(let n of Ur(s))c(n,null);continue}for(let[n,i]of e.entries()){let p=e.slice(n+1).find((h)=>h.variable===i.variable);i.end=p?p.start:s.length}for(let n of e){let i=new Set,p=!1,h=n.variable.replace(/[$]/g,"\\$&"),o=s.slice(n.start,n.end);for(let l of o.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=o.slice(l.index+n.variable.length,l.index+n.variable.length+200),a=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(a){i.add(a[a.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}c(n.id,p?null:i)}}return d}function v(g,d,c){let s=[],e=[];return g.forEach((r,n)=>{let i=r.startsWith("npm:")?r.slice(4):R.resolve(d,r),p=`__stxRegistered${n}`,h=JSON.stringify(r),o=c?.get(r);if(o&&[...o].every((l)=>/^[A-Za-z_$][\w$]*$/.test(l))){let l=[...o].sort(),f=l.map((m,_)=>`${m} as ${p}_${_}`);s.push(l.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let a=l.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${a} };`);return}s.push(`import * as ${p} from ${JSON.stringify(i)};`),e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...s,"globalThis.__stxModules = globalThis.__stxModules || {};",...e].join(`
|
|
3
|
-
`)}async function nm(g,d={}){if(g.length===0)return null;let c=process.cwd(),s=v(g,c,d.names),e;try{let{bundleClientScript:l}=await import("./chunk-
|
|
3
|
+
`)}async function nm(g,d={}){if(g.length===0)return null;let c=process.cwd(),s=v(g,c,d.names),e;try{let{bundleClientScript:l}=await import("./chunk-ap84eenm.js"),f=()=>l(s,R.join(c,".stx-module-registry.ts"),{projectRoot:c,minify:d.minify,externalizeUserModules:!1,collectInputs:d.collectInputs,throwOnFailure:!0});try{e=await f()}catch(a){if(!d.names)throw a;s=v(g,c,void 0),e=await f()}}catch(l){let{formatBuildFailure:f}=await import("./chunk-cvgbtmxp.js"),a=f(l);console.warn(`[stx] could not build the page module registry (#1957): ${a}`);let m=`[stx] the page module registry did not build, so ${g.join(", ")} cannot load (#1957): ${a}`;return`;console.error(${JSON.stringify(m)});`}let{transformAutoImports:r,generateAutoImportDestructuring:n}=await import("./chunk-jfmj0wsy.js"),i=r(e),p=n(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-4pr29yrx.js");e=h(i.code);let o=JSON.stringify(new Bun.CryptoHasher("md5").update(s).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${o}]) return;`,` __stxBundles[${o}] = true;`,p,e,"})();"].join(`
|
|
4
4
|
`)}var P=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,j=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function J(g){let d=[],c=[],s=!0,r=g.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(P,(h,o,l,f)=>{let a=`__stxChunkExports${d.length}`;if(d.push(f),c.push(`var ${a} = __stxChunk(${JSON.stringify(f)});`),l)c.push(`var ${l} = ${a};`);else if(o)for(let m of o.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){s=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){s=!1;continue}c.push(`var ${t} = ${a}[${JSON.stringify(M)}];`)}return""});if(!s)throw Error("an import it does not read");let n=[];r=r.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,o,l)=>{let f=o??l;return n.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];r=r.replace(j,(h,o)=>{for(let l of o.split(",")){let f=l.trim();if(!f)continue;let a=N.exec(f);if(!a||a[1].startsWith('"')){s=!1;continue}if(I.has(a[1]))continue;let m=a[2]??a[1];i.push([a[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(r));if(!s||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:c.join(`
|
|
5
5
|
`),chunks:d,lazy:n,body:r,exports:i}}function Bl(g){if(/\bexport\s+(?:let|var)\b/.test(g))return!0;if(g.length/Math.max(1,g.split(`
|
|
6
|
-
`).length)>200)return!1;for(let d of g.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let c of d[1].split(",")){let s=c.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(s))continue;let e=s.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${e}(?![\\w$])`,"g").test(g))continue;let n=new RegExp(`(?<![\\w$.])${e}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${e}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${e}\\s*=`,"g");if((g.match(n)?.length??0)>(g.match(i)?.length??0))return!0}return!1}async function fo(g,d={}){let c=g.filter((e)=>e.ids.length>0);if(c.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let s=process.cwd();try{let{bundleClientEntriesSplit:e}=await import("./chunk-
|
|
6
|
+
`).length)>200)return!1;for(let d of g.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let c of d[1].split(",")){let s=c.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(s))continue;let e=s.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${e}(?![\\w$])`,"g").test(g))continue;let n=new RegExp(`(?<![\\w$.])${e}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${e}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${e}\\s*=`,"g");if((g.match(n)?.length??0)>(g.match(i)?.length??0))return!0}return!1}async function fo(g,d={}){let c=g.filter((e)=>e.ids.length>0);if(c.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let s=process.cwd();try{let{bundleClientEntriesSplit:e}=await import("./chunk-ap84eenm.js"),r=[],n=await e(new Map(c.map((t)=>[t.name,v(t.ids,s,t.names)])),{projectRoot:s,filePath:R.join(s,".stx-module-registry.ts"),collectInputs:r});d.collectInputs?.push(...r);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-jfmj0wsy.js"),{transformStoreImports:h}=await import("./chunk-4pr29yrx.js"),o=new Map;for(let[t,u]of[...n.chunks,...n.entries])try{o.set(t,J(u))}catch(b){throw Error(`cannot read ${t}: ${b instanceof Error?b.message:String(b)}`)}for(let[t,u]of[...n.chunks,...n.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of r)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&Bl(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let l=new Set,f=new Set,a=(t)=>{if(f.has(t))return;if(l.has(t))throw Error(`the chunks import each other (${t})`);l.add(t);for(let u of o.get(t)?.chunks??[]){if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);a(u)}for(let u of o.get(t)?.lazy??[])if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);l.delete(t),f.add(t)};for(let t of o.keys())a(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of n.chunks.keys()){let u=o.get(t),{prelude:b,body:k}=m(u),y=u.exports.map(([S,x])=>`get ${JSON.stringify(x)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
|
|
7
7
|
${b}
|
|
8
8
|
${u.reads}
|
|
9
9
|
${k}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P,d,m,O,p,J}from"./chunk-qa5y30sy.js";import{q,js,je,he,Dt,Ar,Ve,Ue,s,y,Te,R}from"./chunk-
|
|
2
|
+
import{P,d,m,O,p,J}from"./chunk-qa5y30sy.js";import{q,js,je,he,Dt,Ar,Ve,Ue,s,y,Te,R}from"./chunk-b6w0f610.js";import{ft}from"./chunk-qjey0jk6.js";import{N}from"./chunk-farh4p7f.js";import{le}from"./chunk-xymr4ys9.js";import{H,nt}from"./chunk-8s6s6nd0.js";import{A,Pn}from"./chunk-bwdbj60y.js";import M from"path";import{existsSync as ye}from"fs";function ce(c,e){let a=0;for(let r=e;r<c.length;r++){let b=c[r];if(b==="("||b==="["||b==="{")a++;else if(b===")"||b==="]"||b==="}")a--;else if(b===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,b=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=b.exec(r);while(n){let u=n.index,t=u+n[0].length-1,T=1,L=t+1;while(L<r.length&&T>0){if(r[L]==="(")T++;else if(r[L]===")")T--;L++}if(T!==0)break;let re=r.substring(t+1,L-1),B=`${a}(${re})`;r=r.substring(0,u)+B+r.substring(L),b.lastIndex=u+B.length,n=b.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function me(c){let e=c,a=[],r=new Set,b=0,n=0,u=e.length,t=(B)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===B){n++;return}n++}},T=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let B=1;while(n<u&&B>0)if(e[n]==="{")B++,n++;else if(e[n]==="}")B--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")T();else n++;continue}n++}},L=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
|
|
3
3
|
`)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},re=()=>{if(b!==0)return;let B=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(B){let U=B[2];if(!r.has(U))a.push(U),r.add(U);return}let te=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(te){let U=te[1];if(!r.has(U))a.push(U),r.add(U);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let U=Y[1];if(!r.has(U))a.push(U),r.add(U)}};while(n<u){if(L())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){T();continue}if(e[n]==="{"){b++,n++;continue}if(e[n]==="}"){b--,n++;continue}if(b===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))re();n++}return a.join(", ")}function ve(c,e=""){let a=me(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
|
|
4
4
|
(function() {
|
|
5
5
|
${ft("var",a)}
|
|
@@ -44,10 +44,10 @@ ${n}
|
|
|
44
44
|
}
|
|
45
45
|
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
46
46
|
}
|
|
47
|
-
})();`;return a+c+r}function Me(c,e){if(H(c)){let n=H(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:nt(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Dt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let b=r[1]+r[2],n=r[1].slice(1),u=b.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),T=r[1],L=r[2];return{html:`${t}${T} data-stx-scope="${e}"${L}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function ue(c,e){let a=M.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var ae=new Set,pe=new Set;function qh(){ae.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Gf(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],b=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",T=u[2],L=u[3]==="/"||Ce.has(T.toLowerCase());if(t){b=Math.max(0,b-1);continue}if(b===0)r.push(T);if(!L)b++}return r}function fe(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var tt=new P(500),wc=new Set;function Kh(){wc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return wc}async function gs(c,e,a,r,b,n=new Set){let u=r.partialsDir||M.join(M.dirname(a),"partials");if(u&&!M.isAbsolute(u))u=M.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),T=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(T.has(i))return"";return T.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let C=o[1],W=L(C,u,a),E="";if(W&&await Bun.file(W).exists())b.add(W),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let C=t.substring(x+1,o-1),W=ce(C,0);if(W===-1){h.lastIndex=o;continue}let E=C.substring(0,W).trim(),Z=C.substring(W+1).trim(),z=Z.match(/^\s*['"]([^'"]+)['"]/);if(!z){h.lastIndex=o;continue}let _=z[1],K=Z.substring(z[0].length),D,k=ce(K,0);if(k!==-1)D=K.substring(k+1).trim();try{let I=`Boolean(${E})`,j;if(m(I)){let ie=p(I,Object.keys(e));j=Boolean(ie(...Object.values(e)))}else j=Boolean(d(I,e));let ee=v?!j:j,ne="";if(ee){let ie=L(_,u,a);if(ie&&await Bun.file(ie).exists())b.add(ie);ne=`@include('${_}'${D?`, ${D}`:""})`}t=t.substring(0,i)+ne+t.substring(o),h.lastIndex=0}catch(I){let j=I instanceof Error?I.message:String(I),ee=y("Include",`Error evaluating ${f} condition: ${j}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let[,W,E,Z,z]=C;try{let _,K=E.trim();if(m(K))_=p(K,Object.keys(e))(...Object.values(e));else _=d(K,e);let D="";if(Array.isArray(_)&&_.length>0)for(let k of _){let I={...e,[Z]:k},j=await te(W,I,c,h);D+=j}else if(z)D=await te(z,{},c,h);t=t.substring(0,h)+D+t.substring(x+1),f.lastIndex=0}catch(_){let K=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+y("Each",`Error in @each: ${K}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*(\[[^\]]+\])/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let W=C[1],E=l.slice(C[0].length),Z,z=E.match(/^\s*,\s*\{/);if(z){E=E.slice(z[0].length-1);let D=1,k=1;while(k<E.length&&D>0){if(E[k]==="{")D++;else if(E[k]==="}"){if(D--,D===0)break}k++}Z=E.substring(0,k+1),E=E.slice(k+1)}let _,K=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(K)_=K[1];try{let D=JSON.parse(W.replace(/'/g,'"')),k={};if(Z)try{k=O(Z,e)}catch(j){let ee=j instanceof Error?j.message:String(j);if(r.debug){let ne=y("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>ne)}else t=t.replace(o,()=>_||"");continue}let I=!1;for(let j of D){let ee=L(j,u,a);if(!ee)continue;if(await s(ee)){let ne=await te(j,k,c,h);t=t.replace(o,()=>ne),I=!0;break}}if(!I)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let j=y("Include",`None of the includeFirst paths exist: ${W}`,a,c,h,o);t=t.replace(o,()=>j)}else t=t.replace(o,"")}catch(D){let k=D instanceof Error?D.message:String(D),I=y("Include",`Error processing @includeFirst: ${k}`,a,c,h,o);t=t.replace(o,()=>I)}f.lastIndex=0}}function L(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=M.resolve(v),x=M.resolve(M.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let z of r._layerPartialDirs??[]){let _=M.resolve(z,g);if(_.startsWith(`${M.resolve(z)}${M.sep}`)&&ye(_))return _}l=M.resolve(v,g)}else l=M.resolve(x,g);let o=M.normalize(l),C=o.startsWith(i+M.sep)||o===i,W=o.startsWith(x+M.sep)||o===x,E=!1,Z=M.dirname(x);if(o.startsWith(Z+M.sep)){if(!M.relative(Z,o).split(M.sep).some((D)=>D.startsWith(".")&&D!=="."&&D!==".."))E=!0}if(!C&&!W&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let re=M.resolve(a);n.add(re);function B(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),y("Include",v,a,h,g)}async function te(f,v={},h,g){let i=L(f,u,a);if(!i)return B(f,`Could not resolve path for include: ${f}`,h,g);let x=M.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>M.basename(o)).join(" -> ");return B(f,`Circular include detected: ${l}`,h,g)}try{b.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(S){let X=S instanceof Error?S.message:String(S);return B(f,`Error loading include file ${f}: ${X}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:S}=await import("./chunk-
|
|
47
|
+
})();`;return a+c+r}function Me(c,e){if(H(c)){let n=H(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:nt(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Dt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let b=r[1]+r[2],n=r[1].slice(1),u=b.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),T=r[1],L=r[2];return{html:`${t}${T} data-stx-scope="${e}"${L}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function ue(c,e){let a=M.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var ae=new Set,pe=new Set;function qh(){ae.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Gf(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],b=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",T=u[2],L=u[3]==="/"||Ce.has(T.toLowerCase());if(t){b=Math.max(0,b-1);continue}if(b===0)r.push(T);if(!L)b++}return r}function fe(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var tt=new P(500),wc=new Set;function Kh(){wc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return wc}async function gs(c,e,a,r,b,n=new Set){let u=r.partialsDir||M.join(M.dirname(a),"partials");if(u&&!M.isAbsolute(u))u=M.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),T=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(T.has(i))return"";return T.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let C=o[1],W=L(C,u,a),E="";if(W&&await Bun.file(W).exists())b.add(W),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let C=t.substring(x+1,o-1),W=ce(C,0);if(W===-1){h.lastIndex=o;continue}let E=C.substring(0,W).trim(),Z=C.substring(W+1).trim(),z=Z.match(/^\s*['"]([^'"]+)['"]/);if(!z){h.lastIndex=o;continue}let _=z[1],K=Z.substring(z[0].length),D,k=ce(K,0);if(k!==-1)D=K.substring(k+1).trim();try{let I=`Boolean(${E})`,j;if(m(I)){let ie=p(I,Object.keys(e));j=Boolean(ie(...Object.values(e)))}else j=Boolean(d(I,e));let ee=v?!j:j,ne="";if(ee){let ie=L(_,u,a);if(ie&&await Bun.file(ie).exists())b.add(ie);ne=`@include('${_}'${D?`, ${D}`:""})`}t=t.substring(0,i)+ne+t.substring(o),h.lastIndex=0}catch(I){let j=I instanceof Error?I.message:String(I),ee=y("Include",`Error evaluating ${f} condition: ${j}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let[,W,E,Z,z]=C;try{let _,K=E.trim();if(m(K))_=p(K,Object.keys(e))(...Object.values(e));else _=d(K,e);let D="";if(Array.isArray(_)&&_.length>0)for(let k of _){let I={...e,[Z]:k},j=await te(W,I,c,h);D+=j}else if(z)D=await te(z,{},c,h);t=t.substring(0,h)+D+t.substring(x+1),f.lastIndex=0}catch(_){let K=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+y("Each",`Error in @each: ${K}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),C=l.match(/^\s*(\[[^\]]+\])/);if(!C){f.lastIndex=0,t=t.replace(o,"");continue}let W=C[1],E=l.slice(C[0].length),Z,z=E.match(/^\s*,\s*\{/);if(z){E=E.slice(z[0].length-1);let D=1,k=1;while(k<E.length&&D>0){if(E[k]==="{")D++;else if(E[k]==="}"){if(D--,D===0)break}k++}Z=E.substring(0,k+1),E=E.slice(k+1)}let _,K=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(K)_=K[1];try{let D=JSON.parse(W.replace(/'/g,'"')),k={};if(Z)try{k=O(Z,e)}catch(j){let ee=j instanceof Error?j.message:String(j);if(r.debug){let ne=y("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>ne)}else t=t.replace(o,()=>_||"");continue}let I=!1;for(let j of D){let ee=L(j,u,a);if(!ee)continue;if(await s(ee)){let ne=await te(j,k,c,h);t=t.replace(o,()=>ne),I=!0;break}}if(!I)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let j=y("Include",`None of the includeFirst paths exist: ${W}`,a,c,h,o);t=t.replace(o,()=>j)}else t=t.replace(o,"")}catch(D){let k=D instanceof Error?D.message:String(D),I=y("Include",`Error processing @includeFirst: ${k}`,a,c,h,o);t=t.replace(o,()=>I)}f.lastIndex=0}}function L(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=M.resolve(v),x=M.resolve(M.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let z of r._layerPartialDirs??[]){let _=M.resolve(z,g);if(_.startsWith(`${M.resolve(z)}${M.sep}`)&&ye(_))return _}l=M.resolve(v,g)}else l=M.resolve(x,g);let o=M.normalize(l),C=o.startsWith(i+M.sep)||o===i,W=o.startsWith(x+M.sep)||o===x,E=!1,Z=M.dirname(x);if(o.startsWith(Z+M.sep)){if(!M.relative(Z,o).split(M.sep).some((D)=>D.startsWith(".")&&D!=="."&&D!==".."))E=!0}if(!C&&!W&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let re=M.resolve(a);n.add(re);function B(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),y("Include",v,a,h,g)}async function te(f,v={},h,g){let i=L(f,u,a);if(!i)return B(f,`Could not resolve path for include: ${f}`,h,g);let x=M.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>M.basename(o)).join(" -> ");return B(f,`Circular include detected: ${l}`,h,g)}try{b.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(S){let X=S instanceof Error?S.message:String(S);return B(f,`Error loading include file ${f}: ${X}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:S}=await import("./chunk-a4cn8rf4.js");l=S(l,e)}if(l&&(r.debug||!A()&&!Pn()))try{let{warnUnbalancedTags:S}=await import("./chunk-vk98r75z.js");S(l,i)}catch{}try{let{processESImports:S}=await import("./chunk-c0t2tdfk.js");l=await S(l,e,i,r,b)}catch(S){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,S instanceof Error?S.message:S)}let o=l,C=he(o);if(C)o=C.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Z="";if(E)Z=`<style${E[1]}>${E[2]}</style>`;let z=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(S,X,w)=>{if(!fe(X))return"";return z.push({attrs:X,body:w}),`__STX_DATA_BLOCK_${z.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Te(l,i);for(let[S,X]of Object.entries(v))_[S]=X;let K=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,D=[...l.matchAll(K)].sort((S,X)=>{let w=(S[1]||"").includes("server"),V=(X[1]||"").includes("server");return Number(V)-Number(w)}),k="",I=null,j=!1,ee=!1;for(let S of D){let X=S[1]||"",w=S[2]||"";if(fe(X))continue;let V=X.includes("server"),be=Ve(X);if(!V&&!/\bsrc\s*=/i.test(X))je(w,i,r.strict);if(!V&&w.trim()){let{interpolateScriptExpressions:F}=await import("./chunk-ztbexx3h.js");w=F(w,_,f)}let oe="";try{let{extractAndStripCssImports:F,renderVendorStyleTags:Q}=await import("./chunk-jfmj0wsy.js"),se=F(w,{filePath:i,projectRoot:process.cwd()});w=se.code,oe=Q(se.styles)}catch(F){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,F instanceof Error?F.message:F)}if(be&&w.trim())w=Ue(w);if(!V){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-jfmj0wsy.js");w=Q(w).code;let{hasUserImports:se,bundleClientScript:Se}=await import("./chunk-ap84eenm.js");if(se(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:F}=await import("./chunk-qmkaqjba.js");w=F(w)}let de=Ee(w);if(!V){let{extractBridgeData:F,generateServerDataBridge:Q}=await import("./chunk-jfmj0wsy.js"),se=Q(w,F(_));if(se)w=`${se}
|
|
48
48
|
${w}`}if(de&&!V){j=!0,I=ue(i,e);let F=N(w),Q=ge(F,I);k+=`${oe}<script data-stx-scoped data-stx-run="always" data-stx-owner="${I}">${Q}</script>
|
|
49
|
-
`;continue}if(V)try{let{extractVariables:F}=await import("./chunk-
|
|
50
|
-
`}}if(z.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-
|
|
49
|
+
`;continue}if(V)try{let{extractVariables:F}=await import("./chunk-x3p4emdp.js");await F(w,_,i)}catch(F){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,F)}if(!V&&!de){let F=X.replace(/\bclient\b/i,"").trim();I=ue(i,e);let Q=N(w),se=ge(Q,I);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(se))ee=!0;k+=`${oe}<script data-stx-scoped data-stx-run="always" data-stx-owner="${I}"${F?` ${F}`:""}>${se}</script>
|
|
50
|
+
`}}if(z.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-ztbexx3h.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(X,w)=>{let V=z[Number(w)];return`<script${V.attrs}>${S(V.body,_,f)}</script>`})}if(I){let S=Me(o,I);if(o=S.html,S.mergedIntoExisting){let w=I,V=S.mergedIntoExisting;k=k.split(`'${w}'`).join(`'${V}'`).split(`"${w}"`).join(`"${V}"`),I=V}else if(!S.stamped&&j&&!ae.has(i))ae.add(i),console.warn(`[stx] ${M.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(S.stamped&&S.root!=="body"&&(j||ee)&&!pe.has(i)){let w=Gf(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${M.relative(process.cwd(),i)} declares ${j?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((V)=>`<${V}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let X=S.stamped&&S.root!==null&&Ar(S.root);k=ke(k,X?I:null)}if(o.includes("@include")||o.includes("@partial"))o=await gs(o,_,i,r,b,n);let{processLoops:ne,reportDeferredLoopWarnings:ie}=await import("./chunk-g65dptx2.js"),G=ne(o,_,i,void 0,!0);G=le(G,_,i),G=ie(G);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-0xtda6aw.js");if(G=xe(G,_,i,r),G=we(G,_,i),G=_e(G,_,i,r),G=R(G,_,i),Z)G+=`
|
|
51
51
|
`+Z;if(k)G+=`
|
|
52
52
|
`+k;return G}catch(l){if(l instanceof J)throw l;let o=l instanceof Error?l.message:String(l);return B(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,U;while((U=Y.exec(t))!==null){let f=U.index,v=f+U[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],C,W=x.substring(l[0].length),E=ce(W,0);if(E!==-1)C=W.substring(E+1).trim();let Z={};if(C)try{Z=O(C,e)}catch(_){let K=_ instanceof Error?_.message:String(_);t=t.replace(i,y("Include",`Error parsing include variables for ${o}: ${K}`,a,c,f)),Y.lastIndex=0;continue}let z=await te(o,Z,c,f);t=t.substring(0,f)+z+t.substring(g),Y.lastIndex=0}return t}function ms(c,e){let a=c;function r(b,n,u,t){let T=b,L=!0;while(L){L=!1;let re=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),B=T.match(re);if(!B||B.index===void 0)break;let te=B.index,Y=B[1],U=te+B[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=U,i=-1;while(h>0&&g<T.length){let l=T.slice(g),o=l.match(f),C=l.match(v),W=o?g+o.index:1/0,E=C?g+C.index:1/0;if(W<E)h++,g=W+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=T.slice(U,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);T=T.substring(0,te)+T.substring(i+`@${u}`.length),L=!0}return T}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function hs(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
|
|
53
53
|
`)})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ee,Ci,Ei,Sg,zt,al,kg,cl,fy,ze,kn,He}from"./chunk-
|
|
2
|
+
import{Ee,Ci,Ei,Sg,zt,al,kg,cl,fy,ze,kn,He}from"./chunk-b6w0f610.js";import{ml,r}from"./chunk-x7redxyd.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Ee as BROWSER_CORE_IMPORTS,Sg as STX_AUTO_IMPORTS,Ci as extractAndStripCssImports,ze as extractBridgeData,ml as findInterpolationEnd,cl as generateAutoImportDestructuring,fy as generateBrowserAutoImportDestructuring,kn as generateServerDataBridge,zt as injectBrowserCoreAutoImports,He as processClientScript,kg as referencesName,Ei as renderVendorStyleTags,r as stripCommentsAndLiterals,al as transformAutoImports};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-yhc1c4tr.js";import{_o}from"./chunk-3z1mmar2.js";import p from"path";async function um(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(_o(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-z3gz5fy4.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
|
|
3
3
|
export{um};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$n,j}from"./chunk-k32q90b2.js";import m from"fs";import e from"path";async function Tn(r,o,i){if(r.__stx_runtime_config)return;let n=$n();if(n||i){r.__stx_runtime_config=n??j(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-
|
|
2
|
+
import{$n,j}from"./chunk-k32q90b2.js";import m from"fs";import e from"path";async function Tn(r,o,i){if(r.__stx_runtime_config)return;let n=$n();if(n||i){r.__stx_runtime_config=n??j(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-as2ffje6.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=j(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Pi(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
|
|
4
4
|
`),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{E,Oi,eo,d,m,O,ut,p,to,t,u,k}from"./chunk-qa5y30sy.js";import{Ce,jt,ee,L,Cn,ne,R}from"./chunk-2kfayg4t.js";import{fr}from"./chunk-fnxg6134.js";import{le}from"./chunk-xymr4ys9.js";import{Cs}from"./chunk-zsnmk5me.js";var he=1000,me=!1;function xe(n,r){let i=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,e="",o=0,s;while((s=i.exec(n))!==null){let l=s.index+s[0].length,b=s.index+s[0].indexOf("("),x=k(n,"(",")",b);if(x===-1)continue;let f=n.slice(l,x).trim();if(!f)continue;if(!Object.keys(r).some((a)=>new RegExp(`(?:^|[^\\w$.])${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(f)))continue;let h;try{let a=O(f,r);if(!a||typeof a!=="object")continue;h=JSON.stringify(a)}catch{continue}e+=n.slice(o,l)+h,o=x,i.lastIndex=x}return o===0?n:e+n.slice(o)}function be(n,r){let i=/@component\s*\(/g,e=n,o,s=[];while((o=i.exec(e))!==null){let l=o.index,b=l+o[0].length-1,x=1,f=b+1;while(f<e.length&&x>0){if(e[f]==="(")x++;else if(e[f]===")"){if(x--,x===0)break}f++}if(x!==0)continue;let c=e.substring(b+1,f),h=f+1,a=c.match(/^\s*['"]([^'"]+)['"]/);if(!a)continue;let y=a[1],g=c.slice(a[0].length),w=g.match(/^\s*,\s*/);if(!w)continue;let S=g.slice(w[0].length).trim();if(!S)continue;try{let F=O(S,r),B=JSON.stringify(F),v=`@component('${y}', ${B})`;s.push({start:l,end:h,replacement:v})}catch{continue}}for(let l=s.length-1;l>=0;l--){let{start:b,end:x,replacement:f}=s[l];e=e.substring(0,b)+f+e.substring(x)}return e}function ie(n,r,i){let e=n,o=new RegExp(`${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),s;while((s=o.exec(e))!==null){let l=s.index,b=l+s[0].length-1,x=1,f=b+1,c=null,h=!1;while(f<e.length&&x>0){let g=e[f];if(h){h=!1,f++;continue}if(g==="\\"&&c){h=!0,f++;continue}if(c){if(g===c)c=null;f++;continue}if(g==='"'||g==="'"||g==="`"){c=g,f++;continue}if(g==="(")x++;else if(g===")"){if(x--,x===0)break}f++}if(x!==0)break;let a=e.substring(b+1,f),y=i(a);e=e.substring(0,l)+y+e.substring(f+1)}return e}function ye(n,r){let i=n;return i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(e,o)=>{if(o in r)return`:${o}="${o}"`;return e}),i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(e,o,s)=>{try{if(L(s,r.__stx_client_signal_names||[]))return e;let l=Object.keys(r),b=Object.values(r);Oi(s);let x=!1,c=p(s,l,()=>{x=!0})(...b);if(x)return e;let h=JSON.stringify(c);if(h===void 0){if(!ut(s).some((g)=>!(g in r)))return"";return e}let a=Buffer.from(h,"utf8").toString("base64");return`__stx_${o}="${a}"`}catch(l){return e}}),i}var Q="<!--__STX_BREAK__-->",te="<!--__STX_CONTINUE__-->";function ue(n,r){let i=/\{\{\{?|\{!!|@(break|continue)(?![\w$])/g,e="",o=0;for(let s=i.exec(n);s;s=i.exec(n)){if(!s[1]){let f=s[0].length===3&&s[0]==="{{{"?3:2,c=s[0]==="{!!"?n.indexOf("!!}",i.lastIndex):Ce(n,s.index,f);if(c<0)break;i.lastIndex=c+(s[0]==="{!!"?3:f);continue}let l=i.lastIndex,b=!0,x=/^\s*\(/.exec(n.slice(l));if(x){let f=l+x[0].length-1,c=k(n,"(",")",f);if(c<0)break;l=c+1;try{let h=`!!(${n.slice(f+1,c).trim()})`;b=m(h)?Boolean(p(h,Object.keys(r))(...Object.values(r))):Boolean(d(h,r))}catch{b=!1}}if(e+=n.slice(o,s.index),b)return e+(s[1]==="break"?Q:te);o=l,i.lastIndex=l}return e+n.slice(o)}function fe(n){let r=(o)=>o.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),i="",e=0;return Cn(n,(o,s,l)=>(i+=ce(r(n.slice(e,l))),i+=`\${__stxRenderLoopValue(${l}, (${s}), ${o.length})}`,e=l+o.length,o)),i+ce(r(n.slice(e)))}function ge(n,r,i,e){return ne(n,r,i==null?"":String(i),!1,e)}function ce(n){let r=n;return r=ie(r,"@break",(i)=>{let e=i.trim();if(!to(e))return"";return`\`; if (${e}) { break; } result += \``}),r=ie(r,"@continue",(i)=>{let e=i.trim();if(!to(e))return"";return`\`; if (${e}) { continue; } result += \``}),r=r.replace(/@break(?!\()/g,"`; break; result += `"),r=r.replace(/@continue(?!\()/g,"`; continue; result += `"),r}function Ee(n){let r=/@forelse\s*\(/g,i,e=[],o=/@foreach\s*\(/g,s=/@endforeach/g,l;while((l=o.exec(n))!==null)e.push({pos:l.index,delta:1});while((l=s.exec(n))!==null)e.push({pos:l.index,delta:-1});e.sort((c,h)=>c.pos-h.pos);let b=[],x=0;for(let c of e)x+=c.delta,b.push({pos:c.pos,depth:x});function f(c){let h=0,a=b.length-1,y=0;while(h<=a){let g=h+a>>1;if(b[g].pos<=c)y=b[g].depth,h=g+1;else a=g-1}return y}while((i=r.exec(n))!==null){if(f(i.index)>0)continue;let c=i.index,h=i.index+i[0].length-1,a=1,y=h+1,g=-1;while(y<n.length&&a>0){if(n[y]==="(")a++;else if(n[y]===")"){if(a--,a===0){g=y;break}}y++}if(g===-1)continue;let w=n.substring(h+1,g),S=jt(w);if(!S)continue;let{arrayExpr:F,itemVar:B}=S,v=g+1,A=1,T=v,K=/@forelse\s*\(/g,V=/@endforelse/g,N=-1;while(A>0&&T<n.length){K.lastIndex=T,V.lastIndex=T;let P=K.exec(n),_=V.exec(n);if(!_)break;if(P&&P.index<_.index)A++,T=P.index+P[0].length;else{if(A--,A===0){N=_.index;break}T=_.index+11}}if(N===-1)continue;let I=n.substring(v,N),Z=N+11,z=-1,D=0,M=0;while(M<I.length){let P=I.indexOf("@",M);if(P===-1)break;let _=I.substring(P);if(/^@forelse\s*\(/.test(_))D++,M=P+1;else if(_.startsWith("@endforelse"))D--,M=P+11;else if(D===0&&_.startsWith("@empty")){if(I.length<=P+6||!/[a-z]/i.test(I[P+6])){z=P;break}M=P+1}else M=P+1}if(z===-1)continue;return{start:c,end:Z,arrayExpr:F,itemVar:B,foreachContent:I.substring(0,z),emptyContent:I.substring(z+6)}}return null}function ae(n,r){let i=n;while(!0){let e=Ee(i);if(!e)break;let{start:o,end:s,arrayExpr:l,itemVar:b,foreachContent:x,emptyContent:f}=e;try{let c;if(m(l))c=p(l,Object.keys(r))(...Object.values(r));else c=d(l,r);let h;if(!Array.isArray(c)||c.length===0)h=f;else h=`@foreach (${l} as ${b})${x}@endforeach`;i=i.substring(0,o)+h+i.substring(s)}catch(c){let h=c instanceof Error?c.message:String(c),a=u("Forelse",`Error in @forelse(${l} as ${b}): ${h}`,t.EVALUATION_ERROR);i=i.substring(0,o)+a+i.substring(s)}}return i}var de="<!--stx:foreach-not-iterable:",_e=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function $e(n,r){return`${de}${encodeURIComponent(n)}|${encodeURIComponent(r)}-->`}function Re(n,r){console.warn(`[stx] @foreach(${n}) in ${r}: ${n} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function ws(n){if(!n.includes(de))return n;return n.replace(_e,(r,i,e)=>(Re(decodeURIComponent(i),decodeURIComponent(e)),""))}function Jf(n,r,i,e,o=!1){let s=re(n,r,i,e,o),l=s.next();while(!l.done)l=s.next();return l.value}async function Ko(n,r,i,e,o=!1){let s=re(n,r,i,e,o),l=s.next();while(!l.done)await E(),l=s.next();return l.value}function*re(n,r,i,e,o=!1){let s=n,l=new Set(r.__stx_client_signal_names||[]);for(let c of fr(n))l.add(c);if(l.size)r={...r,__stx_client_signal_names:[...l]};s=ae(s,r);function b(c){let h=/@foreach\s*\(/g,a;while((a=h.exec(c))!==null){let y=a.index,g=a.index+a[0].length-1,w=1,S=g+1,F=-1;while(S<c.length&&w>0){if(c[S]==="(")w++;else if(c[S]===")"){if(w--,w===0){F=S;break}}S++}if(F===-1)continue;let B=c.substring(g+1,F),v=jt(B);if(!v)continue;let A=y,{arrayExpr:T,itemVar:K}=v,V=F+1,N=1,I=V,Z=/@foreach\s*\(/g,z=/@endforeach/g;while(N>0&&I<c.length){Z.lastIndex=I,z.lastIndex=I;let D=Z.exec(c),M=z.exec(c);if(!M)break;if(D&&D.index<M.index)N++,I=D.index+D[0].length;else{if(N--,N===0){let P=c.substring(V,M.index),_=M.index+11;return{start:A,end:_,arrayExpr:T,itemVar:K,content:P}}I=M.index+11}}}return null}function*x(c,h){let a=c;while(!0){let y=b(a);if(!y)break;let{start:g,end:w,arrayExpr:S,itemVar:F,content:B}=y;try{let v=S.trim(),A;if(m(v))A=p(v,Object.keys(h))(...Object.values(h));else A=d(v,h);let T=!1;if(!Array.isArray(A))if(A instanceof Map)A=Array.from(A),T=!0;else if(A instanceof Set)A=Array.from(A);else if(typeof A==="string")A=Array.from(A);else if(A&&typeof A==="object"&&!(A instanceof Date)&&!(A instanceof RegExp))A=Object.entries(A),T=!0;else{let _=$e(v,i)+u("Foreach",`Error in @foreach: ${v} is not iterable`,t.TYPE_ERROR);a=a.substring(0,g)+_+a.substring(w);continue}let K=e?.loops?.useAltLoopVariable??me,V=F.trim(),N=null,I,Z=!1;if(V.includes("=>")){let _=V.split("=>").map((W)=>W.trim());if(_.length===2&&_[0]&&_[1])N=_[0],I=_[1];else I=V}else if(!V.startsWith("[")&&!V.startsWith("{")&&V.includes(",")){let _=V.split(",").map((W)=>W.trim());if(_.length===2&&_[0]&&_[1])I=_[0],N=_[1],Z=!0;else I=V}else I=V;let z="",D=new Set(ee(`${S} as ${F}`)),M=A,P=h[eo]??new WeakMap;for(let _=0;_<M.length;_++){if(_%16===0)yield;let W=M[_],se={index:_,iteration:_+1,first:_===0,last:_===M.length-1,count:M.length},j={...h,loop:se,$loop:se,[eo]:P};if(Array.isArray(h.__stx_client_signal_names))j.__stx_client_signal_names=h.__stx_client_signal_names.filter((H)=>!D.has(H));if(I.startsWith("[")&&I.endsWith("]")){let H=I.slice(1,-1).split(",").map((U)=>U.trim());if(Array.isArray(W))H.forEach((U,X)=>{if(U)j[U]=W[X]});else j[I]=W}else if(I.startsWith("{")&&I.endsWith("}")){let H=I.slice(1,-1).split(",").map((U)=>U.trim()).filter(Boolean);if(W!==null&&typeof W==="object")H.forEach((U)=>{let X=U.indexOf(":"),Y=(X===-1?U:U.slice(0,X)).trim(),oe=X===-1?Y:U.slice(X+1).trim();if(Y&&oe)j[oe]=W[Y]});else j[I]=W}else j[I]=W;if(N)if(!Z&&T&&Array.isArray(W)&&W.length===2)j[N]=W[0],j[I]=W[1];else j[N]=_;let C=ae(B,j);C=yield*re(C,j,i,e,!0),C=le(C,j,i),C=ue(C,j);let J=C.indexOf(Q),G=C.indexOf(te),q=J<0?G:G<0?J:Math.min(J,G);if(q>=0)C=C.slice(0,q);if(C=R(C,j,i),C=ye(C,j),C=be(C,j),C=xe(C,j),z+=C,q>=0&&q===J)break}a=a.substring(0,g)+z+a.substring(w)}catch(v){let A=u("Foreach",`Error in @foreach(${S.trim()} as ${F.trim()}): ${v instanceof Error?v.message:String(v)}`,t.EVALUATION_ERROR);a=a.substring(0,g)+A+a.substring(w)}}return a}s=yield*x(s,r),s=Ae(s,r,i,e);let f=e?.loops?.maxWhileIterations??he;return s=ke(s,r,f),o?s:ws(s)}function Yf(n){let r=/^(\s*)([A-Za-z_$][\w$]*|\[[^\]]*\]|\{[^}]*\})(\s+(?:of|in)\s)/.exec(n);if(!r||/^(?:const|let|var)$/.test(r[2]))return n;return`${r[1]}let ${n.slice(r[1].length)}`}function pe(n){return to(n)}function Ae(n,r,i,e){let o=n,s=!0;while(s){s=!1;let l=o.match(/@for\s*\(/);if(!l||l.index===void 0)break;let b=l.index,x=b+l[0].length-1,f=k(o,"(",")",x);if(f===-1)break;let c=Yf(o.slice(x+1,f)),h=f+1,a=Cs(o.slice(b),"for","endfor");if(a.length===0)break;let y=a[0].content,g=b+a[0].end;if(!pe(c)){let w=u("For",`Unsafe expression in @for: ${c}`,t.UNSAFE_EXPRESSION);o=o.substring(0,b)+w+o.substring(g),s=!0;continue}try{let w=we(c),S=/@(?:for|foreach|if|unless)\s*\(/.test(y);if(w.length>0&&S){let K=Oe({forExpr:c,content:y,iterVarNames:w,context:r,filePath:i,options:e});o=o.substring(0,b)+K+o.substring(g),s=!0;continue}let F=Object.keys(r),B=Object.values(r),v=fe(y),T=Function(...F,"__stxRenderLoopValue",`
|
|
2
|
+
import{E,Oi,eo,d,m,O,ut,p,to,t,u,k}from"./chunk-qa5y30sy.js";import{Ce,jt,ee,L,Cn,ne,R}from"./chunk-b6w0f610.js";import{fr}from"./chunk-y036cwc7.js";import{le}from"./chunk-xymr4ys9.js";import{Cs}from"./chunk-zsnmk5me.js";var he=1000,me=!1;function xe(n,r){let i=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,e="",o=0,s;while((s=i.exec(n))!==null){let l=s.index+s[0].length,b=s.index+s[0].indexOf("("),x=k(n,"(",")",b);if(x===-1)continue;let f=n.slice(l,x).trim();if(!f)continue;if(!Object.keys(r).some((a)=>new RegExp(`(?:^|[^\\w$.])${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(f)))continue;let h;try{let a=O(f,r);if(!a||typeof a!=="object")continue;h=JSON.stringify(a)}catch{continue}e+=n.slice(o,l)+h,o=x,i.lastIndex=x}return o===0?n:e+n.slice(o)}function be(n,r){let i=/@component\s*\(/g,e=n,o,s=[];while((o=i.exec(e))!==null){let l=o.index,b=l+o[0].length-1,x=1,f=b+1;while(f<e.length&&x>0){if(e[f]==="(")x++;else if(e[f]===")"){if(x--,x===0)break}f++}if(x!==0)continue;let c=e.substring(b+1,f),h=f+1,a=c.match(/^\s*['"]([^'"]+)['"]/);if(!a)continue;let y=a[1],g=c.slice(a[0].length),w=g.match(/^\s*,\s*/);if(!w)continue;let S=g.slice(w[0].length).trim();if(!S)continue;try{let F=O(S,r),B=JSON.stringify(F),v=`@component('${y}', ${B})`;s.push({start:l,end:h,replacement:v})}catch{continue}}for(let l=s.length-1;l>=0;l--){let{start:b,end:x,replacement:f}=s[l];e=e.substring(0,b)+f+e.substring(x)}return e}function ie(n,r,i){let e=n,o=new RegExp(`${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),s;while((s=o.exec(e))!==null){let l=s.index,b=l+s[0].length-1,x=1,f=b+1,c=null,h=!1;while(f<e.length&&x>0){let g=e[f];if(h){h=!1,f++;continue}if(g==="\\"&&c){h=!0,f++;continue}if(c){if(g===c)c=null;f++;continue}if(g==='"'||g==="'"||g==="`"){c=g,f++;continue}if(g==="(")x++;else if(g===")"){if(x--,x===0)break}f++}if(x!==0)break;let a=e.substring(b+1,f),y=i(a);e=e.substring(0,l)+y+e.substring(f+1)}return e}function ye(n,r){let i=n;return i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(e,o)=>{if(o in r)return`:${o}="${o}"`;return e}),i=i.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(e,o,s)=>{try{if(L(s,r.__stx_client_signal_names||[]))return e;let l=Object.keys(r),b=Object.values(r);Oi(s);let x=!1,c=p(s,l,()=>{x=!0})(...b);if(x)return e;let h=JSON.stringify(c);if(h===void 0){if(!ut(s).some((g)=>!(g in r)))return"";return e}let a=Buffer.from(h,"utf8").toString("base64");return`__stx_${o}="${a}"`}catch(l){return e}}),i}var Q="<!--__STX_BREAK__-->",te="<!--__STX_CONTINUE__-->";function ue(n,r){let i=/\{\{\{?|\{!!|@(break|continue)(?![\w$])/g,e="",o=0;for(let s=i.exec(n);s;s=i.exec(n)){if(!s[1]){let f=s[0].length===3&&s[0]==="{{{"?3:2,c=s[0]==="{!!"?n.indexOf("!!}",i.lastIndex):Ce(n,s.index,f);if(c<0)break;i.lastIndex=c+(s[0]==="{!!"?3:f);continue}let l=i.lastIndex,b=!0,x=/^\s*\(/.exec(n.slice(l));if(x){let f=l+x[0].length-1,c=k(n,"(",")",f);if(c<0)break;l=c+1;try{let h=`!!(${n.slice(f+1,c).trim()})`;b=m(h)?Boolean(p(h,Object.keys(r))(...Object.values(r))):Boolean(d(h,r))}catch{b=!1}}if(e+=n.slice(o,s.index),b)return e+(s[1]==="break"?Q:te);o=l,i.lastIndex=l}return e+n.slice(o)}function fe(n){let r=(o)=>o.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),i="",e=0;return Cn(n,(o,s,l)=>(i+=ce(r(n.slice(e,l))),i+=`\${__stxRenderLoopValue(${l}, (${s}), ${o.length})}`,e=l+o.length,o)),i+ce(r(n.slice(e)))}function ge(n,r,i,e){return ne(n,r,i==null?"":String(i),!1,e)}function ce(n){let r=n;return r=ie(r,"@break",(i)=>{let e=i.trim();if(!to(e))return"";return`\`; if (${e}) { break; } result += \``}),r=ie(r,"@continue",(i)=>{let e=i.trim();if(!to(e))return"";return`\`; if (${e}) { continue; } result += \``}),r=r.replace(/@break(?!\()/g,"`; break; result += `"),r=r.replace(/@continue(?!\()/g,"`; continue; result += `"),r}function Ee(n){let r=/@forelse\s*\(/g,i,e=[],o=/@foreach\s*\(/g,s=/@endforeach/g,l;while((l=o.exec(n))!==null)e.push({pos:l.index,delta:1});while((l=s.exec(n))!==null)e.push({pos:l.index,delta:-1});e.sort((c,h)=>c.pos-h.pos);let b=[],x=0;for(let c of e)x+=c.delta,b.push({pos:c.pos,depth:x});function f(c){let h=0,a=b.length-1,y=0;while(h<=a){let g=h+a>>1;if(b[g].pos<=c)y=b[g].depth,h=g+1;else a=g-1}return y}while((i=r.exec(n))!==null){if(f(i.index)>0)continue;let c=i.index,h=i.index+i[0].length-1,a=1,y=h+1,g=-1;while(y<n.length&&a>0){if(n[y]==="(")a++;else if(n[y]===")"){if(a--,a===0){g=y;break}}y++}if(g===-1)continue;let w=n.substring(h+1,g),S=jt(w);if(!S)continue;let{arrayExpr:F,itemVar:B}=S,v=g+1,A=1,T=v,K=/@forelse\s*\(/g,V=/@endforelse/g,N=-1;while(A>0&&T<n.length){K.lastIndex=T,V.lastIndex=T;let P=K.exec(n),_=V.exec(n);if(!_)break;if(P&&P.index<_.index)A++,T=P.index+P[0].length;else{if(A--,A===0){N=_.index;break}T=_.index+11}}if(N===-1)continue;let I=n.substring(v,N),Z=N+11,z=-1,D=0,M=0;while(M<I.length){let P=I.indexOf("@",M);if(P===-1)break;let _=I.substring(P);if(/^@forelse\s*\(/.test(_))D++,M=P+1;else if(_.startsWith("@endforelse"))D--,M=P+11;else if(D===0&&_.startsWith("@empty")){if(I.length<=P+6||!/[a-z]/i.test(I[P+6])){z=P;break}M=P+1}else M=P+1}if(z===-1)continue;return{start:c,end:Z,arrayExpr:F,itemVar:B,foreachContent:I.substring(0,z),emptyContent:I.substring(z+6)}}return null}function ae(n,r){let i=n;while(!0){let e=Ee(i);if(!e)break;let{start:o,end:s,arrayExpr:l,itemVar:b,foreachContent:x,emptyContent:f}=e;try{let c;if(m(l))c=p(l,Object.keys(r))(...Object.values(r));else c=d(l,r);let h;if(!Array.isArray(c)||c.length===0)h=f;else h=`@foreach (${l} as ${b})${x}@endforeach`;i=i.substring(0,o)+h+i.substring(s)}catch(c){let h=c instanceof Error?c.message:String(c),a=u("Forelse",`Error in @forelse(${l} as ${b}): ${h}`,t.EVALUATION_ERROR);i=i.substring(0,o)+a+i.substring(s)}}return i}var de="<!--stx:foreach-not-iterable:",_e=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function $e(n,r){return`${de}${encodeURIComponent(n)}|${encodeURIComponent(r)}-->`}function Re(n,r){console.warn(`[stx] @foreach(${n}) in ${r}: ${n} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function ws(n){if(!n.includes(de))return n;return n.replace(_e,(r,i,e)=>(Re(decodeURIComponent(i),decodeURIComponent(e)),""))}function Jf(n,r,i,e,o=!1){let s=re(n,r,i,e,o),l=s.next();while(!l.done)l=s.next();return l.value}async function Ko(n,r,i,e,o=!1){let s=re(n,r,i,e,o),l=s.next();while(!l.done)await E(),l=s.next();return l.value}function*re(n,r,i,e,o=!1){let s=n,l=new Set(r.__stx_client_signal_names||[]);for(let c of fr(n))l.add(c);if(l.size)r={...r,__stx_client_signal_names:[...l]};s=ae(s,r);function b(c){let h=/@foreach\s*\(/g,a;while((a=h.exec(c))!==null){let y=a.index,g=a.index+a[0].length-1,w=1,S=g+1,F=-1;while(S<c.length&&w>0){if(c[S]==="(")w++;else if(c[S]===")"){if(w--,w===0){F=S;break}}S++}if(F===-1)continue;let B=c.substring(g+1,F),v=jt(B);if(!v)continue;let A=y,{arrayExpr:T,itemVar:K}=v,V=F+1,N=1,I=V,Z=/@foreach\s*\(/g,z=/@endforeach/g;while(N>0&&I<c.length){Z.lastIndex=I,z.lastIndex=I;let D=Z.exec(c),M=z.exec(c);if(!M)break;if(D&&D.index<M.index)N++,I=D.index+D[0].length;else{if(N--,N===0){let P=c.substring(V,M.index),_=M.index+11;return{start:A,end:_,arrayExpr:T,itemVar:K,content:P}}I=M.index+11}}}return null}function*x(c,h){let a=c;while(!0){let y=b(a);if(!y)break;let{start:g,end:w,arrayExpr:S,itemVar:F,content:B}=y;try{let v=S.trim(),A;if(m(v))A=p(v,Object.keys(h))(...Object.values(h));else A=d(v,h);let T=!1;if(!Array.isArray(A))if(A instanceof Map)A=Array.from(A),T=!0;else if(A instanceof Set)A=Array.from(A);else if(typeof A==="string")A=Array.from(A);else if(A&&typeof A==="object"&&!(A instanceof Date)&&!(A instanceof RegExp))A=Object.entries(A),T=!0;else{let _=$e(v,i)+u("Foreach",`Error in @foreach: ${v} is not iterable`,t.TYPE_ERROR);a=a.substring(0,g)+_+a.substring(w);continue}let K=e?.loops?.useAltLoopVariable??me,V=F.trim(),N=null,I,Z=!1;if(V.includes("=>")){let _=V.split("=>").map((W)=>W.trim());if(_.length===2&&_[0]&&_[1])N=_[0],I=_[1];else I=V}else if(!V.startsWith("[")&&!V.startsWith("{")&&V.includes(",")){let _=V.split(",").map((W)=>W.trim());if(_.length===2&&_[0]&&_[1])I=_[0],N=_[1],Z=!0;else I=V}else I=V;let z="",D=new Set(ee(`${S} as ${F}`)),M=A,P=h[eo]??new WeakMap;for(let _=0;_<M.length;_++){if(_%16===0)yield;let W=M[_],se={index:_,iteration:_+1,first:_===0,last:_===M.length-1,count:M.length},j={...h,loop:se,$loop:se,[eo]:P};if(Array.isArray(h.__stx_client_signal_names))j.__stx_client_signal_names=h.__stx_client_signal_names.filter((H)=>!D.has(H));if(I.startsWith("[")&&I.endsWith("]")){let H=I.slice(1,-1).split(",").map((U)=>U.trim());if(Array.isArray(W))H.forEach((U,X)=>{if(U)j[U]=W[X]});else j[I]=W}else if(I.startsWith("{")&&I.endsWith("}")){let H=I.slice(1,-1).split(",").map((U)=>U.trim()).filter(Boolean);if(W!==null&&typeof W==="object")H.forEach((U)=>{let X=U.indexOf(":"),Y=(X===-1?U:U.slice(0,X)).trim(),oe=X===-1?Y:U.slice(X+1).trim();if(Y&&oe)j[oe]=W[Y]});else j[I]=W}else j[I]=W;if(N)if(!Z&&T&&Array.isArray(W)&&W.length===2)j[N]=W[0],j[I]=W[1];else j[N]=_;let C=ae(B,j);C=yield*re(C,j,i,e,!0),C=le(C,j,i),C=ue(C,j);let J=C.indexOf(Q),G=C.indexOf(te),q=J<0?G:G<0?J:Math.min(J,G);if(q>=0)C=C.slice(0,q);if(C=R(C,j,i),C=ye(C,j),C=be(C,j),C=xe(C,j),z+=C,q>=0&&q===J)break}a=a.substring(0,g)+z+a.substring(w)}catch(v){let A=u("Foreach",`Error in @foreach(${S.trim()} as ${F.trim()}): ${v instanceof Error?v.message:String(v)}`,t.EVALUATION_ERROR);a=a.substring(0,g)+A+a.substring(w)}}return a}s=yield*x(s,r),s=Ae(s,r,i,e);let f=e?.loops?.maxWhileIterations??he;return s=ke(s,r,f),o?s:ws(s)}function Yf(n){let r=/^(\s*)([A-Za-z_$][\w$]*|\[[^\]]*\]|\{[^}]*\})(\s+(?:of|in)\s)/.exec(n);if(!r||/^(?:const|let|var)$/.test(r[2]))return n;return`${r[1]}let ${n.slice(r[1].length)}`}function pe(n){return to(n)}function Ae(n,r,i,e){let o=n,s=!0;while(s){s=!1;let l=o.match(/@for\s*\(/);if(!l||l.index===void 0)break;let b=l.index,x=b+l[0].length-1,f=k(o,"(",")",x);if(f===-1)break;let c=Yf(o.slice(x+1,f)),h=f+1,a=Cs(o.slice(b),"for","endfor");if(a.length===0)break;let y=a[0].content,g=b+a[0].end;if(!pe(c)){let w=u("For",`Unsafe expression in @for: ${c}`,t.UNSAFE_EXPRESSION);o=o.substring(0,b)+w+o.substring(g),s=!0;continue}try{let w=we(c),S=/@(?:for|foreach|if|unless)\s*\(/.test(y);if(w.length>0&&S){let K=Oe({forExpr:c,content:y,iterVarNames:w,context:r,filePath:i,options:e});o=o.substring(0,b)+K+o.substring(g),s=!0;continue}let F=Object.keys(r),B=Object.values(r),v=fe(y),T=Function(...F,"__stxRenderLoopValue",`
|
|
3
3
|
let result = '';
|
|
4
4
|
for (${c}) {
|
|
5
5
|
result += \`${v}\`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{um}from"./chunk-
|
|
2
|
+
import{um}from"./chunk-jgra00m8.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{um as buildApp};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{he,Yc,Ks,xn,h,ze,He}from"./chunk-
|
|
2
|
+
import{he,Yc,Ks,xn,h,ze,He}from"./chunk-b6w0f610.js";import{br,st,V}from"./chunk-yhc1c4tr.js";import{cr,i}from"./chunk-xfd3yqgj.js";import{_e}from"./chunk-nttsc0aw.js";import{Ui}from"./chunk-s9df8srx.js";function y(s){return s.endsWith(".md")||s.endsWith(".markdown")}function C(s){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(n,p){let g;while((g=n.exec(s))!==null){let t=g.index,o=t+g[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function b(s,e={}){let{data:r,content:m}=br(s),a=await(e.renderer??((n)=>st(n)))(m);return{html:C(a),frontmatter:r??{}}}import{dirname as k,resolve as R}from"path";function v(s){let e=s,r=he(s);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),g;while((g=m.exec(s))!==null){let o=g[1],l=g[2],d=g[0],u=o.includes("server");if(p(l))n.push(d);else if(u)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let u=l.index+l[0].length,f=t.indexOf("</script>",u);if(f===-1)continue;d.push({start:l.index,end:f+9}),o.lastIndex=f+9}for(let u=d.length-1;u>=0;u--)t=t.substring(0,d[u].start)+t.substring(d[u].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function M(s,e){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -12,5 +12,5 @@ ${s}
|
|
|
12
12
|
</html>`}async function ac(s,e={}){let r=R(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(y(r)){let n=await b(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=R(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:g,injectCSS:t,...o}=e,l={...e.context||{}};xn(l);let d=await w(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),u=await p.text(),f={...l,content:d},x={...o,context:f,injectCSS:t};return w(u,n,x)}return w(c,r,e)}async function w(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=v(s),n={...V,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Ks(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await h(o,p,e);let g=new Set,t=m;if(t=await i(t,p,e,n,g),Yc(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
|
|
13
13
|
${a.join(`
|
|
14
14
|
`)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=ze(p),d=await Promise.all(a.map(async(x)=>{let _=x.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(_))return x;let S=x.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!S)return x;return await He(S[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),f=[await cr(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
|
|
15
|
-
`);t=Ui(t,f)}t=await _e(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-
|
|
15
|
+
`);t=Ui(t,f)}t=await _e(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-gw7t6a3t.js");t=await o(t)}catch{}return t}
|
|
16
16
|
export{ac};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{vr}from"./chunk-x512h2gv.js";import{Nr}from"./chunk-qa5y30sy.js";import{a}from"./chunk-
|
|
2
|
+
import{vr}from"./chunk-x512h2gv.js";import{Nr}from"./chunk-qa5y30sy.js";import{a}from"./chunk-yhc1c4tr.js";import{H,nt}from"./chunk-8s6s6nd0.js";import{_c}from"./chunk-hmdkf6c6.js";import{M,c}from"./chunk-s9df8srx.js";var x=/<style\b[^>]*>/iy,R=/<\/style>/gi,b=/<script\b[^>]*>/iy,S=/<template(?=[\s>/])[^>]*>/iy,w=/<\/template\s*>/iy;function gr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let g=e.indexOf("-->",n+4);r=g===-1?e.length:g+3;continue}x.lastIndex=n;let u=x.exec(e);if(u){R.lastIndex=n+u[0].length;let g=R.exec(e);r=g===null?e.length:g.index+8;continue}S.lastIndex=n;let o=S.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}w.lastIndex=n;let d=w.exec(e);if(d){if(t>0)t--;r=n+d[0].length;continue}if(b.lastIndex=n,b.test(e))return t>0?s:n;r=n+1}return-1}function Z(e,r={}){return new vr(e,r).routes}import y from"path";var T=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let d=await a();t||=d?.pagesDir||"pages",s||=d?.root||"."}catch{t||="pages",s||="."}let n=y.isAbsolute(t)?t:y.join(s,t),u=T.get(n);if(u)return u;let o=[];try{o=Z(".",{pagesDir:n,emit:!1}).map((d)=>d.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function E(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return E(JSON.stringify(e))}function ke(e){return e.includes("data-stx-runtime")}function Sc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function p(e,r){let t=gr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
|
|
3
3
|
`+e.slice(t);let n=Nr(e);if(n!==null)return`${e.slice(0,n)}
|
|
4
4
|
${r}${e.slice(n)}`;if(e.includes("</head>")){let o=M(e);return e.slice(0,o)+r+`
|
|
5
5
|
`+e.slice(o)}if(H(e))return nt(e,(o)=>`${o}
|
|
6
6
|
${r}`);return`${r}
|
|
7
|
-
${e}`}async function mr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-
|
|
7
|
+
${e}`}async function mr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-g4gcf4jn.js"),{url:u}=await n("runtime",r.debug===!0);return p(e,`<script data-stx-runtime src="${u}"></script>`)}if(r.buildMode==="compile")return p(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-g4gcf4jn.js"),s=await t(r.debug);return p(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function O(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function kc(e){if(e.includes("data-stx-tooltip-runtime")||!O(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${_c()}</script>`,t=c(e);if(t===-1)return`${e}
|
|
8
8
|
${r}`;return`${e.slice(0,t)}${r}
|
|
9
|
-
${e.slice(t)}`}var C=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function A(e){return C.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function _e(e,r){if(!e.includes("</body>"))return e;if(A(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:_}=await import("./chunk-
|
|
9
|
+
${e.slice(t)}`}var C=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function A(e){return C.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function _e(e,r){if(!e.includes("</body>"))return e;if(A(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:_}=await import("./chunk-g4gcf4jn.js");n=`<script data-stx-owned-routes src="${_(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(f)};
|
|
10
10
|
`)}"></script>
|
|
11
11
|
`}else i.ownedRoutes=f}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${l(i)};</script>
|
|
12
|
-
`}let{getCachedRouterScript:u,getServeClientAsset:o}=await import("./chunk-
|
|
12
|
+
`}let{getCachedRouterScript:u,getServeClientAsset:o}=await import("./chunk-g4gcf4jn.js"),d=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await u()}</script>`,g=c(e);return e.slice(0,g)+s+n+d+`
|
|
13
13
|
</body>`+e.slice(g+7)}
|
|
14
14
|
export{gr,Z,ke,Sc,mr,kc,_e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R}from"./chunk-
|
|
2
|
+
import{R}from"./chunk-b6w0f610.js";import{i}from"./chunk-xfd3yqgj.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-qjey0jk6.js";import"./chunk-farh4p7f.js";import"./chunk-qa5y30sy.js";import{S,_,T,te}from"./chunk-
|
|
2
|
+
import"./chunk-qjey0jk6.js";import"./chunk-farh4p7f.js";import"./chunk-qa5y30sy.js";import{S,_,T,te}from"./chunk-b6w0f610.js";import"./chunk-k32q90b2.js";import"./chunk-k7dxm48r.js";import{pr}from"./chunk-01c16zw4.js";import{existsSync as C}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var u=new Map,h=S(64),w=new Set,v=0,E=new Set(b);function z(){u.clear(),h.clear()}function R(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function P(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function I(s){if(!s)return[];let o=_(s,v),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of E){if(w.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function M(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(C(l.join(s,`index.${o}`)))return s;let t=pr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=I(s);if(t.length===0)return null;let i=o??M();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=te({loader:"ts",target:"browser",define:T()}),k=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=R(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>k.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let x=t.filter((n)=>!d.has(n)&&!P(s,n));if(x.length>0)console.warn(`[stx] could not bundle ${x.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return u.set(r,""),null;let O=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
|
|
4
4
|
`),y=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Zh,vs,Yo,xs,fr,Zo,Qo,Zf,Ss,ks,_s,ei,xc,Qf,Ct}from"./chunk-
|
|
2
|
+
import{Zh,vs,Yo,xs,fr,Zo,Qo,Zf,Ss,ks,_s,ei,xc,Qf,Ct}from"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import{q}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Zf as bindLoopInterpolations,Zh as clearScriptScanCache,Ss as convertServerLoopAttributesToDirectives,Zo as convertSignalDirectivesToAttributes,ks as convertSignalLoopsToAttributes,fr as extractClientSignalNames,q as extractExports,xc as findMarkupIndexOutsideScripts,xs as hasSignalsSyntax,Yo as parseLoopExpression,Qo as preEvalLiteralReactiveIfs,_s as processScriptSetup,ei as processSignals,Qf as rewriteStxImportSpecifiers,vs as scanScriptTags,Ct as stripStxRuntimeImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fn,Lo,jo,Bo,Hh,Fo}from"./chunk-
|
|
2
|
+
import{fn,Lo,jo,Bo,Hh,Fo}from"./chunk-wk4wg6sn.js";import"./chunk-669b2bya.js";import"./chunk-x512h2gv.js";import"./chunk-k32q90b2.js";export{jo as buildServerApi,Hh as createServerApi,fn as discoverServerApi,Lo as generateApiTypes,Fo as isServerApiSource,Bo as productionApiDispatcher};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{qh,Gf,tt,wc,Kh,gs,ms,hs}from"./chunk-
|
|
2
|
+
import{qh,Gf,tt,wc,Kh,gs,ms,hs}from"./chunk-hc6111md.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-xymr4ys9.js";import"./chunk-zsnmk5me.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Kh as clearOnceStore,wc as onceStore,tt as partialsCache,gs as processIncludes,ms as processStackPushDirectives,hs as processStackReplacements,qh as resetUnscopedSignalWarnings,Gf as topLevelElements};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{O,t,u}from"./chunk-qa5y30sy.js";import{ne}from"./chunk-
|
|
2
|
+
import{O,t,u}from"./chunk-qa5y30sy.js";import{ne}from"./chunk-b6w0f610.js";import{si}from"./chunk-tnp2ta5q.js";import E from"path";var S;async function W(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var T={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function J(e,s=0){if(s<=0)return!1;return Date.now()-e.loadedAt>s}async function G(e,s){if({...T,...s.i18n}.cache&&v[e]){let r=v[e],o=s.i18n?.cacheMaxAge??0;if(!J(r,o))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=C(e,s).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function C(e,s){let i={...T,...s.i18n},n=E.isAbsolute(i.translationsDir)?i.translationsDir:E.resolve(s.root||process.cwd(),i.translationsDir);try{let r=await W(),o=r?await r(e,{translationsDir:n,defaultLocale:i.defaultLocale,sources:ee(i.format)}):await Y(e,i,n);if(o===void 0){let c=e!==i.defaultLocale?await C(i.defaultLocale,s):{};if(i.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}let l=o;if(i.cache)v[e]={translations:l,loadedAt:Date.now(),locale:e};return l}catch(r){if(s.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==i.defaultLocale)return C(i.defaultLocale,s);return{}}}async function Y(e,s,i){let n=E.join(i,`${e}${Z(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 Q(o);if(s.format==="json")return JSON.parse(o);throw r}catch{return}}}function Z(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 Q(e){let s={},i=e.split(`
|
|
3
3
|
`),n=[{obj:s,indent:-1}];for(let r of i){let o=r.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let l=o.search(/\S/);if(l===-1)continue;while(n.length>1&&n[n.length-1].indent>=l)n.pop();let c=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==="")c[f]={},n.push({obj:c[f],indent:l});else c[f]=X(m)}}return s}function X(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 ee(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function te(e,s){return G(e,s)}function re(e,s){for(let i of e){let n=i.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let l=Number.parseInt(r[1],10);if(s===l)return r[2];continue}let o=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(o){let l=Number.parseInt(o[1],10),c=o[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(o[2],10);if(s>=l&&s<=c)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=P(s),o=`=${n}`;if(r[o])return R(r[o],n,i);let l=ce(n);if(r[l])return R(r[l],n,i);if(r.other)return R(r.other,n,i);return String(n)}function R(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=P(s);if(n[i])return n[i];return n.other||String(e)}function de(e,s){let i=Number(e)||0,n=P(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 P(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 N(e,s,i=!0,n={}){let r=e.split("."),o=s;for(let c of r){if(o===void 0||o===null)break;o=o[c]}if(o===void 0||o===null)return i?e:"";let l=String(o);if(be(l))return ie(l,n);if(l.includes("|")&&"count"in n){let c=Number(n.count),a=l.split("|");l=re(a,c)}for(let[c,a]of Object.entries(n)){let g=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");l=l.replace(new RegExp(`:${g}`,"g"),()=>String(a))}return l}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 Rc(e,s,i,n){let r=e,o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,l={...T,...n.i18n},c=await te(l.locale,n);s.__translations=c,s.__locale=l.locale,s.__i18nConfig=l,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}}`,A=JSON.parse(x);return typeof A.data==="object"?A.data:{}},()=>O(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=N(f,c,l.fallbackToKey,b);return y?ne(r,h,y,!1,p.length):w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return u("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:{}},()=>O(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 ne(r,w,N(f,c,l.fallbackToKey,h),!1,p.length)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return u("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,...l)=>{let c=i(o,...l).then((a)=>({match:o,replacement:a}));return n.push(c),o}),(await Promise.all(n)).reduce((o,{match:l,replacement:c})=>o.replace(l,()=>c),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 I(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 Ac(e,s,i,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(l,c,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"}[c]||"Make this element accessible";return`<!-- a11y-hint: ${a||p} -->`});let o=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(o,(l,c)=>`<span class="sr-only">${c.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(l,c,a)=>`<span id="${`desc-${c}`}" 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,l)=>{let c=s.get(l);if(!c)c=`stx-a11y-component-${s.size}`,s.set(l,c);return`<${o}${c}`}),n=new Map([...s.entries()].map(([r,o])=>[o,r]));return{protectedSource:i,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(o,l,c)=>{let a=n.get(c);return a?`<${l}${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 l=/<a\s+([^>]*)>\s*<\/a>/gi;r=l.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=l.exec(e)}let c=/<(input|select|textarea)\s+([^>]*)>/gi;r=c.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=c.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),A=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=A&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${A[1]}["']`,"i").test(e),U=r.index,M=e.substring(0,U),Se=e.substring(U),H=(M.match(/<label\b/gi)||[]).length,z=(M.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=c.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&&_(I(f[1],"lang"),I(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(I(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")),l=0;for(let a of o){let g=Number.parseInt(a.tagName.charAt(1));if(l>0&&g>l+1)n.push({type:"heading-skip",element:`<${a.outerHTML}>`,message:`Heading level skipped from h${l} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});l=g}let c=r.querySelector("html");if(i.includes("<html")&&c&&!c.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(c&&_(c.getAttribute("lang"),c.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 Pc(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,o=Array.isArray(e)?e:[e],l=await si(o,{recursive:n,ignorePaths:r}),c=[];for(let a of l)try{let g=await Bun.file(a).text();if(a.endsWith("good-a11y.stx"))continue;let p=await Ae(g,a);if(c.push(a),p.length>0)i[a]=p}catch(g){console.error(`Error scanning ${a}:`,g)}return{results:i,scannedFiles:c}}var Ic={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,""):"",c={"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||c} -->${e}`},hasEndTag:!1},Oc={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
|
|
4
4
|
export{Rc,Ac,Pc,Ic,Oc};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ra,vu,Kn,Xm,xu,Su,ku,Jm}from"./chunk-
|
|
2
|
+
import{Ra,vu,Kn,Xm,xu,Su,ku,Jm}from"./chunk-yakdcak2.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Kn as Validator,vu as defineForm,xu as processErrorDirective,Su as processErrorsDirective,Jm as processFormValidationDirectives,ku as processHasErrorsDirective,Ra as useForm,Xm as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fl,zl}from"./chunk-w468n41y.js";import"./chunk-v37zmez0.js";import"./chunk-prrvggcy.js";import"./chunk-jgra00m8.js";import"./chunk-yr1zx78b.js";import"./chunk-dtarm8x9.js";import"./chunk-mcnwvh06.js";import"./chunk-2n932qtv.js";import"./chunk-5s1fb8z4.js";import"./chunk-85zmxbt0.js";import"./chunk-6ftee542.js";import"./chunk-gd56arnm.js";import"./chunk-ew5cey88.js";import"./chunk-vwwpbhd2.js";import"./chunk-8me8hamk.js";import"./chunk-ysfeg3cn.js";import"./chunk-gp8hgpt9.js";import"./chunk-55zq2ha8.js";import"./chunk-hev4t4d5.js";import"./chunk-1mqcttg3.js";import"./chunk-yakdcak2.js";import"./chunk-32ty2zx6.js";import"./chunk-qcxrcypb.js";import"./chunk-gbtbfg7e.js";import"./chunk-cqhwzd9y.js";import"./chunk-j1efsjsb.js";import"./chunk-5p1k2h5q.js";import"./chunk-15m7jnc0.js";import"./chunk-sj3ry5ck.js";import"./chunk-ntbe5q5x.js";import"./chunk-vvzys1x7.js";import"./chunk-v4xes880.js";import{an}from"./chunk-58sh82aj.js";import{Ff}from"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import{Ne,i}from"./chunk-xfd3yqgj.js";import"./chunk-y190sh29.js";import"./chunk-hc6111md.js";import"./chunk-q1wxgw5s.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import{_e}from"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import{hr,yr}from"./chunk-021tjkd6.js";import{$s,V,a}from"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import{h,He}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";import{Ui}from"./chunk-s9df8srx.js";import"./chunk-6m6y9bbx.js";import"./chunk-z512gt4v.js";export{$s as buildWebComponents,yr as cacheTemplate,hr as checkCache,an as classifyAllScripts,Fl as createMiddleware,zl as createRoute,V as defaultConfig,h as extractVariables,_e as injectRouterScript,Ui as insertBeforeBodyClose,a as loadStxConfig,He as processClientScript,i as processDirectives,Ne as readMarkdownFile,Ff as withinBundlerCallback};
|
|
@@ -10930,8 +10930,16 @@ catch (e2) {
|
|
|
10930
10930
|
return get;
|
|
10931
10931
|
}
|
|
10932
10932
|
|
|
10933
|
+
// A wait of 0 is a wait of 0. These defaults were written with ||, which
|
|
10934
|
+
// also replaces 0: useTimeout(fn, 0), meant as "on the next turn", waited a
|
|
10935
|
+
// full second, and a debounce or throttle of 0 waited 250ms. Only an omitted
|
|
10936
|
+
// wait takes the default, as in the module composables (use-timer.ts).
|
|
10937
|
+
function waitOr(value, fallback) {
|
|
10938
|
+
return value === undefined ? fallback : value;
|
|
10939
|
+
}
|
|
10940
|
+
|
|
10933
10941
|
function useDebounce(fn, delay) {
|
|
10934
|
-
delay = delay
|
|
10942
|
+
delay = waitOr(delay, 250);
|
|
10935
10943
|
var timer = null;
|
|
10936
10944
|
var lastArgs = null;
|
|
10937
10945
|
var debounced = function() {
|
|
@@ -10963,7 +10971,7 @@ catch (e2) {
|
|
|
10963
10971
|
var useDebounceFn = useDebounce;
|
|
10964
10972
|
|
|
10965
10973
|
function useDebouncedValue(getter, delay) {
|
|
10966
|
-
delay = delay
|
|
10974
|
+
delay = waitOr(delay, 250);
|
|
10967
10975
|
var current = getter();
|
|
10968
10976
|
var listeners = [];
|
|
10969
10977
|
var timer = null;
|
|
@@ -10993,7 +11001,7 @@ catch (e2) {
|
|
|
10993
11001
|
var refDebounced = useDebouncedValue;
|
|
10994
11002
|
|
|
10995
11003
|
function useThrottle(fn, limit) {
|
|
10996
|
-
limit = limit
|
|
11004
|
+
limit = waitOr(limit, 250);
|
|
10997
11005
|
var timer = null;
|
|
10998
11006
|
var lastRan = 0;
|
|
10999
11007
|
var throttled = function() {
|
|
@@ -11094,7 +11102,7 @@ else if (timer === null) {
|
|
|
11094
11102
|
}
|
|
11095
11103
|
|
|
11096
11104
|
function useTimeout(callback, delay) {
|
|
11097
|
-
delay = delay
|
|
11105
|
+
delay = waitOr(delay, 1000);
|
|
11098
11106
|
var timer = null;
|
|
11099
11107
|
var pending = false;
|
|
11100
11108
|
var listeners = [];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Eo,Eh,Th}from"./chunk-15m7jnc0.js";import"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Th as clearComposableCache,Eh as getComposableScript,Eo as listComposableModules};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tu,Im,nu,ru,Om,Nm}from"./chunk-
|
|
2
|
+
import{tu,Im,nu,ru,Om,Nm}from"./chunk-vwwpbhd2.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Nm as applySlots,Om as extractSlotContent,Im as parseSlotElement,tu as parseSlots,ru as processSlots,nu as renderSlot};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{dm}from"./chunk-yr1zx78b.js";import"./chunk-85zmxbt0.js";import"./chunk-58sh82aj.js";import"./chunk-wk4wg6sn.js";import"./chunk-e634vffz.js";import"./chunk-nttsc0aw.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{dm as startProductionServer};
|