@stacksjs/stx 0.2.909 → 0.2.912

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 (84) hide show
  1. package/dist/{chunk-p8p0xs8g.js → chunk-03sqt4jx.js} +2 -2
  2. package/dist/{chunk-q91hentn.js → chunk-1gfc406y.js} +1 -1
  3. package/dist/{chunk-9mmdtd5q.js → chunk-28f696hb.js} +1 -1
  4. package/dist/{chunk-t9ad2qwm.js → chunk-46fzxsh0.js} +2 -2
  5. package/dist/chunk-59nhx5mp.js +2 -0
  6. package/dist/{chunk-pp89n1et.js → chunk-5xsghm23.js} +1 -1
  7. package/dist/chunk-68qw8ak4.js +2 -0
  8. package/dist/{chunk-581qafp7.js → chunk-6ryenxnh.js} +1 -1
  9. package/dist/chunk-759jwj0e.js +3 -0
  10. package/dist/{chunk-5crybqrs.js → chunk-7y5fkje7.js} +1 -1
  11. package/dist/chunk-83ykx150.js +2 -0
  12. package/dist/{chunk-r3hb020a.js → chunk-8vk795yg.js} +1 -1
  13. package/dist/{chunk-c43kvce7.js → chunk-996gpkb6.js} +1 -1
  14. package/dist/{chunk-e5n8wfj2.js → chunk-9ejbveb6.js} +1 -1
  15. package/dist/{chunk-b234w3mf.js → chunk-9gptdyqq.js} +14 -4
  16. package/dist/{chunk-162e363h.js → chunk-9kaxt6tw.js} +1 -1
  17. package/dist/{chunk-4nkzj2pj.js → chunk-a5920t9d.js} +2 -2
  18. package/dist/{chunk-3dx77nfw.js → chunk-a5990vzz.js} +1 -1
  19. package/dist/{chunk-pbs4db9n.js → chunk-aahxd88g.js} +4 -4
  20. package/dist/chunk-ardnfxn5.js +2 -0
  21. package/dist/chunk-bjbzpy42.js +2 -0
  22. package/dist/{chunk-y7caf6hd.js → chunk-btetjy8n.js} +3 -3
  23. package/dist/{chunk-x6n0r41y.js → chunk-c0738x1k.js} +1 -1
  24. package/dist/{chunk-376714qg.js → chunk-c8qp8b5z.js} +1 -1
  25. package/dist/{chunk-snhsh171.js → chunk-cxzy7kxg.js} +7 -7
  26. package/dist/{chunk-73py4qeh.js → chunk-d2rwg24x.js} +1 -1
  27. package/dist/chunk-dhk7355h.js +2 -0
  28. package/dist/{chunk-rmz99qwk.js → chunk-dqwc5b8m.js} +1 -1
  29. package/dist/{chunk-mv1hr9d4.js → chunk-ff03ga49.js} +4 -4
  30. package/dist/chunk-fwebja2k.js +2 -0
  31. package/dist/{chunk-tktgaz78.js → chunk-gmk82cm4.js} +1 -1
  32. package/dist/{chunk-8njqq95v.js → chunk-jbbgye38.js} +5 -5
  33. package/dist/{chunk-3b8epemd.js → chunk-jcmhpbh4.js} +1 -1
  34. package/dist/{chunk-69yqdxck.js → chunk-jk6zn8tw.js} +1 -1
  35. package/dist/{chunk-e6za83ty.js → chunk-jkenezzp.js} +1 -1
  36. package/dist/{chunk-8zx8zgwe.js → chunk-kfvp7mh1.js} +1 -1
  37. package/dist/{chunk-yqxhy0nq.js → chunk-nkkassx2.js} +1 -1
  38. package/dist/{chunk-2epswh9w.js → chunk-nxcg5tf5.js} +1 -1
  39. package/dist/{chunk-66tpsdpm.js → chunk-pdvssk6k.js} +4 -4
  40. package/dist/{chunk-2pagy1jn.js → chunk-pgb2p7pm.js} +1 -1
  41. package/dist/chunk-prekacv2.js +2 -0
  42. package/dist/{chunk-9yb1hke7.js → chunk-pthvpadr.js} +1 -1
  43. package/dist/{chunk-yy71cxxj.js → chunk-pwv6pvnm.js} +1 -1
  44. package/dist/{chunk-dyg45v6h.js → chunk-q3ccf7ky.js} +1 -1
  45. package/dist/{chunk-tszsy2pv.js → chunk-q3smaxw7.js} +2 -2
  46. package/dist/{chunk-xf3j14d6.js → chunk-r3eq7mza.js} +1 -1
  47. package/dist/{chunk-q7k0eha6.js → chunk-rektg4nx.js} +1 -1
  48. package/dist/{chunk-tcytjgh5.js → chunk-rpyhbyt7.js} +1 -1
  49. package/dist/chunk-rssjx1mg.js +2 -0
  50. package/dist/chunk-rtrhv7nd.js +2 -0
  51. package/dist/{chunk-440epzas.js → chunk-s1sm41pe.js} +1 -1
  52. package/dist/chunk-vavq2ak3.js +2 -0
  53. package/dist/{chunk-fkm2bf2x.js → chunk-ve0sbkrt.js} +1 -1
  54. package/dist/{chunk-3khg2ats.js → chunk-vhk5m98x.js} +1 -1
  55. package/dist/{chunk-rgrh0fpj.js → chunk-vktbykbf.js} +1 -1
  56. package/dist/{chunk-txsre59k.js → chunk-vr9dbmxh.js} +2 -2
  57. package/dist/{chunk-r8gv2pcy.js → chunk-vys2c06e.js} +4 -4
  58. package/dist/{chunk-gmjsnh5h.js → chunk-wnnj29pg.js} +1 -1
  59. package/dist/{chunk-va00ve6h.js → chunk-wsg1evmc.js} +1 -1
  60. package/dist/{chunk-k3eab0c5.js → chunk-wvpk866c.js} +1 -1
  61. package/dist/{chunk-xprmhc0y.js → chunk-x5x8hbm0.js} +1 -1
  62. package/dist/{chunk-eavaz8vm.js → chunk-xsxdyzha.js} +2 -2
  63. package/dist/{chunk-kp957mbs.js → chunk-ypy1k5t0.js} +1 -1
  64. package/dist/{chunk-5g2svr3g.js → chunk-zcgks568.js} +1 -1
  65. package/dist/{chunk-m2t2gpjb.js → chunk-zqvkbj0k.js} +2 -2
  66. package/dist/{chunk-gjk0nzyy.js → chunk-zytwcfbt.js} +1 -1
  67. package/dist/cli.js +7 -7
  68. package/dist/craft-entry.js +1 -1
  69. package/dist/craft.js +1 -1
  70. package/dist/pwa.js +1 -1
  71. package/dist/ssg.js +2 -2
  72. package/package.json +5 -5
  73. package/dist/chunk-0b0y695e.js +0 -2
  74. package/dist/chunk-59wq842b.js +0 -2
  75. package/dist/chunk-drmp871t.js +0 -2
  76. package/dist/chunk-e99ccfbw.js +0 -2
  77. package/dist/chunk-g9dxcxk0.js +0 -2
  78. package/dist/chunk-jvpnd7zd.js +0 -2
  79. package/dist/chunk-n73v0pcq.js +0 -2
  80. package/dist/chunk-p7rwa0xw.js +0 -2
  81. package/dist/chunk-pdfnq2gs.js +0 -3
  82. package/dist/chunk-r643mp2v.js +0 -2
  83. package/dist/chunk-tw1rbnc3.js +0 -2
  84. package/dist/chunk-w83rcgej.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{n,u}from"./chunk-c08jvjqt.js";import{Oi,s,On,b}from"./chunk-snhsh171.js";import{ft}from"./chunk-b234w3mf.js";import{Vs,Ws}from"./chunk-eca022er.js";import{Zc,Si,Hs,Us}from"./chunk-mpfm5ctr.js";import{Gc,Jc}from"./chunk-gjk0nzyy.js";import{Mt}from"./chunk-bvqgq18r.js";import{En,sl,Ir,Or}from"./chunk-w4177qn3.js";import{w}from"./chunk-v6gkjg5f.js";import{Co}from"./chunk-0d3pkkrv.js";import{c,f}from"./chunk-8tfpv6zf.js";import Q from"fs";import z from"path";import{loadConfigWithResult as Kt}from"bunfig";var K={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,t={}){let{duration:i,delay:o,ease:r,direction:l,custom:d}={...K,...t};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
2
+ import{n,u}from"./chunk-c08jvjqt.js";import{Oi,s,On,b}from"./chunk-cxzy7kxg.js";import{ft}from"./chunk-9gptdyqq.js";import{Vs,Ws}from"./chunk-eca022er.js";import{Zc,Si,Hs,Us}from"./chunk-mpfm5ctr.js";import{Gc,Jc}from"./chunk-zytwcfbt.js";import{Mt}from"./chunk-bvqgq18r.js";import{En,sl,Ir,Or}from"./chunk-w4177qn3.js";import{w}from"./chunk-v6gkjg5f.js";import{Co}from"./chunk-0d3pkkrv.js";import{c,f}from"./chunk-8tfpv6zf.js";import Q from"fs";import z from"path";import{loadConfigWithResult as Kt}from"bunfig";var K={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,t={}){let{duration:i,delay:o,ease:r,direction:l,custom:d}={...K,...t};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
3
3
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
4
4
  @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${l==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
5
5
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -1306,6 +1306,6 @@ ${y}
1306
1306
  customElements.define('${t}', ${d});
1307
1307
  `}async function et(e,t,i,o){if(t.length<1)return u("WebComponent","@webcomponent directive requires at least the tag name parameter",n.INVALID_DIRECTIVE_SYNTAX);let r=t[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",m=U.isAbsolute(d)?[U.join(d,`${r}.stx`),U.join(U.dirname(o),`${r}.stx`)]:[U.join(U.dirname(o),d,`${r}.stx`),U.join(process.cwd(),d,`${r}.stx`),U.join(U.dirname(o),`${r}.stx`)],p=null;for(let h of m)if(await s(h)){p=await Bun.file(h).text();break}if(!p)return u("WebComponent",`Component file not found: ${r}.stx`,n.FILE_NOT_FOUND);let g=Bt(p,r);return`<script type="module">
1308
1308
  ${Jt(g)}
1309
- </script>`}var q={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:En,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:je,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:et,hasEndTag:!1,description:"Include a web component in the template"},Gc,Jc,Vs,Ws,Ae,Re,Ee,_e,Oe,Te,Ue,De,...Co],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Gt(e,t,i){let o=t||"pages";if(e)return{root:e,pagesDir:o};let r=i||process.cwd(),l=z.join(r,"resources","views"),d=z.join(r,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=z.join(r,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,ge=["partialsDir","componentsDir","layoutsDir"],Pe=new WeakMap;function Yt(e,t){let i=t.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/");return o===r||o.startsWith(`${r}/`)}function Sg(e,t){let i=!e.root,o=Gt(e.root,e.pagesDir,t);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let r=`${t}::${o.root}`;if(!tt.has(r))tt.add(r),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Pe.has(e)){let r={};for(let l of ge){let d=e[l];if(typeof d==="string"&&d)r[l]=d}Pe.set(e,r)}if(e.root&&e.root!=="."){let r=e.root;for(let l of ge){let d=e[l];if(typeof d!=="string"||!d)continue;if(z.isAbsolute(d)||Yt(d,r))continue;e[l]=z.join(r,d)}}for(let r of ge){let l=e[r];if(typeof l!=="string"||!l||z.isAbsolute(l))continue;e[r]=z.resolve(t,l)}return e}function Xt(e,t){let i=Pe.get(e);for(let o of ge){let r=e[o];if(typeof r!=="string"||!r)continue;let l=z.isAbsolute(r)?r:z.join(t,r);if(Q.existsSync(l))continue;let d=i?.[o]??r,m=e.root,p=!!m&&m!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(p?`, resolved under root "${m}".`:"."))}}function Zt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Qt(e){if(sl(e.stateDir),e.stateDir=Ir(),e.cachePath=Or(e.cachePath),e.build)e.build.cacheDir=Or(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=Or(e.media.cache.directory);if(e.story)e.story.outDir=Or(e.story.outDir)}var Y=null,Z=new Map,me=new Map,ae=null;async function vi(e,t=Kt){try{return await t(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var er=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Wc(e,t){let i=w.resolve(e,{paths:[t]});if(er.test(i))throw Error(`${e} is not installed in ${t} (found only in Bun's install cache)`);return i}async function a(e){let t=e?z.resolve(e):process.cwd(),i=me.get(t);if(i&&i.signature!==Hs(i.graph)){let l=Z.get(t);if(Z.delete(t),me.delete(t),!e)Y=null,ae=null;let{clearComponentCache:d}=await import("./chunk-dyg45v6h.js"),{partialsCache:m}=await import("./chunk-9mmdtd5q.js");if(d(),m.clear(),l&&i.configSignature===Us(i.graph)){let p=l.then(async(g)=>{let y={...i.graph};await Si(y,t),me.set(t,{graph:y,signature:Hs(y),configSignature:Us(y)});let h={...g,_layerGraph:y};if(!e)Y=h;return h});return Z.set(t,p),p}}if(!e){if(Y)return Y;if(ae)return ae}let o=Z.get(t);if(o)return o;let r=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(z.join(t,`stx.config${v}`))),m=l.some((v)=>Q.existsSync(z.join(t,"config",`ui${v}`))),p;if(d&&m){let v=await vi({name:"ui",cwd:z.join(t,"config"),defaultConfig:q,errorPolicy:"throw",verbose:!1});p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:q,errorPolicy:"throw",verbose:!1})).config;if(p.extends!==void 0||i){let v=await Zc(t,q);p=v.config,me.set(t,{graph:v.graph,signature:Hs(v.graph),configSignature:Us(v.graph)})}if(p.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-43kz6rx9.js");v(p.runtimeConfig,{});let{generateRuntimeConfigTypes:x}=await import("./chunk-9yb1hke7.js");await x(t,p.runtimeConfig)}Zt(p),Qt(p),Sg(p,t),Xt(p,t);let g=[],y=new Set((p.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of p.componentPackages??["@stacksjs/components"]){let x=`${v}/stx-plugin`;if(y.has(x)||y.has(v))continue;try{Wc(x,t),g.push(x)}catch{}}let h=[...p.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-cqq68aw8.js"),x=[],C=[],A=new Set(p.componentPackages??["@stacksjs/components"]),P=[];for(let R of h){let _=typeof R==="string"?R:R[0],I=typeof R==="string"?{}:R[1]||{};try{let T,k;try{let S=Wc(_,t);T=await import(S),k=z.dirname(S)}catch{let S=z.resolve(t,_);T=await import(S),k=z.dirname(S)}let D=T.default||T;if(!v.has(D.name))await v.register(D,p);if(D.components){let S=Array.isArray(D.components)?D.components:[D.components],M=A.has(D.name)||A.has(_)||A.has(_.replace(/\/stx-plugin$/,""));for(let F of S){let N=z.resolve(k,F);x.push(N);let V=M;if(!V){let E=Oi(z.join(N,"package.json"));if(E)try{let L=JSON.parse(Q.readFileSync(z.join(E,"package.json"),"utf8"));V=typeof L.name==="string"&&A.has(L.name)}catch{}}if(V)C.push(N)}}if(D.pages){let S=z.resolve(k,D.pages),M=I.path||"/";P.push({dir:S,prefix:M})}if(D.setup){let S={addDirective:(M)=>{p.customDirectives=p.customDirectives||[],p.customDirectives.push(M)},addRoute:(M,F)=>{p.apiRoutes=p.apiRoutes||{},p.apiRoutes[M]=F},addMiddleware:(M)=>{p.middleware=p.middleware||[],p.middleware.push(M)},pluginDir:k,config:p};await D.setup(I,S)}process.stderr.write(`[stx] Plugin loaded: ${D.name||_}
1309
+ </script>`}var q={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:En,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:je,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:et,hasEndTag:!1,description:"Include a web component in the template"},Gc,Jc,Vs,Ws,Ae,Re,Ee,_e,Oe,Te,Ue,De,...Co],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Gt(e,t,i){let o=t||"pages";if(e)return{root:e,pagesDir:o};let r=i||process.cwd(),l=z.join(r,"resources","views"),d=z.join(r,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=z.join(r,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,ge=["partialsDir","componentsDir","layoutsDir"],Pe=new WeakMap;function Yt(e,t){let i=t.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/");return o===r||o.startsWith(`${r}/`)}function Sg(e,t){let i=!e.root,o=Gt(e.root,e.pagesDir,t);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let r=`${t}::${o.root}`;if(!tt.has(r))tt.add(r),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Pe.has(e)){let r={};for(let l of ge){let d=e[l];if(typeof d==="string"&&d)r[l]=d}Pe.set(e,r)}if(e.root&&e.root!=="."){let r=e.root;for(let l of ge){let d=e[l];if(typeof d!=="string"||!d)continue;if(z.isAbsolute(d)||Yt(d,r))continue;e[l]=z.join(r,d)}}for(let r of ge){let l=e[r];if(typeof l!=="string"||!l||z.isAbsolute(l))continue;e[r]=z.resolve(t,l)}return e}function Xt(e,t){let i=Pe.get(e);for(let o of ge){let r=e[o];if(typeof r!=="string"||!r)continue;let l=z.isAbsolute(r)?r:z.join(t,r);if(Q.existsSync(l))continue;let d=i?.[o]??r,m=e.root,p=!!m&&m!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(p?`, resolved under root "${m}".`:"."))}}function Zt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Qt(e){if(sl(e.stateDir),e.stateDir=Ir(),e.cachePath=Or(e.cachePath),e.build)e.build.cacheDir=Or(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=Or(e.media.cache.directory);if(e.story)e.story.outDir=Or(e.story.outDir)}var Y=null,Z=new Map,me=new Map,ae=null;async function vi(e,t=Kt){try{return await t(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var er=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Wc(e,t){let i=w.resolve(e,{paths:[t]});if(er.test(i))throw Error(`${e} is not installed in ${t} (found only in Bun's install cache)`);return i}async function a(e){let t=e?z.resolve(e):process.cwd(),i=me.get(t);if(i&&i.signature!==Hs(i.graph)){let l=Z.get(t);if(Z.delete(t),me.delete(t),!e)Y=null,ae=null;let{clearComponentCache:d}=await import("./chunk-q3ccf7ky.js"),{partialsCache:m}=await import("./chunk-28f696hb.js");if(d(),m.clear(),l&&i.configSignature===Us(i.graph)){let p=l.then(async(g)=>{let y={...i.graph};await Si(y,t),me.set(t,{graph:y,signature:Hs(y),configSignature:Us(y)});let h={...g,_layerGraph:y};if(!e)Y=h;return h});return Z.set(t,p),p}}if(!e){if(Y)return Y;if(ae)return ae}let o=Z.get(t);if(o)return o;let r=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(z.join(t,`stx.config${v}`))),m=l.some((v)=>Q.existsSync(z.join(t,"config",`ui${v}`))),p;if(d&&m){let v=await vi({name:"ui",cwd:z.join(t,"config"),defaultConfig:q,errorPolicy:"throw",verbose:!1});p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else p=(await vi({name:"stx",alias:"ui",cwd:t,defaultConfig:q,errorPolicy:"throw",verbose:!1})).config;if(p.extends!==void 0||i){let v=await Zc(t,q);p=v.config,me.set(t,{graph:v.graph,signature:Hs(v.graph),configSignature:Us(v.graph)})}if(p.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-43kz6rx9.js");v(p.runtimeConfig,{});let{generateRuntimeConfigTypes:x}=await import("./chunk-pthvpadr.js");await x(t,p.runtimeConfig)}Zt(p),Qt(p),Sg(p,t),Xt(p,t);let g=[],y=new Set((p.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of p.componentPackages??["@stacksjs/components"]){let x=`${v}/stx-plugin`;if(y.has(x)||y.has(v))continue;try{Wc(x,t),g.push(x)}catch{}}let h=[...p.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-cqq68aw8.js"),x=[],C=[],A=new Set(p.componentPackages??["@stacksjs/components"]),P=[];for(let R of h){let _=typeof R==="string"?R:R[0],I=typeof R==="string"?{}:R[1]||{};try{let T,k;try{let S=Wc(_,t);T=await import(S),k=z.dirname(S)}catch{let S=z.resolve(t,_);T=await import(S),k=z.dirname(S)}let D=T.default||T;if(!v.has(D.name))await v.register(D,p);if(D.components){let S=Array.isArray(D.components)?D.components:[D.components],M=A.has(D.name)||A.has(_)||A.has(_.replace(/\/stx-plugin$/,""));for(let F of S){let N=z.resolve(k,F);x.push(N);let V=M;if(!V){let E=Oi(z.join(N,"package.json"));if(E)try{let L=JSON.parse(Q.readFileSync(z.join(E,"package.json"),"utf8"));V=typeof L.name==="string"&&A.has(L.name)}catch{}}if(V)C.push(N)}}if(D.pages){let S=z.resolve(k,D.pages),M=I.path||"/";P.push({dir:S,prefix:M})}if(D.setup){let S={addDirective:(M)=>{p.customDirectives=p.customDirectives||[],p.customDirectives.push(M)},addRoute:(M,F)=>{p.apiRoutes=p.apiRoutes||{},p.apiRoutes[M]=F},addMiddleware:(M)=>{p.middleware=p.middleware||[],p.middleware.push(M)},pluginDir:k,config:p};await D.setup(I,S)}process.stderr.write(`[stx] Plugin loaded: ${D.name||_}
1310
1310
  `)}catch(T){console.warn(`[stx] Failed to load plugin ${_}:`,T.message)}}p._pluginComponentDirs=x,p._componentPackageDirs=C,p._pluginPageDirs=P}if(p.nativePrimitives!==!1)p._nativePrimitivesFallback={dir:Fs(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return p})();if(Z.set(t,r),r.catch(()=>{if(Z.get(t)===r)Z.delete(t)}),!e)ae=r,r.then((l)=>{Y=l}).catch(()=>{});return r}var j=new Proxy(q,{get(e,t){if(Y&&t in Y)return Y[t];if(!ae)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[t]}});function _y(e){return e}function Cy(e){let t=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")t.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")t.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")t.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")t.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)t.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)t.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))t.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))t.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)t.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)t.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))t.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))t.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))t.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))t.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,r)=>{if(!o.name||typeof o.name!=="string")t.push({path:`customDirectives[${r}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")t.push({path:`customDirectives[${r}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))t.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,r)=>{if(!o.name||typeof o.name!=="string")t.push({path:`middleware[${r}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")t.push({path:`middleware[${r}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))t.push({path:`middleware[${r}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)t.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))t.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))t.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((r,l)=>{if(!r.pattern||typeof r.pattern!=="string")t.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(r.strategy))t.push({path:`pwa.routes[${l}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(r.maxAgeSeconds!==void 0&&(typeof r.maxAgeSeconds!=="number"||r.maxAgeSeconds<0))t.push({path:`pwa.routes[${l}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(r.maxEntries!==void 0&&(typeof r.maxEntries!=="number"||r.maxEntries<1))t.push({path:`pwa.routes[${l}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))t.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((r)=>typeof r!=="number"||r<16||r>1024).length>0)t.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((l)=>!o.includes(l)).length>0)t.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:t.length===0,errors:t,warnings:i}}
1311
1311
  export{Hc,Uc,$r,pt,Vc,Fs,zs,q,Sg,vi,Wc,a,j,_y,Cy};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Qf,eg,$e,tg,Rc,mn,hn,sy,Ac,yn,hr,ng,rg,sg,Cs,og,ig,Pc,bn,ag,wn,Ic,oy}from"./chunk-tcytjgh5.js";import"./chunk-txsre59k.js";import"./chunk-cwcmmgvz.js";import"./chunk-13awnyq0.js";import"./chunk-p8p0xs8g.js";import"./chunk-gjk0nzyy.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-b234w3mf.js";import"./chunk-snhsh171.js";import"./chunk-73py4qeh.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{hr as MODULE_SPECIFIER_PREFIX,Pc as assertBundleBuildCanSettle,Qf as bundleCacheDir,eg as bundleCacheEntryLimit,oy as bundleClientEntriesSplit,wn as bundleClientScript,hn as clearBundleFailures,$e as clientBundleDependencies,mn as getBundleFailures,yn as hasUserImports,ig as isWithinBundlerCallback,bn as moduleSubstitutionKey,rg as normalizeRegistrySpecifiers,ag as queueClientBundleBuild,Rc as recordBundleFailure,ng as registryIdForPath,Ac as resolveBundlerFallback,sg as rewriteRegistryImports,sy as setBundlerFallbackMode,tg as shouldLogBundlerDiagnostics,Ic as tempBuildName,Cs as withModuleSubstitutes,og as withinBundlerCallback};
2
+ import{Qf,eg,$e,tg,Rc,mn,hn,sy,Ac,yn,hr,ng,rg,sg,Cs,og,ig,Pc,bn,ag,wn,Ic,oy}from"./chunk-rpyhbyt7.js";import"./chunk-vr9dbmxh.js";import"./chunk-cwcmmgvz.js";import"./chunk-13awnyq0.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.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{hr as MODULE_SPECIFIER_PREFIX,Pc as assertBundleBuildCanSettle,Qf as bundleCacheDir,eg as bundleCacheEntryLimit,oy as bundleClientEntriesSplit,wn as bundleClientScript,hn as clearBundleFailures,$e as clientBundleDependencies,mn as getBundleFailures,yn as hasUserImports,ig as isWithinBundlerCallback,bn as moduleSubstitutionKey,rg as normalizeRegistrySpecifiers,ag as queueClientBundleBuild,Rc as recordBundleFailure,ng as registryIdForPath,Ac as resolveBundlerFallback,sg as rewriteRegistryImports,sy as setBundlerFallbackMode,tg as shouldLogBundlerDiagnostics,Ic as tempBuildName,Cs as withModuleSubstitutes,og as withinBundlerCallback};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{uy,fg,lt,Dc,dy,Ts,$s,Rs}from"./chunk-mv1hr9d4.js";import"./chunk-va00ve6h.js";import"./chunk-pdfnq2gs.js";import"./chunk-9bexzgws.js";import"./chunk-v0yay1kw.js";import"./chunk-snhsh171.js";import"./chunk-73py4qeh.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{dy as clearOnceStore,Dc as onceStore,lt as partialsCache,Ts as processIncludes,$s as processStackPushDirectives,Rs as processStackReplacements,uy as resetUnscopedSignalWarnings,fg as topLevelElements};
2
+ import{uy,fg,lt,Dc,dy,Ts,$s,Rs}from"./chunk-ff03ga49.js";import"./chunk-wsg1evmc.js";import"./chunk-759jwj0e.js";import"./chunk-9bexzgws.js";import"./chunk-v0yay1kw.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.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{dy as clearOnceStore,Dc as onceStore,lt as partialsCache,Ts as processIncludes,$s as processStackPushDirectives,Rs as processStackReplacements,uy as resetUnscopedSignalWarnings,fg as topLevelElements};
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import{Z}from"./chunk-13awnyq0.js";import R from"path";var B=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function ns(...d){let g=new Set;for(let l of d){if(!l||!l.includes("__stxModules["))continue;for(let e of l.matchAll(B))try{g.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...g].sort()}function $o(...d){let g=new Map,l=(e,n)=>{let o=g.get(e);if(o===null)return;if(n===null){g.set(e,null);return}let s=o??new Set;for(let i of n)s.add(i);g.set(e,s)};for(let e of d){if(!e||!e.includes("__stxModules["))continue;let n=[];for(let s of e.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${s[2]}"`)}catch{continue}n.push({variable:s[1],id:i,start:s.index+s[0].length,end:e.length})}let o=e.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(n.length===0||o!==n.length){for(let s of ns(e))l(s,null);continue}for(let[s,i]of n.entries()){let p=n.slice(s+1).find((h)=>h.variable===i.variable);i.end=p?p.start:e.length}for(let s of n){let i=new Set,p=!1,h=s.variable.replace(/[$]/g,"\\$&"),r=e.slice(s.start,s.end);for(let a of r.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=r.slice(a.index+s.variable.length,a.index+s.variable.length+200),c=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(c){i.add(c[c.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}l(s.id,p?null:i)}}return g}function k(d,g,l){let e=[],n=[];return d.forEach((o,s)=>{let i=o.startsWith("npm:")?o.slice(4):R.resolve(g,o),p=`__stxRegistered${s}`,h=JSON.stringify(o),r=l?.get(o);if(r&&[...r].every((a)=>/^[A-Za-z_$][\w$]*$/.test(a))){let a=[...r].sort(),f=a.map((m,_)=>`${m} as ${p}_${_}`);e.push(a.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let c=a.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${c} };`);return}e.push(`import * as ${p} from ${JSON.stringify(i)};`),n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...n].join(`
3
- `)}async function vm(d,g={}){if(d.length===0)return null;let l=process.cwd(),e=k(d,l,g.names),n;try{let{bundleClientScript:f}=await import("./chunk-q91hentn.js"),c=()=>f(e,R.join(l,".stx-module-registry.ts"),{projectRoot:l,minify:g.minify,externalizeUserModules:!1,collectInputs:g.collectInputs,throwOnFailure:!0});try{n=await c()}catch(m){if(!g.names)throw m;e=k(d,l,void 0),n=await c()}}catch(f){let{formatBuildFailure:c}=await import("./chunk-nrap20qt.js"),m=c(f);console.warn(`[stx] could not build the page module registry (#1957): ${m}`);let _=`[stx] the page module registry did not build, so ${d.join(", ")} cannot load (#1957): ${m}`;return`;console.error(${JSON.stringify(_)});`}let{transformAutoImports:o,generateAutoImportDestructuring:s}=await import("./chunk-581qafp7.js"),i=o(n),p=s(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-q9yahsww.js");n=h(i.code);let r=JSON.stringify(new Bun.CryptoHasher("md5").update(e).digest("hex").slice(0,12)),a=Z(n);return[a?";await (async function() {":";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${r}]) { ${a?"await __stxBundles["+r+"];":""} return; }`,a?`var __resolveBundle, __rejectBundle;
3
+ `)}async function vm(d,g={}){if(d.length===0)return null;let l=process.cwd(),e=k(d,l,g.names),n;try{let{bundleClientScript:f}=await import("./chunk-1gfc406y.js"),c=()=>f(e,R.join(l,".stx-module-registry.ts"),{projectRoot:l,minify:g.minify,externalizeUserModules:!1,collectInputs:g.collectInputs,throwOnFailure:!0});try{n=await c()}catch(m){if(!g.names)throw m;e=k(d,l,void 0),n=await c()}}catch(f){let{formatBuildFailure:c}=await import("./chunk-nrap20qt.js"),m=c(f);console.warn(`[stx] could not build the page module registry (#1957): ${m}`);let _=`[stx] the page module registry did not build, so ${d.join(", ")} cannot load (#1957): ${m}`;return`;console.error(${JSON.stringify(_)});`}let{transformAutoImports:o,generateAutoImportDestructuring:s}=await import("./chunk-6ryenxnh.js"),i=o(n),p=s(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-q9yahsww.js");n=h(i.code);let r=JSON.stringify(new Bun.CryptoHasher("md5").update(e).digest("hex").slice(0,12)),a=Z(n);return[a?";await (async function() {":";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${r}]) { ${a?"await __stxBundles["+r+"];":""} return; }`,a?`var __resolveBundle, __rejectBundle;
4
4
  __stxBundles[${r}]=new Promise(function(resolve,reject){__resolveBundle=resolve;__rejectBundle=reject;});
5
5
  __stxBundles[${r}].catch(function(){});
6
6
  try {`:`__stxBundles[${r}] = true;`,p,n,a?`__resolveBundle();
7
7
  } catch(error) { delete __stxBundles[${r}]; __rejectBundle(error); throw error; }`:"","})();"].join(`
8
8
  `)}var j=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,O=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function P(d){let g=[],l=[],e=!0,o=d.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(j,(h,r,a,f)=>{let c=`__stxChunkExports${g.length}`;if(g.push(f),l.push(`var ${c} = __stxChunk(${JSON.stringify(f)});`),a)l.push(`var ${a} = ${c};`);else if(r)for(let m of r.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){e=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){e=!1;continue}l.push(`var ${t} = ${c}[${JSON.stringify(M)}];`)}return""});if(!e)throw Error("an import it does not read");let s=[];o=o.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,r,a)=>{let f=r??a;return s.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];o=o.replace(O,(h,r)=>{for(let a of r.split(",")){let f=a.trim();if(!f)continue;let c=N.exec(f);if(!c||c[1].startsWith('"')){e=!1;continue}if(I.has(c[1]))continue;let m=c[2]??c[1];i.push([c[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(o));if(!e||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:l.join(`
9
9
  `),chunks:g,lazy:s,body:o,exports:i}}function su(d){if(/\bexport\s+(?:let|var)\b/.test(d))return!0;if(d.length/Math.max(1,d.split(`
10
- `).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function Ro(d,g={}){let l=d.filter((n)=>n.ids.length>0);if(l.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let e=process.cwd();try{let{bundleClientEntriesSplit:n}=await import("./chunk-q91hentn.js"),o=[],s=await n(new Map(l.map((t)=>[t.name,k(t.ids,e,t.names)])),{projectRoot:e,filePath:R.join(e,".stx-module-registry.ts"),collectInputs:o});g.collectInputs?.push(...o);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-581qafp7.js"),{transformStoreImports:h}=await import("./chunk-q9yahsww.js"),r=new Map;for(let[t,u]of[...s.chunks,...s.entries])try{r.set(t,P(u))}catch(x){throw Error(`cannot read ${t}: ${x instanceof Error?x.message:String(x)}`)}for(let[t,u]of[...s.chunks,...s.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of o)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&su(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let a=new Set,f=new Set,c=(t)=>{if(f.has(t))return;if(a.has(t))throw Error(`the chunks import each other (${t})`);a.add(t);for(let u of r.get(t)?.chunks??[]){if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);c(u)}for(let u of r.get(t)?.lazy??[])if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);a.delete(t),f.add(t)};for(let t of r.keys())c(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of s.chunks.keys()){let u=r.get(t),{prelude:x,body:v}=m(u),b=u.exports.map(([S,y])=>`get ${JSON.stringify(y)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
10
+ `).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function Ro(d,g={}){let l=d.filter((n)=>n.ids.length>0);if(l.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let e=process.cwd();try{let{bundleClientEntriesSplit:n}=await import("./chunk-1gfc406y.js"),o=[],s=await n(new Map(l.map((t)=>[t.name,k(t.ids,e,t.names)])),{projectRoot:e,filePath:R.join(e,".stx-module-registry.ts"),collectInputs:o});g.collectInputs?.push(...o);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-6ryenxnh.js"),{transformStoreImports:h}=await import("./chunk-q9yahsww.js"),r=new Map;for(let[t,u]of[...s.chunks,...s.entries])try{r.set(t,P(u))}catch(x){throw Error(`cannot read ${t}: ${x instanceof Error?x.message:String(x)}`)}for(let[t,u]of[...s.chunks,...s.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of o)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&su(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let a=new Set,f=new Set,c=(t)=>{if(f.has(t))return;if(a.has(t))throw Error(`the chunks import each other (${t})`);a.add(t);for(let u of r.get(t)?.chunks??[]){if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);c(u)}for(let u of r.get(t)?.lazy??[])if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);a.delete(t),f.add(t)};for(let t of r.keys())c(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of s.chunks.keys()){let u=r.get(t),{prelude:x,body:v}=m(u),b=u.exports.map(([S,y])=>`get ${JSON.stringify(y)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
11
11
  ${x}
12
12
  ${u.reads}
13
13
  ${v}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{br,i}from"./chunk-vys2c06e.js";import"./chunk-a5920t9d.js";import"./chunk-ff03ga49.js";import"./chunk-fs43342z.js";import"./chunk-wsg1evmc.js";import"./chunk-759jwj0e.js";import"./chunk-s1sm41pe.js";import"./chunk-9bexzgws.js";import"./chunk-zqvkbj0k.js";import{Pe}from"./chunk-pdvssk6k.js";import"./chunk-v0yay1kw.js";import"./chunk-ve0sbkrt.js";import"./chunk-13awnyq0.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import{Ke,lo,uo}from"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.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{br as buildModulesTag,Pe as injectRouterScript,i as processDirectives,lo as processJsonDirective,uo as processOnceDirective,Ke as validateClientScript};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ti,$i,Dt,Se,Rr,Ks,Ar,Xs,Gs,_g,Cg,Eg,Pr,Tg,$g,Rg,Ag,el,tl,nl,Ri,rl,Pg,Lt,jt,Bt,Ft,zt,Ht,ft,Ig}from"./chunk-b234w3mf.js";export{Ar as Router,Rg as abortNavigation,Ks as bracketPathToRegex,Lt as clearMiddleware,tl as createClientCookieManager,zt as createMiddlewareContext,Ft as createRouteLocation,el as createServerCookieManager,nl as createStorageManager,Ag as defineMiddleware,Cg as defineRoute,Eg as defineRoutes,Xs as findErrorPage,Gs as formatRoutes,$i as generateRouteManifest,Ti as generateRouteTypes,rl as getMiddleware,jt as getMiddlewareNames,ft as getRouterScript,Ig as getRouterScriptDev,Pg as hasMiddleware,Dt as isFileRequestPath,Bt as loadMiddlewareFromDirectory,Rr as matchRoute,$g as navigateTo,Se as patternToRegex,Ri as registerMiddleware,Tg as resetRoutes,Pr as route,Ht as runMiddleware,_g as setAppUrl};
2
+ import{Ti,$i,Dt,Se,Rr,Ks,Ar,Xs,Gs,_g,Cg,Eg,Pr,Tg,$g,Rg,Ag,el,tl,nl,Ri,rl,Pg,Lt,jt,Bt,Ft,zt,Ht,ft,Ig}from"./chunk-9gptdyqq.js";export{Ar as Router,Rg as abortNavigation,Ks as bracketPathToRegex,Lt as clearMiddleware,tl as createClientCookieManager,zt as createMiddlewareContext,Ft as createRouteLocation,el as createServerCookieManager,nl as createStorageManager,Ag as defineMiddleware,Cg as defineRoute,Eg as defineRoutes,Xs as findErrorPage,Gs as formatRoutes,$i as generateRouteManifest,Ti as generateRouteTypes,rl as getMiddleware,jt as getMiddlewareNames,ft as getRouterScript,Ig as getRouterScriptDev,Pg as hasMiddleware,Dt as isFileRequestPath,Bt as loadMiddlewareFromDirectory,Rr as matchRoute,$g as navigateTo,Se as patternToRegex,Ri as registerMiddleware,Tg as resetRoutes,Pr as route,Ht as runMiddleware,_g as setAppUrl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{mh,Ka,Uu,hh,yh,bh,wh,vh,Vu,Wu,xh,Sh,kh,_h}from"./chunk-ypy1k5t0.js";import"./chunk-vys2c06e.js";import"./chunk-a5920t9d.js";import"./chunk-ff03ga49.js";import"./chunk-fs43342z.js";import"./chunk-wsg1evmc.js";import"./chunk-759jwj0e.js";import"./chunk-s1sm41pe.js";import"./chunk-9bexzgws.js";import"./chunk-zqvkbj0k.js";import"./chunk-pdvssk6k.js";import"./chunk-v0yay1kw.js";import"./chunk-ve0sbkrt.js";import"./chunk-13awnyq0.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.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{Uu as SUSPENSE_RESOLVER_RUNTIME,Ka as buildSuspenseResolveScript,vh as createStreamRenderer,bh as extractStreamBoundaries,_h as generateHydrationRuntime,Wu as islandDirective,Sh as processSectionDirectives,yh as processStreamDirectives,xh as registerStreamingDirectives,hh as renderStreamingPage,mh as streamTemplate,wh as streamTemplateSimple,kh as streamToResponse,Vu as streamingSuspenseDirective};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Oe,Vi,Wi,Fg,Gt,_l,zg,Cl,Py,Ge,In,Je}from"./chunk-snhsh171.js";import"./chunk-73py4qeh.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import{Hl,t}from"./chunk-ahf9j8wb.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Oe as BROWSER_CORE_IMPORTS,Fg as STX_AUTO_IMPORTS,Vi as extractAndStripCssImports,Ge as extractBridgeData,Hl as findInterpolationEnd,Cl as generateAutoImportDestructuring,Py as generateBrowserAutoImportDestructuring,In as generateServerDataBridge,Gt as injectBrowserCoreAutoImports,Je as processClientScript,zg as referencesName,Wi as renderVendorStyleTags,t as stripCommentsAndLiterals,_l as transformAutoImports};
2
+ import{Oe,Vi,Wi,Fg,Gt,_l,zg,Cl,Py,Ge,In,Je}from"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import{Hl,t}from"./chunk-ahf9j8wb.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Oe as BROWSER_CORE_IMPORTS,Fg as STX_AUTO_IMPORTS,Vi as extractAndStripCssImports,Ge as extractBridgeData,Hl as findInterpolationEnd,Cl as generateAutoImportDestructuring,Py as generateBrowserAutoImportDestructuring,In as generateServerDataBridge,Gt as injectBrowserCoreAutoImports,Je as processClientScript,zg as referencesName,Wi as renderVendorStyleTags,t as stripCommentsAndLiterals,_l as transformAutoImports};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Y}from"./chunk-cxzy7kxg.js";function r(t){return Y(t)}
3
+ export{r};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ai,ci,li,py,As,fy}from"./chunk-va00ve6h.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-wsg1evmc.js";export{As as clearImageDeliveryCatalog,py as deliveredImage,li as efficientDeliverySources,ai as getImageDelivery,ci as isTransparentImage,fy as prepareImageDelivery};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Tm}from"./chunk-9ejbveb6.js";import"./chunk-vys2c06e.js";import"./chunk-a5920t9d.js";import"./chunk-ff03ga49.js";import"./chunk-fs43342z.js";import"./chunk-wsg1evmc.js";import"./chunk-759jwj0e.js";import"./chunk-s1sm41pe.js";import"./chunk-9bexzgws.js";import"./chunk-zqvkbj0k.js";import"./chunk-pdvssk6k.js";import"./chunk-v0yay1kw.js";import"./chunk-ve0sbkrt.js";import"./chunk-13awnyq0.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.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{Tm as startInteractive};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{wg,yy,by,wy,vy,vg,xg,xy,Sy,wi,ky,Er,Tr,Bs}from"./chunk-fkm2bf2x.js";import{gt}from"./chunk-zkwkhesc.js";import"./chunk-snhsh171.js";import"./chunk-73py4qeh.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{vy as __setSignalsGeneratorsForTest,gt as cacheEngineFingerprint,Tr as cacheTemplate,Er as checkCache,ky as clearDevCaches,xg as getCachedRouterScript,vg as getCachedSignalsRuntime,xy as getServeClientAsset,wi as getServeModuleBundle,Bs as hashFilePath,by as invalidateFileCache,wy as invalidateFileCacheByDir,yy as readFileCached,Sy as registerServeModuleBundle,wg as templateCache};
2
+ import{wg,yy,by,wy,vy,vg,xg,xy,Sy,wi,ky,Er,Tr,Bs}from"./chunk-ve0sbkrt.js";import{gt}from"./chunk-zkwkhesc.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.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{vy as __setSignalsGeneratorsForTest,gt as cacheEngineFingerprint,Tr as cacheTemplate,Er as checkCache,ky as clearDevCaches,xg as getCachedRouterScript,vg as getCachedSignalsRuntime,xy as getServeClientAsset,wi as getServeModuleBundle,Bs as hashFilePath,by as invalidateFileCache,wy as invalidateFileCacheByDir,yy as readFileCached,Sy as registerServeModuleBundle,wg as templateCache};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-0jdz31q1.js";import"./chunk-c08jvjqt.js";import"./chunk-4b110x6r.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-snhsh171.js";import"./chunk-w98yt4d4.js";import"./chunk-73py4qeh.js";import"./chunk-razwegar.js";import"./chunk-gjk0nzyy.js";import{l}from"./chunk-w4177qn3.js";import u from"fs";import m from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||l(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=m.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),c=JSON.parse(p);if(c.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(c.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
2
+ import"./chunk-0jdz31q1.js";import"./chunk-c08jvjqt.js";import"./chunk-4b110x6r.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-cxzy7kxg.js";import"./chunk-w98yt4d4.js";import"./chunk-d2rwg24x.js";import"./chunk-razwegar.js";import"./chunk-zytwcfbt.js";import{l}from"./chunk-w4177qn3.js";import u from"fs";import m from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||l(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=m.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),c=JSON.parse(p);if(c.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(c.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
3
3
  `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{P}from"./chunk-snhsh171.js";import{i}from"./chunk-r8gv2pcy.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
2
+ import{P}from"./chunk-cxzy7kxg.js";import{i}from"./chunk-vys2c06e.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}
@@ -1,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)}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{vs,xs}from"./chunk-wbsbrm6n.js";import{x}from"./chunk-snhsh171.js";import{a}from"./chunk-p8p0xs8g.js";import{it,fe}from"./chunk-0vyytd9v.js";import{_c}from"./chunk-tszsy2pv.js";import{W}from"./chunk-1jxkc6d0.js";import{w}from"./chunk-v6gkjg5f.js";import{f}from"./chunk-8tfpv6zf.js";import{existsSync as z,mkdirSync as C,copyFileSync as I,chmodSync as B,rmSync as xe}from"fs";import{join as c,basename as ye,resolve as K}from"path";import{spawn as _}from"child_process";import{platform as Se}from"os";function O(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=x(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var qu=`
2
+ import{vs,xs}from"./chunk-wbsbrm6n.js";import{x}from"./chunk-cxzy7kxg.js";import{a}from"./chunk-03sqt4jx.js";import{it,fe}from"./chunk-0vyytd9v.js";import{_c}from"./chunk-q3smaxw7.js";import{W}from"./chunk-1jxkc6d0.js";import{w}from"./chunk-v6gkjg5f.js";import{f}from"./chunk-8tfpv6zf.js";import{existsSync as z,mkdirSync as C,copyFileSync as I,chmodSync as B,rmSync as xe}from"fs";import{join as c,basename as ye,resolve as K}from"path";import{spawn as _}from"child_process";import{platform as Se}from"os";function O(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=x(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var qu=`
3
3
  <script>
4
4
  (function() {
5
5
  'use strict';
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import{k,E,zi,Rn}from"./chunk-snhsh171.js";import{wi}from"./chunk-fkm2bf2x.js";import{l}from"./chunk-w4177qn3.js";import{L,f}from"./chunk-8tfpv6zf.js";import M from"fs";import d from"path";import{hasLocalConfig as ye}from"bunfig";var It={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function at(n){return`--stx-${n}`}function H(n,t){let s=t.lastIndexOf("-");if(s===-1)return typeof n[t]==="string"?n[t]:void 0;let r=n[t.slice(0,s)];if(!r||typeof r!=="object")return;let i=r[t.slice(s+1)];return typeof i==="string"?i:void 0}var $e=/^(?:#[\da-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|var)\(.*\)|white|black|transparent|currentcolor)$/i;function te(n,t){let s=t.trim();return H(n,s)??($e.test(s)?s:void 0)}function ne(n={}){return[...Object.keys(n.roles??{}).filter((t)=>!It[t]).map((t)=>`roles.${t}`),...Object.keys(n.shapes??{}).filter((t)=>!Re[t]).map((t)=>`shapes.${t}`),...Object.keys(n.density??{}).filter((t)=>!Ve[t]).map((t)=>`density.${t}`)]}function se(n){let t={};for(let[s,r]of Object.entries(It)){let i=H(n,r.light);if(i===void 0)continue;t[s]=`var(${at(s)}, ${i})`}return t}function re(n,t={}){let s=[],r=[];for(let[i,c]of Object.entries(It)){let o=t[i],g=typeof o==="string"?o:o?.light,a=typeof o==="string"?o:o?.dark,u=g&&te(n,g)||H(n,c.light),m=a&&te(n,a)||H(n,c.dark);if(u===void 0)continue;if(s.push(` ${at(i)}: ${u};`),m!==void 0)r.push(` ${at(i)}: ${m};`)}if(s.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...s,"}",".dark {",...r,"}",""].join(`
2
+ import{k,E,zi,Rn}from"./chunk-cxzy7kxg.js";import{wi}from"./chunk-ve0sbkrt.js";import{l}from"./chunk-w4177qn3.js";import{L,f}from"./chunk-8tfpv6zf.js";import M from"fs";import d from"path";import{hasLocalConfig as ye}from"bunfig";var It={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function at(n){return`--stx-${n}`}function H(n,t){let s=t.lastIndexOf("-");if(s===-1)return typeof n[t]==="string"?n[t]:void 0;let r=n[t.slice(0,s)];if(!r||typeof r!=="object")return;let i=r[t.slice(s+1)];return typeof i==="string"?i:void 0}var $e=/^(?:#[\da-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|var)\(.*\)|white|black|transparent|currentcolor)$/i;function te(n,t){let s=t.trim();return H(n,s)??($e.test(s)?s:void 0)}function ne(n={}){return[...Object.keys(n.roles??{}).filter((t)=>!It[t]).map((t)=>`roles.${t}`),...Object.keys(n.shapes??{}).filter((t)=>!Re[t]).map((t)=>`shapes.${t}`),...Object.keys(n.density??{}).filter((t)=>!Ve[t]).map((t)=>`density.${t}`)]}function se(n){let t={};for(let[s,r]of Object.entries(It)){let i=H(n,r.light);if(i===void 0)continue;t[s]=`var(${at(s)}, ${i})`}return t}function re(n,t={}){let s=[],r=[];for(let[i,c]of Object.entries(It)){let o=t[i],g=typeof o==="string"?o:o?.light,a=typeof o==="string"?o:o?.dark,u=g&&te(n,g)||H(n,c.light),m=a&&te(n,a)||H(n,c.dark);if(u===void 0)continue;if(s.push(` ${at(i)}: ${u};`),m!==void 0)r.push(` ${at(i)}: ${m};`)}if(s.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...s,"}",".dark {",...r,"}",""].join(`
3
3
  `)}var Re={control:{value:"0.375rem",description:"Buttons, inputs, selects \u2014 rounded-md"},panel:{value:"0.5rem",description:"Cards, dialogs, menus \u2014 rounded-lg"},pill:{value:"9999px",description:"Chips and badges, which are pill-shaped by intent"}};function xn(n){return`--stx-radius-${n}`}function ie(){let n={};for(let[t,s]of Object.entries(Re))n[t]=`var(${xn(t)}, ${s.value})`;return n}function oe(n={}){return["/* stx shape tokens \u2014 a radius by what the thing is. */",":root {",...Object.entries(Re).map(([t,s])=>` ${xn(t)}: ${n[t]??s.value};`),"}",""].join(`
4
4
  `)}var Ve={"control-px":{value:"1rem",description:"Inline padding of a md text control \u2014 px-4"},"control-py":{value:"0.5rem",description:"Block padding of a md text control \u2014 py-2"},"control-text":{value:"1rem",description:"Font size of a md text control \u2014 text-base"},"control-leading":{value:"1.5rem",description:"Line height of a md text control \u2014 text-base"},"cell-px":{value:"1.5rem",description:"Inline padding of every table cell, header or body \u2014 px-6"},"cell-py":{value:"1rem",description:"Block padding of a body cell \u2014 py-4"},"cell-text":{value:"0.875rem",description:"Font size of a body cell \u2014 text-sm"},"cell-leading":{value:"1.25rem",description:"Line height of a body cell \u2014 text-sm"},"cell-head-py":{value:"0.75rem",description:"Block padding of a header cell \u2014 py-3"},"cell-head-text":{value:"0.75rem",description:"Font size of a header cell \u2014 text-xs"},"cell-head-leading":{value:"1rem",description:"Line height of a header cell \u2014 text-xs"}},wr={"control-x":"control-px","control-y":"control-py","cell-x":"cell-px","cell-y":"cell-py","cell-head-y":"cell-head-py"},vr={control:{size:"control-text",leading:"control-leading"},cell:{size:"cell-text",leading:"cell-leading"},"cell-head":{size:"cell-head-text",leading:"cell-head-leading"}};function ct(n){return`--stx-${n}`}function Y(n){let t=Ve[n];if(!t)throw Error(`[stx] unknown density token "${n}"`);return`var(${ct(n)}, ${t.value})`}function ce(){let n={};for(let[t,s]of Object.entries(wr))n[t]=Y(s);return n}function ae(){let n={};for(let[t,{size:s,leading:r}]of Object.entries(vr))n[t]=[Y(s),{lineHeight:Y(r)}];return n}function le(n={}){return["/* stx density tokens \u2014 how much room a control or a table cell takes. */",":root {",...Object.entries(Ve).map(([t,s])=>` ${ct(t)}: ${n[t]??s.value};`),"}",""].join(`
5
5
  `)}function de(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function J(n,t){let s={...n};for(let[r,i]of Object.entries(t))s[r]=de(i)&&de(s[r])?J(s[r],i):i;return s}function ge(n,t){if(!t.fonts)return"";let s=new n({...t.config,fonts:t.fonts,cssVariables:!1}).toCSS(!1,t.minify);return s&&!t.minify?`${s}
6
- `:s}function fe(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...c}=r,{extend:o,...g}=s,a=g.colors||{};g.colors={...a,...se(a)};let u=g.borderRadius||{};g.borderRadius={...u,...ie()};let m=g.spacing||{};g.spacing={...m,...ce()};let P=g.fontSize||{};g.fontSize={...P,...ae()};let D=J(g,c),O=J(o||{},i||{});if(Object.keys(O).length>0)D.extend=O;let y=[...n.safelist||[],...t.safelist||[]],I={...n.shortcuts||{},...t.shortcuts||{}},_=[...n.preflights||[],...t.preflights||[]],{fonts:z,...Q}=n,{fonts:N,roles:R,shapes:T,density:A,...w}=t,b={roles:R,shapes:T,density:A},p=N??z;return{config:{...Q,...w,theme:D,safelist:y,shortcuts:I,..._.length>0?{preflights:_}:{},content:[],output:""},safelist:y,shortcuts:I,includePreflight:t.preflight!==!1,minify:t.minify===!0,tokenCSS:re({...a,...D.colors},R)+oe(T)+le(A),unknownRoles:ne(b),...p?{fonts:p}:{}}}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import j from"fs";import Te from"path";var je=256,x=new Map,ue=(n)=>Bun.hash(n).toString(16).padStart(16,"0").slice(0,16),pe=(n)=>l(process.cwd(),"css-assets",`${n}.css`);function K(n,t){if(x.delete(n),x.set(n,t),x.size>je)x.delete(x.keys().next().value)}function he(n){let t=ue(n),s=pe(t);if(x.has(s))return K(s,n),t;let r;try{let i;try{i=j.readFileSync(s,"utf8")}catch{}if(i!==n)j.mkdirSync(Te.dirname(s),{recursive:!0}),r=`${s}.${process.pid}.${crypto.randomUUID()}.tmp`,j.writeFileSync(r,n,{flag:"wx"}),j.renameSync(r,s);return K(s,n),t}catch{return}finally{if(r)try{j.unlinkSync(r)}catch{}}}function cg(n){if(!/^[a-f0-9]{16}$/.test(n))return;let t=pe(n),s=x.get(t);if(s!==void 0)return K(t,s),s;try{let r=j.readFileSync(t,"utf8");if(ue(r)!==n)return;return K(t,r),r}catch{return}}function me(){x.clear()}var h=null,U="";function xe(n){try{let t=n.startsWith("file:")?new URL(n).pathname:n;U=`${t}@${Math.trunc(M.statSync(t).mtimeMs)}`}catch{U=n}}var Z=!1,v=null,F="",B=!1,Be=256,Ee="sorted",C=new Map,V=null,we=null,W=new Map,ke=new Set;function ee(n){return Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)}function X(n,t){if(C.has(n))C.delete(n);else if(C.size>=Be)C.delete(C.keys().next().value);C.set(n,t)}async function Pe(n,t=V){if(!t)return null;try{let s=Bun.file(d.join(t,`cw-${ee(n)}.css`));if(!await s.exists())return null;return await s.text()}catch{return null}}async function De(n,t,s=V){if(!s)return;try{if(!M.existsSync(s))M.mkdirSync(s,{recursive:!0});await Bun.write(d.join(s,`cw-${ee(n)}.css`),t)}catch{}}async function Ce(n){try{let t=await import(n);if(t&&t.CSSGenerator)return{CSSGenerator:t.CSSGenerator,config:t.config,build:t.build,defaultConfig:t.defaultConfig,extractClasses:t.extractClasses}}catch{}return null}var Oe=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],Ie=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function Ne(){let n=[],t=process.cwd();while(t!==d.dirname(t)){for(let s of["node_modules","pantry"])for(let r of Oe)n.push(d.join(t,s,...r));t=d.dirname(t)}return n}function Ae(){let n=[],t=process.env.HOME||process.env.USERPROFILE||"",s=[t&&d.join(t,"Code","Tools","ts-css"),t&&d.join(t,"Code","Tools","crosswind"),t&&d.join(t,"repos","stacks-org","ts-css"),t&&d.join(t,"repos","stacks-org","crosswind"),d.join(process.cwd(),"..","ts-css"),d.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let r of s)n.push(d.join(r,"packages","toolkit","dist","engine","index.js")),n.push(d.join(r,"packages","toolkit","src","engine","index.ts"));if(t)n.push(d.join(t,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return n}async function Nc(){if(Z)return h;Z=!0;try{let n=async(i)=>{for(let c of i){if(!await Bun.file(c).exists())continue;let o=await Ce(c);if(o){if(xe(c),!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${d.dirname(d.dirname(c))}`);return o}}return null};if(process.env.CROSSWIND_SRC){let i=d.resolve(process.env.CROSSWIND_SRC),c=await n([i]);if(!c)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return h=c,h}let t=await n(Ne());if(t)return h=t,h;let s=Ie;for(let i of s){let c=await Ce(i);if(c){h=c;try{xe(import.meta.resolve(i))}catch{U=i}if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return h}}let r=await n(Ae());if(r)return h=r,h;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function ay(){q.clear(),h=null,Z=!1,v=null,F="",C.clear(),me(),we=null,W.clear()}var Se=!1;async function Mc(n){try{let t=ye({name:"css",cwd:n})?"css":ye({name:"crosswind",cwd:n})?"crosswind":null;if(!t)return null;if(t==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!Se)Se=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:s}=await import("bunfig"),r=await s({name:t,cwd:n,defaultConfig:{},checkEnv:!1,verbose:!1});if(!r?.path||!r.config||Object.keys(r.config).length===0)return null;let i=d.relative(n,r.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||r.path}`);return r.config}catch(t){if(t instanceof Error&&t.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,t instanceof Error?t.message:t),null}}async function lg(n){let t=null;try{let{loadStxConfig:s}=await import("./chunk-tktgaz78.js"),r=await s(n);if(r.css)if(typeof r.css==="string"){let i=d.isAbsolute(r.css)?r.css:d.resolve(n,r.css);if(await Bun.file(i).exists()){let c=await import(i);t=c.default||c,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${r.css}`)}}else{if(t={...r.css,content:r.css.content||[],preflight:r.css.preflight??!0,minify:r.css.minify??!1},r.css.config){let i=d.isAbsolute(r.css.config)?r.css.config:d.resolve(n,r.css.config);if(await Bun.file(i).exists()){let c=await import(i);t={...c.default||c,...t}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return t||await Mc(n)}function ug(n){try{let t=new WeakSet;return ee(JSON.stringify(n??{},(s,r)=>{if(typeof r==="function")return`[fn]${String(r)}`;if(typeof r==="object"&&r!==null){if(t.has(r))return"[circular]";t.add(r)}return r})??"")}catch{return"unhashable"}}async function Sn(n){if(B)return F;B=!0;try{let t=await Nc();if(!t||!t.build)return B=!1,"";if(!v)v=await Mc(n);if(!v)return B=!1,"";let s=t.defaultConfig?.theme||{},r=v.theme||{},i={...t.defaultConfig,...v,theme:{...s,...r,extend:{...s.extend||{},...r.extend||{}}}},c=performance.now(),o=await t.build(i),g=performance.now()-c;if(F=o.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${o.classes.size} classes in ${g.toFixed(1)}ms`),i.output){let a=d.isAbsolute(i.output)?i.output:d.join(n,i.output),u=d.dirname(a);if(!M.existsSync(u))M.mkdirSync(u,{recursive:!0});await Bun.write(a,o.css)}return B=!1,o.css}catch(t){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,t),B=!1,F}}async function xr(n){v=null,await Sn(n)}function cy(){return F}function dg(n){let t=new Set,s=/class\s*=\s*["']([^"']+)["']/gi,r=s.exec(n);while(r!==null){for(let o of r[1].split(/\s+/))if(o.trim())t.add(o.trim());r=s.exec(n)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,c=i.exec(n);while(c!==null){let o=c[1].match(/'([^']+)'/g);if(o){for(let g of o)for(let a of g.slice(1,-1).split(/\s+/))if(a.trim())t.add(a.trim())}c=i.exec(n)}return t}var q=k(64);async function pg(n,t){let s=()=>W.get(t?d.resolve(t):process.cwd())?.fingerprint??null,r=q.get(E(n,t,s()));if(r!==void 0)return r;let i=await Fe(n,t);if(i)q.set(E(n,t,s()),i);return i}function*be(n){yield n;let t=new Set;for(let s of n.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)){let r=s[1];if(t.has(r))continue;t.add(r);let i=wi(r);if(i)yield i}}function ly(n){return[...be(n)].join(`
6
+ `:s}function fe(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...c}=r,{extend:o,...g}=s,a=g.colors||{};g.colors={...a,...se(a)};let u=g.borderRadius||{};g.borderRadius={...u,...ie()};let m=g.spacing||{};g.spacing={...m,...ce()};let P=g.fontSize||{};g.fontSize={...P,...ae()};let D=J(g,c),O=J(o||{},i||{});if(Object.keys(O).length>0)D.extend=O;let y=[...n.safelist||[],...t.safelist||[]],I={...n.shortcuts||{},...t.shortcuts||{}},_=[...n.preflights||[],...t.preflights||[]],{fonts:z,...Q}=n,{fonts:N,roles:R,shapes:T,density:A,...w}=t,b={roles:R,shapes:T,density:A},p=N??z;return{config:{...Q,...w,theme:D,safelist:y,shortcuts:I,..._.length>0?{preflights:_}:{},content:[],output:""},safelist:y,shortcuts:I,includePreflight:t.preflight!==!1,minify:t.minify===!0,tokenCSS:re({...a,...D.colors},R)+oe(T)+le(A),unknownRoles:ne(b),...p?{fonts:p}:{}}}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import j from"fs";import Te from"path";var je=256,x=new Map,ue=(n)=>Bun.hash(n).toString(16).padStart(16,"0").slice(0,16),pe=(n)=>l(process.cwd(),"css-assets",`${n}.css`);function K(n,t){if(x.delete(n),x.set(n,t),x.size>je)x.delete(x.keys().next().value)}function he(n){let t=ue(n),s=pe(t);if(x.has(s))return K(s,n),t;let r;try{let i;try{i=j.readFileSync(s,"utf8")}catch{}if(i!==n)j.mkdirSync(Te.dirname(s),{recursive:!0}),r=`${s}.${process.pid}.${crypto.randomUUID()}.tmp`,j.writeFileSync(r,n,{flag:"wx"}),j.renameSync(r,s);return K(s,n),t}catch{return}finally{if(r)try{j.unlinkSync(r)}catch{}}}function cg(n){if(!/^[a-f0-9]{16}$/.test(n))return;let t=pe(n),s=x.get(t);if(s!==void 0)return K(t,s),s;try{let r=j.readFileSync(t,"utf8");if(ue(r)!==n)return;return K(t,r),r}catch{return}}function me(){x.clear()}var h=null,U="";function xe(n){try{let t=n.startsWith("file:")?new URL(n).pathname:n;U=`${t}@${Math.trunc(M.statSync(t).mtimeMs)}`}catch{U=n}}var Z=!1,v=null,F="",B=!1,Be=256,Ee="sorted",C=new Map,V=null,we=null,W=new Map,ke=new Set;function ee(n){return Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)}function X(n,t){if(C.has(n))C.delete(n);else if(C.size>=Be)C.delete(C.keys().next().value);C.set(n,t)}async function Pe(n,t=V){if(!t)return null;try{let s=Bun.file(d.join(t,`cw-${ee(n)}.css`));if(!await s.exists())return null;return await s.text()}catch{return null}}async function De(n,t,s=V){if(!s)return;try{if(!M.existsSync(s))M.mkdirSync(s,{recursive:!0});await Bun.write(d.join(s,`cw-${ee(n)}.css`),t)}catch{}}async function Ce(n){try{let t=await import(n);if(t&&t.CSSGenerator)return{CSSGenerator:t.CSSGenerator,config:t.config,build:t.build,defaultConfig:t.defaultConfig,extractClasses:t.extractClasses}}catch{}return null}var Oe=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],Ie=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function Ne(){let n=[],t=process.cwd();while(t!==d.dirname(t)){for(let s of["node_modules","pantry"])for(let r of Oe)n.push(d.join(t,s,...r));t=d.dirname(t)}return n}function Ae(){let n=[],t=process.env.HOME||process.env.USERPROFILE||"",s=[t&&d.join(t,"Code","Tools","ts-css"),t&&d.join(t,"Code","Tools","crosswind"),t&&d.join(t,"repos","stacks-org","ts-css"),t&&d.join(t,"repos","stacks-org","crosswind"),d.join(process.cwd(),"..","ts-css"),d.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let r of s)n.push(d.join(r,"packages","toolkit","dist","engine","index.js")),n.push(d.join(r,"packages","toolkit","src","engine","index.ts"));if(t)n.push(d.join(t,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return n}async function Nc(){if(Z)return h;Z=!0;try{let n=async(i)=>{for(let c of i){if(!await Bun.file(c).exists())continue;let o=await Ce(c);if(o){if(xe(c),!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${d.dirname(d.dirname(c))}`);return o}}return null};if(process.env.CROSSWIND_SRC){let i=d.resolve(process.env.CROSSWIND_SRC),c=await n([i]);if(!c)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return h=c,h}let t=await n(Ne());if(t)return h=t,h;let s=Ie;for(let i of s){let c=await Ce(i);if(c){h=c;try{xe(import.meta.resolve(i))}catch{U=i}if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return h}}let r=await n(Ae());if(r)return h=r,h;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function ay(){q.clear(),h=null,Z=!1,v=null,F="",C.clear(),me(),we=null,W.clear()}var Se=!1;async function Mc(n){try{let t=ye({name:"css",cwd:n})?"css":ye({name:"crosswind",cwd:n})?"crosswind":null;if(!t)return null;if(t==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!Se)Se=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:s}=await import("bunfig"),r=await s({name:t,cwd:n,defaultConfig:{},checkEnv:!1,verbose:!1});if(!r?.path||!r.config||Object.keys(r.config).length===0)return null;let i=d.relative(n,r.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||r.path}`);return r.config}catch(t){if(t instanceof Error&&t.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,t instanceof Error?t.message:t),null}}async function lg(n){let t=null;try{let{loadStxConfig:s}=await import("./chunk-gmk82cm4.js"),r=await s(n);if(r.css)if(typeof r.css==="string"){let i=d.isAbsolute(r.css)?r.css:d.resolve(n,r.css);if(await Bun.file(i).exists()){let c=await import(i);t=c.default||c,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${r.css}`)}}else{if(t={...r.css,content:r.css.content||[],preflight:r.css.preflight??!0,minify:r.css.minify??!1},r.css.config){let i=d.isAbsolute(r.css.config)?r.css.config:d.resolve(n,r.css.config);if(await Bun.file(i).exists()){let c=await import(i);t={...c.default||c,...t}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return t||await Mc(n)}function ug(n){try{let t=new WeakSet;return ee(JSON.stringify(n??{},(s,r)=>{if(typeof r==="function")return`[fn]${String(r)}`;if(typeof r==="object"&&r!==null){if(t.has(r))return"[circular]";t.add(r)}return r})??"")}catch{return"unhashable"}}async function Sn(n){if(B)return F;B=!0;try{let t=await Nc();if(!t||!t.build)return B=!1,"";if(!v)v=await Mc(n);if(!v)return B=!1,"";let s=t.defaultConfig?.theme||{},r=v.theme||{},i={...t.defaultConfig,...v,theme:{...s,...r,extend:{...s.extend||{},...r.extend||{}}}},c=performance.now(),o=await t.build(i),g=performance.now()-c;if(F=o.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${o.classes.size} classes in ${g.toFixed(1)}ms`),i.output){let a=d.isAbsolute(i.output)?i.output:d.join(n,i.output),u=d.dirname(a);if(!M.existsSync(u))M.mkdirSync(u,{recursive:!0});await Bun.write(a,o.css)}return B=!1,o.css}catch(t){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,t),B=!1,F}}async function xr(n){v=null,await Sn(n)}function cy(){return F}function dg(n){let t=new Set,s=/class\s*=\s*["']([^"']+)["']/gi,r=s.exec(n);while(r!==null){for(let o of r[1].split(/\s+/))if(o.trim())t.add(o.trim());r=s.exec(n)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,c=i.exec(n);while(c!==null){let o=c[1].match(/'([^']+)'/g);if(o){for(let g of o)for(let a of g.slice(1,-1).split(/\s+/))if(a.trim())t.add(a.trim())}c=i.exec(n)}return t}var q=k(64);async function pg(n,t){let s=()=>W.get(t?d.resolve(t):process.cwd())?.fingerprint??null,r=q.get(E(n,t,s()));if(r!==void 0)return r;let i=await Fe(n,t);if(i)q.set(E(n,t,s()),i);return i}function*be(n){yield n;let t=new Set;for(let s of n.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)){let r=s[1];if(t.has(r))continue;t.add(r);let i=wi(r);if(i)yield i}}function ly(n){return[...be(n)].join(`
7
7
  `)}async function Fe(n,t){try{let s=await Nc();if(!s)return"";let r=new Set;for(let p of be(n)){let G=typeof s.extractClasses==="function"?s.extractClasses(p):dg(p);for(let ve of G)r.add(ve)}if(r.size===0)return"";let i=t?d.resolve(t):process.cwd(),c=l(i,"cache");if(!V)V=c;let o=W.get(i);if(!o){let p=await lg(i);o={config:p,fingerprint:ug(p)},W.set(i,o),we=o.fingerprint}let g=[...r].sort(),a=g.join(" "),u=`${Ee}::${U}::${o.fingerprint||"default"}::${a}`,m=C.get(u);if(m!==void 0)return X(u,m),m;let P=await Pe(u,c);if(P!==null)return X(u,P),P;let D=s.defaultConfig||s.config,O=o.config||{},y=fe(D,O),{safelist:I,includePreflight:_,minify:z,tokenCSS:Q}=y;if(y.unknownRoles.length>0&&!ke.has(i))ke.add(i),console.warn(`${e.yellow}[ts-css]${e.reset} No stx role for ${y.unknownRoles.join(", ")} - these keep the stock value. Role names: semanticTokenNames() in @stacksjs/stx/theme-tokens.`);let N=y.config,R=new s.CSSGenerator(N),T=N.shortcuts||O.shortcuts||{},A=Object.keys(T).filter((p)=>r.has(p)||I.includes(p));for(let p of I)if(!T[p])R.generate(p);for(let p of g)if(!T[p])R.generate(p);let w="";if(A.length>0){let p=new s.CSSGenerator(N);for(let G of A)p.generate(G);if(w=p.toCSS(!1,z),w&&!w.endsWith(`
8
8
  `))w+=`
9
9
  `}let b=w+R.toCSS(_,z);return b=ge(s.CSSGenerator,y)+Q+b,X(u,b),De(u,b,c),b}catch(s){return console.warn("Failed to generate Css CSS:",s),""}}async function S(n,t,s=!1,r=!1){let i=await pg(n,t);if(!i)return r?Rn(n):n;let c=s?he(i):void 0,o=c?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${c}.css">`:`<style data-css="generated">
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Bh,Ho,Fh,zh,Hh,Uh}from"./chunk-3khg2ats.js";import"./chunk-tcytjgh5.js";import"./chunk-txsre59k.js";import"./chunk-cwcmmgvz.js";import"./chunk-m2t2gpjb.js";import"./chunk-66tpsdpm.js";import"./chunk-v0yay1kw.js";import"./chunk-13awnyq0.js";import"./chunk-p8p0xs8g.js";import"./chunk-gjk0nzyy.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-b234w3mf.js";import"./chunk-snhsh171.js";import"./chunk-73py4qeh.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{Uh as clearStoreCache,Bh as getStoreScript,Hh as getStoreScriptFor,zh as pageStoresAll,Ho as storesRead,Fh as storesReadInFiles};
2
+ import{Bh,Ho,Fh,zh,Hh,Uh}from"./chunk-vhk5m98x.js";import"./chunk-rpyhbyt7.js";import"./chunk-vr9dbmxh.js";import"./chunk-cwcmmgvz.js";import"./chunk-zqvkbj0k.js";import"./chunk-pdvssk6k.js";import"./chunk-v0yay1kw.js";import"./chunk-13awnyq0.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.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{Uh as clearStoreCache,Bh as getStoreScript,Hh as getStoreScriptFor,zh as pageStoresAll,Ho as storesRead,Fh as storesReadInFiles};