@stacksjs/stx 0.2.910 → 0.2.913

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.
Files changed (94) hide show
  1. package/dist/chunk-027qc41m.js +2 -0
  2. package/dist/{chunk-c829tgwv.js → chunk-084f6953.js} +1 -1
  3. package/dist/{chunk-ba27s9vr.js → chunk-0b5vmmf8.js} +1 -1
  4. package/dist/chunk-12f99j3h.js +2 -0
  5. package/dist/{chunk-cpt9sg6d.js → chunk-132j46ey.js} +1 -1
  6. package/dist/{chunk-cw7vnkc8.js → chunk-1nf2ma94.js} +1 -1
  7. package/dist/{chunk-cd2jc724.js → chunk-1qygqpc7.js} +1 -1
  8. package/dist/{chunk-dh4p07cc.js → chunk-2qypb5q8.js} +1 -1
  9. package/dist/{chunk-13awnyq0.js → chunk-2vdbt2a7.js} +1 -1
  10. package/dist/{chunk-e4fseqnv.js → chunk-3xgr1z61.js} +1 -1
  11. package/dist/{chunk-a259mfax.js → chunk-500be1wy.js} +2 -2
  12. package/dist/chunk-5md9ymx3.js +2 -0
  13. package/dist/{chunk-xjbj655y.js → chunk-5mv2hc96.js} +3 -3
  14. package/dist/{chunk-pp89n1et.js → chunk-5xsghm23.js} +1 -1
  15. package/dist/{chunk-4kh0616n.js → chunk-6s82ecbh.js} +4 -4
  16. package/dist/{chunk-anj2j86n.js → chunk-6vyy44ve.js} +2 -2
  17. package/dist/{chunk-ck4ypzet.js → chunk-75r2p1cz.js} +1 -1
  18. package/dist/{chunk-gwvkqf5r.js → chunk-7b2t9j0x.js} +4 -4
  19. package/dist/{chunk-7apr0ww2.js → chunk-7mv9z3mp.js} +1 -1
  20. package/dist/{chunk-688hf1mx.js → chunk-89z732nx.js} +1 -1
  21. package/dist/{chunk-87aqcw1w.js → chunk-8mc1kr6z.js} +1 -1
  22. package/dist/{chunk-b234w3mf.js → chunk-9gptdyqq.js} +14 -4
  23. package/dist/chunk-a774ncg3.js +3 -0
  24. package/dist/chunk-aty34jhn.js +2 -0
  25. package/dist/chunk-banmft69.js +2 -0
  26. package/dist/{chunk-jcp3rs1t.js → chunk-bwk2jakf.js} +1 -1
  27. package/dist/chunk-dk881ye4.js +2 -0
  28. package/dist/{chunk-ccq7d7ar.js → chunk-dm9r5gzb.js} +1 -1
  29. package/dist/{chunk-ggez55jb.js → chunk-etn044yn.js} +7 -7
  30. package/dist/{chunk-kvcz1926.js → chunk-exny40nv.js} +1 -1
  31. package/dist/chunk-f9dy0r3f.js +2 -0
  32. package/dist/{chunk-4zw9trtx.js → chunk-fcqca9qb.js} +1 -1
  33. package/dist/{chunk-vd03gnnb.js → chunk-fcxg3xwf.js} +5 -5
  34. package/dist/{chunk-9grwqzpe.js → chunk-fd8fp6h4.js} +1 -1
  35. package/dist/{chunk-ah615efp.js → chunk-fx6hg5yd.js} +1 -1
  36. package/dist/{chunk-r425m35g.js → chunk-g9s2t064.js} +1 -1
  37. package/dist/{chunk-zbzfkh3m.js → chunk-gfm238j6.js} +1 -1
  38. package/dist/{chunk-8d6wkfdx.js → chunk-gqz6502d.js} +2 -2
  39. package/dist/{chunk-94k80qpp.js → chunk-hacdy30m.js} +1 -1
  40. package/dist/{chunk-pgqc8895.js → chunk-hcxsyw55.js} +4 -4
  41. package/dist/{chunk-ph8k7jdx.js → chunk-hgpjneyy.js} +2 -2
  42. package/dist/{chunk-9nf58keq.js → chunk-hm954re1.js} +1 -1
  43. package/dist/{chunk-2r84qtat.js → chunk-ja4fyz87.js} +2 -2
  44. package/dist/chunk-jr3txt3f.js +2 -0
  45. package/dist/{chunk-3760wpvw.js → chunk-kc3w40c2.js} +1 -1
  46. package/dist/{chunk-5k55yk8g.js → chunk-mqknt05a.js} +1 -1
  47. package/dist/chunk-n008g6xh.js +2 -0
  48. package/dist/{chunk-dqt1kw68.js → chunk-p9cm5ksf.js} +1 -1
  49. package/dist/{chunk-gt3426kc.js → chunk-pasjfsz4.js} +1 -1
  50. package/dist/{chunk-4ccbj4z6.js → chunk-px6zx8ae.js} +1 -1
  51. package/dist/{chunk-pn3gj7zm.js → chunk-pzf34jvd.js} +1 -1
  52. package/dist/chunk-q8k9ava8.js +2 -0
  53. package/dist/{chunk-d5szrgdq.js → chunk-qedhz0p8.js} +1 -1
  54. package/dist/chunk-qfwnp28b.js +2 -0
  55. package/dist/{chunk-q33tyfpp.js → chunk-rbfrxaer.js} +1 -1
  56. package/dist/{chunk-caaexbqy.js → chunk-rmyhjta6.js} +1 -1
  57. package/dist/{chunk-29trx6h3.js → chunk-s19t5mh2.js} +1 -1
  58. package/dist/chunk-s26a54qk.js +2 -0
  59. package/dist/{chunk-magfdzdj.js → chunk-thrvqves.js} +1 -1
  60. package/dist/{chunk-pmmctgdd.js → chunk-tm4fgc58.js} +1 -1
  61. package/dist/{chunk-r2ns89f7.js → chunk-v37hjzt2.js} +1 -1
  62. package/dist/{chunk-13kfjnyn.js → chunk-vk9s9byv.js} +4 -4
  63. package/dist/{chunk-azyq6fds.js → chunk-vr6maaas.js} +1 -1
  64. package/dist/{chunk-g17g6w1t.js → chunk-whd6y829.js} +3 -3
  65. package/dist/chunk-ygrrbcfm.js +2 -0
  66. package/dist/chunk-ys68yvgz.js +2 -0
  67. package/dist/{chunk-kvrbdez2.js → chunk-z02jzx63.js} +1 -1
  68. package/dist/chunk-zjrnz9yt.js +7 -0
  69. package/dist/{chunk-x40j9ta1.js → chunk-zwhc17pt.js} +2 -2
  70. package/dist/chunk-zzpedcte.js +2 -0
  71. package/dist/cli.js +8 -8
  72. package/dist/craft-entry.js +1 -1
  73. package/dist/craft.js +1 -1
  74. package/dist/pwa.js +1 -1
  75. package/dist/ssg.js +2 -2
  76. package/dist/strip-literals.js +40 -26
  77. package/package.json +5 -5
  78. package/dist/chunk-1a911c4c.js +0 -2
  79. package/dist/chunk-24hrd8sg.js +0 -2
  80. package/dist/chunk-2cbrcb9m.js +0 -2
  81. package/dist/chunk-3rzpkjmn.js +0 -2
  82. package/dist/chunk-44qcbbc4.js +0 -2
  83. package/dist/chunk-6w9sgs52.js +0 -2
  84. package/dist/chunk-7w9ksdbp.js +0 -2
  85. package/dist/chunk-850b0cxa.js +0 -2
  86. package/dist/chunk-9yvhj108.js +0 -2
  87. package/dist/chunk-ahf9j8wb.js +0 -12
  88. package/dist/chunk-cf4apy9s.js +0 -3
  89. package/dist/chunk-cqcxj08t.js +0 -2
  90. package/dist/chunk-q6jecdtg.js +0 -2
  91. package/dist/chunk-ssdjny2r.js +0 -2
  92. package/dist/chunk-sx1jg8dw.js +0 -2
  93. package/dist/chunk-vf29gp9a.js +0 -2
  94. package/dist/chunk-ya8nwtdn.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Q,Xe}from"./chunk-ggez55jb.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function gn(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Xe(t,s);if(p>s){c=p;continue}let a=Q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
2
+ import{Q,Xe}from"./chunk-etn044yn.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function gn(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Xe(t,s);if(p>s){c=p;continue}let a=Q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
3
3
  export{gn};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{y,b,g}from"./chunk-ggez55jb.js";import{q}from"./chunk-2r84qtat.js";import{i}from"./chunk-4kh0616n.js";import k from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,n;O.lastIndex=0;while((n=O.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function mh(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await y(p,f,e);let E=z(c),l=new Set;if(!E.some((h)=>h.type==="suspense")){let h=n.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let u=await i(c,f,e,n,l);for(let x=0;x<u.length;x+=s)r.enqueue(u.slice(x,x+s)),await new Promise((m)=>setTimeout(m,0))}else{let u=[],x=new RegExp(T.source,"g"),m;while((m=x.exec(c))!==null)u.push({name:m[1],content:m[2],start:m.index,end:m.index+m[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let D=await i(I,f,e,n,l);r.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let h=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
2
+ import{y,b,g}from"./chunk-etn044yn.js";import{q}from"./chunk-ja4fyz87.js";import{i}from"./chunk-6s82ecbh.js";import k from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,n;O.lastIndex=0;while((n=O.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function mh(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await y(p,f,e);let E=z(c),l=new Set;if(!E.some((h)=>h.type==="suspense")){let h=n.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let u=await i(c,f,e,n,l);for(let x=0;x<u.length;x+=s)r.enqueue(u.slice(x,x+s)),await new Promise((m)=>setTimeout(m,0))}else{let u=[],x=new RegExp(T.source,"g"),m;while((m=x.exec(c))!==null)u.push({name:m[1],content:m[2],start:m.index,end:m.index+m[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let D=await i(I,f,e,n,l);r.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let h=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),h.set(d.name,i(d.content,f,e,n,l))}r.enqueue(`
5
5
  <script>
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ai,ci,li,py,As,fy}from"./chunk-ba27s9vr.js";export{As as clearImageDeliveryCatalog,py as deliveredImage,li as efficientDeliverySources,ai as getImageDelivery,ci as isTransparentImage,fy as prepareImageDelivery};
2
+ import{ai,ci,li,py,As,fy}from"./chunk-0b5vmmf8.js";export{As as clearImageDeliveryCatalog,py as deliveredImage,li as efficientDeliverySources,ai as getImageDelivery,ci as isTransparentImage,fy as prepareImageDelivery};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function M(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return M(e.replace(/^\//,""))}function Ti(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
3
3
  `),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function $i(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
4
- `))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),K=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function Dt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&K.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function Se(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function Rr(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Ks(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return Se(a,t)}import W from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(W.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class Ar{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:j,params:O}=Se(g,{page:!0}),T=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:j,params:O,filePath:h,isDynamic:O.length>0,layout:T.length>0?T[T.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");Ti(this.routes,s),$i(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Xs(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Gs(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function _g(e){k=e.replace(/\/$/,"")}function Cg(e,t,a={}){f[e]={path:t,name:e,params:a}}function Eg(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function Pr(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Tg(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import U from"path";function $g(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Rg(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Ag(e,t={}){return{handler:e,mode:t.mode??"universal"}}function P(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function el(e,t){let a=e.headers.get("cookie")||"",r=P(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function tl(){return{get(e){if(typeof document>"u")return;return P(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return P(document.cookie)}}}function nl(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function Ri(e,t){v.set(e,t)}function rl(e){return v.get(e)}function Pg(e){return v.has(e)}function Lt(){v.clear()}function jt(){return Array.from(v.keys())}async function Bt(e,t="middleware"){let a=U.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=U.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")Ri(o,s);else if(typeof s==="function")Ri(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function z(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Ft(e,t,a,r=""){return{path:e,params:t,query:z(r),fullPath:r?`${e}?${r}`:e,meta:a}}function zt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?el(a,i):tl(),storage:nl(),state:{},request:a,responseHeaders:i}}async function Ht(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=rl(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Cn(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function We(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Cn(n)}}var q="X-STX-Have-Layout",H="X-STX-Have-Layout-Group";function Ai(e,t){let a=e.group||Cn(e.layout),r=t.group||Cn(t.layout);if(a!==r)return!0;return Boolean(e.layout&&t.layout&&e.layout!==t.layout)}function Pi(e){let t=e.get(q),a=e.get(H);if(t===null&&a===null)return null;return{layout:t??"",group:a??""}}var A,C;function V(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function G(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0,syntax:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").replace(/<\/script/gi,"<\\/script").trim()}catch{return e}}function X(){return`
4
+ `))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),K=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function Dt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&K.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function Se(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function Rr(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Ks(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return Se(a,t)}import W from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(W.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class Ar{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:j,params:O}=Se(g,{page:!0}),T=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:j,params:O,filePath:h,isDynamic:O.length>0,layout:T.length>0?T[T.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");Ti(this.routes,s),$i(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Xs(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Gs(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function _g(e){k=e.replace(/\/$/,"")}function Cg(e,t,a={}){f[e]={path:t,name:e,params:a}}function Eg(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function Pr(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Tg(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import q from"path";function $g(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Rg(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Ag(e,t={}){return{handler:e,mode:t.mode??"universal"}}function P(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function el(e,t){let a=e.headers.get("cookie")||"",r=P(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function tl(){return{get(e){if(typeof document>"u")return;return P(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return P(document.cookie)}}}function nl(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function Ri(e,t){v.set(e,t)}function rl(e){return v.get(e)}function Pg(e){return v.has(e)}function Lt(){v.clear()}function jt(){return Array.from(v.keys())}async function Bt(e,t="middleware"){let a=q.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=q.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")Ri(o,s);else if(typeof s==="function")Ri(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function z(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Ft(e,t,a,r=""){return{path:e,params:t,query:z(r),fullPath:r?`${e}?${r}`:e,meta:a}}function zt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?el(a,i):tl(),storage:nl(),state:{},request:a,responseHeaders:i}}async function Ht(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=rl(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Cn(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function We(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Cn(n)}}var U="X-STX-Have-Layout",H="X-STX-Have-Layout-Group";function Ai(e,t){let a=e.group||Cn(e.layout),r=t.group||Cn(t.layout);if(a!==r)return!0;return Boolean(e.layout&&t.layout&&e.layout!==t.layout)}function Pi(e){let t=e.get(U),a=e.get(H);if(t===null&&a===null)return null;return{layout:t??"",group:a??""}}var A,C;function V(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function G(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0,syntax:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").replace(/<\/script/gi,"<\\/script").trim()}catch{return e}}function X(){return`
5
5
  ;(function(){
6
6
  'use strict';
7
7
  var ROUTER_REV=8;
@@ -476,21 +476,27 @@ import x from"fs";import u from"path";import p from"fs";import w from"path";var
476
476
  // Intent moves a queued page to the front; navigation starts it at once,
477
477
  // sharing the same promise instead of waiting behind background work.
478
478
  var prefetchQueue=[],prefetchActive=0;
479
+ function pumpPrefetch(){
480
+ // A low network priority does not make server-side rendering cheap. Do
481
+ // not fill a freed slot while the page the person requested is pending.
482
+ if(isNavigating||awaitingKey)return;
483
+ while(prefetchActive<2&&prefetchQueue.length)runPrefetch(prefetchQueue.shift());
484
+ }
479
485
  function runPrefetch(job){
480
486
  prefetchActive++;
481
487
  var started;
482
488
  try{started=job.start()}catch(error){started=Promise.reject(error)}
483
489
  Promise.resolve(started).then(job.resolve,job.reject).finally(function(){
484
490
  prefetchActive--;
485
- while(prefetchActive<2&&prefetchQueue.length)runPrefetch(prefetchQueue.shift());
491
+ pumpPrefetch();
486
492
  });
487
493
  }
488
494
  function queuePrefetch(key,start,intent){
489
495
  return new Promise(function(resolve,reject){
490
496
  var job={key:key,start:start,resolve:resolve,reject:reject};
491
- if(prefetchActive<2)runPrefetch(job);
492
- else if(intent)prefetchQueue.unshift(job);
497
+ if(intent)prefetchQueue.unshift(job);
493
498
  else prefetchQueue.push(job);
499
+ pumpPrefetch();
494
500
  });
495
501
  }
496
502
  function promotePrefetch(key,navigation){
@@ -1370,6 +1376,7 @@ import x from"fs";import u from"path";import p from"fs";import w from"path";var
1370
1376
  document.body.classList.remove(o.loadingClass);finishProgress();
1371
1377
  settleDirection();
1372
1378
  if(openingUrl&&pagePath()!==openingUrl)keepOpeningPage();
1379
+ pumpPrefetch();
1373
1380
  }
1374
1381
  function stale(){return id!==navSeq}
1375
1382
  // A failed fetch keeps the app: the destination shows a way to try again
@@ -2908,6 +2915,8 @@ else {
2908
2915
  function finishScreen(){
2909
2916
  enforceLimit();
2910
2917
  observeLinks();
2918
+ // Retained Back can supersede a pending navigation without its done().
2919
+ pumpPrefetch();
2911
2920
  }
2912
2921
 
2913
2922
  // Show a screen that is already here: Back to one below in the stack, or a
@@ -2921,6 +2930,7 @@ else {
2921
2930
  var from=active,host=getContainer();
2922
2931
  if(navAbort){try{navAbort.abort()}catch(e){}navAbort=null}
2923
2932
  navSeq++;
2933
+ awaitingKey='';
2924
2934
  isNavigating=false;
2925
2935
  document.body.classList.remove(o.loadingClass);
2926
2936
  if(from&&from.el){if(!opts.settled)saveScroll(from);saveEntry(from)}
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Y}from"./chunk-etn044yn.js";function r(t){return Y(t)}
3
+ export{r};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ec,tc,nc,rc,ry}from"./chunk-fx6hg5yd.js";import"./chunk-wbsbrm6n.js";import"./chunk-500be1wy.js";import"./chunk-0vyytd9v.js";import"./chunk-6s82ecbh.js";import"./chunk-zwhc17pt.js";import"./chunk-vk9s9byv.js";import"./chunk-fs43342z.js";import"./chunk-0b5vmmf8.js";import"./chunk-a774ncg3.js";import"./chunk-084f6953.js";import"./chunk-9bexzgws.js";import"./chunk-6vyy44ve.js";import"./chunk-hcxsyw55.js";import"./chunk-v0yay1kw.js";import"./chunk-z02jzx63.js";import"./chunk-2vdbt2a7.js";import"./chunk-ja4fyz87.js";import"./chunk-v37hjzt2.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-etn044yn.js";import"./chunk-fcqca9qb.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-75r2p1cz.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{ec as buildNative,ry as default,tc as findCraftBinary,rc as getAvailableFormats,nc as getAvailableTargets};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lm}from"./chunk-thrvqves.js";import"./chunk-5mv2hc96.js";import"./chunk-0mxkw6m6.js";import"./chunk-7mv9z3mp.js";import"./chunk-gqz6502d.js";import"./chunk-6s82ecbh.js";import"./chunk-zwhc17pt.js";import"./chunk-vk9s9byv.js";import"./chunk-fs43342z.js";import"./chunk-0b5vmmf8.js";import"./chunk-a774ncg3.js";import"./chunk-084f6953.js";import"./chunk-9bexzgws.js";import"./chunk-6vyy44ve.js";import"./chunk-hcxsyw55.js";import"./chunk-v0yay1kw.js";import"./chunk-z02jzx63.js";import"./chunk-2vdbt2a7.js";import"./chunk-ja4fyz87.js";import"./chunk-v37hjzt2.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-etn044yn.js";import"./chunk-fcqca9qb.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-75r2p1cz.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Lm as buildForProduction};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Dn,Ji}from"./chunk-4zw9trtx.js";import"./chunk-w98yt4d4.js";export{Ji as generateRuntimeConfigTypes,Dn as prepareRuntimeConfig};
2
+ import{Dn,Ji}from"./chunk-fcqca9qb.js";import"./chunk-w98yt4d4.js";export{Ji as generateRuntimeConfigTypes,Dn as prepareRuntimeConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ou,iu}from"./chunk-fcxg3xwf.js";import"./chunk-72pbhpq8.js";import"./chunk-mqknt05a.js";import"./chunk-gfm238j6.js";import"./chunk-qedhz0p8.js";import"./chunk-3m457a9q.js";import"./chunk-ta7cwykn.js";import"./chunk-hacdy30m.js";import"./chunk-thrvqves.js";import"./chunk-5mv2hc96.js";import"./chunk-6yketqa1.js";import"./chunk-9atdw0p8.js";import"./chunk-5jn2qyv7.js";import"./chunk-2qypb5q8.js";import"./chunk-gyv2bsmn.js";import"./chunk-2m4d8jkv.js";import"./chunk-gg31th5s.js";import"./chunk-1ezcxbpg.js";import"./chunk-jttzrv0w.js";import"./chunk-ekyx5z50.js";import"./chunk-1qygqpc7.js";import"./chunk-89z732nx.js";import"./chunk-nan0ysys.js";import"./chunk-zk1c6tg7.js";import"./chunk-jhegz7az.js";import"./chunk-pc89t52s.js";import"./chunk-hm954re1.js";import"./chunk-pzf34jvd.js";import"./chunk-0mxkw6m6.js";import"./chunk-500be1wy.js";import"./chunk-0vyytd9v.js";import"./chunk-8n42epb6.js";import{gn}from"./chunk-7mv9z3mp.js";import{og}from"./chunk-px6zx8ae.js";import"./chunk-gqz6502d.js";import"./chunk-cwcmmgvz.js";import{Ue,i}from"./chunk-6s82ecbh.js";import"./chunk-zwhc17pt.js";import"./chunk-vk9s9byv.js";import"./chunk-fs43342z.js";import"./chunk-0b5vmmf8.js";import"./chunk-a774ncg3.js";import"./chunk-084f6953.js";import"./chunk-9bexzgws.js";import"./chunk-6vyy44ve.js";import{Pe}from"./chunk-hcxsyw55.js";import"./chunk-v0yay1kw.js";import{Er,Tr}from"./chunk-z02jzx63.js";import"./chunk-2vdbt2a7.js";import{zs,q,a}from"./chunk-ja4fyz87.js";import"./chunk-v37hjzt2.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import{B,y,Je}from"./chunk-etn044yn.js";import"./chunk-fcqca9qb.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-75r2p1cz.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";import{la}from"./chunk-8tfpv6zf.js";import"./chunk-fycxc75p.js";import"./chunk-d4hnj3ct.js";export{zs as buildWebComponents,Tr as cacheTemplate,Er as checkCache,gn as classifyAllScripts,ou as createMiddleware,iu as createRoute,q as defaultConfig,y as extractVariables,B as findSfcTemplateBlock,Pe as injectRouterScript,la as insertBeforeBodyClose,a as loadStxConfig,Je as processClientScript,i as processDirectives,Ue as readMarkdownFile,og as withinBundlerCallback};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{y,Ui,Sl,kl,Hg,Ug,Vg,Wg,qg,po,Kg,Ye,ie,Ze,Xg,Hr,Gg,El,Tl,qi,Qe,s,On,$l,b,Ce,Iy}from"./chunk-ggez55jb.js";import"./chunk-4zw9trtx.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Tl as SIGNAL_COMPOSABLE_CALL,Ce as clearComponentCache,qi as componentClientSignalNames,Ui as convertToCommonJS,b as createDetailedErrorMessage,qg as extractDirectiveNames,Sl as extractScriptFromTemplate,y as extractVariables,s as fileExists,Iy as getComponentCacheStats,Ug as getPositionInfo,ie as getSharedTranspiler,$l as getSourceLineInfo,Wg as hasDirectives,kl as hasVariables,Gg as isHydrateTrigger,Kg as isJavaScriptScript,Qe as renderComponentWithSlot,On as resolveTemplatePath,Xg as scopeOnRootElement,po as scopeSequenceKey,Ye as shouldTranspileTypeScript,El as slotContentHasExpressions,Ze as transpileTypeScript,Hr as userComponentFileExists,Vg as validateDirective,Hg as validateTemplate};
2
+ import{y,Ui,Sl,kl,Hg,Ug,Vg,Wg,qg,po,Kg,Ye,ie,Ze,Xg,Hr,Gg,El,Tl,qi,Qe,s,On,$l,b,Ce,Iy}from"./chunk-etn044yn.js";import"./chunk-fcqca9qb.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-75r2p1cz.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Tl as SIGNAL_COMPOSABLE_CALL,Ce as clearComponentCache,qi as componentClientSignalNames,Ui as convertToCommonJS,b as createDetailedErrorMessage,qg as extractDirectiveNames,Sl as extractScriptFromTemplate,y as extractVariables,s as fileExists,Iy as getComponentCacheStats,Ug as getPositionInfo,ie as getSharedTranspiler,$l as getSourceLineInfo,Wg as hasDirectives,kl as hasVariables,Gg as isHydrateTrigger,Kg as isJavaScriptScript,Qe as renderComponentWithSlot,On as resolveTemplatePath,Xg as scopeOnRootElement,po as scopeSequenceKey,Ye as shouldTranspileTypeScript,El as slotContentHasExpressions,Ze as transpileTypeScript,Hr as userComponentFileExists,Vg as validateDirective,Hg as validateTemplate};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{et,Ln,go,Yi,z}from"./chunk-w98yt4d4.js";import{Dn}from"./chunk-4zw9trtx.js";import{Zr,C,Ul,vt,oa,Vl}from"./chunk-4b110x6r.js";import{D}from"./chunk-phzhmnnm.js";import{T,R}from"./chunk-0jdz31q1.js";import{Yr,xo,Hn,Fl,je}from"./chunk-ck4ypzet.js";import{mo,d,m,Ee,Ur,p,te,K,be,_,yt,wo,Le,nt,vo}from"./chunk-c08jvjqt.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-e5rag6rh.js";import{t,h}from"./chunk-ahf9j8wb.js";import{c}from"./chunk-8tfpv6zf.js";import Rt from"path";import mn from"process";import{AsyncLocalStorage as ac}from"async_hooks";var ri=new ac;function Pn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ii(e,n){return ri.run(Pn(e),n)}async function oi(e,n){let r=ri.getStore();if(!r)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function zr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function G(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),X=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(X&&!a.has(X))i.push(X),a.add(X)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Js(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function cc(e,n=G(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(G(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ys(e,n){let r=`{ ${cc(e,n)} }`;return G(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import ln from"fs";import Ue from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ai=new Map;function Nr(e,n=!0){let r=ai.get(e);if(n&&r)return r;let i=new Map,a=[Ue.join(e,"src"),Ue.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=ln.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ue.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ai.set(e,i);return i}function Zs(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ue.join(r,"node_modules",e);try{if(ln.statSync(i).isDirectory())return i}catch{}let a=Ue.dirname(r);if(a===r)return null;r=a}}function Qs(e,n,r={}){return[Ue.resolve(Ue.dirname(n),`${e}.stx`),Ue.resolve(Ue.dirname(n),e),Ue.resolve(r.componentsDir||"components",`${e}.stx`),Ue.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ci(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function Ii(e,n){let[r,i,a]=ci(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Oi(e,n){let r=n?Ue.resolve(n):void 0,i=Ue.dirname(Ue.resolve(e));for(;;){if(ln.existsSync(Ue.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ue.dirname(i);if(a===i)return;i=a}}var lc=["src/ui","src/components","components","dist"];function us(e,n){let r=Ue.resolve(e);if(!n&&!r.split(Ue.sep).includes("node_modules"))return[];let i=Oi(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(ln.readFileSync(Ue.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:lc;return[Ue.dirname(Ue.resolve(e)),...l.map((u)=>Ue.resolve(i,u))]}function*Ni(e,n,r={},i){let a=ci(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ue.resolve(Ue.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...us(n,r.projectRoot),...i?.__originalFilePath?[Ue.join(Ue.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ue.join(Ue.dirname(n),"components"),Ue.resolve(u,"src/components"),Ue.resolve(u,"components"),...import.meta.dir?[Ue.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ue.join(v,S);try{for(let S of ln.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ue.join(v,S.name,I)}catch{}}}function li(e,n,r={},i){let a=Ii(e,i);if(a!==void 0)return a;for(let l of Ni(e,n,r,i))try{if(ln.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function eo(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Ns from"fs";import xe from"path";import Zt from"path";import jn from"fs";var uc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function qs(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return uc.has(e.toLowerCase())}var ui=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),pi={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},pc=new Set(["ctrl","alt","shift","meta"]),gi={left:0,middle:1,right:2};function fi(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(pc.has(i))n.systemKeys.push(i);else if(i in gi)n.mouse=i;else if(i in pi||/^[a-z]$/.test(i))n.keys.push(pi[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function mi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function fc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=gi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function dc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Xs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function gc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=fc(e),a=dc(Xs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(qs(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{et,Ln,go,Yi,z}from"./chunk-w98yt4d4.js";import{Dn}from"./chunk-fcqca9qb.js";import{Zr,C,Ul,vt,oa,Vl}from"./chunk-4b110x6r.js";import{D}from"./chunk-phzhmnnm.js";import{T,R}from"./chunk-0jdz31q1.js";import{Yr,xo,Hn,Fl,je}from"./chunk-75r2p1cz.js";import{mo,d,m,Ee,Ur,p,te,K,be,_,yt,wo,Le,nt,vo}from"./chunk-c08jvjqt.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-e5rag6rh.js";import{t,h}from"./chunk-zjrnz9yt.js";import{c}from"./chunk-8tfpv6zf.js";import Rt from"path";import mn from"process";import{AsyncLocalStorage as ac}from"async_hooks";var ri=new ac;function Pn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ii(e,n){return ri.run(Pn(e),n)}async function oi(e,n){let r=ri.getStore();if(!r)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function zr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function G(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),X=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(X&&!a.has(X))i.push(X),a.add(X)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Js(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function cc(e,n=G(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(G(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ys(e,n){let r=`{ ${cc(e,n)} }`;return G(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import ln from"fs";import Ue from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ai=new Map;function Nr(e,n=!0){let r=ai.get(e);if(n&&r)return r;let i=new Map,a=[Ue.join(e,"src"),Ue.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=ln.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ue.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ai.set(e,i);return i}function Zs(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ue.join(r,"node_modules",e);try{if(ln.statSync(i).isDirectory())return i}catch{}let a=Ue.dirname(r);if(a===r)return null;r=a}}function Qs(e,n,r={}){return[Ue.resolve(Ue.dirname(n),`${e}.stx`),Ue.resolve(Ue.dirname(n),e),Ue.resolve(r.componentsDir||"components",`${e}.stx`),Ue.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ci(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function Ii(e,n){let[r,i,a]=ci(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Oi(e,n){let r=n?Ue.resolve(n):void 0,i=Ue.dirname(Ue.resolve(e));for(;;){if(ln.existsSync(Ue.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ue.dirname(i);if(a===i)return;i=a}}var lc=["src/ui","src/components","components","dist"];function us(e,n){let r=Ue.resolve(e);if(!n&&!r.split(Ue.sep).includes("node_modules"))return[];let i=Oi(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(ln.readFileSync(Ue.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:lc;return[Ue.dirname(Ue.resolve(e)),...l.map((u)=>Ue.resolve(i,u))]}function*Ni(e,n,r={},i){let a=ci(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ue.resolve(Ue.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...us(n,r.projectRoot),...i?.__originalFilePath?[Ue.join(Ue.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ue.join(Ue.dirname(n),"components"),Ue.resolve(u,"src/components"),Ue.resolve(u,"components"),...import.meta.dir?[Ue.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ue.join(v,S);try{for(let S of ln.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ue.join(v,S.name,I)}catch{}}}function li(e,n,r={},i){let a=Ii(e,i);if(a!==void 0)return a;for(let l of Ni(e,n,r,i))try{if(ln.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function eo(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Ns from"fs";import xe from"path";import Zt from"path";import jn from"fs";var uc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function qs(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return uc.has(e.toLowerCase())}var ui=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),pi={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},pc=new Set(["ctrl","alt","shift","meta"]),gi={left:0,middle:1,right:2};function fi(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(pc.has(i))n.systemKeys.push(i);else if(i in gi)n.mouse=i;else if(i in pi||/^[a-z]$/.test(i))n.keys.push(pi[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function mi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function fc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=gi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function dc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Xs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function gc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=fc(e),a=dc(Xs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(qs(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${r}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function mc(e,n=""){let r=mi(e,n);if(r.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=r.length-1;l>=0;l--){let u=r[l],f=u.originalTag;if(!f.includes(" id="))f=f.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${u.elementId}"`);else{let v=f.match(/id=["']([^"']+)["']/);if(v)for(let S of u.events)S.elementId=v[1]}for(let v of u.events){let S=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),I=new RegExp(`\\s*${S}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${S}\\s*=\\s*'[^']*'`,"g");f=f.replace(I,""),f=f.replace(j,"")}i=i.slice(0,u.startIndex)+f+i.slice(u.endIndex),a.push(...u.events)}return{template:i,bindings:a}}function di(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function ol(e,n,r){if(Vl(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:f,bindings:v}=mc(e,di(n)),S=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...S,...v],f}let i=mi(e,di(n));if(i.length===0)return e;let a=e;for(let f=i.length-1;f>=0;f--){let v=i[f],S=v.originalTag;if(!S.includes(" id="))S=S.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let I=S.match(/id=["']([^"']+)["']/);if(I)for(let j of v.events)j.elementId=I[1]}for(let I of v.events){let j=I.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),L=new RegExp(`\\s*${j}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${j}\\s*=\\s*'[^']*'`,"g");S=S.replace(L,""),S=S.replace(M,"")}a=a.slice(0,v.startIndex)+S+a.slice(v.endIndex)}let l=Mi(i.flatMap((f)=>f.events)),u=c(a);if(u!==-1)a=a.slice(0,u)+l+`
115
- `+a.slice(u);else a+=l;return a}function hi(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function Ut(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&hi(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&hi(f[1],!1).has(n))return!0;return!1}var qe="0.2.910";var xi=Symbol.for(`stx.lazy-module-promises.${qe}`);function xc(){let e=globalThis;return e[xi]??=new Map,e[xi]}function o(e,n){let r=xc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var bc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(bc,"<\\/$1")}import bi from"fs";var yi=[];function k(e){let n=new T(e);return yi.push(n),n}function il(){for(let e of yi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Mr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:bi.statSync(r).mtimeMs})}catch{}return n}function to(e){for(let n of e)try{if(bi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Oe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var yc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function _c(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function wc(e,n){let r=n;while(!0){let i=Zt.join(r,"node_modules",e,"package.json");if(jn.existsSync(i))return Zt.dirname(i);let a=Zt.dirname(r);if(a===r)return null;r=a}}function vc(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function Sc(e,n){let r=_c(e);if(!r||!r.subpath)return null;let i=wc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(jn.readFileSync(Zt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=vc(a.exports,l);if(!u)return null;let f=Zt.resolve(i,u);return jn.existsSync(f)?f:null}function Vi(e,n){let r=n.filePath?Zt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(yc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Zt.resolve(r,S),!jn.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=Sc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=jn.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function $c(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${$c(n.source)}" data-stx-layer="vendor">
115
+ `+a.slice(u);else a+=l;return a}function hi(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function Ut(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&hi(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&hi(f[1],!1).has(n))return!0;return!1}var qe="0.2.913";var xi=Symbol.for(`stx.lazy-module-promises.${qe}`);function xc(){let e=globalThis;return e[xi]??=new Map,e[xi]}function o(e,n){let r=xc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var bc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(bc,"<\\/$1")}import bi from"fs";var yi=[];function k(e){let n=new T(e);return yi.push(n),n}function il(){for(let e of yi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Mr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:bi.statSync(r).mtimeMs})}catch{}return n}function to(e){for(let n of e)try{if(bi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Oe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var yc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function _c(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function wc(e,n){let r=n;while(!0){let i=Zt.join(r,"node_modules",e,"package.json");if(jn.existsSync(i))return Zt.dirname(i);let a=Zt.dirname(r);if(a===r)return null;r=a}}function vc(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function Sc(e,n){let r=_c(e);if(!r||!r.subpath)return null;let i=wc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(jn.readFileSync(Zt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=vc(a.exports,l);if(!u)return null;let f=Zt.resolve(i,u);return jn.existsSync(f)?f:null}function Vi(e,n){let r=n.filePath?Zt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(yc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Zt.resolve(r,S),!jn.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=Sc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=jn.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function $c(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${$c(n.source)}" data-stx-layer="vendor">
116
116
  @layer vendor {
117
117
  ${n.contents}
118
118
  }
@@ -182,7 +182,7 @@ else {
182
182
  // STX: auto-generated event bindings
183
183
  ${e.map((r,i)=>Mc(r,i)).join(`
184
184
  `)}`}function Si(e){let n=[],r=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,u=0;while(u<l){let f=i[u];if(f==="'"||f==='"'||f==="`"){let v=f;if(u++,v==="`"){let S=0;while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]==="`"&&S===0){u++;break}if(i[u]==="$"&&i[u+1]==="{"){S++,u+=2;continue}if(i[u]==="}"&&S>0){S--,u++;continue}u++}}else while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]===v){u++;break}u++}continue}if(f==="/"&&i[u+1]==="/"){while(u<l&&i[u]!==`
185
- `)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var Nc=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function Lc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!Nc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Je(e,n={}){let r=e,i="",a=!1,l=[],u=Vi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Wi(u.styles),v=Gt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-q33tyfpp.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=_l(r);r=U.code,i=Cl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${In(r,n.serverData)}${i}`,r=D(r),!a&&Ye(n.attrs||""))r=Ze(r);let j=Dc(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
185
+ `)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var Nc=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function Lc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!Nc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Je(e,n={}){let r=e,i="",a=!1,l=[],u=Vi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Wi(u.styles),v=Gt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-rbfrxaer.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=_l(r);r=U.code,i=Cl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${In(r,n.serverData)}${i}`,r=D(r),!a&&Ye(n.attrs||""))r=Ze(r);let j=Dc(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
186
186
  ${me(`${i}${r}
187
187
  ${j}`)}
188
188
  </script>`}let W=oa(e),Z=/function __stx_setup_/.test(r),q=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function X(U){let H=U.length>0?`
@@ -1183,9 +1183,9 @@ ${S.join(`
1183
1183
  `){let V=e[a];if(V==="\\"){a+=2;continue}if(V==="[")M=!0;else if(V==="]")M=!1;else if(V==="/"&&!M){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},L=()=>{if(i!==0)return;let M=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(M){let q=M[2].split(",").map((X)=>{let U=X.trim().split(":");return U[U.length-1].trim()});for(let X of q)if(X&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(X)&&!r.has(X))n.push(X),r.add(X);return}let V=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(V){let q=V[2];if(!r.has(q))n.push(q),r.add(q);return}let W=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let q=W[1];if(!r.has(q))n.push(q),r.add(q);return}let Z=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Z){let q=Z[1];if(!r.has(q))n.push(q),r.add(q)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){u(e[a]);continue}if(e[a]==="`"){f();continue}if(e[a]==="/"&&I()){j();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))L();a++}return n}function zp(e,n,r){for(let i of ee(e)){let a=O(i.attrs);if(["server","src","component","stx:component"].some((f)=>a.has(f))||!kt(a))continue;let l=fn(e.slice(i.bodyStart,i.bodyEnd));if(!l)continue;let u=Object.assign(Object.create(null),r);for(let[f,v]of Object.entries(l.defaults))if(u[f]===void 0)u[f]=Cs(v);for(let f of new Set([...l.propNames,...Object.keys(l.defaults)])){let v=l.localBindings[f]??(l.propBindings[f]?void 0:f);if(v)Object.defineProperty(n,v,{value:u[f],writable:!0,enumerable:!0,configurable:!0})}if(l.identifier)Object.defineProperty(n,l.identifier,{value:u,writable:!0,enumerable:!0,configurable:!0})}}var Bp=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function Xg(e,n){let r=Vt(e),i=e.slice(r).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/);if(!i)return null;let a=i[1].toLowerCase();if(!Bp.has(a))return null;let l=new RegExp(`<\\/?${a}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),u=x(e,(I,j)=>(l.lastIndex=j,l.exec(I)?.index===j?l.lastIndex:-1));if(a==="span"&&/\sdata-stx-scope\s*=/.test(u[0]?.token||""))return null;let f=0,v=!1;for(let I of u){if(f+=I.token.startsWith("</")?-1:1,f<0)return null;if(f===0){if(e.slice(I.end).trim())return null;v=!0;break}}if(!v)return null;let S=r+i[0].length;return e.slice(0,S)+n+e.slice(S)}function Ha(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=xe.relative(xe.resolve(i),xe.resolve(e));return!a.startsWith("..")&&!xe.isAbsolute(a)})}async function Hr(e,n,r,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,u=(ce)=>ce.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),f=r.__importedComponents;if(f){for(let ce of[l,l.toLowerCase(),u(l),J(l)])if(f.has(ce))return!0}let v=[...new Set([`${l}.stx`,`${u(l)}.stx`,`${J(l)}.stx`])],S=typeof a.root==="string"?xe.resolve(a.root):void 0,I=S??xe.dirname(i),j=[],L=(ce)=>{if(ce&&!j.includes(ce))j.push(ce)};for(let ce of us(i,S))L(ce);let M=r.__originalFilePath;if(M)L(xe.join(xe.dirname(M),"components"));if(Ha(n,a))L(a._rootComponentsDir);L(n),L(a._rootComponentsDir),L(xe.join(xe.dirname(i),"components")),L(a.componentsDir);for(let ce of a.additionalComponentsDirs??[])L(ce);let V=a._targetComponentFallbackNames?.some((ce)=>ce.toLowerCase()===l.toLowerCase());if(!V)for(let ce of a._targetComponentDirs??[])L(ce);if(S)L(xe.resolve(S,"resources/views/components")),L(xe.resolve(S,"resources/components")),L(xe.resolve(S,"src/components")),L(xe.resolve(S,"components"));for(let ce of a._layerComponentDirs??[])L(ce);let W=a._pluginComponentDirs;if(Array.isArray(W))for(let ce of W)L(typeof ce==="string"?ce:null);if(L(a.fallbackComponentsDir),V)for(let ce of a._targetComponentDirs??[])L(ce);let Z=a._nativePrimitivesFallback;if(Z&&!Z.except.some((ce)=>ce.toLowerCase()===l.toLowerCase()))L(Z.dir);if(l.startsWith("./")||l.startsWith("../"))return s(xe.resolve(xe.dirname(i),`${l}.stx`));let q=Na(xe.resolve(import.meta.dir,"components")),X=j.map((ce)=>xe.isAbsolute(ce)?ce:xe.resolve(I,ce)),U=`${v.join("\x00")}\x00\x00${X.join("\x00")}`,H=Or.get(U);if(H!==void 0)return H;let re=!1;e:for(let ce of X){if(Na(ce)===q)continue;for(let le of v)if(await s(xe.join(ce,le))){re=!0;break e}}return Or.set(U,re),re}function Na(e){let n=Pr.get(e);if(n!==void 0)return n;let r=e;try{r=Ns.realpathSync(e)}catch{}return Pr.set(e,r),r}function Gg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function El(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function Wp(e,n,r){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let u;try{u=N(a,n)}catch{return l}if(u===void 0||u===null)return"";let f=String(u);if(/<\/style/i.test(f))return console.warn(`[stx] a <style> expression in ${r??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return f};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var La=new Set;function za(e,n,r,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&La.has(a))return;La.add(a);let l=n?` used in ${n}`:"",u=i?` Cause: ${i}.`:"",f=r.length>0?`
1184
1184
  searched:
1185
1185
  ${r.map((v)=>` - ${v}`).join(`
1186
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Ba(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Fp=new Set(["for","if","show","key","ref","class","className","style"]),Wa=new Set,Ka="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Tl=new RegExp(`\\b(?:${Ka})\\s*(?:<[^>]*>)?\\s*\\(`);function qi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Ka})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Qe(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-3760wpvw.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&Gg(W)?W:"";try{let q=(ge)=>ge.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),X=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let ge=[X,X.toLowerCase(),q(X),J(X)];for(let ve of ge)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let ge=[`${X}.stx`,`${q(X)}.stx`,`${J(X)}.stx`],ve=[...new Set(ge)],ze=a.__originalFilePath,Se=[];for(let Pe of us(l))if(!Se.includes(Pe))Se.push(Pe);let pt=Se.length;for(let Pe of u._layerComponentDirs??[])if(!Se.includes(Pe))Se.push(Pe);if(ze){let Pe=xe.join(xe.dirname(ze),"components");Se.push(Pe)}let tt=u._rootComponentsDir;if(typeof tt==="string"&&Ha(i,u)&&!Se.includes(tt))Se.push(tt);if(i&&!Se.includes(i))Se.push(i);if(typeof tt==="string"&&!Se.includes(tt))Se.push(tt);let It=xe.join(xe.dirname(l),"components");if(!Se.includes(It))Se.push(It);if(u.componentsDir&&u.componentsDir!==i&&!Se.includes(u.componentsDir))Se.push(u.componentsDir);for(let Pe of u.additionalComponentsDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let sn=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(X),Pt=(I?.events??[]).map((Pe)=>Pe.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),es=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Bs=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ws=!Pt.includes("valuechange")&&(es||Pt.includes("change")&&!Bs),Ft=u._nativeHostAttrs&&/^textinput$/i.test(X),rn=Pt.includes("update:value")&&!Pt.includes("input"),Cn=u._nativeHostAttrs&&/^video$/i.test(X),Fs=u._nativeHostAttrs&&/^image$/i.test(X),ts=eo([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),on=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),ns=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),ss=Cn&&(on||ns)&&(I?.events??[]).every((Pe)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Pe.replace(/^@/,"").split(".")[0])),rs=new Set(["","primary","secondary","outline","ghost","danger"]),is=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",os=u._nativeHostAttrs&&/^button$/i.test(X)&&!rs.has(is),Qr=u._targetComponentFallbackNames?.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())??!1,Vs=Qr&&(!sn||Ws)&&(!Ft||rn)&&(!Cn||ss)&&(!Fs||ts)&&!os;for(let Pe of Vs?[]:u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let an=typeof u.root==="string"?xe.resolve(u.root):void 0,ei=an??xe.dirname(l),cn=[];if(an)cn.push(xe.resolve(an,"resources/views/components")),cn.push(xe.resolve(an,"resources/components")),cn.push(xe.resolve(an,"src/components")),cn.push(xe.resolve(an,"components"));cn.push(xe.resolve(import.meta.dir,"components"));for(let Pe of cn)if(!Se.includes(Pe))Se.push(Pe);if(Qr){let Pe=(u._componentPackageDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0),Ot=(Vs?Pe.length?Pe:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0);if(Ot.length){let bt=Se.slice(pt).map((dt)=>xe.isAbsolute(dt)?dt:xe.resolve(ei,dt)).filter((dt)=>!Ot.includes(dt)),cs=`${X}\x00${bt.join("\x00")}`,Ct=Ir.get(cs);if(Ct===void 0){Ct=!1;for(let dt of bt){for(let Ht of ve)if(await s(xe.join(dt,Ht))){Ct=!0;break}if(Ct)break}Ir.set(cs,Ct)}if(!Ct){for(let dt of Ot){let Ht=Se.indexOf(dt);if(Ht>=0)Se.splice(Ht,1)}Se.splice(pt,0,...Ot)}}}let ti=u._pluginComponentDirs;if(Array.isArray(ti)){for(let Pe of ti)if(typeof Pe==="string"&&!Se.includes(Pe))Se.push(Pe)}if(u.fallbackComponentsDir&&!Se.includes(u.fallbackComponentsDir))Se.push(u.fallbackComponentsDir);if(Vs){for(let Pe of u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe)}let as=u._nativePrimitivesFallback;if(as&&!as.except.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())&&!Se.includes(as.dir))Se.push(as.dir);let ni=[...new Set(Se.map((Pe)=>{if(!Pe)return Pe;return xe.isAbsolute(Pe)?Pe:xe.resolve(ei,Pe)}))];Se.length=0,Se.push(...ni);let Us=`${X}\x00${l}\x00${ni.join("\x00")}`,Hs=Ms.get(Us);if(Hs)if(await s(Hs))U=Hs;else Ms.delete(Us);if(!U&&(X.startsWith("./")||X.startsWith("../")))U=xe.resolve(xe.dirname(l),`${X}.stx`),re.push(U);else if(!U)for(let Pe of Se){if(!Pe)continue;for(let Ot of ve){let bt=xe.join(Pe,Ot);if(re.push(bt),await s(bt)){U=bt;break}}if(U)break;if(!U)try{let Ot=await import("fs");if(!Ot.statSync(Pe,{throwIfNoEntry:!1})?.isDirectory())continue;let cs=8,Ct=[{path:Pe,depth:0}];while(Ct.length>0&&!U){let dt=Ct.pop();if(dt.depth>=cs)continue;let Ht;try{Ht=Ot.readdirSync(dt.path,{withFileTypes:!0})}catch{continue}for(let ls of Ht){if(!ls.isDirectory())continue;if(ls.name==="node_modules"||ls.name.startsWith("."))continue;let si=xe.join(dt.path,ls.name);for(let oc of ve){let Ks=xe.join(si,oc);if(re.push(Ks),await s(Ks)){U=Ks;break}}if(U)break;Ct.push({path:si,depth:dt.depth+1})}}}catch{}if(U)break}if(U)Ms.set(Us,U)}if(!U||!await s(U))return za(e,l,re),Ba(e);v.add(U);let ce;if(qn.has(U)&&Tr.get(U)===Pa(U))ce=qn.get(U);else try{let ge=Pa(U);ce=await Bun.file(U).text(),qn.set(U,ce),Tr.set(U,ge)}catch(ge){let ve=ge instanceof Error?ge.message:String(ge);return za(e,l,[U],ve),Ba(e)}if(I)for(let ge of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=ge.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let ze=ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ze}\\b`).test(ce))I.declaredProps.add(ge);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ze}\\b|\\[\\s*['"]${ze}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ze}['"]`).test(ce))I.consumedProps?.add(ge)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let ge of I.reactiveProps){if(Fp.has(ge)||I.consumedProps?.has(ge))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${ge}`;if(Wa.has(ve))continue;Wa.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${ge}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${ge}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${ge}').`)}let le=new Set(["__originalFilePath","__importedComponents",ms,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),pe={};for(let[ge,ve]of Object.entries(a))if(!ge.startsWith("__")||le.has(ge))pe[ge]=ve;let Re=S.length>0?{[ws]:[...S]}:{},Ae=r;if(r.includes("@include")){let{processIncludes:ge}=await o("stx/includes",()=>import("./chunk-2cbrcb9m.js"));Ae=await ge(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ae)){let{processComponents:ge}=await o("stx/component-renderer",()=>import("./chunk-dqt1kw68.js")),ve={...a,__processedComponents:M,...Re};Ae=await ge(Ae,ve,l,u,v);let ze=ve.__stx_preserved_client_expressions;if(Array.isArray(ze)&&ze.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...ze])]}let we=[];if(El(Ae)){let{processExpressions:ge}=await o("stx/expressions",()=>import("./chunk-pmmctgdd.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Re}:S.length>0?{...a,...Re}:a;Ae=ge(Ae,ve,l);for(let ze of Ae.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(ze[1].trim())}let fe=new Set(Array.isArray(a.__stx_client_declared_names)?a.__stx_client_declared_names:[]),We=[];if(fe.size>0&&Ae)for(let ge of Ae.matchAll(/<[A-Z][\w.-]*\b([^>]*)>/g))for(let ve of ge[1].matchAll(/\s(?:v-model(?::[\w-]+)?|:[\w-]+)\s*=\s*"([^"]*)"/g)){let ze=ve[1].trim();try{if(ze&&Ee(ze).some((Se)=>fe.has(Se)))We.push(ze)}catch{}}let Fe=se(Ae),it=[],ot=Fe.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ge,ve)=>{let ze=Fe.scripts[Number(ve)]||"",Se=ze.match(/^<script\b([^>]*)>/i)?.[1]||"",pt=Se.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),tt=!pt||["module","text/javascript","application/javascript"].includes(pt),It=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${Se}`);if(!/\bserver\b/i.test(Se)&&tt&&!It)return it.push(ze),"";return ze}),{extractSlotContent:At}=await o("stx/slots",()=>import("./chunk-e4fseqnv.js")),St=At(ot),at={};if(St.defaultSlot?.trim())at.default=St.defaultSlot;for(let[ge,ve]of St.namedSlots)at[ge]=ve.content;let $t=a.__stx_scope_seq??={n:0,key:po(String(a.__filename??l))},Ve=Ua(e,process.cwd()),ut=`stx_${(Ve.endsWith(".stx")?Ve.slice(0,-4):Ve).replace(/[^a-zA-Z0-9]/g,"_")}_${++$t.n}_${$t.key}`,De={...pe,$uid:ut,$native:u._nativeHostAttrs===!0,...n,props:n,slot:ot,$slots:at,__processedComponents:V,__sections:{},__stx_signals_gate:Me(ce)||El(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we],__stx_caller_client_bindings:[...Array.isArray(a.__stx_caller_client_bindings)?a.__stx_caller_client_bindings:[],...We]};if(/import\s/.test(ce)){De.__importedComponents=new Map(De.__importedComponents);let{processESImports:ge}=await o("stx/component-renderer",()=>import("./chunk-dqt1kw68.js"));ce=await ge(ce,De,U,u,v)}zp(ce,De,n);let Mt=ce,Dt=B(Mt);if(Dt)Mt=Dt.content.trim();let zs=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,hn=[...ce.matchAll(zs)];for(let[,ge,ve]of hn)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ge))Ke(ve,U,u.strict);let xt=[],xn=null,Nt=hn.some((ge)=>/\bserver\b/.test(ge[1]||"")&&/\bcache\b/.test(ge[1]||"")),tn=null,bn=null,yn=null,Jn=0,_n=null;if(Pp(u),Nt&&Wr>0){let ge=Mp({props:n,slot:Ae,slotContext:r.trim()?Dp(pe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:ut});if(ge!==null){tn=`${U}\x00${E(ce)}\x00${ge}`;let ve=Ds.get(tn);if(ve){for(let ze of ve.dependencies)v.add(ze);if(Pi(a,ve.clientFactories),$t.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let ze=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let Se of ve.preservedClientExpressions)ze.add(Se);a.__stx_preserved_client_expressions=[...ze]}return ve.output}bn=new Set(v),yn=Ai(a),Jn=$t.n,_n=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Tt=new Set;for(let ge of hn){let ve=ge[1]||"",ze=ge[2]||"",Se=ve.includes("server");if(Ye(ve)&&ze.trim())ze=Ze(ze);if(Se&&ze){for(let tt of ye(ze))Tt.add(tt);try{await L(ze,De,U,{onFailure:(tt)=>{if(tt.kind!=="unknown")xn=tt.kind}})}catch(tt){}}if(!Se){let tt=ze.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),It=tt.includes("{{")&&tt.includes("}}"),sn=tt.includes("{!!")&&tt.includes("!!}");if(It||sn)tt=Xi(tt,De,U);let Pt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");xt.push(`<script${Pt}>${tt}</script>`)}}let jt=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),wn=jt?jt[1]:"",ue=jt?jt[2]:"",de="",$e=wn&&/\bscoped\b/i.test(wn);if(jt)de=`<style${wn}>${Wp(ue,De,U)}</style>`;let Te=Mt;if(Te=Te.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),jt)Te=Te.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ge=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(Te=Te.replace(ge,(ze,Se)=>{let pt=Se.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(pt)ve.push(`<style${pt[1]}>${pt[2]}</style>`);return""}),Te=Te.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)de=`${de}${ve.join(`
1187
- `)}`}if(r&&Te.includes("{{ text || slot }}"))Te=Te.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:st}=await o("stx/slots",()=>import("./chunk-e4fseqnv.js")),{defaultSlot:ct,namedSlots:nn}=St,Gr=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(ot),Lt=xt.length>0&&dr(Te)||u._nativeHostAttrs===!0&&xt.length>0||Gr&&xt.length>0||xt.some((ge)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ge)),Xn=(ge)=>Lt?qo(ge,ut):ge,Gn=new Map([...nn].map(([ge,ve])=>[ge,{...ve,content:Xn(ve.content)}]));Te=await st(Te,Lt?Ko(Xn(ct),ut):ct,Gn,De,Lt?ut:"");let vn=qi(xt),Sn=(Array.isArray(De.__stx_client_signal_names)?De.__stx_client_signal_names:[]).filter((ge)=>!Tt.has(ge));if(vn.length>0||Sn.length>0)De.__stx_client_signal_names=[...new Set([...Sn,...vn])];else delete De.__stx_client_signal_names;let En=io(xt.join(`
1188
- `)),kn=(Array.isArray(De.__stx_client_declared_names)?De.__stx_client_declared_names:[]).filter((ge)=>!Tt.has(ge)&&!(ge in n));if(En.size>0||kn.length>0)De.__stx_client_declared_names=[...new Set([...kn,...En])];else delete De.__stx_client_declared_names;let zt=S.filter((ge)=>!Tt.has(ge)&&!(ge in n));if(zt.length>0)De[ws]=zt;let Yn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:xe.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Lt||xt.length===0,defaultLayout:void 0};De.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:Qn}=await o("stx/process",()=>import("./chunk-ssdjny2r.js")),Be=await Qn(Te,De,U,Yn,v),Et=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ge of Be.matchAll(/\{\{([\s\S]*?)\}\}/g))Et.add(ge[1].trim());if(Et.size>0)a.__stx_preserved_client_expressions=[...Et];let Bt=ut,ft=Be;if(Lt){let ge="";if(Object.keys(n).length>0)try{ge=` data-stx-props="${Rr(JSON.stringify(n))}"`}catch{}let ve=Z?` stx-hydrate="${Rr(Z)}"`:"",ze=Object.fromEntries(Object.entries(at).map(([Ft,rn])=>[Ft,Boolean(rn)])),Se=Object.keys(ze).length>0?` data-stx-slots="${Rr(JSON.stringify(ze))}"`:"",pt=` data-stx-scope="${Bt}"${ge}${Se}${ve}`,tt=Be.slice(Vt(Be)),It=/^<span(?=[\s/>])/i.test(tt),sn=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(tt),Pt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(tt),es=It?"span":"div",Bs=sn&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Pt&&u._nativeHostAttrs?' style="width:100%;height:100%"':It||sn?' style="display:contents"':"";ft=Xg(Be,pt)??`<${es}${pt} data-stx-component-wrapper${Bs}>${Be}</${es}>`;let Ws=await Promise.all(xt.map(async(Ft)=>{let rn=Ft.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!rn)return Ft;let[,Cn,Fs]=rn,ts=ja(Ft,De,U);if(ts!==null)return ts;let on=await Up(Fs,U,u.buildMode==="compile"),ns=In(on.clientCode,Ge(De)),{vendorStyleTags:ss}=on,rs=ns?`function(__scopeId) {
1186
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Ba(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Fp=new Set(["for","if","show","key","ref","class","className","style"]),Wa=new Set,Ka="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Tl=new RegExp(`\\b(?:${Ka})\\s*(?:<[^>]*>)?\\s*\\(`);function qi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Ka})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Qe(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-kc3w40c2.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&Gg(W)?W:"";try{let q=(ge)=>ge.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),X=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let ge=[X,X.toLowerCase(),q(X),J(X)];for(let ve of ge)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let ge=[`${X}.stx`,`${q(X)}.stx`,`${J(X)}.stx`],ve=[...new Set(ge)],ze=a.__originalFilePath,Se=[];for(let Pe of us(l))if(!Se.includes(Pe))Se.push(Pe);let pt=Se.length;for(let Pe of u._layerComponentDirs??[])if(!Se.includes(Pe))Se.push(Pe);if(ze){let Pe=xe.join(xe.dirname(ze),"components");Se.push(Pe)}let tt=u._rootComponentsDir;if(typeof tt==="string"&&Ha(i,u)&&!Se.includes(tt))Se.push(tt);if(i&&!Se.includes(i))Se.push(i);if(typeof tt==="string"&&!Se.includes(tt))Se.push(tt);let It=xe.join(xe.dirname(l),"components");if(!Se.includes(It))Se.push(It);if(u.componentsDir&&u.componentsDir!==i&&!Se.includes(u.componentsDir))Se.push(u.componentsDir);for(let Pe of u.additionalComponentsDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let sn=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(X),Pt=(I?.events??[]).map((Pe)=>Pe.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),es=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Bs=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ws=!Pt.includes("valuechange")&&(es||Pt.includes("change")&&!Bs),Ft=u._nativeHostAttrs&&/^textinput$/i.test(X),rn=Pt.includes("update:value")&&!Pt.includes("input"),Cn=u._nativeHostAttrs&&/^video$/i.test(X),Fs=u._nativeHostAttrs&&/^image$/i.test(X),ts=eo([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),on=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),ns=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),ss=Cn&&(on||ns)&&(I?.events??[]).every((Pe)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Pe.replace(/^@/,"").split(".")[0])),rs=new Set(["","primary","secondary","outline","ghost","danger"]),is=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",os=u._nativeHostAttrs&&/^button$/i.test(X)&&!rs.has(is),Qr=u._targetComponentFallbackNames?.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())??!1,Vs=Qr&&(!sn||Ws)&&(!Ft||rn)&&(!Cn||ss)&&(!Fs||ts)&&!os;for(let Pe of Vs?[]:u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let an=typeof u.root==="string"?xe.resolve(u.root):void 0,ei=an??xe.dirname(l),cn=[];if(an)cn.push(xe.resolve(an,"resources/views/components")),cn.push(xe.resolve(an,"resources/components")),cn.push(xe.resolve(an,"src/components")),cn.push(xe.resolve(an,"components"));cn.push(xe.resolve(import.meta.dir,"components"));for(let Pe of cn)if(!Se.includes(Pe))Se.push(Pe);if(Qr){let Pe=(u._componentPackageDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0),Ot=(Vs?Pe.length?Pe:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0);if(Ot.length){let bt=Se.slice(pt).map((dt)=>xe.isAbsolute(dt)?dt:xe.resolve(ei,dt)).filter((dt)=>!Ot.includes(dt)),cs=`${X}\x00${bt.join("\x00")}`,Ct=Ir.get(cs);if(Ct===void 0){Ct=!1;for(let dt of bt){for(let Ht of ve)if(await s(xe.join(dt,Ht))){Ct=!0;break}if(Ct)break}Ir.set(cs,Ct)}if(!Ct){for(let dt of Ot){let Ht=Se.indexOf(dt);if(Ht>=0)Se.splice(Ht,1)}Se.splice(pt,0,...Ot)}}}let ti=u._pluginComponentDirs;if(Array.isArray(ti)){for(let Pe of ti)if(typeof Pe==="string"&&!Se.includes(Pe))Se.push(Pe)}if(u.fallbackComponentsDir&&!Se.includes(u.fallbackComponentsDir))Se.push(u.fallbackComponentsDir);if(Vs){for(let Pe of u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe)}let as=u._nativePrimitivesFallback;if(as&&!as.except.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())&&!Se.includes(as.dir))Se.push(as.dir);let ni=[...new Set(Se.map((Pe)=>{if(!Pe)return Pe;return xe.isAbsolute(Pe)?Pe:xe.resolve(ei,Pe)}))];Se.length=0,Se.push(...ni);let Us=`${X}\x00${l}\x00${ni.join("\x00")}`,Hs=Ms.get(Us);if(Hs)if(await s(Hs))U=Hs;else Ms.delete(Us);if(!U&&(X.startsWith("./")||X.startsWith("../")))U=xe.resolve(xe.dirname(l),`${X}.stx`),re.push(U);else if(!U)for(let Pe of Se){if(!Pe)continue;for(let Ot of ve){let bt=xe.join(Pe,Ot);if(re.push(bt),await s(bt)){U=bt;break}}if(U)break;if(!U)try{let Ot=await import("fs");if(!Ot.statSync(Pe,{throwIfNoEntry:!1})?.isDirectory())continue;let cs=8,Ct=[{path:Pe,depth:0}];while(Ct.length>0&&!U){let dt=Ct.pop();if(dt.depth>=cs)continue;let Ht;try{Ht=Ot.readdirSync(dt.path,{withFileTypes:!0})}catch{continue}for(let ls of Ht){if(!ls.isDirectory())continue;if(ls.name==="node_modules"||ls.name.startsWith("."))continue;let si=xe.join(dt.path,ls.name);for(let oc of ve){let Ks=xe.join(si,oc);if(re.push(Ks),await s(Ks)){U=Ks;break}}if(U)break;Ct.push({path:si,depth:dt.depth+1})}}}catch{}if(U)break}if(U)Ms.set(Us,U)}if(!U||!await s(U))return za(e,l,re),Ba(e);v.add(U);let ce;if(qn.has(U)&&Tr.get(U)===Pa(U))ce=qn.get(U);else try{let ge=Pa(U);ce=await Bun.file(U).text(),qn.set(U,ce),Tr.set(U,ge)}catch(ge){let ve=ge instanceof Error?ge.message:String(ge);return za(e,l,[U],ve),Ba(e)}if(I)for(let ge of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=ge.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let ze=ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ze}\\b`).test(ce))I.declaredProps.add(ge);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ze}\\b|\\[\\s*['"]${ze}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ze}['"]`).test(ce))I.consumedProps?.add(ge)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let ge of I.reactiveProps){if(Fp.has(ge)||I.consumedProps?.has(ge))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${ge}`;if(Wa.has(ve))continue;Wa.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${ge}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${ge}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${ge}').`)}let le=new Set(["__originalFilePath","__importedComponents",ms,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),pe={};for(let[ge,ve]of Object.entries(a))if(!ge.startsWith("__")||le.has(ge))pe[ge]=ve;let Re=S.length>0?{[ws]:[...S]}:{},Ae=r;if(r.includes("@include")){let{processIncludes:ge}=await o("stx/includes",()=>import("./chunk-jr3txt3f.js"));Ae=await ge(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ae)){let{processComponents:ge}=await o("stx/component-renderer",()=>import("./chunk-p9cm5ksf.js")),ve={...a,__processedComponents:M,...Re};Ae=await ge(Ae,ve,l,u,v);let ze=ve.__stx_preserved_client_expressions;if(Array.isArray(ze)&&ze.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...ze])]}let we=[];if(El(Ae)){let{processExpressions:ge}=await o("stx/expressions",()=>import("./chunk-tm4fgc58.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Re}:S.length>0?{...a,...Re}:a;Ae=ge(Ae,ve,l);for(let ze of Ae.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(ze[1].trim())}let fe=new Set(Array.isArray(a.__stx_client_declared_names)?a.__stx_client_declared_names:[]),We=[];if(fe.size>0&&Ae)for(let ge of Ae.matchAll(/<[A-Z][\w.-]*\b([^>]*)>/g))for(let ve of ge[1].matchAll(/\s(?:v-model(?::[\w-]+)?|:[\w-]+)\s*=\s*"([^"]*)"/g)){let ze=ve[1].trim();try{if(ze&&Ee(ze).some((Se)=>fe.has(Se)))We.push(ze)}catch{}}let Fe=se(Ae),it=[],ot=Fe.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ge,ve)=>{let ze=Fe.scripts[Number(ve)]||"",Se=ze.match(/^<script\b([^>]*)>/i)?.[1]||"",pt=Se.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),tt=!pt||["module","text/javascript","application/javascript"].includes(pt),It=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${Se}`);if(!/\bserver\b/i.test(Se)&&tt&&!It)return it.push(ze),"";return ze}),{extractSlotContent:At}=await o("stx/slots",()=>import("./chunk-3xgr1z61.js")),St=At(ot),at={};if(St.defaultSlot?.trim())at.default=St.defaultSlot;for(let[ge,ve]of St.namedSlots)at[ge]=ve.content;let $t=a.__stx_scope_seq??={n:0,key:po(String(a.__filename??l))},Ve=Ua(e,process.cwd()),ut=`stx_${(Ve.endsWith(".stx")?Ve.slice(0,-4):Ve).replace(/[^a-zA-Z0-9]/g,"_")}_${++$t.n}_${$t.key}`,De={...pe,$uid:ut,$native:u._nativeHostAttrs===!0,...n,props:n,slot:ot,$slots:at,__processedComponents:V,__sections:{},__stx_signals_gate:Me(ce)||El(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we],__stx_caller_client_bindings:[...Array.isArray(a.__stx_caller_client_bindings)?a.__stx_caller_client_bindings:[],...We]};if(/import\s/.test(ce)){De.__importedComponents=new Map(De.__importedComponents);let{processESImports:ge}=await o("stx/component-renderer",()=>import("./chunk-p9cm5ksf.js"));ce=await ge(ce,De,U,u,v)}zp(ce,De,n);let Mt=ce,Dt=B(Mt);if(Dt)Mt=Dt.content.trim();let zs=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,hn=[...ce.matchAll(zs)];for(let[,ge,ve]of hn)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ge))Ke(ve,U,u.strict);let xt=[],xn=null,Nt=hn.some((ge)=>/\bserver\b/.test(ge[1]||"")&&/\bcache\b/.test(ge[1]||"")),tn=null,bn=null,yn=null,Jn=0,_n=null;if(Pp(u),Nt&&Wr>0){let ge=Mp({props:n,slot:Ae,slotContext:r.trim()?Dp(pe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:ut});if(ge!==null){tn=`${U}\x00${E(ce)}\x00${ge}`;let ve=Ds.get(tn);if(ve){for(let ze of ve.dependencies)v.add(ze);if(Pi(a,ve.clientFactories),$t.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let ze=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let Se of ve.preservedClientExpressions)ze.add(Se);a.__stx_preserved_client_expressions=[...ze]}return ve.output}bn=new Set(v),yn=Ai(a),Jn=$t.n,_n=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Tt=new Set;for(let ge of hn){let ve=ge[1]||"",ze=ge[2]||"",Se=ve.includes("server");if(Ye(ve)&&ze.trim())ze=Ze(ze);if(Se&&ze){for(let tt of ye(ze))Tt.add(tt);try{await L(ze,De,U,{onFailure:(tt)=>{if(tt.kind!=="unknown")xn=tt.kind}})}catch(tt){}}if(!Se){let tt=ze.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),It=tt.includes("{{")&&tt.includes("}}"),sn=tt.includes("{!!")&&tt.includes("!!}");if(It||sn)tt=Xi(tt,De,U);let Pt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");xt.push(`<script${Pt}>${tt}</script>`)}}let jt=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),wn=jt?jt[1]:"",ue=jt?jt[2]:"",de="",$e=wn&&/\bscoped\b/i.test(wn);if(jt)de=`<style${wn}>${Wp(ue,De,U)}</style>`;let Te=Mt;if(Te=Te.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),jt)Te=Te.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ge=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(Te=Te.replace(ge,(ze,Se)=>{let pt=Se.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(pt)ve.push(`<style${pt[1]}>${pt[2]}</style>`);return""}),Te=Te.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)de=`${de}${ve.join(`
1187
+ `)}`}if(r&&Te.includes("{{ text || slot }}"))Te=Te.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:st}=await o("stx/slots",()=>import("./chunk-3xgr1z61.js")),{defaultSlot:ct,namedSlots:nn}=St,Gr=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(ot),Lt=xt.length>0&&dr(Te)||u._nativeHostAttrs===!0&&xt.length>0||Gr&&xt.length>0||xt.some((ge)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ge)),Xn=(ge)=>Lt?qo(ge,ut):ge,Gn=new Map([...nn].map(([ge,ve])=>[ge,{...ve,content:Xn(ve.content)}]));Te=await st(Te,Lt?Ko(Xn(ct),ut):ct,Gn,De,Lt?ut:"");let vn=qi(xt),Sn=(Array.isArray(De.__stx_client_signal_names)?De.__stx_client_signal_names:[]).filter((ge)=>!Tt.has(ge));if(vn.length>0||Sn.length>0)De.__stx_client_signal_names=[...new Set([...Sn,...vn])];else delete De.__stx_client_signal_names;let En=io(xt.join(`
1188
+ `)),kn=(Array.isArray(De.__stx_client_declared_names)?De.__stx_client_declared_names:[]).filter((ge)=>!Tt.has(ge)&&!(ge in n));if(En.size>0||kn.length>0)De.__stx_client_declared_names=[...new Set([...kn,...En])];else delete De.__stx_client_declared_names;let zt=S.filter((ge)=>!Tt.has(ge)&&!(ge in n));if(zt.length>0)De[ws]=zt;let Yn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:xe.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Lt||xt.length===0,defaultLayout:void 0};De.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:Qn}=await o("stx/process",()=>import("./chunk-zzpedcte.js")),Be=await Qn(Te,De,U,Yn,v),Et=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ge of Be.matchAll(/\{\{([\s\S]*?)\}\}/g))Et.add(ge[1].trim());if(Et.size>0)a.__stx_preserved_client_expressions=[...Et];let Bt=ut,ft=Be;if(Lt){let ge="";if(Object.keys(n).length>0)try{ge=` data-stx-props="${Rr(JSON.stringify(n))}"`}catch{}let ve=Z?` stx-hydrate="${Rr(Z)}"`:"",ze=Object.fromEntries(Object.entries(at).map(([Ft,rn])=>[Ft,Boolean(rn)])),Se=Object.keys(ze).length>0?` data-stx-slots="${Rr(JSON.stringify(ze))}"`:"",pt=` data-stx-scope="${Bt}"${ge}${Se}${ve}`,tt=Be.slice(Vt(Be)),It=/^<span(?=[\s/>])/i.test(tt),sn=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(tt),Pt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(tt),es=It?"span":"div",Bs=sn&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Pt&&u._nativeHostAttrs?' style="width:100%;height:100%"':It||sn?' style="display:contents"':"";ft=Xg(Be,pt)??`<${es}${pt} data-stx-component-wrapper${Bs}>${Be}</${es}>`;let Ws=await Promise.all(xt.map(async(Ft)=>{let rn=Ft.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!rn)return Ft;let[,Cn,Fs]=rn,ts=ja(Ft,De,U);if(ts!==null)return ts;let on=await Up(Fs,U,u.buildMode==="compile"),ns=In(on.clientCode,Ge(De)),{vendorStyleTags:ss}=on,rs=ns?`function(__scopeId) {
1189
1189
  ${ns}
1190
1190
  return (${on.factoryBody})(__scopeId);
1191
1191
  }`:on.factoryBody,is=Z?null:or(a,rs),os=is?`window.__stxComponentFactories[${JSON.stringify(is)}](${JSON.stringify(Bt)});`:`(${rs})(${JSON.stringify(Bt)});`;if(Z)return`${ss}<script type="stx/island" data-stx-island="${Bt}" data-stx-scoped data-stx-owner="${Bt}"${Cn}>${me(os)}</script>`;return`${ss}<script data-stx-scoped data-stx-run="always" data-stx-owner="${Bt}"${Cn}>${me(os)}</script>`}));if(ft=ft+`
@@ -1211,7 +1211,7 @@ ${He.yellow}${He.bold}Message:${He.reset} ${n}
1211
1211
  `,f)I+=`
1212
1212
  ${He.blue}${He.bold}Context:${He.reset}
1213
1213
  ${He.dim}${f}${He.reset}
1214
- `;return I}function Ce(){qn.clear(),Tr.clear(),Ms.clear(),Ir.clear(),Or.clear(),Pr.clear(),Ds.clear()}function Iy(){return{size:qn.size,maxSize:500}}var Ar=k(128);async function Up(e,n,r){let i=E(e,n,r),a=Ar.get(i);if(a){if(to(a.deps))return a;Ar.delete(i)}let l=Vi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Wi(l.styles);u=Gt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-q33tyfpp.js")),I=[],j=!1;if(v(u)){let X=u;u=await S(X,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===X}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-r425m35g.js"));u=L(u);let M=D(u),V=Lp(M),W=new Set(G(M,!0).split(",").map((X)=>X.trim())),Z=`function(__scopeId) {
1214
+ `;return I}function Ce(){qn.clear(),Tr.clear(),Ms.clear(),Ir.clear(),Or.clear(),Pr.clear(),Ds.clear()}function Iy(){return{size:qn.size,maxSize:500}}var Ar=k(128);async function Up(e,n,r){let i=E(e,n,r),a=Ar.get(i);if(a){if(to(a.deps))return a;Ar.delete(i)}let l=Vi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Wi(l.styles);u=Gt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-rbfrxaer.js")),I=[],j=!1;if(v(u)){let X=u;u=await S(X,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===X}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-g9s2t064.js"));u=L(u);let M=D(u),V=Lp(M),W=new Set(G(M,!0).split(",").map((X)=>X.trim())),Z=`function(__scopeId) {
1215
1215
  ${vt("const",[...Ul,...V],M)}
1216
1216
  const __scope = window.stx._scopes = window.stx._scopes || {};
1217
1217
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ns,$o,vm,su,Ro}from"./chunk-g17g6w1t.js";import"./chunk-13awnyq0.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";export{vm as buildModuleRegistryScript,Ro as buildSharedModuleRegistries,su as exportsMutableBinding,ns as registeredModuleIdsIn,$o as registeredModuleNamesIn};
2
+ import{ns,$o,vm,su,Ro}from"./chunk-whd6y829.js";import"./chunk-2vdbt2a7.js";import"./chunk-75r2p1cz.js";import"./chunk-0jdz31q1.js";export{vm as buildModuleRegistryScript,Ro as buildSharedModuleRegistries,su as exportsMutableBinding,ns as registeredModuleIdsIn,$o as registeredModuleNamesIn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Bh,Ho,Fh,zh,Hh,Uh}from"./chunk-hm954re1.js";import"./chunk-px6zx8ae.js";import"./chunk-gqz6502d.js";import"./chunk-cwcmmgvz.js";import"./chunk-6vyy44ve.js";import"./chunk-hcxsyw55.js";import"./chunk-v0yay1kw.js";import"./chunk-2vdbt2a7.js";import"./chunk-ja4fyz87.js";import"./chunk-v37hjzt2.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-etn044yn.js";import"./chunk-fcqca9qb.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-75r2p1cz.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Uh as clearStoreCache,Bh as getStoreScript,Hh as getStoreScriptFor,zh as pageStoresAll,Ho as storesRead,Fh as storesReadInFiles};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ln,z}from"./chunk-w98yt4d4.js";import m from"fs";import e from"path";async function Dn(r,o,i){if(r.__stx_runtime_config)return;let n=Ln();if(n||i){r.__stx_runtime_config=n??z(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-44qcbbc4.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=z(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ji(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'
2
+ import{Ln,z}from"./chunk-w98yt4d4.js";import m from"fs";import e from"path";async function Dn(r,o,i){if(r.__stx_runtime_config)return;let n=Ln();if(n||i){r.__stx_runtime_config=n??z(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-qfwnp28b.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=z(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ji(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??{})} }