@stacksjs/stx 0.2.238 → 0.2.239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-dzr5w33y.js → chunk-04tp3hjf.js} +3 -3
- package/dist/{chunk-gcn830km.js → chunk-0prbc65y.js} +1 -1
- package/dist/{chunk-gg2epwyx.js → chunk-5kmwyys8.js} +1 -1
- package/dist/{chunk-cdb8a0tx.js → chunk-9778d23n.js} +1 -1
- package/dist/{chunk-ssbddr82.js → chunk-csjhh5t2.js} +1 -1
- package/dist/{chunk-y805f58c.js → chunk-h3paff80.js} +1 -1
- package/dist/{chunk-7rfx2s7c.js → chunk-hr7hvaf0.js} +1 -1
- package/dist/{chunk-89nbkhxk.js → chunk-jz3cjfz1.js} +1 -1
- package/dist/{chunk-acwjyext.js → chunk-sqe4sz8r.js} +1 -1
- package/dist/chunk-tpc0vwvz.js +22 -0
- package/dist/{chunk-w56erqz5.js → chunk-wr17wgn4.js} +1 -1
- package/dist/{chunk-xrx24ndt.js → chunk-yzftmbry.js} +1 -1
- package/dist/cli.js +4 -4
- package/dist/stx-virtual-ts.d.ts +25 -2
- package/dist/stx-virtual-ts.js +53 -5
- package/package.json +5 -5
- package/dist/chunk-9g2rhkx8.js +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mg as _$,ng as K5}from"./chunk-
|
|
2
|
+
import{mg as _$,ng as K5}from"./chunk-jz3cjfz1.js";import{Ag as q6,Cg as Z1,Dg as y6,Eg as Q5,Fg as B$,Gg as L$,Hg as v6,Ig as g6,xg as y7,zg as U$}from"./chunk-h3paff80.js";import{Bj as c5,uj as u1,vj as O1,wj as H1,xj as m$,yj as p$,zj as p5}from"./chunk-nhmq45hh.js";import{Vj as Y$,Wj as J$}from"./chunk-x58dcsjw.js";import{xk as g5,yk as f5}from"./chunk-8k7evyhh.js";import{Ek as l7,Fk as i7}from"./chunk-frp9fc7j.js";import{hl as Q1}from"./chunk-r84h7wxw.js";import{$l as X6,$o as S6,Dq as O0,Hm as x6,Lm as Z5,Nr as G$,Om as N1,Pm as M1,Rq as Q6,Sq as E1,Vo as Z$,Wq as p0,Zl as b7,Zo as X5,_m as c1,_r as E$,ap as z6,as as d0,bn as L6,bq as g7,bs as M0,fs as V0,iq as P6,jn as n$,jq as b6,ln as o$,on as l1,pm as u0,rp as j0,sn as t$,vn as Q$,wn as F6,zm as s$,zp as m0}from"./chunk-spnkgsft.js";import{Ls as B,Ts as W$,Us as K$,Ys as o}from"./chunk-nnd1hqht.js";import{it as S0}from"./chunk-xgtcq9bj.js";import{Du as A6,Zt as $5,_t as H6,cu as V6,du as E6,su as I6,tu as R6,uu as D6,vu as w6,wu as T6,xu as C6,zu as k6}from"./chunk-r2kag877.js";import{Nu as p}from"./chunk-j4ze77e0.js";var l5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function e7($,X,Q={}){let{storage:Z="local",serializer:Y=l5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Q,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Z==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let H=L.getItem($);if(H===null)return X;let q=Y.read(H);if(J&&typeof X==="object"&&X!==null)return{...X,...q};return q}catch{return X}},F=(L)=>{let H=_();if(!H)return;try{if(L===null||L===void 0)H.removeItem($);else H.setItem($,Y.write(L))}catch(q){console.warn(`[useStorage] Failed to write key "${$}":`,q)}},z=U(),j=(L,H)=>{for(let q of W)try{q(L,H)}catch(A){console.error("[useStorage] Subscriber error:",A)}};if(K&&G){let L=(q)=>{if(q.key===$&&q.storageArea===_()){let A=z;try{z=q.newValue?Y.read(q.newValue):X}catch(N){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,N);return}j(z,A)}};window.addEventListener("storage",L);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",L))}let O={get value(){return z},set value(L){let H=z;z=L,F(L),j(L,H)},get:()=>z,set:(L)=>{O.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let H=z;z=X,j(X,H)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return O}function i5($,X,Q,Z,Y={}){let{serializer:J=l5,mergeDefaults:G=!1,listenToStorageChanges:W=!0}=Y,K=typeof window<"u",_=()=>{if(!K)return null;return $==="session"?sessionStorage:localStorage},U=(j)=>{if(j===null||j===void 0)return Z;try{let O=J.read(j);if(G&&typeof Z==="object"&&Z!==null)return{...Z,...O};return O}catch(O){return console.warn(`[${X}] Failed to read key "${Q}":`,O),Z}},z=p5((()=>{let j=_();if(!j)return Z;try{return U(j.getItem(Q))}catch(O){return console.warn(`[${X}] Cannot read "${Q}":`,O),Z}})());if(c5(()=>{let j=z(),O=_();if(!O)return;try{if(j===null||j===void 0)O.removeItem(Q);else O.setItem(Q,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Q}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Q)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",j))}return z}function $3($,X,Q){return i5("local","useLocalStorage",$,X,Q)}function X3($,X,Q){return i5("session","useSessionStorage",$,X,Q)}function Q3($="local"){if(typeof window>"u")return;($==="session"?sessionStorage:localStorage).clear()}function Z3($="local"){if(typeof window>"u")return[];let X=$==="session"?sessionStorage:localStorage;return Object.keys(X)}function Y3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Q=0;for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))Q+=(Z.length+(X.getItem(Z)?.length||0))*2;return Q}var l=null;function d1($,X,Q=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Q.has($))return!0;if(Q.add($),$ instanceof Date&&X instanceof Date)return $.getTime()===X.getTime();if($ instanceof RegExp&&X instanceof RegExp)return $.source===X.source&&$.flags===X.flags;if(Array.isArray($)){if(!Array.isArray(X)||$.length!==X.length)return!1;for(let J=0;J<$.length;J++)if(!d1($[J],X[J],Q))return!1;return!0}if(Array.isArray(X))return!1;if($ instanceof Map){if(!(X instanceof Map)||$.size!==X.size)return!1;for(let[J,G]of $)if(!X.has(J)||!d1(G,X.get(J),Q))return!1;return!0}if(X instanceof Map)return!1;if($ instanceof Set){if(!(X instanceof Set)||$.size!==X.size)return!1;for(let J of $)if(!X.has(J))return!1;return!0}if(X instanceof Set)return!1;let Z=Object.keys($),Y=Object.keys(X);if(Z.length!==Y.length)return!1;for(let J of Z){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!d1($[J],X[J],Q))return!1}return!0}function UJ($){l=$}function BJ(){return l}function LJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:J3()}}function J3(){return{refs:new Map,effects:new Set,cleanups:[]}}function FJ($){let X=new Set,Q=new Set,Z=$,Y=Symbol("ref"),J={get value(){let G=u1();if(G)Q.add(G);return Z},set value(G){if(!Object.is(G,Z)){let W=Z;Z=G;for(let K of X)K(G,W);for(let K of Q)if(m$())p$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(l)l.scope.refs.set(Y,J);return J}var a5=new WeakMap;function G3($){let X=a5.get($);if(X)return X;let Q=new Map,Z=(G)=>{let W=Q.get(G);if(!W)return;for(let K of[...W])if(m$())p$(K);else K()},Y=(G,W)=>{if(!Q.has(G))Q.set(G,new Set);return Q.get(G).add(W),()=>{Q.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=u1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return G3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Z(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Z(W),K}});return a5.set($,J),J}function zJ($){let X,Q=!0,Z=new Set,Y=new Set,J=()=>{Q=!0,G()},G=()=>{if(Q){let K=X,_=O1(J);if(X=$(),H1(_),Q=!1,!Object.is(X,K)){for(let U of Z)U(X,K);for(let U of Y)U()}}},W=O1(J);return X=$(),Q=!1,H1(W),{get value(){let K=u1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Z.add(K),()=>{Z.delete(K)}}}}function W3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function jJ($,X,Q={}){let{immediate:Z=!1,deep:Y=!1,flush:J="post"}=Q,G,W,K=!1,_=()=>{if(K)return;let O=j();if((Y?!d1(O,G):!Object.is(O,G))||Z)if(X(O,G),Y&&O!==null&&typeof O==="object")try{G=structuredClone(O)}catch{G=O}else G=O},U=(O)=>{if(J==="sync")O();else if(J==="pre")Promise.resolve().then(O);else W3(O)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let O=O1(z);try{return $()}finally{H1(O)}}return $.value};if(typeof $!=="function"){let O=$.subscribe(()=>{U(_)});W=()=>{K=!0,O()}}else W=()=>{K=!0};if(G=j(),Z)U(_);if(l)l.scope.cleanups.push(()=>W?.());return()=>W?.()}function OJ($,X,Q={}){let Z=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Z.push(G)}if(Q.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Z)J()}}function HJ($){let X,Q=!1,Z=()=>{if(Q)return;if(X)X();let Y=O1(Z);X=$(),H1(Y)};if(Z(),l)l.scope.cleanups.push(()=>{if(Q=!0,X)X()});return()=>{if(Q=!0,X)X()}}function AJ($){if(l)l.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function qJ($){if(l)l.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function NJ($){if(l)l.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function MJ($){if(l)l.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function VJ($){if(l)l.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function EJ($){if(l)l.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function n0($,X){let Q=$.hooks[X];for(let Z of Q)await Z()}async function IJ($){await n0($,"beforeMount"),$.isMounted=!0,await n0($,"mounted")}async function RJ($){if(!$.isMounted||$.isUnmounted)return;await n0($,"beforeUpdate"),await n0($,"updated")}async function DJ($){if($.isUnmounted)return;await n0($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await n0($,"unmounted")}function wJ(){return`
|
|
3
3
|
<script data-stx-client-runtime>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -1120,7 +1120,7 @@ ${H}`}if(O=await z6(O),W.forEach((L)=>Z.add(L)),Q.cache&&Q.cachePath){if(await J
|
|
|
1120
1120
|
<h1>Something went wrong</h1>
|
|
1121
1121
|
<p>An internal error occurred. Please try again later.</p>
|
|
1122
1122
|
</body>
|
|
1123
|
-
</html>`,loader:"html"}}})}};async function O4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(I){I.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((I)=>I.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-
|
|
1123
|
+
</html>`,loader:"html"}}})}};async function O4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(I){I.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((I)=>I.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-yzftmbry.js"),N=await A();if(N?.apiRouter)L=N?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(N?.apiRoutes){O=N.apiRoutes;let V=Object.keys(O).length;if(V>0)console.log(`${B.blue}Loaded ${B.bright}${V} API route${V>1?"s":""}${B.reset}`)}if(N?.broadcasting?.enabled)try{let{startBroadcasting:V,loadChannels:M}=await import("./chunk-frv8qh41.js"),I=N.broadcasting;await V(I);let w=I.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${w}/ws${B.reset}`);let C=Y0.join(process.cwd(),"channels.ts");if(H0.existsSync(C))try{let R=await M(C);console.log(`${B.blue}Loaded ${B.bright}${R} broadcast channel${R!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(R){console.warn(`${B.yellow}Failed to load channels.ts: ${R.message}${B.reset}`)}}catch(V){console.warn(`${B.yellow}Broadcasting failed to start: ${V.message}${B.reset}`)}}catch{}if(console.log(`${B.blue}Starting server on ${B.cyan}http://localhost:${j}/${B.reset}...`),Y)console.log(`${B.magenta}Hot reload enabled on ws://localhost:${G}${B.reset}`);let H=j4({port:j,async fetch(A){return _$(A,await(async()=>{let N=new URL(A.url);if(L)try{let C=await L.handleRequest(A);if(C.status!==404)return C}catch{}if(O[N.pathname])try{return await O[N.pathname](A)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(N.pathname==="/")return(async()=>{let R=await o(_||"");if(Y)R=D0(R,G);if(X.native)if(R.includes("<head>"))R=R.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(R.includes("<html"))R=R.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else R="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+R;if(X.titlebarHidden)if(R.includes("<head>"))R=R.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(R.includes("<html"))R=R.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else R=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${R}`;return R})().then((R)=>new Response(R,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let V=Y0.join(K,N.pathname);if(H0.existsSync(V)&&H0.statSync(V).isFile()){let C=Bun.file(V),R=Y0.extname(V).toLowerCase(),E="text/plain";if(R===".ts"||R===".tsx"){let h=new Bun.Transpiler({loader:R===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(R){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let M=Y0.dirname(W),I=Y0.join(M,N.pathname);if(H0.existsSync(I)&&H0.statSync(I).isFile()){let C=Bun.file(I),R=Y0.extname(I).toLowerCase(),E="text/plain";if(R===".ts"||R===".tsx"){let h=new Bun.Transpiler({loader:R===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(R){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let w=Y0.join(process.cwd(),"public",N.pathname);if(H0.existsSync(w)&&H0.statSync(w).isFile()){let C=Bun.file(w),R=Y0.extname(w).toLowerCase(),E="application/octet-stream";if(R===".ts"||R===".tsx"){let h=new Bun.Transpiler({loader:R===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(R){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}return new Response("Not Found",{status:404})})())},error(A){return new Response(`<pre>${A}
|
|
1124
1124
|
${A.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
|
|
1125
1125
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1126
1126
|
${B.bright}\u2192 ${B.cyan}http://localhost:${j}/${B.reset}`),console.log(`
|
|
@@ -1607,7 +1607,7 @@ ${O.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),con
|
|
|
1607
1607
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1608
1608
|
${B.bright}\u2192 ${B.cyan}http://localhost:${U}/${B.reset}`),console.log(`
|
|
1609
1609
|
${B.yellow}Routes:${B.reset}`);let z=new Set(W.map((O)=>O.routeTemplate)),j=Object.entries(G).filter(([O])=>!z.has(O)).sort(([O],[L])=>O.localeCompare(L)).map(([O,L])=>({route:O==="/"?"/":O,filePath:Q0.relative(process.cwd(),L.filePath),fileType:L.fileType}));for(let O of W){let L=O.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");j.push({route:L,filePath:Q0.relative(process.cwd(),O.filePath),fileType:"stx"})}if(j.sort((O,L)=>O.route.localeCompare(L.route)),j.forEach((O,L)=>{let q=L===j.length-1?"\u2514\u2500 ":"\u251C\u2500 ",A=O.fileType==="md"?`${B.magenta}(markdown)${B.reset}`:"";console.log(` ${B.green}${q}${O.route}${B.reset} \u2192 ${B.bright}${O.filePath}${B.reset} ${A}`)}),console.log(`
|
|
1610
|
-
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:q4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function N4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-xrx24ndt.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}I6(),await D6(W);let N=R6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-xrx24ndt.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-frv8qh41.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let I=S0(W,"output");J0.mkdirSync(I,{recursive:!0});let w=new Map,C=new Set,R=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:I,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-xrx24ndt.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-x21s75kv.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-xrx24ndt.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-nrzx6d77.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-s2smc4wv.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=q4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(I,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-z54ans51.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await R(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-s2smc4wv.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await R(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await R(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
|
|
1610
|
+
Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var{serve:q4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function N4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-yzftmbry.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}I6(),await D6(W);let N=R6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-yzftmbry.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-frv8qh41.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let I=S0(W,"output");J0.mkdirSync(I,{recursive:!0});let w=new Map,C=new Set,R=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:I,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-yzftmbry.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-x21s75kv.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-yzftmbry.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-nrzx6d77.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-s2smc4wv.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=q4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(I,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-z54ans51.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await R(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-s2smc4wv.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await R(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await R(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
|
|
1611
1611
|
${D.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
|
|
1612
1612
|
${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
|
|
1613
1613
|
${B.bright}\u2192 ${B.cyan}http://localhost:${W0}/${B.reset}`),Y)console.log(`${B.dim} HMR: ws://localhost:${G}${B.reset}`);console.log(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Lf as a}from"./chunk-
|
|
2
|
+
import{Lf as a}from"./chunk-wr17wgn4.js";import"./chunk-tpc0vwvz.js";import"./chunk-h3paff80.js";import"./chunk-qa8qmer5.js";import"./chunk-nhmq45hh.js";import"./chunk-frp9fc7j.js";import"./chunk-spnkgsft.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-nnd1hqht.js";import"./chunk-msxcd1kp.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-5a1b5kjt.js";import"./chunk-r2kag877.js";import"./chunk-8p8qa1s9.js";import"./chunk-j4ze77e0.js";export{a as buildForProduction};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Af as f,Bf as g,Cf as h,xf as c,yf as d,zf as e}from"./chunk-
|
|
2
|
+
import{Af as f,Bf as g,Cf as h,xf as c,yf as d,zf as e}from"./chunk-sqe4sz8r.js";import{Mf as a,Pf as b}from"./chunk-tpc0vwvz.js";import"./chunk-5q44vwmg.js";import"./chunk-ht51fz7w.js";import"./chunk-spnkgsft.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-nnd1hqht.js";import"./chunk-msxcd1kp.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-5a1b5kjt.js";import"./chunk-r2kag877.js";import"./chunk-8p8qa1s9.js";import"./chunk-j4ze77e0.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{as as E}from"./chunk-spnkgsft.js";import{Nu as D}from"./chunk-j4ze77e0.js";import I from"path";async function M(q={}){let G=performance.now(),J=q.root||process.cwd(),j=await E(),y=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${y.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(y==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,...q.ssg})}else{let{buildForProduction:z}=await import("./chunk-
|
|
2
|
+
import{as as E}from"./chunk-spnkgsft.js";import{Nu as D}from"./chunk-j4ze77e0.js";import I from"path";async function M(q={}){let G=performance.now(),J=q.root||process.cwd(),j=await E(),y=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${y.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(y==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,...q.ssg})}else{let{buildForProduction:z}=await import("./chunk-0prbc65y.js");B=await z({outputDir:".output",debug:q.debug,...q.ssr})}let H=Math.round(performance.now()-G);return{mode:y,ssg:A,ssr:B,duration:H}}
|
|
3
3
|
export{M as jg};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{jg as a}from"./chunk-
|
|
2
|
+
import{jg as a}from"./chunk-9778d23n.js";import"./chunk-spnkgsft.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-nnd1hqht.js";import"./chunk-msxcd1kp.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-5a1b5kjt.js";import"./chunk-r2kag877.js";import"./chunk-8p8qa1s9.js";import"./chunk-j4ze77e0.js";export{a as buildApp};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{im as E,jm as M,wq as T}from"./chunk-spnkgsft.js";import{Au as d,Cu as c,Du as i}from"./chunk-r2kag877.js";import{Ku as m,Nu as p}from"./chunk-j4ze77e0.js";var y=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function f(z,Q,F){let J={fullTag:F,content:Q,attrs:z};if(/\bserver\b/.test(z))return{...J,type:"server"};if(/\bdata-stx-scoped\b/.test(z))return{...J,type:"client"};if(y.test(Q))return{...J,type:"signals"};if(/\bclient\b/.test(z)||/\btype\s*=\s*["']module["']/.test(z)||/\bsrc\s*=/.test(z))return{...J,type:"client"};return{...J,type:"server"}}var g=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function P(z){let Q=[],F=[],J=[],$=0;while($<z.length){let Y=z.indexOf("<",$);if(Y===-1)break;let K=M(z,Y);if(K>Y){$=K;continue}let Z=E(z,Y);if(Z>Y){let B=z.slice(Y,Z),U=g.exec(B);if(U){let X=f(U[1],U[2],B);switch(X.type){case"signals":Q.push(X);break;case"client":F.push(X);break;case"server":J.push(X);break}}$=Z;continue}$=Y+(z.startsWith("<!--",Y)?4:1)}return{signals:Q,client:F,server:J}}var s="X-STX-Router",a="private, no-store";function R(z){return z.headers.get("X-STX-Router")==="true"}function u(z,Q){if(!z)return Q;return z.split(",").some((J)=>J.trim().toLowerCase()===Q.toLowerCase())?z:`${z}, ${Q}`}function t(z){return{Vary:u(z,"X-STX-Router")}}import L from"path";d();var h="stx-page-head:",o=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,I=null;function r(){if(I!==null)return I;try{let{getRouterScript:z}=(i(),m(c));I=`<script>${z()}</script>`}catch{I=""}return I}async function Yz(z,Q){if(Q===!1)return null;if(Q&&typeof Q==="string"){let J=L.resolve(z,Q);if(await Bun.file(J).exists())return J;return null}let F=L.join(z,"app.stx");if(await Bun.file(F).exists())return F;return null}async function Zz(z,Q){try{let F=await Bun.file(z).text(),J=F,$=F.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)J=$[1].trim();let Y=P(F),K=[...Y.client.map((j)=>j.fullTag),...Y.signals.map((j)=>j.fullTag)],Z=[],B=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,U;while((U=B.exec(F))!==null)Z.push(U[0]);let X=J;for(let j of Y.server)X=X.replace(j.fullTag,"");for(let j of Y.client)X=X.replace(j.fullTag,"");X=X.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let W="<!--__STX_PAGE_SLOT__-->";if(X=X.replace(/<slot\s*\/>/gi,W).replace(/<slot\s*>\s*<\/slot>/gi,W),!X.includes(W))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:q,extractVariables:k,defaultConfig:v,loadStxConfig:H}=await import("./chunk-
|
|
2
|
+
import{im as E,jm as M,wq as T}from"./chunk-spnkgsft.js";import{Au as d,Cu as c,Du as i}from"./chunk-r2kag877.js";import{Ku as m,Nu as p}from"./chunk-j4ze77e0.js";var y=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function f(z,Q,F){let J={fullTag:F,content:Q,attrs:z};if(/\bserver\b/.test(z))return{...J,type:"server"};if(/\bdata-stx-scoped\b/.test(z))return{...J,type:"client"};if(y.test(Q))return{...J,type:"signals"};if(/\bclient\b/.test(z)||/\btype\s*=\s*["']module["']/.test(z)||/\bsrc\s*=/.test(z))return{...J,type:"client"};return{...J,type:"server"}}var g=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function P(z){let Q=[],F=[],J=[],$=0;while($<z.length){let Y=z.indexOf("<",$);if(Y===-1)break;let K=M(z,Y);if(K>Y){$=K;continue}let Z=E(z,Y);if(Z>Y){let B=z.slice(Y,Z),U=g.exec(B);if(U){let X=f(U[1],U[2],B);switch(X.type){case"signals":Q.push(X);break;case"client":F.push(X);break;case"server":J.push(X);break}}$=Z;continue}$=Y+(z.startsWith("<!--",Y)?4:1)}return{signals:Q,client:F,server:J}}var s="X-STX-Router",a="private, no-store";function R(z){return z.headers.get("X-STX-Router")==="true"}function u(z,Q){if(!z)return Q;return z.split(",").some((J)=>J.trim().toLowerCase()===Q.toLowerCase())?z:`${z}, ${Q}`}function t(z){return{Vary:u(z,"X-STX-Router")}}import L from"path";d();var h="stx-page-head:",o=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,I=null;function r(){if(I!==null)return I;try{let{getRouterScript:z}=(i(),m(c));I=`<script>${z()}</script>`}catch{I=""}return I}async function Yz(z,Q){if(Q===!1)return null;if(Q&&typeof Q==="string"){let J=L.resolve(z,Q);if(await Bun.file(J).exists())return J;return null}let F=L.join(z,"app.stx");if(await Bun.file(F).exists())return F;return null}async function Zz(z,Q){try{let F=await Bun.file(z).text(),J=F,$=F.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)J=$[1].trim();let Y=P(F),K=[...Y.client.map((j)=>j.fullTag),...Y.signals.map((j)=>j.fullTag)],Z=[],B=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,U;while((U=B.exec(F))!==null)Z.push(U[0]);let X=J;for(let j of Y.server)X=X.replace(j.fullTag,"");for(let j of Y.client)X=X.replace(j.fullTag,"");X=X.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let W="<!--__STX_PAGE_SLOT__-->";if(X=X.replace(/<slot\s*\/>/gi,W).replace(/<slot\s*>\s*<\/slot>/gi,W),!X.includes(W))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:q,extractVariables:k,defaultConfig:v,loadStxConfig:H}=await import("./chunk-yzftmbry.js"),w=await H(),A={__filename:z,__dirname:L.dirname(z)};for(let j of K){let N=j.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(N&&!j.includes("client")&&!j.includes('type="module"'))await k(N[1],A,z)}let V=await q(X,A,z,{...v,...w,...Q},new Set),G=V.indexOf(W);if(G===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:V.substring(0,G),afterSlot:V.substring(G+W.length),filePath:z,shellScripts:K,shellStyles:Z}}catch(F){return console.error(`[stx] Error processing shell ${z}:`,F),null}}function $z(z,Q,F){let J,$="",Y=Q.match(o);if(Y){Q=Q.replace(Y[0],"");try{let X=Buffer.from(Y[1],"base64").toString("utf8"),W=X.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(W)J=W[1].trim();$=X.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let K=F||J||"stx App",Z=r(),B="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{vg as a}from"./chunk-
|
|
2
|
+
import{vg as a}from"./chunk-jz3cjfz1.js";import"./chunk-h3paff80.js";import"./chunk-spnkgsft.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-nnd1hqht.js";import"./chunk-msxcd1kp.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-5a1b5kjt.js";import"./chunk-r2kag877.js";import"./chunk-8p8qa1s9.js";import"./chunk-j4ze77e0.js";export{a as startProductionServer};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ag as e,Cg as b,Lg as JJ,zg as t}from"./chunk-y805f58c.js";import{$o as o,Om as u,Pm as l,gm as y,hm as P,qm as x,rp as g,xm as v}from"./chunk-spnkgsft.js";import{Du as OJ,Yt as a,zu as s}from"./chunk-r2kag877.js";import{Nu as R}from"./chunk-j4ze77e0.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-s2smc4wv.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-h451yyp6.js"),{defaultConfig:z}=await import("./chunk-jqnckvbk.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-s2smc4wv.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
|
|
2
|
+
import{Ag as e,Cg as b,Lg as JJ,zg as t}from"./chunk-h3paff80.js";import{$o as o,Om as u,Pm as l,gm as y,hm as P,qm as x,rp as g,xm as v}from"./chunk-spnkgsft.js";import{Du as OJ,Yt as a,zu as s}from"./chunk-r2kag877.js";import{Nu as R}from"./chunk-j4ze77e0.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-s2smc4wv.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-h451yyp6.js"),{defaultConfig:z}=await import("./chunk-jqnckvbk.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-s2smc4wv.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
|
|
3
3
|
export{WJ as kg,YJ as lg,i as mg,q as ng,KJ as og,f as pg,h as qg,m as rg,wJ as sg,d as tg,AJ as ug,mJ as vg};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Mf as S,Nf as s,Of as i,Rf as t,Sf as e,Tf as HH,Uf as KH,Vf as QH,Wf as YH}from"./chunk-
|
|
2
|
+
import{Mf as S,Nf as s,Of as i,Rf as t,Sf as e,Tf as HH,Uf as KH,Vf as QH,Wf as YH}from"./chunk-tpc0vwvz.js";import{Wi as a}from"./chunk-5q44vwmg.js";import{it as h}from"./chunk-xgtcq9bj.js";import{Ct as f}from"./chunk-5a1b5kjt.js";import{existsSync as ZH,readFileSync as XH}from"fs";import J from"path";function qH(K,Q="",V=""){let U=K.startLine>1?`
|
|
3
3
|
`.repeat(K.startLine-1):"",E=i(s(K.code)),X=K.kind==="client"||K.kind==="plain"?e(Q,K.code):"";return KH(`${U+E}
|
|
4
4
|
${X}
|
|
5
5
|
export {}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Is as Y}from"./chunk-1kg9sz9a.js";import{Ct as D}from"./chunk-5a1b5kjt.js";import b from"path";var v=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function u(K){let J=(Z)=>Z.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function h(K){let J=[],Z=u(K);v.lastIndex=0;let $;while(($=v.exec(Z))!==null){let j=($[1]||"").trim(),F=($[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=($[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=$.index+F,Q=$.index+$[0].length-z,U=K.slice(W,Q);if(/\bsrc\s*=/.test(j))continue;let X=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(X&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(X[1]))continue;let q=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",G=B(K,W);J.push({kind:q,code:U,startLine:G,attrs:j})}return J}function B(K,J){let Z=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Z++;return Z}function N(K,J){let Z=K.lastIndexOf(`
|
|
3
|
+
`,J-1)+1;return J-Z+1}function I(K){let J=K.split(""),Z=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
|
|
4
|
+
`)J[z]=" "},$=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of $){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Z(F.index,F.index+F[0].length)}return J.join("")}function p(K){let J=0,Z="";for(let $=0;$<K.length;$++){let j=K[$];if(Z){if(j==="\\"){$++;continue}if(j===Z)Z="";continue}if(j==='"'||j==="'"||j==="`"){Z=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[$+1]==="|"){$++;continue}if(K[$-1]==="|")continue;return K.slice(0,$)}}return K}var C=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,O="__stx_interpolated",y="__StxElement",R="__StxTemplateValue",m=`type ${R}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function g(K){return K.replace(/\{\{[\s\S]*?\}\}/g,O).replace(/\{!![\s\S]*?!!\}/g,O)}function Uj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Z=J.split(`
|
|
5
|
+
`).length-1,$=J.length-Z;return`0${" ".repeat(Math.max(0,$-1))}${`
|
|
6
|
+
`.repeat(Z)}`})}var l=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],d=new RegExp(String.raw`^[ \t]*@(?:${l.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function Xj(K){return K.replace(d,(J)=>J.replace(/[^\n]/g," "))}var L=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function i(K){let J=I(K),Z=[],$=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,j;while((j=$.exec(J))!==null){if(j[1]||j[3])continue;let z=j[2]??j[4]??"",W=j[2]!==void 0?2:3,Q=p(z);if(!Q.trim())continue;let U=j.index+W+(Q.length-Q.trimStart().length);Z.push({code:Q.trim(),line:B(J,U),column:N(J,U),offset:U,kind:"interpolation"})}w.lastIndex=0;while((j=w.exec(J))!==null){let F=j[1],z=j[3]??"",W=F.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(L.has(W)||L.has(F))continue;if(!z.trim())continue;let Q=j.index+j[0].indexOf(j[2],j[0].indexOf(F)+F.length)+1;if(C.has(W)){let X=z.match(/\s+(?:in|of)\s+/);if(!X||X.index===void 0)continue;let q=z.slice(X.index+X[0].length),G=X.index+X[0].length+(q.length-q.trimStart().length);Z.push({code:g(q.trim()),line:B(J,Q+G),column:N(J,Q+G),offset:Q+G,kind:"directive",attribute:W});continue}let U=z.length-z.trimStart().length;Z.push({code:g(z.trim()),line:B(J,Q+U),column:N(J,Q+U),offset:Q+U,kind:"directive",attribute:W})}return Z.sort((F,z)=>F.line-z.line||F.column-z.column),Z}function c(K){let J=new Map,Z=(W,Q)=>{let U=W.split(/[,[\]{}()\s]+/).filter(Boolean);for(let X of U){let q=X.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(q))continue;let G=U.length===1?Q:void 0,H=J.get(q);if(!H)J.set(q,{name:q,iterable:G});else if(H.iterable!==G)H.iterable=void 0}},$=/^\$?[A-Z_$][\w$]*$/i,j=(W)=>{let Q=W.trim();return $.test(Q)?Q:void 0};for(let W of K.matchAll(/@for(?:each|else)\s*\(([\s\S]*?)\)/g)){let Q=W[1].match(/^([\s\S]*?)\bas\b([\s\S]*)$/);if(!Q)continue;Z(Q[2].replace(/=>/g," "),j(Q[1]))}for(let W of K.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)/g))Z(W[1]);let F=I(K);w.lastIndex=0;let z;while((z=w.exec(F))!==null){let W=z[1].replace(/\..*$/,"");if(!C.has(W))continue;let Q=z[3].match(/\s+(?:in|of)\s+/);if(!Q||Q.index===void 0)continue;Z(z[3].slice(0,Q.index),j(z[3].slice(Q.index+Q[0].length)))}for(let W of K.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let Q of W[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))Z(Q[1]);return[...J.values()].sort((W,Q)=>W.name.localeCompare(Q.name))}function V(K){let J=new Set;for(let Z of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))J.add(Z[1]);for(let Z of K.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))J.add(Z[1]);for(let Z of K.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))J.add(Z[1]);for(let Z of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let $ of Z[1].split(",")){let j=$.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(j))J.add(j)}return[...J].sort()}function o(){return["declare var window: any",...D.map((K)=>`declare var ${K}: any`)].join(`
|
|
7
|
+
`)}var r=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"];function n(){return r.map((K)=>`declare var ${K}: any`).join(`
|
|
8
|
+
`)}function f(K){let J=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,Z,$=!1,j=new Set,F=Y(K);while((Z=J.exec(F))!==null){$=!0;for(let z of a(Z[1])){let W=z.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(W))j.add(W)}}return $?[...j]:null}function a(K){let J=[],Z=0,$="";for(let j of K){if(j===","&&Z===0){J.push($),$="";continue}if(j==="("||j==="["||j==="{")Z++;else if(j===")"||j==="]"||j==="}")Z--;$+=j}return J.push($),J.filter((j)=>j.trim().length>0)}function s(K){let J=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,Z=[],$=K.replace(J,(j)=>{return Z.push(j.trim()),j.split(`
|
|
9
|
+
`).map(()=>"").join(`
|
|
10
|
+
`)});return{imports:Z.join(`
|
|
11
|
+
`),body:$}}function x(K){let J=Y(K),Z=Array(J.length),$=0;for(let W=0;W<J.length;W++){let Q=J[W];if(Q==="}"||Q===")"||Q==="]")$=Math.max(0,$-1);if(Z[W]=$,Q==="{"||Q==="("||Q==="[")$++}let j=[],F=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,z;while((z=F.exec(J))!==null){if(Z[z.index]!==0)continue;let W=z[1],Q=z[2],U;if(W==="interface"){let X=J.indexOf("{",z.index);if(X===-1)continue;let q=0;U=-1;for(let G=X;G<J.length;G++)if(J[G]==="{")q++;else if(J[G]==="}"&&--q===0){U=G+1;break}if(U===-1)continue}else{let X=0;U=J.length;for(let q=J.indexOf("=",z.index)+1;q<J.length;q++){let G=J[q];if(G==="{"||G==="["||G==="("||G==="<")X++;else if(G==="}"||G==="]"||G===")"||G===">")X--;else if(X<=0&&(G===";"||G===`
|
|
12
|
+
`&&!/[=|&,<([{]\s*$/.test(J.slice(Math.max(0,q-40),q)))){U=G===";"?q+1:q;break}}}j.push({name:Q,text:K.slice(z.index,U).replace(/^[ \t]*export[ \t]+/,"")}),F.lastIndex=U}return j}function t(K){return new Set(x(K).map((J)=>J.name))}function qj(K,J=""){let Z=f(K),$=t(J),j=x(K).filter((U)=>!$.has(U.name)).map((U)=>U.text);if(!Z){let U=V(K);if(U.length===0&&j.length===0)return"";return["",`// ${jj}`,...j,...U.map((X)=>`declare var ${X}: any`)].join(`
|
|
13
|
+
`)}if(Z.length===0)return j.length>0?["",`// ${k}`,...j].join(`
|
|
14
|
+
`):"";let{imports:F,body:z}=s(K),W=z.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),Q=["",`// ${k}`];if(F)Q.push(F);return Q.push(...j),Q.push(`async function ${_}() {`,W,` return { ${Z.join(", ")} }`,"}",`type ${A} = Awaited<ReturnType<typeof ${_}>>`,...Z.map((U)=>`declare var ${U}: ${A}[${JSON.stringify(U)}]`)),Q.join(`
|
|
15
|
+
`)}function e(K){let Z=Y(K).split(""),$=0;for(let j=0;j<Z.length;j++){let F=Z[j];if(F==="{"||F==="("||F==="["){$++;continue}if(F==="}"||F===")"||F==="]"){$=Math.max(0,$-1);continue}if($>0&&F!==`
|
|
16
|
+
`)Z[j]=" "}return V(Z.join(""))}function Hj(K,J){if(f(K)!==null)return[];let Z=Y(J),$=new Set(D);return e(K).filter((j)=>{if($.has(j))return!1;if(V(J).includes(j))return!1;return new RegExp(`(?<![.#\\w$])${j}(?![\\w$])`).test(Z)})}var k="stx: types for the declared client payload (#1868)",jj="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",_="__stxServerScope",A="__StxClientPayload";var Jj=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","props","slot"];var Kj=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function Qj(K,J){let Z=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,$=[],j;while((j=Z.exec(K))!==null){if(j.index>=J)break;let F=j[1];if(F==="endif"||F==="endunless"){$.pop();continue}let z="";if(j[2]==="("){let W=0,Q=j.index+j[0].length-1,U=Q+1;for(;Q<K.length;Q++){let X=K[Q];if(X==="(")W++;else if(X===")"){if(W--,W===0)break}}z=K.slice(U,Q).trim(),Z.lastIndex=Q+1}if(F==="if")$.push({conditions:[z]});else if(F==="unless")$.push({conditions:[`!(${z})`]});else if(F==="elseif"||F==="else"){let W=$[$.length-1];if(!W)continue;let Q=W.conditions.map((U)=>`!(${U})`);W.conditions=F==="elseif"?[...Q,z]:Q}}return $.flatMap((F)=>F.conditions).filter(Boolean)}function Zj(K){let J=K.code.trim();if(!J)return null;if(K.attribute?.startsWith("@")){if(Kj.test(J))return null;let $=";(($event: any): void => { ";return{text:`${$}${J} });`,prefixLength:$.length}}let Z=";void ((";return{text:`${Z}${J}));`,prefixLength:Z.length}}var $j=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function zj(K,J){if(!J)return K;return K.replace($j,(Z,$,j,F)=>{let z=b.resolve(J,F).replace(/\\/g,"/");return`${$}${j}${z}${j}`})}function Vj(K,J={}){let Z=h(K),$=K.split(`
|
|
17
|
+
`),j=Array.from({length:$.length},()=>""),F=new Map;for(let W of Z)zj(W.code,J.originDir??"").split(`
|
|
18
|
+
`).forEach((U,X)=>{let q=W.startLine-1+X;if(q<j.length)j[q]=U});let z=(W,Q)=>{if(j.push(W),Q)F.set(j.length,Q)};if(J.globals!==!1){if(z(""),J.runtimeGlobals!==!1)for(let Q of o().split(`
|
|
19
|
+
`))z(Q);for(let Q of n().split(`
|
|
20
|
+
`))z(Q);for(let Q of Jj)z(`declare var ${Q}: any`);z(`declare var ${O}: any`);let W=new Set(Z.flatMap((Q)=>V(Q.code)));z(`type ${y}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let Q of c(K)){if(W.has(Q.name))continue;let U=Q.iterable&&W.has(Q.iterable)?`${y}<typeof ${Q.iterable}>`:"any";z(`declare var ${Q.name}: ${U}`)}}if(J.templateExpressions!==!1){let W=i(K).map((Q)=>({expression:Q,statement:Zj(Q)})).filter((Q)=>Q.statement!==null);if(W.length>0){let Q=I(K),X=[...new Set(Z.flatMap((G)=>V(G.code)))].filter((G)=>/^[A-Z_$][\w$]*$/i.test(G)),q=0;if(X.length>0){z(m);for(let G of X)z(`type __StxT_${G} = ${R}<typeof ${G}>`);z(`;((${X.map((G)=>`${G}: __StxT_${G}`).join(", ")}) => {`),q=1}for(let{expression:G,statement:H}of W){let P=" ".repeat(q),M=G.offset===void 0?[]:Qj(Q,G.offset),S=M.length>0?`${M.map((E)=>`if (${E}) `).join("")}{ `:"",T=M.length>0?" }":"";z(P+S+H.text+T,{line:G.line,column:G.column,expression:G,prefixLength:H.prefixLength+P.length+S.length})}if(q>0)z("});")}}return z("export {}"),{text:j.join(`
|
|
21
|
+
`),lineMap:F,sourceLineCount:$.length}}function Yj(K,J,Z){let $=K.lineMap.get(J);if(!$)return J<=K.sourceLineCount?{line:J,column:Z}:null;let j=Math.max(0,Z-1-($.prefixLength??0));return{line:$.line,column:$.column+j,expression:$.expression}}
|
|
22
|
+
export{h as Mf,Uj as Nf,Xj as Of,i as Pf,V as Qf,n as Rf,qj as Sf,Hj as Tf,zj as Uf,Vj as Vf,Yj as Wf};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qf as p}from"./chunk-
|
|
2
|
+
import{Qf as p}from"./chunk-tpc0vwvz.js";import{Gg as a,Ig as JF,Jg as ZF,Kg as qF}from"./chunk-h3paff80.js";import{rj as C,sj as D}from"./chunk-qa8qmer5.js";import{Dk as QF,Ek as XF,Fk as YF}from"./chunk-frp9fc7j.js";import{Dq as c,Lm as u,Zo as o,_r as n,as as N,cm as l,em as d,eq as e,sq as t,zq as FF}from"./chunk-spnkgsft.js";import{Ys as r}from"./chunk-nnd1hqht.js";import{Bu as S,Du as WF}from"./chunk-r2kag877.js";import G from"fs";import Z from"path";import{createHash as $F}from"crypto";WF();function g(J){return $F("sha256").update(J).digest("hex").slice(0,8)}function f(J=!1){let q=J?D():C(),z=g(q);return{content:q,filename:`runtime.${z}.js`,hash:z}}function m(){let J=S(),q=g(J);return{content:J,filename:`router.${q}.js`,hash:q}}function UF(J){return{runtimeTag:J.runtime?`<script src="/__stx/${J.runtime.filename}"></script>`:"",routerTag:J.router?`<script src="/__stx/${J.router.filename}"></script>`:"",cssTag:J.css?`<link rel="stylesheet" href="/__stx/${J.css.filename}">`:""}}import h from"path";import{createHash as GF}from"crypto";function VF(J={}){let q=new Set;return{context:new Proxy(J,{get(Q,X){if(X in Q)return Q[X];if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return},has(Q,X){if(X in Q)return!0;if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return!1}}),accessedKeys:q}}async function i(J,q,z={}){let Q=h.resolve(J),X=await Bun.file(Q).text(),I=GF("sha256").update(X).digest("hex").slice(0,16);l();let K={};try{K=await N()}catch{}let B=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(X))!==null){let $=k[1];if(/\bserver\b/.test($))B.push(k[2])}let W=new Set(B.flatMap(($)=>p($))),{context:E}=VF({__filename:Q,__dirname:h.dirname(Q),__stx_serverDeclared:W}),L=new Set,_={...n,...K,...z,buildMode:"compile",strict:!1},w=await c(X,E,Q,_,L),U=a(w),H=d();return{route:q,sourceFile:J,html:w,fragment:U,placeholders:H,hasServerScripts:B.length>0,serverScriptContent:B,dependencies:Array.from(L),contentHash:I,status:u(X),streamTemplates:E.__streamTemplates}}var kF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function s(J,q){let z=0,Q=0;if(!G.existsSync(J))return{copied:z,bytes:Q};G.mkdirSync(q,{recursive:!0});function X(I,K){let B=G.readdirSync(I,{withFileTypes:!0});for(let V of B){if(kF.has(V.name))continue;let k=Z.join(I,V.name),W=Z.join(K,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),X(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),z++,Q+=G.statSync(W).size}}}return X(J,q),{copied:z,bytes:Q}}async function lF(J={}){let q=Date.now(),z=Z.resolve(J.root||process.cwd()),Q=Z.resolve(z,J.outputDir||".output");console.log("[stx build] Starting production build...");let X={};try{X=await N()}catch{}let I=J.componentsDir??X.componentsDir??"components",K=J.partialsDir??X.partialsDir??"partials",B=J.layoutsDir??X.layoutsDir??"layouts",V=J.publicDir??X.publicDir??"public",k=X.app?.head||{},W=X.app?.colorMode,E=X.router?.container||"main";if(G.existsSync(Q))G.rmSync(Q,{recursive:!0});let L=[Z.join(Q,"public","__stx"),Z.join(Q,"public","assets"),Z.join(Q,"server","pages"),Z.join(Q,"server","fragments")];for(let Y of L)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let _=o(z),w=["components","layouts","partials"],U=_.filter((Y)=>{return!w.some((F)=>Y.pattern.startsWith(`/${F}/`)||Y.pattern===`/${F}`)});console.log(`[stx build] Found ${U.length} page routes (${_.length-U.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let H=f(J.debug),$=m();await Bun.write(Z.join(Q,"public","__stx",H.filename),H.content),await Bun.write(Z.join(Q,"public","__stx",$.filename),$.content),console.log(`[stx build] Runtime: ${H.filename} (${(H.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${$.filename} (${($.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let O=[],j=[];for(let Y of U)try{let F=await i(Y.filePath,Y.pattern,{componentsDir:I,partialsDir:K,layoutsDir:B,debug:J.debug});if(O.push(F),F.html=F.html.replace(/runtime\.__STX_HASH__\.js/g,H.filename).replace(/router\.__STX_HASH__\.js/g,$.filename),F.html=FF(F.html,k,{bodyScripts:[`<script src="/__stx/${$.filename}"></script>`],...W&&{colorMode:W}}),W)F.html=e(F.html,W);if(k.htmlAttrs)F.html=t(F.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(F.html)){let T=F.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(T&&T[1]){let P=T[1];F.html=F.html.replace(" "+P,""),F.html=F.html.replace(/<body([^>]*)>/,`<body$1 ${P}>`)}}F.html=F.html.replace(/<style data-crosswind="generated">[\s\S]*?<\/style>\s*/g,""),F.html=await r(F.html),F.fragment=JF(F.html,E);let y=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),b=Z.join("server","pages",`${y}.compiled.json`),A=Z.join("server","fragments",`${y}.html`);await Bun.write(Z.join(Q,b),JSON.stringify(F,null,2)),await Bun.write(Z.join(Q,A),F.fragment),j.push({pattern:Y.pattern,compiledPath:b,fragmentPath:A,isDynamic:F.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("[")}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(F){console.error(`[stx build] \u2717 ${Y.pattern}:`,F instanceof Error?F.message:F)}let M=Z.resolve(z,V);if(G.existsSync(M)){let{copied:Y,bytes:F}=s(M,Z.join(Q,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${V}/`)}let v=YF(z);if(v){let{copied:Y,bytes:F}=s(v,Z.join(Q,"public",XF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${QF}/`)}let R={runtime:H.filename,router:$.filename},zF=ZF(j,R,Q);qF(zF,Q);let x=Date.now()-q;return console.log(`
|
|
3
3
|
[stx build] Done in ${x}ms \u2014 ${O.length} pages compiled`),{pageCount:O.length,assets:R,outputDir:Q,duration:x}}
|
|
4
4
|
export{g as Gf,f as Hf,m as If,UF as Jf,i as Kf,lF as Lf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$ as kl,$a as bn,$b as uo,$c as up,$d as uq,A as Wj,Aa as mm,Ab as On,Ac as Vo,Ad as Vp,Ae as $q,B as Xj,Ba as nm,Bb as Pn,Bc as Wo,Bd as Wp,Be as ar,C as Yj,Ca as Am,Cb as Qn,Cc as Xo,Cd as Xp,Ce as br,D as Zj,Da as Bm,Db as Rn,Dc as Yo,Dd as Yp,De as cr,E as Pk,Ea as Cm,Eb as Sn,Ec as Zo,Ed as Zp,Ee as dr,F as Qk,Fa as Dm,Fb as Tn,Fc as _o,Fd as _p,Fe as er,G as Rk,Ga as Em,Gb as Un,Gc as $o,Gd as $p,Ge as fr,H as Sk,Ha as Im,Hb as Vn,Hc as ap,Hd as aq,He as gr,I as Tk,Ia as Jm,Ib as Wn,Ic as bp,Id as bq,Ie as hr,J as Uk,Ja as Km,Jb as Xn,Jc as cp,Jd as cq,Je as ir,K as Vk,Ka as Lm,Kb as Yn,Kc as dp,Kd as dq,Ke as jr,L as Wk,La as Mm,Lb as Zn,Lc as ep,Ld as eq,Le as kr,M as Xk,Ma as Nm,Mb as _n,Mc as fp,Md as fq,Me as lr,N as Yk,Na as Om,Nb as go,Nc as gp,Nd as gq,Ne as mr,O as Zk,Oa as Pm,Ob as ho,Oc as hp,Od as hq,Oe as nr,P as _k,Pa as Qm,Pb as io,Pc as ip,Pd as iq,Pe as or,Q as $k,Qa as Rm,Qb as jo,Qc as jp,Qd as jq,Qe as pr,R as al,Ra as Sm,Rb as ko,Rc as kp,Rd as kq,Re as qr,S as bl,Sa as Tm,Sb as lo,Sc as lp,Sd as lq,Se as rr,T as cl,Ta as Um,Tb as mo,Tc as mp,Td as mq,Te as sr,U as dl,Ua as Vm,Ub as no,Uc as np,Ud as nq,Ue as tr,V as el,Va as Wm,Vb as oo,Vc as op,Vd as oq,Ve as ur,W as fl,Wa as Xm,Wb as po,Wc as pp,Wd as pq,We as vr,X as gl,Xa as Zm,Xb as qo,Xc as qp,Xd as qq,Xe as wr,Y as hl,Ya as _m,Yb as ro,Yc as rp,Yd as rq,Z as il,Za as $m,Zb as so,Zc as sp,Zd as sq,_ as jl,_a as an,_b as to,_c as tp,_d as tq,aa as ll,ab as cn,ac as vo,ad as vp,ae as vq,ba as ml,bb as dn,bc as wo,bd as wp,be as wq,ca as nl,cb as en,cc as xo,cd as xp,ce as xq,da as ol,db as fn,dc as yo,dd as yp,de as yq,ea as pl,eb as gn,ec as zo,ed as zp,ee as zq,fa as ql,fb as hn,fc as Ao,fd as Ap,fe as Aq,ga as rl,gb as jn,gc as Bo,gd as Bp,ge as Bq,ha as sl,hb as kn,hc as Co,hd as Cp,he as Cq,ia as tl,ib as ln,ic as Do,id as Dp,ie as Dq,ja as ul,jb as mn,jc as Eo,jd as Ep,je as Eq,ka as vl,kb as nn,kc as Fo,kd as Fp,ke as Fq,la as wl,lb as on,lc as Go,ld as Gp,le as Gq,ma as xl,mb as pn,mc as Ho,md as Hp,me as Hq,na as yl,nb as qn,nc as Io,nd as Ip,ne as Iq,o as a,oa as zl,ob as tn,oc as Jo,od as Jp,oe as Pq,p as Hj,pa as bm,pb as un,pc as Ko,pd as Kp,pe as Qq,q as Ij,qa as cm,qb as vn,qc as Lo,qd as Lp,qe as Rq,r as Jj,ra as dm,rb as wn,rc as Mo,rd as Mp,re as Sq,s as Kj,sa as em,sb as Cn,sc as No,sd as Np,se as Tq,t as Lj,ta as fm,tb as Dn,tc as Oo,td as Op,te as Uq,u as Mj,ua as gm,ub as En,uc as Po,ud as Pp,ue as Vq,v as Nj,va as hm,vb as Fn,vc as Qo,vd as Qp,ve as Wq,w as Oj,wa as im,wb as Kn,wc as Ro,wd as Rp,we as Xq,x as Pj,xa as jm,xb as Ln,xc as So,xd as Sp,xe as Yq,y as Uj,ya as km,yb as Mn,yc as To,yd as Tp,ye as Zq,z as Vj,za as lm,zb as Nn,zc as Uo,zd as Up,ze as _q}from"./chunk-dzr5w33y.js";import{$e as bk,Ye as _j,Ze as $j,_e as ak,af as ck,bf as dk,cf as ek,df as fk,ef as gk,ff as hk,gf as ik,hf as jk,if as kk,jf as lk,kf as mk}from"./chunk-jy6madxa.js";import{lf as Dk,mf as Ek,nf as Fk,of as Gk,pf as Hk,qf as Ik,rf as Jk,sf as Kk,tf as Lk,uf as Mk,vf as Nk,wf as Ok}from"./chunk-j2pmv4jw.js";import{Af as co,Bf as eo,Cf as fo,xf as $n,yf as ao,zf as bo}from"./chunk-acwjyext.js";import{Df as rn,Ef as sn}from"./chunk-vzskgbqj.js";import{Ff as xn}from"./chunk-bskzz385.js";import{Gf as Rl,Hf as Sl,If as Tl,Jf as Ul,Kf as Xl,Lf as $l}from"./chunk-w56erqz5.js";import{Mf as Vl,Pf as Wl}from"./chunk-9g2rhkx8.js";import{$f as sm,Xf as om,Yf as pm,Zf as qm,_f as rm,ag as tm,bg as um,cg as vm,dg as wm,eg as xm,fg as ym,gg as zm}from"./chunk-d19bydks.js";import{hg as Bk,ig as Ck}from"./chunk-n7w8kgfw.js";import{jg as am}from"./chunk-cdb8a0tx.js";import{kg as Fm,lg as Gm,mg as Hm,ng as Ym,og as yn,pg as zn,qg as An,rg as Bn,sg as Gn,tg as Hn,ug as In,vg as Jn}from"./chunk-89nbkhxk.js";import{Ag as El,Bg as Fl,Cg as Gl,Dg as Hl,Eg as Il,Fg as Jl,Gg as Kl,Hg as Ll,Ig as Ml,Jg as Yl,Kg as Zl,Lg as _l,wg as Al,xg as Bl,yg as Cl,zg as Dl}from"./chunk-y805f58c.js";import{Mg as Wi,Ng as Xi,Og as Yi,Pg as Zi,Qg as _i,Rg as $i,Sg as aj,Tg as bj,Ug as cj,Vg as dj,Wg as ej}from"./chunk-6x3jqwxp.js";import{Xg as wj,Zg as xj}from"./chunk-cs1dc1n7.js";import{dh as nk,eh as ok,fh as pk,gh as qk,hh as rk,ih as sk,jh as tk,lh as uk,mh as vk,nh as wk,oh as xk,ph as yk,qh as zk,th as Ak}from"./chunk-k46js7bz.js";import{uh as gh,vh as hh,wh as ih,xh as jh}from"./chunk-tv4n71jy.js";import{Ch as kh}from"./chunk-rbke5wqk.js";import{Dh as rh,Eh as sh,Fh as th,Gh as uh,Hh as vh,Ih as wh}from"./chunk-z0y4gcsp.js";import{Jh as Li,Kh as Mi,Lh as Ni,Ph as Oi,Qh as Pi,Rh as Qi}from"./chunk-wdwf3wzg.js";import{$h as Ji,Sh as Bi,Th as Ci,Uh as Di,Vh as Ei,Wh as Fi,Yh as Gi,Zh as Hi,_h as Ii,ai as Ki}from"./chunk-j93x5fzs.js";import{bi as rg,ci as sg,di as tg,ei as ug,fi as vg,gi as wg}from"./chunk-ntnv2f7a.js";import{hi as xg,ii as yg,ji as zg,ki as Ag,li as Bg}from"./chunk-1gdzz04h.js";import{mi as Cg,ni as Dg,oi as Eg,pi as Fg,qi as Gg}from"./chunk-ssfhndm6.js";import{ri as Hg,si as Ig,ti as Jg,ui as Kg,vi as Lg,wi as Mg,xi as Ng}from"./chunk-94fee5jw.js";import{Ai as Qg,Bi as Rg,Ci as Sg,Di as Tg,yi as Og,zi as Pg}from"./chunk-pv9at6r1.js";import{Fi as Ug,Gi as Vg,Hi as Wg,Ii as Xg,Ji as Yg,Ki as Zg,Li as _g,Mi as $g,Ni as ah,Oi as bh,Pi as ch,Qi as dh,Ri as eh,Si as fh}from"./chunk-dq88kv1p.js";import{Ui as lg,Vi as mg}from"./chunk-s8bx0wv7.js";import{Yi as ng}from"./chunk-5q44vwmg.js";import"./chunk-ht51fz7w.js";import{aj as og}from"./chunk-fvjh7rx0.js";import{bj as pg,cj as qg}from"./chunk-b6jhznkh.js";import{dj as ee,ej as fe,fj as ge,gj as he,hj as ie,ij as je,jj as ke,kj as le,lj as me,mj as ne,nj as oe,oj as pe,pj as qe,qj as re}from"./chunk-fee1k8c5.js";import{rj as Oe,sj as Pe}from"./chunk-qa8qmer5.js";import{Aj as Be,Bj as Ce,Cj as De,Dj as Ee,Ej as Fe,Fj as Ge,Gj as He,Hj as Ie,Ij as Je,Jj as Ke,Kj as Le,Lj as Me,Mj as Ne,zj as Ae}from"./chunk-nhmq45hh.js";import{Nj as Qe,Oj as Re,Pj as Se,Qj as Te,Rj as Ue,Sj as Ve,Tj as We,Uj as Xe,Vj as Ye,Wj as Ze,Xj as _e}from"./chunk-x58dcsjw.js";import{pk as Jq,qk as Kq,rk as Lq,sk as Mq,tk as Nq,uk as Oq}from"./chunk-0e1pt5my.js";import{Ak as Ol,Bk as Pl,Ck as Ql,vk as Qj,wk as Rj,xk as Sj,yk as Tj,zk as Nl}from"./chunk-8k7evyhh.js";import"./chunk-frp9fc7j.js";import"./chunk-r84h7wxw.js";import{$m as Wb,$n as Wc,$p as Jf,$q as Yh,$r as zj,Al as da,Am as wb,An as vc,Ao as Ld,Ap as hf,Aq as ig,Ar as xi,Bl as ea,Bm as xb,Bn as wc,Bo as Md,Bp as jf,Bq as jg,Br as yi,Cl as fa,Cm as yb,Cn as xc,Co as Nd,Cp as kf,Cq as kg,Cr as zi,Dl as ga,Dm as zb,Dn as yc,Do as Od,Dp as lf,Dq as lh,Dr as Ai,El as ha,Em as Ab,En as zc,Eo as Pd,Ep as mf,Eq as mh,Er as Ri,Fl as ia,Fm as Bb,Fn as Ac,Fo as Qd,Fp as nf,Fq as nh,Fr as Si,Gm as Cb,Gn as Bc,Go as Rd,Gp as of,Gq as oh,Gr as Ti,Hn as Cc,Ho as Sd,Hp as pf,Hq as ph,Hr as Ui,Il as za,Im as Db,In as Dc,Io as Td,Ip as qf,Iq as qh,Ir as Vi,Jl as Aa,Jm as Eb,Jn as Ec,Jo as Ud,Jp as rf,Jq as xh,Jr as fj,Kl as Ba,Km as Fb,Kn as Fc,Ko as Vd,Kp as sf,Kq as yh,Kr as gj,Ll as Ca,Lm as Gb,Ln as Gc,Lo as Wd,Lp as tf,Lq as zh,Lr as hj,Ml as Da,Mm as Hb,Mn as Hc,Mo as Xd,Mp as uf,Mq as Ah,Mr as ij,Nm as Ib,Nn as Ic,No as Yd,Np as vf,Nq as Bh,Nr as jj,Om as Jb,On as Jc,Oo as Zd,Op as wf,Oq as Ch,Or as kj,Pl as Ga,Pm as Kb,Pn as Kc,Po as _d,Pp as xf,Pq as Dh,Pr as lj,Ql as Ha,Qm as Lb,Qn as Lc,Qo as $d,Qp as yf,Qq as Eh,Qr as mj,Rl as Oa,Rm as Mb,Rn as Mc,Ro as ae,Rp as zf,Rq as Fh,Rr as nj,Sl as Pa,Sm as Nb,Sn as Nc,So as be,Sp as Af,Sq as Gh,Sr as oj,Tl as Qa,Tm as Ob,Tn as Oc,To as ce,Tp as Bf,Tq as Hh,Tr as pj,Ul as Ra,Um as Pb,Un as Pc,Uo as de,Up as Cf,Uq as Ih,Ur as qj,Vl as Sa,Vm as Qb,Vn as Qc,Vp as Df,Vq as Jh,Vr as rj,Wl as Ta,Wm as Rb,Wn as Rc,Wo as xe,Wp as Ef,Wq as Kh,Wr as sj,Xl as Ua,Xm as Sb,Xn as Sc,Xp as Ff,Xq as Lh,Xr as tj,Yl as Va,Ym as Tb,Yn as Tc,Yp as Gf,Yq as Mh,Yr as uj,Zl as Wa,Zm as Ub,Zn as Uc,Zo as ye,Zp as Hf,Zq as Nh,Zr as vj,_m as Vb,_n as Vc,_o as ze,_p as If,_q as Xh,_r as yj,an as Xb,ao as Xc,ap as $e,aq as Kf,ar as Zh,as as Aj,bn as Yb,bo as Yc,bq as Lf,br as _h,bs as Bj,cm as Xa,cn as Zb,co as Zc,cq as Mf,cr as $h,cs as Cj,dm as Ya,dn as _b,do as _c,dq as Nf,dr as ai,ds as Dj,em as Za,en as $b,eo as $c,eq as Of,er as bi,es as Ej,fm as _a,fn as ac,fo as ad,fq as Pf,fr as ci,fs as Fj,gm as $a,gn as bc,go as bd,gq as Qf,gr as di,gs as Gj,hm as ab,hn as cc,ho as cd,hq as Rf,hr as ei,il as s,in as dc,io as dd,iq as Sf,ir as fi,jl as t,jn as ec,jo as ed,jq as Tf,jr as gi,kl as u,km as bb,kn as fc,ko as fd,kq as Uf,kr as hi,ll as v,lm as cb,ln as gc,lo as gd,lq as Vf,lr as ii,ml as w,mm as db,mn as hc,mo as hd,mq as Wf,mr as ji,nl as x,nm as eb,nn as ic,no as yd,nq as Xf,nr as ki,ol as y,om as fb,on as jc,oo as zd,oq as Yf,or as li,pl as z,pm as gb,pn as kc,po as Ad,pq as Zf,pr as mi,ql as A,qm as hb,qn as lc,qo as Bd,qq as _f,qr as ni,rl as B,rm as ib,rn as mc,ro as Cd,rp as af,rq as $f,rr as oi,sl as C,sm as jb,sn as nc,so as Dd,sq as ag,sr as pi,tl as D,tm as kb,tn as oc,to as Ed,tp as bf,tq as bg,tr as qi,ul as E,um as lb,un as pc,uo as Fd,uq as cg,ur as ri,vl as F,vm as mb,vn as qc,vo as Gd,vp as cf,vq as dg,vr as si,wl as G,wm as nb,wn as rc,wo as Hd,wp as df,wq as eg,wr as ti,xl as H,xm as ob,xn as sc,xo as Id,xp as ef,xq as fg,xr as ui,yl as I,ym as pb,yn as tc,yo as Jd,yp as ff,yq as gg,yr as vi,zl as J,zn as uc,zo as Kd,zp as gf,zq as hg,zr as wi}from"./chunk-spnkgsft.js";import{hs as d,is as e,js as f,ks as g,ls as h,ms as i,ns as j,os as k,ps as l,qs as m,rs as n,ss as o,ts as p,us as q,vs as r}from"./chunk-4awxsp8f.js";import{As as Sh,Bs as Th,Cs as Uh,Ds as Vh,Es as Wh,ws as Oh,xs as Ph,ys as Qh,zs as Rh}from"./chunk-hk8j3eps.js";import{Fs as b,Gs as c}from"./chunk-mxva4zmq.js";import{Hs as Ea,Is as Fa}from"./chunk-1kg9sz9a.js";import{Js as qb,Ks as rb,Ms as sb,Ws as tb,Xs as ub,Ys as vb}from"./chunk-nnd1hqht.js";import{$s as ue,Zs as se,_s as te,at as ve,dt as we}from"./chunk-msxcd1kp.js";import{et as Ia,ft as Ja,gt as Ka,ht as La,it as Ma,jt as Na}from"./chunk-xgtcq9bj.js";import{kt as id,lt as jd,mt as kd,nt as ld,ot as md,pt as nd,qt as od,rt as pd,st as qd,tt as rd,ut as sd,vt as td,wt as ud,xt as vd,yt as wd,zt as xd}from"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import{Ct as ja,Dt as ka,Et as la,Ft as ma,Gt as na,Ht as oa,It as pa,Jt as qa,Kt as ra,Lt as sa,Mt as ta,Nt as ua,Ot as va,Pt as wa,Qt as xa,Rt as ya}from"./chunk-5a1b5kjt.js";import{Vt as K,Wt as L,Zt as M,cu as N,du as O,ju as P,ku as Q,lu as R,mu as S,nu as T,ou as U,pu as V,qu as W,ru as X,su as Y,tu as Z,uu as _,vu as $,wu as aa,xu as ba,zu as ca}from"./chunk-r2kag877.js";import"./chunk-8p8qa1s9.js";import"./chunk-j4ze77e0.js";export{ik as writeNetlifyConfig,Zl as writeManifest,Nk as writeImageManifest,po as wrapComponentForHMR,jr as withDefaults,vj as webComponentDirectiveHandler,ep as watermark,gq as watchViews,Xk as watchMultiple,Yk as watchEffect,Wk as watch,we as warmImagePlaceholders,jl as waitForStore,Xd as waitForLocale,ao as virtualPathFor,ij as videoDirective,sc as validators,nr as validated,Jd as validateValueEnhanced,mh as validateTemplate,jp as validateParams,Kd as validateFormEnhanced,Xp as validateFile,Fd as validateFields,Ed as validateField,oh as validateDirective,cd as validateCspDirectives,Dj as validateConfig,cm as validateComponentScripts,Am as validateComponentProps,kg as validateClientScript,jh as v,ib as usesSignalsInScript,pa as usesReactiveRuntime,Bh as userComponentFileExists,Rg as useVirtualList,qd as useTitle,il as useStoreOrThrow,Ho as useStore,Uj as useStorage,rq as useSlots,Wj as useSessionStorage,nd as useSeoMeta,kl as useRouteParams,ml as useRouteParamOrThrow,ll as useRouteParam,qd as usePageTitle,Ne as useOptimistic,ol as useMiddlewareValue,nl as useMiddlewareState,Vj as useLocalStorage,io as useLoadingIndicator,ld as useHead,gh as useForm,tq as useAttrs,Zp as uploadFiles,Yp as uploadFile,fl as updateInstance,Le as untrack,Rh as unregisterDirective,gl as unmountInstance,pb as unescapeHtml,eo as typecheckStxFiles,Ah as transpileTypeScript,Yq as translate,w as transitionDirective,um as toUsers,tm as toUser,Po as thumbnail,Qp as thumbHashToRGBA,Rp as thumbHashToDataURL,ra as templateNeedsRuntime,qa as templateHasReactiveContext,Qe as templateCache,Lb as syncRecordedResponse,mo as stxClientHelpers,vf as structuredDataDirective,$q as stripLocalePrefix,Kl as stripDocumentWrapper,Fa as stripCommentsAndLiterals,gn as stringToStream,Sc as strictCspPreset,me as streamingSuspenseDirective,qe as streamToResponse,ke as streamTemplateSimple,ee as streamTemplate,Pj as stopHmrServer,qm as stopBroadcasting,La as stateDirName,Ma as stateDir,Ae as state,eg as startsDocument,Jn as startProductionServer,xn as startInteractive,pm as startBroadcasting,br as stampLocaleLayoutGroup,D as staggerDirective,hp as srcsetUrls,E as springDirective,Bc as splitByPipe,Gl as spaNavVaryHeaders,bo as sourcePathFor,op as smartBatchSign,Dh as slotContentHasExpressions,mp as signUrl,yh as shouldTranspileTypeScript,Mj as shouldReloadOnChange,rp as shouldRefreshSignature,Nj as shouldIgnoreFile,Jg as shouldCacheComponent,To as sharpen,qr as shape,Ka as setStateDir,sl as setRouteParams,tl as setMiddlewareState,ve as setImagePlaceholder,lq as setGlobalProvide,Pb as setErrorLocale,Pk as setCurrentInstance,Yi as setCachedVideoResult,Ni as setCachedImageResult,Hi as setCached,tr as serveStxFile,vr as serveMultipleStxFiles,Hj as serveMarkdownFile,Tn as serveFile,wr as serveApp,Sn as serve,so as serializeState,Ym as serializeSetCookie,Vo as sepia,od as seoMetaToHeadConfig,x as scrollAnimateDirective,q as screenReaderDirective,mj as scopeHTML,lj as scopeCSS,yf as scanForSitemapEntries,k as scanA11yTargets,l as scanA11yIssues,Zo as saturation,kp as sanitizeParams,uc as sanitizeFilePath,vc as sanitizeExpression,wc as sanitizeDirectiveParams,tc as sanitizeDirectiveParam,xc as sanitizeComponentProps,nc as safeExecuteAsync,mc as safeExecute,xa as runtimeHandledXAttrsLiteral,of as runPreProcessingMiddleware,pf as runPostProcessingMiddleware,An as runPageAction,Ge as runMountCallbacks,ba as runMiddleware,dl as runHooks,Rq as runDoctor,He as runDestroyCallbacks,Df as runComposers,_o as rotate,kh as rewriteImagesWithSiblings,Mb as responseBindings,Hh as resolveTemplatePath,c as resolveStxTargets,zj as resolveStxDirectories,Xq as resolveI18n,No as resize,Xa as resetPlaceholders,kd as resetHead,ro as resetHMRHandler,ac as resetErrorConfig,lr as required,$a as replacePlaceholders,eq as renderView,fj as renderVideoComponent,Pa as renderVendorStyleTags,Aq as renderToString,Bq as renderToStream,Cq as renderToDOM,Pp as renderThumbhashToCanvas,Oq as renderTemplateString,Mq as renderTemplate,Nq as renderString,he as renderStreamingPage,th as renderSlot,zg as renderSSRSuspense,zp as renderProtectedVideo,yp as renderProtectedImg,lp as renderMediaUpload,Lq as renderMarkdownView,Pl as renderLayoutTypes,Ri as renderImgComponent,Dk as renderImageComponent,sd as renderHtmlAttrs,rd as renderHead,hq as renderEmail,Fh as renderComponentWithSlot,td as renderBodyAttrs,Co as render,Uc as relaxedCspPreset,Dd as registerValidationRule,oe as registerStreamingDirectives,Jo as registerStoresClient,ql as registerStore,wf as registerSeoDirectives,V as registerMiddleware,db as registerFilters,cb as registerFilter,Rb as registerErrorMessages,Id as registerEnhancedValidationRule,Oh as registerDirective,bd as registerCspDirectives,Dm as registerComponentDirectives,J as registerAnimationDirectives,r as registerA11yDirectives,Tk as ref,pn as redirect,Hb as recordResponseStatus,Ib as recordResponseHeader,Na as rebaseOntoStateDir,Jb as readResponseStatus,Kb as readResponseHeaders,Fj as readMarkdownFile,Re as readFileCached,Uk as reactive,cp as quality,wp as pruneSignatureCache,Ki as pruneCache,jq as provide,Kq as protectCodeBlocks,kr as prop,Hf as processVueTemplate,Pg as processVirtualListDirectives,Tg as processVirtualGridDirectives,ej as processVideo,Gd as processValidateDirective,ce as processTranslateDirective,tg as processTransitionDirectives,wg as processTransitionAttributes,wd as processTitleDirective,zb as processTemplateBindings,pg as processTeleportDirectives,xg as processSuspenseDirectives,rf as processStructuredData,ie as processStreamDirectives,Nb as processStatusDirective,eh as processStaticDirectives,mf as processStackReplacements,lf as processStackPushDirectives,uh as processSlots,Il as processShell,Ff as processServerBindings,sf as processSeoDirective,pe as processSectionDirectives,Kf as processScopedStyles,xb as processReactiveBindings,Ap as processProtectedMedia,Zg as processPartialHydrationDirectives,jg as processOnceDirective,nf as processMiddleware,qf as processMetaDirectives,xd as processMetaDirective,Gj as processMarkdownFileDirectives,Mh as processMarkdownDirectives,ff as processLoops,Hg as processKeepAliveDirectives,ig as processJsonDirective,Sg as processInfiniteListDirectives,kf as processIncludes,Ti as processImgComponents,Fk as processImageComponents,sk as processImage,vd as processHeadDirective,zd as processForms,Bd as processFormInputDirectives,mb as processExpressions,Ca as processEventDirectives,Cd as processErrorDirective,If as processDynamicComponents,lh as processDirectives,Wh as processDirectiveAttributes,og as processDeferDirectives,gd as processCustomDirectives,_c as processCspDirectives,rr as processComponentProps,Wa as processClientScript,Ad as processBasicFormDirectives,Cg as processAsyncDirectives,hd as processAppearanceBootstrapDirective,A as processAnimationDirectives,f as processA11yDirectives,Td as preloadTranslationsBackground,Sd as preloadTranslations,ho as preloadIslandHandlers,xe as preloadIconCollection,lm as poolStrings,xj as pluginManager,te as placeholdersWarmed,sg as performLeave,rg as performEnter,Ie as pendingLifecycleCounts,Me as peek,gf as partialsCache,gj as parseVideoDirectiveOptions,Lo as parseUrl,Sp as parseThumbhashString,Hc as parseSwitchBlock,rh as parseSlots,sh as parseSlotElement,Mc as parseScriptDeclarations,tj as parseSFCComponent,Bp as parseProtectedArgs,ef as parseLoopBinding,Si as parseImgComponent,ii as parseImageUrl,Ek as parseImageComponent,yn as parseFormBody,Jc as parseExpressionWithFilters,mn as parseCookies,Im as parseContainerSelector,Ec as parseConditionalBlock,Kc as parseArguments,H as parseAnimationShorthand,mr as optional,mm as optimizeTemplate,Kk as optimizeImage,Lk as optimizeDirectory,or as oneOf,hf as onceStore,al as onUpdated,wb as onUpdate,cl as onUnmounted,xl as onServer,_k as onMounted,Ee as onMount,dh as onHydrated,pq as onErrorCaptured,Fe as onDestroy,Ng as onDeactivated,wl as onClient,$k as onBeforeUpdate,bl as onBeforeUnmount,Zk as onBeforeMount,Mg as onActivated,Lp as observeElement,qn as notFound,Pf as normalizeCriticalHeadOrder,oq as nextTick,Gm as negotiateEncoding,P as navigateTo,el as mountInstance,z as motionDirective,Tc as moderateCspPreset,km as minifyHtml,uf as metaDirective,Zf as metaDedupKey,Mo as mergeParams,$f as mergeHtmlAttrs,md as mergeHeadConfigs,Xc as mergeCspDirectives,rb as mergeCrosswindConfig,M as matchRoute,Nh as markdownDirectiveHandler,Ej as markdownCache,b as looksLikeGlob,_q as localizePath,Ud as loadTranslationLazy,_d as loadTranslation,Aj as loadStxConfig,_ as loadMiddlewareFromDirectory,_l as loadManifest,Hp as loadElement,rm as loadChannels,fr as lintStxStrict,Jp as lazyLoadAll,Ip as lazyLoad,C as keyframeDirective,yq as jsxs,zq as jsxDEV,xq as jsx,on as jsonResponse,ne as islandDirective,Zb as isTest,Ll as isSpaNavigation,El as isSpaNavRequest,pp as isSignatureValid,Je as isSignal,qk as isSharpAvailable,$m as isServerEnvironment,ul as isServer,ta as isRuntimeOwnedColonAttr,Xb as isProduction,d as isPresentationalRole,Ep as isNativeLazySupported,Jq as isMarkdownPath,Qd as isLoading,Rd as isLoaded,xh as isJavaScriptScript,Fp as isIntersectionObserverSupported,yk as isImageFile,rk as isImageBackendAvailable,ae as isICUFormat,ch as isHydrated,Ch as isHydrateTrigger,Fb as isHttpStatus,_m as isEdgeEnvironment,gr as isDirectiveKind,Yb as isDevelopment,Ke as isDerived,Lj as isCssOnlyChange,Fm as isCompressible,vl as isClient,Eg as isAsyncComponent,zn as isActionableMethod,Wo as invert,Te as invalidateFileCacheByDir,Se as invalidateFileCache,lb as interpolateScriptsInTemplate,jb as interpolateScriptExpressions,kb as interpolateScriptAttributes,jc as inlineError,Wq as injectThemeBootstrap,tf as injectSeoTags,Tq as injectSeo,$e as injectRouterScript,Kj as injectHotReload,fa as injectHeatmap,Yc as injectCspMetaTag,vb as injectCrosswindCSS,gg as injectConfigHeadTags,Of as injectColorModeBootScript,bg as injectCloakStyle,Vf as injectBuildId,Ra as injectBrowserCoreAutoImports,Bb as injectAnalytics,kq as inject,pl as initStoreRegistry,lk as initNetlify,jo as initLoadingIndicator,Gp as initLazyLoading,wn as initFile,Op as initBlurUp,Up as initAllBlurUp,Vi as imgDirective,Ik as imageDirective,Hn as hydrateTemplateStream,Gn as hydrateTemplate,go as hydrateIslands,$g as hydrateIsland,In as hydrateFragment,ah as hydrateByStrategy,bh as hydrateAll,zo as hydrate,Rn as htmlResponse,cg as hoistLeadingHeadTags,Qf as hoistColorModeBootScript,ga as heatmapDirective,Di as hashString,_e as hashFilePath,Bi as hashFile,Ci as hashBuffer,Gf as hasVueTemplateSyntax,df as hasVariables,Eo as hasStore,ab as hasPlaceholders,jk as hasNetlifyConfig,X as hasMiddleware,Da as hasEventDirectives,fg as hasDocumentShell,ph as hasDirectives,h as hasDOMSupport,Bk as handleImageRequest,qq as handleError,Gq as h,xk as groupVariantsByFormat,Uo as grayscale,Kn as gitHash,em as getUnusedDirectives,Vd as getTranslationSync,Od as getTranslationCacheStats,Wd as getTranslationAsync,be as getTranslation,ek as getTotalSize,qp as getTimeUntilExpiry,lg as getStoreScript,Fo as getStoreNames,Do as getStore,Zj as getStorageSize,Yj as getStorageKeys,Ih as getSourceLineInfo,zh as getSharedTranspiler,g as getScreenReaderOnlyStyle,nj as getScopeAttribute,ze as getRouteParams,Ga as getPublicEnvDefine,Ha as getPublicEnv,nh as getPositionInfo,Za as getPlaceholderRegistry,Ai as getPlaceholderCacheStats,jd as getPageMeta,Oc as getNonce,zk as getMimeType,Z as getMiddlewareNames,W as getMiddleware,Pd as getLoadingState,Yd as getLoadingLocales,se as getImagePlaceholder,tk as getImageMetadata,yo as getHydrationRuntime,rl as getHydratedStoreState,Oj as getHmrServer,id as getHead,qo as getHMRHandler,mi as getFormatExtension,Fi as getFileMtime,wk as getFallbackVariant,Tb as getErrorMessage,Qb as getErrorLocale,$b as getErrorConfig,Wb as getErrorCodeName,Qh as getDirectives,Ph as getDirective,Qk as getCurrentInstance,Wc as getCspPreset,dd as getCspHeaderName,sb as getCrosswindServeAsset,Lh as getComponentCacheStats,Xi as getCachedVideoResult,up as getCachedSignature,Ve as getCachedSignalsRuntime,We as getCachedRouterScript,yi as getCachedPlaceholder,Mi as getCachedImageResult,Gi as getCached,Ji as getCacheStats,Tf as getBuildId,om as getBroadcastServer,li as getBestVariant,eb as getAllFilters,$h as generateWidthSrcset,Qg as generateVirtualListCSS,$p as generateVideoPreview,Ld as generateValidationScript,aq as generateUploadRuntime,fm as generateTreeShakenBundle,vg as generateTransitionRuntime,ug as generateTransitionCSS,$i as generateThumbnails,ri as generateThumbhashPlaceholder,Rm as generateTemplatesDocs,Bg as generateSuspenseRuntime,Ag as generateSuspenseCSS,to as generateStateScript,ji as generateSrcsetData,Qi as generateSrcset,uk as generateSrcSet,aj as generateSpriteSheet,iq as generateSpaShell,ki as generateSourceTags,fi as generateSizesFromBreakpoints,ei as generateSizesAttribute,vk as generateSizes,xf as generateSitemapIndex,Uq as generateSitemap,Dp as generateSimpleMediaPicker,xp as generateSignatureRuntime,Pe as generateSignalsRuntimeDev,Oe as generateSignalsRuntime,Va as generateServerDataBridge,kj as generateScopeId,uj as generateSFCWebComponent,Aa as generateRuntimeScript,K as generateRouteTypes,L as generateRouteManifest,zf as generateRobotsTxt,Vq as generateRobots,Pi as generateResponsiveVariants,qj as generateReactiveWebComponentTS,pj as generateReactiveWebComponent,sj as generateReactiveRuntime,rj as generateReactiveMixin,_i as generatePoster,xi as generatePlaceholderStyle,wi as generatePlaceholderCSS,qi as generatePlaceholder,_g as generatePartialHydrationCSS,Nc as generateNonce,fk as generateNetlifyToml,cq as generateMinifiedMediaRuntime,bq as generateMediaRuntime,Cp as generateMediaManagerEmbed,Yl as generateManifest,lo as generateLoadingIndicatorHtml,Np as generateLazyLoadRuntime,Ql as generateLayoutTypes,ti as generateLQIP,Lg as generateKeepAliveRuntime,Kg as generateKeepAliveCSS,fh as generateIslandManifest,_p as generateImagePreview,Mk as generateImageManifest,xo as generateHydrationScript,re as generateHydrationRuntime,Ao as generateHydrationCSS,Ug as generateHydrationBootstrap,Jj as generateHotReloadScript,ea as generateHeatmapScript,oo as generateHMRClientScript,bj as generateHLSManifest,uo as generateEventBindings,di as generateDprSrcsetWithVariableQuality,ci as generateDprSrcset,dg as generateDocumentShell,Wm as generateDocs,Sm as generateDirectivesDocs,Vh as generateDirectiveRuntime,Af as generateDefaultRobotsTxt,cj as generateDASHManifest,Rc as generateCspMetaTag,Qc as generateCspHeader,ub as generateCrosswindCSS,vq as generateCompositionRuntime,Qm as generateComponentsDocs,Vg as generateComponentManifest,Om as generateComponentDoc,vi as generateColorPlaceholder,Nf as generateColorModeBootScript,hl as generateClientRuntime,Ei as generateCacheKey,Ta as generateBrowserAutoImportDestructuring,Vp as generateBlurUpRuntime,Wp as generateBlurUpCSS,yb as generateBindingsRuntime,ai as generateAutoWidthSrcset,Sa as generateAutoImportDestructuring,Gg as generateAsyncComponentRuntime,Fg as generateAsyncComponentCSS,I as generateAnimationRuntime,G as generateAnimationCSS,Ab as generateAnalyticsScript,fo as formatTypecheckDiagnostics,_n as formatTypeErrors,tn as formatStxContent,dk as formatSize,O as formatRoutes,un as formatMarkdownContent,Ub as formatLocalizedError,$d as formatICU,bc as formatFilePath,ic as formatError,Sq as formatDoctorReport,Tm as formatDocsAsMarkdown,Vm as formatDocsAsJson,Um as formatDocsAsHtml,bp as format,jm as foldConstants,ap as flipVertical,$o as flipHorizontal,Rl as fingerprint,co as findRuntimeTypeDeclarations,Qq as findPantryPackage,Dc as findMatchingEndTag,zc as findMatchingDelimiter,Ea as findInterpolationEnd,Fc as findIfBlocks,Ic as findExpressions,N as findErrorPage,Gc as findDirectiveBlocks,gm as findDeadCode,gm as findDeadBranches,Jm as findContainerRegion,Pm as findComponentFiles,ur as findCommonDir,ck as filterRequiredFiles,Gh as fileExists,af as extractVariables,Wl as extractTemplateExpressions,je as extractStreamBoundaries,vo as extractState,vh as extractSlotContent,cf as extractScriptFromTemplate,Vl as extractScriptBlocks,_a as extractPlaceholders,Cc as extractParenthesizedExpression,Gb as extractPageResponseStatus,ca as extractLayoutMetadata,ui as extractDominantColor,Lc as extractDirectiveParams,qh as extractDirectiveNames,Ml as extractContainerContent,Mm as extractComponentProps,Wg as extractComponentName,Nm as extractComponentDescription,tb as extractClassNames,Ua as extractBridgeData,Xg as extractBoundProps,Ac as extractBalancedExpression,Oa as extractAndStripCssImports,oj as extractAndScopeStyles,Ba as extractAndProcessEvents,Sj as externalizeSharedAssets,Tj as externalizeRepeatedAssets,Rj as externalizeHtml,ob as evaluateExpression,im as evaluateConstant,Ob as evaluateAuthExpression,hb as escapeHtmlValue,gb as escapeHtml,oc as errorRecovery,qc as errorLogger,qg as ensureTeleportTargets,hg as ensureDocumentShell,Hd as enhancedValidationRules,Km as enableDevTools,hm as eliminateDeadCode,Ce as effect,ip as dprUrls,Xm as docsCommand,Ol as discoverLayoutNames,Mp as disconnectObserver,Lm as disableDevTools,rc as devHelpers,Hl as detectShell,Zm as detectRuntime,gk as detectProjectConfig,ni as detectFormat,bm as detectBuildMode,Be as derived,kk as deploy,Cj as defineStxConfig,Io as defineStore,sq as defineSlots,er as defineSiteConfig,ir as definePropsWithValidation,hr as defineProps,wj as definePlugin,pd as definePageMeta,R as defineMiddleware,hh as defineForm,nq as defineExpose,mq as defineEmits,Sh as defineDirective,Iq as defineCustomElement,Fn as defineConfig,Th as defineClientDirective,Dg as defineAsyncComponent,dq as defaultMediaConfig,Ok as defaultImageConfig,Md as defaultI18nConfig,da as defaultHeatmapConfig,yd as defaultFormClasses,bb as defaultFilters,fd as defaultCspConfig,yj as defaultConfig,sr as default,qb as deepMergeThemes,Jf as dedupeScopedStyles,si as decodeThumbhash,ad as cspNonceDirective,$c as cspDirective,Tp as crossfadeTransition,Oo as crop,Og as createVirtualList,hj as createVideoDirective,kn as createVercelHandler,Xn as createTypeChecker,de as createTranslateFilter,fn as createTextEncoderStream,Hq as createStxApp,en as createStreamingResponse,le as createStreamRenderer,Go as createStore,U as createStorageManager,S as createServerCookieManager,Sk as createScope,yg as createSSRSuspense,ye as createRouter,$ as createRouteLocation,Vn as createRoute,Tk as createRef,Uk as createReactive,uq as createProvideContext,Mn as createProject,En as createProductionBuild,Ya as createPlaceholder,nm as createOptimizedBuild,ln as createNetlifyHandler,_j as createNetlifyClient,aa as createMiddlewareContext,Un as createMiddleware,Kp as createLazyObserver,Ig as createKeepAliveCache,bn as createKVNamespace,Yg as createIslandRegistry,Ui as createImgDirective,Jk as createImagePlugin,Ck as createImageHandler,Hk as createImageDirective,ia as createHeatmapAggregator,bk as createFileManifest,an as createEnvAccessor,lc as createEnhancedError,dn as createEdgeHandler,cn as createEdgeCache,Jh as createDetailedErrorMessage,jn as createDenoHandler,hk as createDefaultNetlifyConfig,ed as createCspHeaders,nn as createCookie,Vk as createComputed,Rk as createComponentInstance,hn as createCloudflareHandler,T as createClientCookieManager,Uh as createBuiltinDirectives,Hq as createApp,F as createAnimationTimeline,Ro as cover,bf as convertToCommonJS,Yo as contrast,Qo as contain,kc as consoleError,_b as configureErrorHandling,Bj as config,Vk as computed,Hm as compressResponse,Cf as composerPattern,Bf as composer,Jl as composeShellWithPage,Cm as componentDirective,Eh as componentClientSignalNames,Xl as compileTemplate,a as collectRepeatedFlag,ak as collectDeployFiles,Zi as clearVideoCache,Nd as clearTranslationCache,mg as clearStoreCache,Xj as clearStorage,vp as clearSignatureCache,zi as clearPlaceholderCache,jf as clearOnceStore,Pc as clearNonce,Y as clearMiddleware,ue as clearImagePlaceholders,Gk as clearImageCache,Sb as clearErrorMessages,Xe as clearDevCaches,fb as clearCustomFilters,Ef as clearComposers,ng as clearComposableCache,Kh as clearComponentCache,Ii as clearCache,ko as cleanupLoadingIndicator,Al as classifyScript,Bl as classifyAllScripts,Yn as checkTemplateFile,Zn as checkTemplate,Ye as checkCache,sp as checkAuthAccess,i as checkA11yWithRegex,j as checkA11y,xm as channel,sn as captureScreenshots,rn as captureScreenshot,Zd as cancelPendingLoads,$j as calculateSha1,bi as calculateOptimalWidths,Ze as cacheTemplate,jj as buildWebComponents,$n as buildVirtualSource,fq as buildViews,Ko as buildUrl,fe as buildSuspenseResolveScript,dr as buildStaticSite,la as buildRuntimeGlobalsDestructure,Sl as buildRuntimeAsset,Tl as buildRouterAsset,cr as buildLangPickerScript,hi as buildImageUrl,_f as buildHtmlAttrs,$l as buildForProduction,Em as buildComponentLibrary,tp as buildAuthParams,am as buildApp,ar as buildAlternateLinks,Dn as build,vm as broadcastPrivate,wm as broadcastPresence,sm as broadcast,Xo as brightness,So as blur,ya as blankInertHtmlRegions,np as batchSignUrls,De as batch,n as autoFixA11yFile,o as autoFixA11yDirectory,m as autoFixA11y,dp as auto,e as attributeValue,Ul as assetTags,za as asInvocableStatement,pr as arrayOf,Zq as applyTranslations,Oi as applyTransformations,wh as applySlots,Bm as applyPropDefaults,gp as applyPreset,ag as applyHtmlAttrs,ud as applyHead,nb as applyFilters,Fl as appendVary,Vc as apiCspPreset,y as animationGroupDirective,dj as analyzeVideo,dm as analyzeUsage,yl as analyzeTemplate,zl as analyzeProject,dm as analyzeDirectiveUsage,Cb as analyticsDirective,Pn as addStore,On as addPage,Zc as addNonceToInlineContent,Qn as addLayout,Nn as addComponent,Bn as actionRedirectResponse,Q as abortNavigation,p as a11yDirective,Ue as __setSignalsGeneratorsForTest,Uf as __setBuildIdForTest,Wi as VideoProcessorCache,ih as Validator,s as TransitionType,u as TransitionEase,t as TransitionDirection,yc as Tokenizer,Wn as TemplateTypeChecker,vn as TEMPLATE_PRESETS,hc as StxValidationError,dc as StxSyntaxError,fc as StxSecurityError,ec as StxRuntimeError,gc as StxFileError,cc as StxError,Dq as Show,ge as SUSPENSE_RESOLVER_RUNTIME,ja as STX_RUNTIME_GLOBALS,Qa as STX_AUTO_IMPORTS,Ja as STATE_DIR_ENV_VAR,B as SPRING_PRESETS,Cl as SPA_NAV_HEADER,sa as RUNTIME_OWNED_COLON_ATTRS,ua as RUNTIME_HANDLED_X_ATTRS,Db as RESPONSE_STATUS_KEY,Eb as RESPONSE_HEADERS_KEY,oa as REACTIVE_RUNTIME_GLOBALS,Cn as ProductionBuild,Fq as Portal,Ln as PROJECT_TEMPLATES,fp as PRESETS,na as NON_CLIENT_PRIMITIVES,Bo as MemorySessionStore,_h as MIME_TYPES,Xh as MEDIA_DEFAULT_WIDTHS,Zh as MEDIA_DEFAULT_FORMATS,Nl as LAYOUT_TYPES_FILE,Li as ImageProcessorCache,Ak as ImageProcessingError,wo as HydrationRuntime,Ij as HotReloadServer,ha as HeatmapAggregator,Yf as HTML_CLASS_MARKER,Xf as HTML_ATTRS_MARKER,wq as Fragment,Eq as For,Dl as FRAGMENT_CACHE_CONTROL,pc as ErrorLogger,Vb as ErrorCodes,Qj as EXTERNALIZED_ASSET_DIR,mk as DeployError,nk as DEFAULT_WIDTHS,v as DEFAULT_TRANSITION_OPTIONS,Ia as DEFAULT_STATE_DIR,pk as DEFAULT_QUALITY,oi as DEFAULT_PLACEHOLDER_OPTIONS,ok as DEFAULT_FORMATS,Yh as DEFAULT_DPR_VALUES,no as ComponentHMRHandler,ka as COMPONENT_SCOPE_LOCAL_GLOBALS,wa as COMPONENT_PASSTHROUGH_X_ATTRS,ma as COMPILE_TIME_ONLY_GLOBALS,gi as COMMON_SIZES,Lf as COLOR_MODE_BOOT_MARKER,Mf as COLOR_MODE_BOOT_GLOBAL,Wf as CLOAK_STYLE,zm as BroadcastServer,ym as Broadcast,Rf as BUILD_ID_META,Sf as BUILD_ID_HEADER,pi as BLUR_UP_CSS,va as ALPINE_BRIDGE_X_ATTRS,Pq as $path};
|
|
2
|
+
import{$ as kl,$a as bn,$b as uo,$c as up,$d as uq,A as Wj,Aa as mm,Ab as On,Ac as Vo,Ad as Vp,Ae as $q,B as Xj,Ba as nm,Bb as Pn,Bc as Wo,Bd as Wp,Be as ar,C as Yj,Ca as Am,Cb as Qn,Cc as Xo,Cd as Xp,Ce as br,D as Zj,Da as Bm,Db as Rn,Dc as Yo,Dd as Yp,De as cr,E as Pk,Ea as Cm,Eb as Sn,Ec as Zo,Ed as Zp,Ee as dr,F as Qk,Fa as Dm,Fb as Tn,Fc as _o,Fd as _p,Fe as er,G as Rk,Ga as Em,Gb as Un,Gc as $o,Gd as $p,Ge as fr,H as Sk,Ha as Im,Hb as Vn,Hc as ap,Hd as aq,He as gr,I as Tk,Ia as Jm,Ib as Wn,Ic as bp,Id as bq,Ie as hr,J as Uk,Ja as Km,Jb as Xn,Jc as cp,Jd as cq,Je as ir,K as Vk,Ka as Lm,Kb as Yn,Kc as dp,Kd as dq,Ke as jr,L as Wk,La as Mm,Lb as Zn,Lc as ep,Ld as eq,Le as kr,M as Xk,Ma as Nm,Mb as _n,Mc as fp,Md as fq,Me as lr,N as Yk,Na as Om,Nb as go,Nc as gp,Nd as gq,Ne as mr,O as Zk,Oa as Pm,Ob as ho,Oc as hp,Od as hq,Oe as nr,P as _k,Pa as Qm,Pb as io,Pc as ip,Pd as iq,Pe as or,Q as $k,Qa as Rm,Qb as jo,Qc as jp,Qd as jq,Qe as pr,R as al,Ra as Sm,Rb as ko,Rc as kp,Rd as kq,Re as qr,S as bl,Sa as Tm,Sb as lo,Sc as lp,Sd as lq,Se as rr,T as cl,Ta as Um,Tb as mo,Tc as mp,Td as mq,Te as sr,U as dl,Ua as Vm,Ub as no,Uc as np,Ud as nq,Ue as tr,V as el,Va as Wm,Vb as oo,Vc as op,Vd as oq,Ve as ur,W as fl,Wa as Xm,Wb as po,Wc as pp,Wd as pq,We as vr,X as gl,Xa as Zm,Xb as qo,Xc as qp,Xd as qq,Xe as wr,Y as hl,Ya as _m,Yb as ro,Yc as rp,Yd as rq,Z as il,Za as $m,Zb as so,Zc as sp,Zd as sq,_ as jl,_a as an,_b as to,_c as tp,_d as tq,aa as ll,ab as cn,ac as vo,ad as vp,ae as vq,ba as ml,bb as dn,bc as wo,bd as wp,be as wq,ca as nl,cb as en,cc as xo,cd as xp,ce as xq,da as ol,db as fn,dc as yo,dd as yp,de as yq,ea as pl,eb as gn,ec as zo,ed as zp,ee as zq,fa as ql,fb as hn,fc as Ao,fd as Ap,fe as Aq,ga as rl,gb as jn,gc as Bo,gd as Bp,ge as Bq,ha as sl,hb as kn,hc as Co,hd as Cp,he as Cq,ia as tl,ib as ln,ic as Do,id as Dp,ie as Dq,ja as ul,jb as mn,jc as Eo,jd as Ep,je as Eq,ka as vl,kb as nn,kc as Fo,kd as Fp,ke as Fq,la as wl,lb as on,lc as Go,ld as Gp,le as Gq,ma as xl,mb as pn,mc as Ho,md as Hp,me as Hq,na as yl,nb as qn,nc as Io,nd as Ip,ne as Iq,o as a,oa as zl,ob as tn,oc as Jo,od as Jp,oe as Pq,p as Hj,pa as bm,pb as un,pc as Ko,pd as Kp,pe as Qq,q as Ij,qa as cm,qb as vn,qc as Lo,qd as Lp,qe as Rq,r as Jj,ra as dm,rb as wn,rc as Mo,rd as Mp,re as Sq,s as Kj,sa as em,sb as Cn,sc as No,sd as Np,se as Tq,t as Lj,ta as fm,tb as Dn,tc as Oo,td as Op,te as Uq,u as Mj,ua as gm,ub as En,uc as Po,ud as Pp,ue as Vq,v as Nj,va as hm,vb as Fn,vc as Qo,vd as Qp,ve as Wq,w as Oj,wa as im,wb as Kn,wc as Ro,wd as Rp,we as Xq,x as Pj,xa as jm,xb as Ln,xc as So,xd as Sp,xe as Yq,y as Uj,ya as km,yb as Mn,yc as To,yd as Tp,ye as Zq,z as Vj,za as lm,zb as Nn,zc as Uo,zd as Up,ze as _q}from"./chunk-04tp3hjf.js";import{$e as bk,Ye as _j,Ze as $j,_e as ak,af as ck,bf as dk,cf as ek,df as fk,ef as gk,ff as hk,gf as ik,hf as jk,if as kk,jf as lk,kf as mk}from"./chunk-jy6madxa.js";import{lf as Dk,mf as Ek,nf as Fk,of as Gk,pf as Hk,qf as Ik,rf as Jk,sf as Kk,tf as Lk,uf as Mk,vf as Nk,wf as Ok}from"./chunk-j2pmv4jw.js";import{Af as co,Bf as eo,Cf as fo,xf as $n,yf as ao,zf as bo}from"./chunk-sqe4sz8r.js";import{Df as rn,Ef as sn}from"./chunk-vzskgbqj.js";import{Ff as xn}from"./chunk-bskzz385.js";import{Gf as Rl,Hf as Sl,If as Tl,Jf as Ul,Kf as Xl,Lf as $l}from"./chunk-wr17wgn4.js";import{Mf as Vl,Pf as Wl}from"./chunk-tpc0vwvz.js";import{$f as sm,Xf as om,Yf as pm,Zf as qm,_f as rm,ag as tm,bg as um,cg as vm,dg as wm,eg as xm,fg as ym,gg as zm}from"./chunk-d19bydks.js";import{hg as Bk,ig as Ck}from"./chunk-n7w8kgfw.js";import{jg as am}from"./chunk-9778d23n.js";import{kg as Fm,lg as Gm,mg as Hm,ng as Ym,og as yn,pg as zn,qg as An,rg as Bn,sg as Gn,tg as Hn,ug as In,vg as Jn}from"./chunk-jz3cjfz1.js";import{Ag as El,Bg as Fl,Cg as Gl,Dg as Hl,Eg as Il,Fg as Jl,Gg as Kl,Hg as Ll,Ig as Ml,Jg as Yl,Kg as Zl,Lg as _l,wg as Al,xg as Bl,yg as Cl,zg as Dl}from"./chunk-h3paff80.js";import{Mg as Wi,Ng as Xi,Og as Yi,Pg as Zi,Qg as _i,Rg as $i,Sg as aj,Tg as bj,Ug as cj,Vg as dj,Wg as ej}from"./chunk-6x3jqwxp.js";import{Xg as wj,Zg as xj}from"./chunk-cs1dc1n7.js";import{dh as nk,eh as ok,fh as pk,gh as qk,hh as rk,ih as sk,jh as tk,lh as uk,mh as vk,nh as wk,oh as xk,ph as yk,qh as zk,th as Ak}from"./chunk-k46js7bz.js";import{uh as gh,vh as hh,wh as ih,xh as jh}from"./chunk-tv4n71jy.js";import{Ch as kh}from"./chunk-rbke5wqk.js";import{Dh as rh,Eh as sh,Fh as th,Gh as uh,Hh as vh,Ih as wh}from"./chunk-z0y4gcsp.js";import{Jh as Li,Kh as Mi,Lh as Ni,Ph as Oi,Qh as Pi,Rh as Qi}from"./chunk-wdwf3wzg.js";import{$h as Ji,Sh as Bi,Th as Ci,Uh as Di,Vh as Ei,Wh as Fi,Yh as Gi,Zh as Hi,_h as Ii,ai as Ki}from"./chunk-j93x5fzs.js";import{bi as rg,ci as sg,di as tg,ei as ug,fi as vg,gi as wg}from"./chunk-ntnv2f7a.js";import{hi as xg,ii as yg,ji as zg,ki as Ag,li as Bg}from"./chunk-1gdzz04h.js";import{mi as Cg,ni as Dg,oi as Eg,pi as Fg,qi as Gg}from"./chunk-ssfhndm6.js";import{ri as Hg,si as Ig,ti as Jg,ui as Kg,vi as Lg,wi as Mg,xi as Ng}from"./chunk-94fee5jw.js";import{Ai as Qg,Bi as Rg,Ci as Sg,Di as Tg,yi as Og,zi as Pg}from"./chunk-pv9at6r1.js";import{Fi as Ug,Gi as Vg,Hi as Wg,Ii as Xg,Ji as Yg,Ki as Zg,Li as _g,Mi as $g,Ni as ah,Oi as bh,Pi as ch,Qi as dh,Ri as eh,Si as fh}from"./chunk-dq88kv1p.js";import{Ui as lg,Vi as mg}from"./chunk-s8bx0wv7.js";import{Yi as ng}from"./chunk-5q44vwmg.js";import"./chunk-ht51fz7w.js";import{aj as og}from"./chunk-fvjh7rx0.js";import{bj as pg,cj as qg}from"./chunk-b6jhznkh.js";import{dj as ee,ej as fe,fj as ge,gj as he,hj as ie,ij as je,jj as ke,kj as le,lj as me,mj as ne,nj as oe,oj as pe,pj as qe,qj as re}from"./chunk-fee1k8c5.js";import{rj as Oe,sj as Pe}from"./chunk-qa8qmer5.js";import{Aj as Be,Bj as Ce,Cj as De,Dj as Ee,Ej as Fe,Fj as Ge,Gj as He,Hj as Ie,Ij as Je,Jj as Ke,Kj as Le,Lj as Me,Mj as Ne,zj as Ae}from"./chunk-nhmq45hh.js";import{Nj as Qe,Oj as Re,Pj as Se,Qj as Te,Rj as Ue,Sj as Ve,Tj as We,Uj as Xe,Vj as Ye,Wj as Ze,Xj as _e}from"./chunk-x58dcsjw.js";import{pk as Jq,qk as Kq,rk as Lq,sk as Mq,tk as Nq,uk as Oq}from"./chunk-0e1pt5my.js";import{Ak as Ol,Bk as Pl,Ck as Ql,vk as Qj,wk as Rj,xk as Sj,yk as Tj,zk as Nl}from"./chunk-8k7evyhh.js";import"./chunk-frp9fc7j.js";import"./chunk-r84h7wxw.js";import{$m as Wb,$n as Wc,$p as Jf,$q as Yh,$r as zj,Al as da,Am as wb,An as vc,Ao as Ld,Ap as hf,Aq as ig,Ar as xi,Bl as ea,Bm as xb,Bn as wc,Bo as Md,Bp as jf,Bq as jg,Br as yi,Cl as fa,Cm as yb,Cn as xc,Co as Nd,Cp as kf,Cq as kg,Cr as zi,Dl as ga,Dm as zb,Dn as yc,Do as Od,Dp as lf,Dq as lh,Dr as Ai,El as ha,Em as Ab,En as zc,Eo as Pd,Ep as mf,Eq as mh,Er as Ri,Fl as ia,Fm as Bb,Fn as Ac,Fo as Qd,Fp as nf,Fq as nh,Fr as Si,Gm as Cb,Gn as Bc,Go as Rd,Gp as of,Gq as oh,Gr as Ti,Hn as Cc,Ho as Sd,Hp as pf,Hq as ph,Hr as Ui,Il as za,Im as Db,In as Dc,Io as Td,Ip as qf,Iq as qh,Ir as Vi,Jl as Aa,Jm as Eb,Jn as Ec,Jo as Ud,Jp as rf,Jq as xh,Jr as fj,Kl as Ba,Km as Fb,Kn as Fc,Ko as Vd,Kp as sf,Kq as yh,Kr as gj,Ll as Ca,Lm as Gb,Ln as Gc,Lo as Wd,Lp as tf,Lq as zh,Lr as hj,Ml as Da,Mm as Hb,Mn as Hc,Mo as Xd,Mp as uf,Mq as Ah,Mr as ij,Nm as Ib,Nn as Ic,No as Yd,Np as vf,Nq as Bh,Nr as jj,Om as Jb,On as Jc,Oo as Zd,Op as wf,Oq as Ch,Or as kj,Pl as Ga,Pm as Kb,Pn as Kc,Po as _d,Pp as xf,Pq as Dh,Pr as lj,Ql as Ha,Qm as Lb,Qn as Lc,Qo as $d,Qp as yf,Qq as Eh,Qr as mj,Rl as Oa,Rm as Mb,Rn as Mc,Ro as ae,Rp as zf,Rq as Fh,Rr as nj,Sl as Pa,Sm as Nb,Sn as Nc,So as be,Sp as Af,Sq as Gh,Sr as oj,Tl as Qa,Tm as Ob,Tn as Oc,To as ce,Tp as Bf,Tq as Hh,Tr as pj,Ul as Ra,Um as Pb,Un as Pc,Uo as de,Up as Cf,Uq as Ih,Ur as qj,Vl as Sa,Vm as Qb,Vn as Qc,Vp as Df,Vq as Jh,Vr as rj,Wl as Ta,Wm as Rb,Wn as Rc,Wo as xe,Wp as Ef,Wq as Kh,Wr as sj,Xl as Ua,Xm as Sb,Xn as Sc,Xp as Ff,Xq as Lh,Xr as tj,Yl as Va,Ym as Tb,Yn as Tc,Yp as Gf,Yq as Mh,Yr as uj,Zl as Wa,Zm as Ub,Zn as Uc,Zo as ye,Zp as Hf,Zq as Nh,Zr as vj,_m as Vb,_n as Vc,_o as ze,_p as If,_q as Xh,_r as yj,an as Xb,ao as Xc,ap as $e,aq as Kf,ar as Zh,as as Aj,bn as Yb,bo as Yc,bq as Lf,br as _h,bs as Bj,cm as Xa,cn as Zb,co as Zc,cq as Mf,cr as $h,cs as Cj,dm as Ya,dn as _b,do as _c,dq as Nf,dr as ai,ds as Dj,em as Za,en as $b,eo as $c,eq as Of,er as bi,es as Ej,fm as _a,fn as ac,fo as ad,fq as Pf,fr as ci,fs as Fj,gm as $a,gn as bc,go as bd,gq as Qf,gr as di,gs as Gj,hm as ab,hn as cc,ho as cd,hq as Rf,hr as ei,il as s,in as dc,io as dd,iq as Sf,ir as fi,jl as t,jn as ec,jo as ed,jq as Tf,jr as gi,kl as u,km as bb,kn as fc,ko as fd,kq as Uf,kr as hi,ll as v,lm as cb,ln as gc,lo as gd,lq as Vf,lr as ii,ml as w,mm as db,mn as hc,mo as hd,mq as Wf,mr as ji,nl as x,nm as eb,nn as ic,no as yd,nq as Xf,nr as ki,ol as y,om as fb,on as jc,oo as zd,oq as Yf,or as li,pl as z,pm as gb,pn as kc,po as Ad,pq as Zf,pr as mi,ql as A,qm as hb,qn as lc,qo as Bd,qq as _f,qr as ni,rl as B,rm as ib,rn as mc,ro as Cd,rp as af,rq as $f,rr as oi,sl as C,sm as jb,sn as nc,so as Dd,sq as ag,sr as pi,tl as D,tm as kb,tn as oc,to as Ed,tp as bf,tq as bg,tr as qi,ul as E,um as lb,un as pc,uo as Fd,uq as cg,ur as ri,vl as F,vm as mb,vn as qc,vo as Gd,vp as cf,vq as dg,vr as si,wl as G,wm as nb,wn as rc,wo as Hd,wp as df,wq as eg,wr as ti,xl as H,xm as ob,xn as sc,xo as Id,xp as ef,xq as fg,xr as ui,yl as I,ym as pb,yn as tc,yo as Jd,yp as ff,yq as gg,yr as vi,zl as J,zn as uc,zo as Kd,zp as gf,zq as hg,zr as wi}from"./chunk-spnkgsft.js";import{hs as d,is as e,js as f,ks as g,ls as h,ms as i,ns as j,os as k,ps as l,qs as m,rs as n,ss as o,ts as p,us as q,vs as r}from"./chunk-4awxsp8f.js";import{As as Sh,Bs as Th,Cs as Uh,Ds as Vh,Es as Wh,ws as Oh,xs as Ph,ys as Qh,zs as Rh}from"./chunk-hk8j3eps.js";import{Fs as b,Gs as c}from"./chunk-mxva4zmq.js";import{Hs as Ea,Is as Fa}from"./chunk-1kg9sz9a.js";import{Js as qb,Ks as rb,Ms as sb,Ws as tb,Xs as ub,Ys as vb}from"./chunk-nnd1hqht.js";import{$s as ue,Zs as se,_s as te,at as ve,dt as we}from"./chunk-msxcd1kp.js";import{et as Ia,ft as Ja,gt as Ka,ht as La,it as Ma,jt as Na}from"./chunk-xgtcq9bj.js";import{kt as id,lt as jd,mt as kd,nt as ld,ot as md,pt as nd,qt as od,rt as pd,st as qd,tt as rd,ut as sd,vt as td,wt as ud,xt as vd,yt as wd,zt as xd}from"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import{Ct as ja,Dt as ka,Et as la,Ft as ma,Gt as na,Ht as oa,It as pa,Jt as qa,Kt as ra,Lt as sa,Mt as ta,Nt as ua,Ot as va,Pt as wa,Qt as xa,Rt as ya}from"./chunk-5a1b5kjt.js";import{Vt as K,Wt as L,Zt as M,cu as N,du as O,ju as P,ku as Q,lu as R,mu as S,nu as T,ou as U,pu as V,qu as W,ru as X,su as Y,tu as Z,uu as _,vu as $,wu as aa,xu as ba,zu as ca}from"./chunk-r2kag877.js";import"./chunk-8p8qa1s9.js";import"./chunk-j4ze77e0.js";export{ik as writeNetlifyConfig,Zl as writeManifest,Nk as writeImageManifest,po as wrapComponentForHMR,jr as withDefaults,vj as webComponentDirectiveHandler,ep as watermark,gq as watchViews,Xk as watchMultiple,Yk as watchEffect,Wk as watch,we as warmImagePlaceholders,jl as waitForStore,Xd as waitForLocale,ao as virtualPathFor,ij as videoDirective,sc as validators,nr as validated,Jd as validateValueEnhanced,mh as validateTemplate,jp as validateParams,Kd as validateFormEnhanced,Xp as validateFile,Fd as validateFields,Ed as validateField,oh as validateDirective,cd as validateCspDirectives,Dj as validateConfig,cm as validateComponentScripts,Am as validateComponentProps,kg as validateClientScript,jh as v,ib as usesSignalsInScript,pa as usesReactiveRuntime,Bh as userComponentFileExists,Rg as useVirtualList,qd as useTitle,il as useStoreOrThrow,Ho as useStore,Uj as useStorage,rq as useSlots,Wj as useSessionStorage,nd as useSeoMeta,kl as useRouteParams,ml as useRouteParamOrThrow,ll as useRouteParam,qd as usePageTitle,Ne as useOptimistic,ol as useMiddlewareValue,nl as useMiddlewareState,Vj as useLocalStorage,io as useLoadingIndicator,ld as useHead,gh as useForm,tq as useAttrs,Zp as uploadFiles,Yp as uploadFile,fl as updateInstance,Le as untrack,Rh as unregisterDirective,gl as unmountInstance,pb as unescapeHtml,eo as typecheckStxFiles,Ah as transpileTypeScript,Yq as translate,w as transitionDirective,um as toUsers,tm as toUser,Po as thumbnail,Qp as thumbHashToRGBA,Rp as thumbHashToDataURL,ra as templateNeedsRuntime,qa as templateHasReactiveContext,Qe as templateCache,Lb as syncRecordedResponse,mo as stxClientHelpers,vf as structuredDataDirective,$q as stripLocalePrefix,Kl as stripDocumentWrapper,Fa as stripCommentsAndLiterals,gn as stringToStream,Sc as strictCspPreset,me as streamingSuspenseDirective,qe as streamToResponse,ke as streamTemplateSimple,ee as streamTemplate,Pj as stopHmrServer,qm as stopBroadcasting,La as stateDirName,Ma as stateDir,Ae as state,eg as startsDocument,Jn as startProductionServer,xn as startInteractive,pm as startBroadcasting,br as stampLocaleLayoutGroup,D as staggerDirective,hp as srcsetUrls,E as springDirective,Bc as splitByPipe,Gl as spaNavVaryHeaders,bo as sourcePathFor,op as smartBatchSign,Dh as slotContentHasExpressions,mp as signUrl,yh as shouldTranspileTypeScript,Mj as shouldReloadOnChange,rp as shouldRefreshSignature,Nj as shouldIgnoreFile,Jg as shouldCacheComponent,To as sharpen,qr as shape,Ka as setStateDir,sl as setRouteParams,tl as setMiddlewareState,ve as setImagePlaceholder,lq as setGlobalProvide,Pb as setErrorLocale,Pk as setCurrentInstance,Yi as setCachedVideoResult,Ni as setCachedImageResult,Hi as setCached,tr as serveStxFile,vr as serveMultipleStxFiles,Hj as serveMarkdownFile,Tn as serveFile,wr as serveApp,Sn as serve,so as serializeState,Ym as serializeSetCookie,Vo as sepia,od as seoMetaToHeadConfig,x as scrollAnimateDirective,q as screenReaderDirective,mj as scopeHTML,lj as scopeCSS,yf as scanForSitemapEntries,k as scanA11yTargets,l as scanA11yIssues,Zo as saturation,kp as sanitizeParams,uc as sanitizeFilePath,vc as sanitizeExpression,wc as sanitizeDirectiveParams,tc as sanitizeDirectiveParam,xc as sanitizeComponentProps,nc as safeExecuteAsync,mc as safeExecute,xa as runtimeHandledXAttrsLiteral,of as runPreProcessingMiddleware,pf as runPostProcessingMiddleware,An as runPageAction,Ge as runMountCallbacks,ba as runMiddleware,dl as runHooks,Rq as runDoctor,He as runDestroyCallbacks,Df as runComposers,_o as rotate,kh as rewriteImagesWithSiblings,Mb as responseBindings,Hh as resolveTemplatePath,c as resolveStxTargets,zj as resolveStxDirectories,Xq as resolveI18n,No as resize,Xa as resetPlaceholders,kd as resetHead,ro as resetHMRHandler,ac as resetErrorConfig,lr as required,$a as replacePlaceholders,eq as renderView,fj as renderVideoComponent,Pa as renderVendorStyleTags,Aq as renderToString,Bq as renderToStream,Cq as renderToDOM,Pp as renderThumbhashToCanvas,Oq as renderTemplateString,Mq as renderTemplate,Nq as renderString,he as renderStreamingPage,th as renderSlot,zg as renderSSRSuspense,zp as renderProtectedVideo,yp as renderProtectedImg,lp as renderMediaUpload,Lq as renderMarkdownView,Pl as renderLayoutTypes,Ri as renderImgComponent,Dk as renderImageComponent,sd as renderHtmlAttrs,rd as renderHead,hq as renderEmail,Fh as renderComponentWithSlot,td as renderBodyAttrs,Co as render,Uc as relaxedCspPreset,Dd as registerValidationRule,oe as registerStreamingDirectives,Jo as registerStoresClient,ql as registerStore,wf as registerSeoDirectives,V as registerMiddleware,db as registerFilters,cb as registerFilter,Rb as registerErrorMessages,Id as registerEnhancedValidationRule,Oh as registerDirective,bd as registerCspDirectives,Dm as registerComponentDirectives,J as registerAnimationDirectives,r as registerA11yDirectives,Tk as ref,pn as redirect,Hb as recordResponseStatus,Ib as recordResponseHeader,Na as rebaseOntoStateDir,Jb as readResponseStatus,Kb as readResponseHeaders,Fj as readMarkdownFile,Re as readFileCached,Uk as reactive,cp as quality,wp as pruneSignatureCache,Ki as pruneCache,jq as provide,Kq as protectCodeBlocks,kr as prop,Hf as processVueTemplate,Pg as processVirtualListDirectives,Tg as processVirtualGridDirectives,ej as processVideo,Gd as processValidateDirective,ce as processTranslateDirective,tg as processTransitionDirectives,wg as processTransitionAttributes,wd as processTitleDirective,zb as processTemplateBindings,pg as processTeleportDirectives,xg as processSuspenseDirectives,rf as processStructuredData,ie as processStreamDirectives,Nb as processStatusDirective,eh as processStaticDirectives,mf as processStackReplacements,lf as processStackPushDirectives,uh as processSlots,Il as processShell,Ff as processServerBindings,sf as processSeoDirective,pe as processSectionDirectives,Kf as processScopedStyles,xb as processReactiveBindings,Ap as processProtectedMedia,Zg as processPartialHydrationDirectives,jg as processOnceDirective,nf as processMiddleware,qf as processMetaDirectives,xd as processMetaDirective,Gj as processMarkdownFileDirectives,Mh as processMarkdownDirectives,ff as processLoops,Hg as processKeepAliveDirectives,ig as processJsonDirective,Sg as processInfiniteListDirectives,kf as processIncludes,Ti as processImgComponents,Fk as processImageComponents,sk as processImage,vd as processHeadDirective,zd as processForms,Bd as processFormInputDirectives,mb as processExpressions,Ca as processEventDirectives,Cd as processErrorDirective,If as processDynamicComponents,lh as processDirectives,Wh as processDirectiveAttributes,og as processDeferDirectives,gd as processCustomDirectives,_c as processCspDirectives,rr as processComponentProps,Wa as processClientScript,Ad as processBasicFormDirectives,Cg as processAsyncDirectives,hd as processAppearanceBootstrapDirective,A as processAnimationDirectives,f as processA11yDirectives,Td as preloadTranslationsBackground,Sd as preloadTranslations,ho as preloadIslandHandlers,xe as preloadIconCollection,lm as poolStrings,xj as pluginManager,te as placeholdersWarmed,sg as performLeave,rg as performEnter,Ie as pendingLifecycleCounts,Me as peek,gf as partialsCache,gj as parseVideoDirectiveOptions,Lo as parseUrl,Sp as parseThumbhashString,Hc as parseSwitchBlock,rh as parseSlots,sh as parseSlotElement,Mc as parseScriptDeclarations,tj as parseSFCComponent,Bp as parseProtectedArgs,ef as parseLoopBinding,Si as parseImgComponent,ii as parseImageUrl,Ek as parseImageComponent,yn as parseFormBody,Jc as parseExpressionWithFilters,mn as parseCookies,Im as parseContainerSelector,Ec as parseConditionalBlock,Kc as parseArguments,H as parseAnimationShorthand,mr as optional,mm as optimizeTemplate,Kk as optimizeImage,Lk as optimizeDirectory,or as oneOf,hf as onceStore,al as onUpdated,wb as onUpdate,cl as onUnmounted,xl as onServer,_k as onMounted,Ee as onMount,dh as onHydrated,pq as onErrorCaptured,Fe as onDestroy,Ng as onDeactivated,wl as onClient,$k as onBeforeUpdate,bl as onBeforeUnmount,Zk as onBeforeMount,Mg as onActivated,Lp as observeElement,qn as notFound,Pf as normalizeCriticalHeadOrder,oq as nextTick,Gm as negotiateEncoding,P as navigateTo,el as mountInstance,z as motionDirective,Tc as moderateCspPreset,km as minifyHtml,uf as metaDirective,Zf as metaDedupKey,Mo as mergeParams,$f as mergeHtmlAttrs,md as mergeHeadConfigs,Xc as mergeCspDirectives,rb as mergeCrosswindConfig,M as matchRoute,Nh as markdownDirectiveHandler,Ej as markdownCache,b as looksLikeGlob,_q as localizePath,Ud as loadTranslationLazy,_d as loadTranslation,Aj as loadStxConfig,_ as loadMiddlewareFromDirectory,_l as loadManifest,Hp as loadElement,rm as loadChannels,fr as lintStxStrict,Jp as lazyLoadAll,Ip as lazyLoad,C as keyframeDirective,yq as jsxs,zq as jsxDEV,xq as jsx,on as jsonResponse,ne as islandDirective,Zb as isTest,Ll as isSpaNavigation,El as isSpaNavRequest,pp as isSignatureValid,Je as isSignal,qk as isSharpAvailable,$m as isServerEnvironment,ul as isServer,ta as isRuntimeOwnedColonAttr,Xb as isProduction,d as isPresentationalRole,Ep as isNativeLazySupported,Jq as isMarkdownPath,Qd as isLoading,Rd as isLoaded,xh as isJavaScriptScript,Fp as isIntersectionObserverSupported,yk as isImageFile,rk as isImageBackendAvailable,ae as isICUFormat,ch as isHydrated,Ch as isHydrateTrigger,Fb as isHttpStatus,_m as isEdgeEnvironment,gr as isDirectiveKind,Yb as isDevelopment,Ke as isDerived,Lj as isCssOnlyChange,Fm as isCompressible,vl as isClient,Eg as isAsyncComponent,zn as isActionableMethod,Wo as invert,Te as invalidateFileCacheByDir,Se as invalidateFileCache,lb as interpolateScriptsInTemplate,jb as interpolateScriptExpressions,kb as interpolateScriptAttributes,jc as inlineError,Wq as injectThemeBootstrap,tf as injectSeoTags,Tq as injectSeo,$e as injectRouterScript,Kj as injectHotReload,fa as injectHeatmap,Yc as injectCspMetaTag,vb as injectCrosswindCSS,gg as injectConfigHeadTags,Of as injectColorModeBootScript,bg as injectCloakStyle,Vf as injectBuildId,Ra as injectBrowserCoreAutoImports,Bb as injectAnalytics,kq as inject,pl as initStoreRegistry,lk as initNetlify,jo as initLoadingIndicator,Gp as initLazyLoading,wn as initFile,Op as initBlurUp,Up as initAllBlurUp,Vi as imgDirective,Ik as imageDirective,Hn as hydrateTemplateStream,Gn as hydrateTemplate,go as hydrateIslands,$g as hydrateIsland,In as hydrateFragment,ah as hydrateByStrategy,bh as hydrateAll,zo as hydrate,Rn as htmlResponse,cg as hoistLeadingHeadTags,Qf as hoistColorModeBootScript,ga as heatmapDirective,Di as hashString,_e as hashFilePath,Bi as hashFile,Ci as hashBuffer,Gf as hasVueTemplateSyntax,df as hasVariables,Eo as hasStore,ab as hasPlaceholders,jk as hasNetlifyConfig,X as hasMiddleware,Da as hasEventDirectives,fg as hasDocumentShell,ph as hasDirectives,h as hasDOMSupport,Bk as handleImageRequest,qq as handleError,Gq as h,xk as groupVariantsByFormat,Uo as grayscale,Kn as gitHash,em as getUnusedDirectives,Vd as getTranslationSync,Od as getTranslationCacheStats,Wd as getTranslationAsync,be as getTranslation,ek as getTotalSize,qp as getTimeUntilExpiry,lg as getStoreScript,Fo as getStoreNames,Do as getStore,Zj as getStorageSize,Yj as getStorageKeys,Ih as getSourceLineInfo,zh as getSharedTranspiler,g as getScreenReaderOnlyStyle,nj as getScopeAttribute,ze as getRouteParams,Ga as getPublicEnvDefine,Ha as getPublicEnv,nh as getPositionInfo,Za as getPlaceholderRegistry,Ai as getPlaceholderCacheStats,jd as getPageMeta,Oc as getNonce,zk as getMimeType,Z as getMiddlewareNames,W as getMiddleware,Pd as getLoadingState,Yd as getLoadingLocales,se as getImagePlaceholder,tk as getImageMetadata,yo as getHydrationRuntime,rl as getHydratedStoreState,Oj as getHmrServer,id as getHead,qo as getHMRHandler,mi as getFormatExtension,Fi as getFileMtime,wk as getFallbackVariant,Tb as getErrorMessage,Qb as getErrorLocale,$b as getErrorConfig,Wb as getErrorCodeName,Qh as getDirectives,Ph as getDirective,Qk as getCurrentInstance,Wc as getCspPreset,dd as getCspHeaderName,sb as getCrosswindServeAsset,Lh as getComponentCacheStats,Xi as getCachedVideoResult,up as getCachedSignature,Ve as getCachedSignalsRuntime,We as getCachedRouterScript,yi as getCachedPlaceholder,Mi as getCachedImageResult,Gi as getCached,Ji as getCacheStats,Tf as getBuildId,om as getBroadcastServer,li as getBestVariant,eb as getAllFilters,$h as generateWidthSrcset,Qg as generateVirtualListCSS,$p as generateVideoPreview,Ld as generateValidationScript,aq as generateUploadRuntime,fm as generateTreeShakenBundle,vg as generateTransitionRuntime,ug as generateTransitionCSS,$i as generateThumbnails,ri as generateThumbhashPlaceholder,Rm as generateTemplatesDocs,Bg as generateSuspenseRuntime,Ag as generateSuspenseCSS,to as generateStateScript,ji as generateSrcsetData,Qi as generateSrcset,uk as generateSrcSet,aj as generateSpriteSheet,iq as generateSpaShell,ki as generateSourceTags,fi as generateSizesFromBreakpoints,ei as generateSizesAttribute,vk as generateSizes,xf as generateSitemapIndex,Uq as generateSitemap,Dp as generateSimpleMediaPicker,xp as generateSignatureRuntime,Pe as generateSignalsRuntimeDev,Oe as generateSignalsRuntime,Va as generateServerDataBridge,kj as generateScopeId,uj as generateSFCWebComponent,Aa as generateRuntimeScript,K as generateRouteTypes,L as generateRouteManifest,zf as generateRobotsTxt,Vq as generateRobots,Pi as generateResponsiveVariants,qj as generateReactiveWebComponentTS,pj as generateReactiveWebComponent,sj as generateReactiveRuntime,rj as generateReactiveMixin,_i as generatePoster,xi as generatePlaceholderStyle,wi as generatePlaceholderCSS,qi as generatePlaceholder,_g as generatePartialHydrationCSS,Nc as generateNonce,fk as generateNetlifyToml,cq as generateMinifiedMediaRuntime,bq as generateMediaRuntime,Cp as generateMediaManagerEmbed,Yl as generateManifest,lo as generateLoadingIndicatorHtml,Np as generateLazyLoadRuntime,Ql as generateLayoutTypes,ti as generateLQIP,Lg as generateKeepAliveRuntime,Kg as generateKeepAliveCSS,fh as generateIslandManifest,_p as generateImagePreview,Mk as generateImageManifest,xo as generateHydrationScript,re as generateHydrationRuntime,Ao as generateHydrationCSS,Ug as generateHydrationBootstrap,Jj as generateHotReloadScript,ea as generateHeatmapScript,oo as generateHMRClientScript,bj as generateHLSManifest,uo as generateEventBindings,di as generateDprSrcsetWithVariableQuality,ci as generateDprSrcset,dg as generateDocumentShell,Wm as generateDocs,Sm as generateDirectivesDocs,Vh as generateDirectiveRuntime,Af as generateDefaultRobotsTxt,cj as generateDASHManifest,Rc as generateCspMetaTag,Qc as generateCspHeader,ub as generateCrosswindCSS,vq as generateCompositionRuntime,Qm as generateComponentsDocs,Vg as generateComponentManifest,Om as generateComponentDoc,vi as generateColorPlaceholder,Nf as generateColorModeBootScript,hl as generateClientRuntime,Ei as generateCacheKey,Ta as generateBrowserAutoImportDestructuring,Vp as generateBlurUpRuntime,Wp as generateBlurUpCSS,yb as generateBindingsRuntime,ai as generateAutoWidthSrcset,Sa as generateAutoImportDestructuring,Gg as generateAsyncComponentRuntime,Fg as generateAsyncComponentCSS,I as generateAnimationRuntime,G as generateAnimationCSS,Ab as generateAnalyticsScript,fo as formatTypecheckDiagnostics,_n as formatTypeErrors,tn as formatStxContent,dk as formatSize,O as formatRoutes,un as formatMarkdownContent,Ub as formatLocalizedError,$d as formatICU,bc as formatFilePath,ic as formatError,Sq as formatDoctorReport,Tm as formatDocsAsMarkdown,Vm as formatDocsAsJson,Um as formatDocsAsHtml,bp as format,jm as foldConstants,ap as flipVertical,$o as flipHorizontal,Rl as fingerprint,co as findRuntimeTypeDeclarations,Qq as findPantryPackage,Dc as findMatchingEndTag,zc as findMatchingDelimiter,Ea as findInterpolationEnd,Fc as findIfBlocks,Ic as findExpressions,N as findErrorPage,Gc as findDirectiveBlocks,gm as findDeadCode,gm as findDeadBranches,Jm as findContainerRegion,Pm as findComponentFiles,ur as findCommonDir,ck as filterRequiredFiles,Gh as fileExists,af as extractVariables,Wl as extractTemplateExpressions,je as extractStreamBoundaries,vo as extractState,vh as extractSlotContent,cf as extractScriptFromTemplate,Vl as extractScriptBlocks,_a as extractPlaceholders,Cc as extractParenthesizedExpression,Gb as extractPageResponseStatus,ca as extractLayoutMetadata,ui as extractDominantColor,Lc as extractDirectiveParams,qh as extractDirectiveNames,Ml as extractContainerContent,Mm as extractComponentProps,Wg as extractComponentName,Nm as extractComponentDescription,tb as extractClassNames,Ua as extractBridgeData,Xg as extractBoundProps,Ac as extractBalancedExpression,Oa as extractAndStripCssImports,oj as extractAndScopeStyles,Ba as extractAndProcessEvents,Sj as externalizeSharedAssets,Tj as externalizeRepeatedAssets,Rj as externalizeHtml,ob as evaluateExpression,im as evaluateConstant,Ob as evaluateAuthExpression,hb as escapeHtmlValue,gb as escapeHtml,oc as errorRecovery,qc as errorLogger,qg as ensureTeleportTargets,hg as ensureDocumentShell,Hd as enhancedValidationRules,Km as enableDevTools,hm as eliminateDeadCode,Ce as effect,ip as dprUrls,Xm as docsCommand,Ol as discoverLayoutNames,Mp as disconnectObserver,Lm as disableDevTools,rc as devHelpers,Hl as detectShell,Zm as detectRuntime,gk as detectProjectConfig,ni as detectFormat,bm as detectBuildMode,Be as derived,kk as deploy,Cj as defineStxConfig,Io as defineStore,sq as defineSlots,er as defineSiteConfig,ir as definePropsWithValidation,hr as defineProps,wj as definePlugin,pd as definePageMeta,R as defineMiddleware,hh as defineForm,nq as defineExpose,mq as defineEmits,Sh as defineDirective,Iq as defineCustomElement,Fn as defineConfig,Th as defineClientDirective,Dg as defineAsyncComponent,dq as defaultMediaConfig,Ok as defaultImageConfig,Md as defaultI18nConfig,da as defaultHeatmapConfig,yd as defaultFormClasses,bb as defaultFilters,fd as defaultCspConfig,yj as defaultConfig,sr as default,qb as deepMergeThemes,Jf as dedupeScopedStyles,si as decodeThumbhash,ad as cspNonceDirective,$c as cspDirective,Tp as crossfadeTransition,Oo as crop,Og as createVirtualList,hj as createVideoDirective,kn as createVercelHandler,Xn as createTypeChecker,de as createTranslateFilter,fn as createTextEncoderStream,Hq as createStxApp,en as createStreamingResponse,le as createStreamRenderer,Go as createStore,U as createStorageManager,S as createServerCookieManager,Sk as createScope,yg as createSSRSuspense,ye as createRouter,$ as createRouteLocation,Vn as createRoute,Tk as createRef,Uk as createReactive,uq as createProvideContext,Mn as createProject,En as createProductionBuild,Ya as createPlaceholder,nm as createOptimizedBuild,ln as createNetlifyHandler,_j as createNetlifyClient,aa as createMiddlewareContext,Un as createMiddleware,Kp as createLazyObserver,Ig as createKeepAliveCache,bn as createKVNamespace,Yg as createIslandRegistry,Ui as createImgDirective,Jk as createImagePlugin,Ck as createImageHandler,Hk as createImageDirective,ia as createHeatmapAggregator,bk as createFileManifest,an as createEnvAccessor,lc as createEnhancedError,dn as createEdgeHandler,cn as createEdgeCache,Jh as createDetailedErrorMessage,jn as createDenoHandler,hk as createDefaultNetlifyConfig,ed as createCspHeaders,nn as createCookie,Vk as createComputed,Rk as createComponentInstance,hn as createCloudflareHandler,T as createClientCookieManager,Uh as createBuiltinDirectives,Hq as createApp,F as createAnimationTimeline,Ro as cover,bf as convertToCommonJS,Yo as contrast,Qo as contain,kc as consoleError,_b as configureErrorHandling,Bj as config,Vk as computed,Hm as compressResponse,Cf as composerPattern,Bf as composer,Jl as composeShellWithPage,Cm as componentDirective,Eh as componentClientSignalNames,Xl as compileTemplate,a as collectRepeatedFlag,ak as collectDeployFiles,Zi as clearVideoCache,Nd as clearTranslationCache,mg as clearStoreCache,Xj as clearStorage,vp as clearSignatureCache,zi as clearPlaceholderCache,jf as clearOnceStore,Pc as clearNonce,Y as clearMiddleware,ue as clearImagePlaceholders,Gk as clearImageCache,Sb as clearErrorMessages,Xe as clearDevCaches,fb as clearCustomFilters,Ef as clearComposers,ng as clearComposableCache,Kh as clearComponentCache,Ii as clearCache,ko as cleanupLoadingIndicator,Al as classifyScript,Bl as classifyAllScripts,Yn as checkTemplateFile,Zn as checkTemplate,Ye as checkCache,sp as checkAuthAccess,i as checkA11yWithRegex,j as checkA11y,xm as channel,sn as captureScreenshots,rn as captureScreenshot,Zd as cancelPendingLoads,$j as calculateSha1,bi as calculateOptimalWidths,Ze as cacheTemplate,jj as buildWebComponents,$n as buildVirtualSource,fq as buildViews,Ko as buildUrl,fe as buildSuspenseResolveScript,dr as buildStaticSite,la as buildRuntimeGlobalsDestructure,Sl as buildRuntimeAsset,Tl as buildRouterAsset,cr as buildLangPickerScript,hi as buildImageUrl,_f as buildHtmlAttrs,$l as buildForProduction,Em as buildComponentLibrary,tp as buildAuthParams,am as buildApp,ar as buildAlternateLinks,Dn as build,vm as broadcastPrivate,wm as broadcastPresence,sm as broadcast,Xo as brightness,So as blur,ya as blankInertHtmlRegions,np as batchSignUrls,De as batch,n as autoFixA11yFile,o as autoFixA11yDirectory,m as autoFixA11y,dp as auto,e as attributeValue,Ul as assetTags,za as asInvocableStatement,pr as arrayOf,Zq as applyTranslations,Oi as applyTransformations,wh as applySlots,Bm as applyPropDefaults,gp as applyPreset,ag as applyHtmlAttrs,ud as applyHead,nb as applyFilters,Fl as appendVary,Vc as apiCspPreset,y as animationGroupDirective,dj as analyzeVideo,dm as analyzeUsage,yl as analyzeTemplate,zl as analyzeProject,dm as analyzeDirectiveUsage,Cb as analyticsDirective,Pn as addStore,On as addPage,Zc as addNonceToInlineContent,Qn as addLayout,Nn as addComponent,Bn as actionRedirectResponse,Q as abortNavigation,p as a11yDirective,Ue as __setSignalsGeneratorsForTest,Uf as __setBuildIdForTest,Wi as VideoProcessorCache,ih as Validator,s as TransitionType,u as TransitionEase,t as TransitionDirection,yc as Tokenizer,Wn as TemplateTypeChecker,vn as TEMPLATE_PRESETS,hc as StxValidationError,dc as StxSyntaxError,fc as StxSecurityError,ec as StxRuntimeError,gc as StxFileError,cc as StxError,Dq as Show,ge as SUSPENSE_RESOLVER_RUNTIME,ja as STX_RUNTIME_GLOBALS,Qa as STX_AUTO_IMPORTS,Ja as STATE_DIR_ENV_VAR,B as SPRING_PRESETS,Cl as SPA_NAV_HEADER,sa as RUNTIME_OWNED_COLON_ATTRS,ua as RUNTIME_HANDLED_X_ATTRS,Db as RESPONSE_STATUS_KEY,Eb as RESPONSE_HEADERS_KEY,oa as REACTIVE_RUNTIME_GLOBALS,Cn as ProductionBuild,Fq as Portal,Ln as PROJECT_TEMPLATES,fp as PRESETS,na as NON_CLIENT_PRIMITIVES,Bo as MemorySessionStore,_h as MIME_TYPES,Xh as MEDIA_DEFAULT_WIDTHS,Zh as MEDIA_DEFAULT_FORMATS,Nl as LAYOUT_TYPES_FILE,Li as ImageProcessorCache,Ak as ImageProcessingError,wo as HydrationRuntime,Ij as HotReloadServer,ha as HeatmapAggregator,Yf as HTML_CLASS_MARKER,Xf as HTML_ATTRS_MARKER,wq as Fragment,Eq as For,Dl as FRAGMENT_CACHE_CONTROL,pc as ErrorLogger,Vb as ErrorCodes,Qj as EXTERNALIZED_ASSET_DIR,mk as DeployError,nk as DEFAULT_WIDTHS,v as DEFAULT_TRANSITION_OPTIONS,Ia as DEFAULT_STATE_DIR,pk as DEFAULT_QUALITY,oi as DEFAULT_PLACEHOLDER_OPTIONS,ok as DEFAULT_FORMATS,Yh as DEFAULT_DPR_VALUES,no as ComponentHMRHandler,ka as COMPONENT_SCOPE_LOCAL_GLOBALS,wa as COMPONENT_PASSTHROUGH_X_ATTRS,ma as COMPILE_TIME_ONLY_GLOBALS,gi as COMMON_SIZES,Lf as COLOR_MODE_BOOT_MARKER,Mf as COLOR_MODE_BOOT_GLOBAL,Wf as CLOAK_STYLE,zm as BroadcastServer,ym as Broadcast,Rf as BUILD_ID_META,Sf as BUILD_ID_HEADER,pi as BLUR_UP_CSS,va as ALPINE_BRIDGE_X_ATTRS,Pq as $path};
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{Ga as a,Ue as F,Wa as r,We as v,Xe as P,o as m,oa as l,ob as n,pb as p,qe as s,rb as i,re as t,wb as e}from"./chunk-
|
|
3
|
+
import{Ga as a,Ue as F,Wa as r,We as v,Xe as P,o as m,oa as l,ob as n,pb as p,qe as s,rb as i,re as t,wb as e}from"./chunk-04tp3hjf.js";import"./chunk-jy6madxa.js";import"./chunk-j2pmv4jw.js";import"./chunk-sqe4sz8r.js";import"./chunk-vzskgbqj.js";import"./chunk-bskzz385.js";import"./chunk-wr17wgn4.js";import"./chunk-tpc0vwvz.js";import"./chunk-d19bydks.js";import"./chunk-n7w8kgfw.js";import"./chunk-9778d23n.js";import"./chunk-jz3cjfz1.js";import"./chunk-h3paff80.js";import"./chunk-6x3jqwxp.js";import"./chunk-cs1dc1n7.js";import"./chunk-k46js7bz.js";import"./chunk-tv4n71jy.js";import"./chunk-rbke5wqk.js";import"./chunk-z0y4gcsp.js";import"./chunk-wdwf3wzg.js";import"./chunk-j93x5fzs.js";import"./chunk-ntnv2f7a.js";import"./chunk-1gdzz04h.js";import"./chunk-ssfhndm6.js";import"./chunk-94fee5jw.js";import"./chunk-pv9at6r1.js";import"./chunk-dq88kv1p.js";import"./chunk-s8bx0wv7.js";import"./chunk-5q44vwmg.js";import"./chunk-ht51fz7w.js";import"./chunk-fvjh7rx0.js";import"./chunk-b6jhznkh.js";import"./chunk-fee1k8c5.js";import"./chunk-qa8qmer5.js";import"./chunk-nhmq45hh.js";import"./chunk-x58dcsjw.js";import"./chunk-0e1pt5my.js";import"./chunk-8k7evyhh.js";import"./chunk-frp9fc7j.js";import{$k as u,al as c}from"./chunk-a0zaf8r9.js";import"./chunk-r84h7wxw.js";import{zm as A}from"./chunk-spnkgsft.js";import{os as f}from"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-nnd1hqht.js";import"./chunk-msxcd1kp.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-5a1b5kjt.js";import"./chunk-r2kag877.js";import"./chunk-8p8qa1s9.js";import{Nu as B}from"./chunk-j4ze77e0.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.239";var __dirname="/home/runner/work/stx/stx/packages/stx/bin",E=new wb("stx");function h(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function d(J){try{if(!L.existsSync(J)){let K=$.dirname(J),x=$.basename(J);if(L.existsSync(K)){let z=L.readdirSync(K).filter((j)=>j.toLowerCase().includes(x.toLowerCase().substring(0,3))||j.endsWith(".stx")||j.endsWith(".md")),k=z.length>0?`File not found. Similar files in ${K}: ${z.slice(0,3).join(", ")}`:`File not found. Directory ${K} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${J}`,suggestion:k}}return{isValid:!1,error:`File does not exist: ${J}`,suggestion:"Check the file path and try again"}}if(L.statSync(J).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${J}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${J}`,suggestion:"Check file permissions and path"}}}function y(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var V=(J)=>J.includes("*")||J.includes("?")||J.includes("{")||J.includes("["),jb=(J)=>J.endsWith(".stx")||J.endsWith(".md");function S(J,Z=1){if(console.error(`\u274C ${J.error}`),J.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${J.suggestion}`);w.exit(Z)}function kb(J){if(!J)return;let Z;try{Z=JSON.parse(J)}catch(K){console.error(`\u274C --info-plist is not valid JSON: ${K.message}`),w.exit(1)}if(typeof Z!=="object"||Z===null||Array.isArray(Z))console.error(`\u274C --info-plist must be a JSON object, e.g. '{"NSFocusStatusUsageDescription":"\u2026"}'`),w.exit(1);for(let[K,x]of Object.entries(Z))if(typeof x!=="string"&&typeof x!=="number"&&typeof x!=="boolean")console.error(`\u274C --info-plist value for "${K}" must be a string, number or boolean`),w.exit(1);return Z}async function Hb(J,Z){try{let K=["test"],x=[];if(J&&J.length>0)for(let W of J)if(V(W))try{let H=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(H.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(x.push(...H),Z.verbose)console.log(`Found ${H.length} file(s) matching pattern: ${W}`)}catch(H){return console.error(`Error expanding glob pattern ${W}:`,H),!1}else x.push(W);if(x.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(K.push(...x),Z.filter)K.push("--pattern",Z.filter);if(Z.timeout)K.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=$.join(zb.tmpdir(),`stx-test-report-${Date.now()}.xml`);K.push("--reporter",Z.reporter),K.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)K.push("--coverage");if(Z.watch)K.push("--watch");K.push("--preload",$.join(__dirname,"../../../test-utils/happy-dom.ts"));let b={...w.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},z="bun";if(Z.verbose)console.log(`Running: ${z} ${K.join(" ")}`);let k=performance.now(),j=o(z,K,{stdio:"inherit",shell:!1,env:b});return new Promise((W)=>{j.on("close",(H)=>{let Y=((performance.now()-k)/1000).toFixed(2);if(H===0)W(!0);else W(!1)}),w.on("SIGINT",()=>{console.log(`
|
|
4
4
|
Test run interrupted`),j.kill("SIGINT"),w.exit(1)})})}catch(K){return console.error("Error running tests:",K instanceof Error?K.message:String(K)),!1}}var Qb=w.argv.length>=3&&(jb(w.argv[2])&&L.existsSync(w.argv[2])||V(w.argv[2]));if(Qb){let J=w.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let K=3;K<w.argv.length;K++){let x=w.argv[K];if(x==="--port"&&K+1<w.argv.length){let b=h(w.argv[++K]);if(!b.isValid)S(b);Z.port=Number.parseInt(w.argv[K],10)}else if(x==="--no-watch")Z.watch=!1;else if(x==="--highlight-theme"&&K+1<w.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=w.argv[++K]}else if(x==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(x==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(x==="--no-cache")Z.cache=!1;else if(x==="--native")Z.native=!0}if(V(J))try{let K=await Array.fromAsync(new Bun.Glob(J).scan({onlyFiles:!0,absolute:!0})),x=J.endsWith(".stx")?K.filter((j)=>j.endsWith(".stx")):J.endsWith(".md")?K.filter((j)=>j.endsWith(".md")):K.filter((j)=>j.endsWith(".stx")||j.endsWith(".md")),b=J.split("*")[0].replace(/\/$/,"")||".",z=$.resolve(b);try{let j=new Bun.Glob("**/*.stx"),H=(await Array.fromAsync(j.scan({cwd:z,onlyFiles:!0,absolute:!0}))).filter((U)=>/\[.+\]/.test($.basename(U)));for(let U of H)if(!x.includes(U))x.push(U)}catch{}if(x.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${J}`),w.exit(1);if(!await v(x,Z))w.exit(1)}catch(K){console.error("Failed to process files:",K),w.exit(1)}else F(J,Z).catch((K)=>{console.error("Failed to start dev server:",K),w.exit(1)})}else{let J=function(x,b){let z=[];for(let k=0;k<=b.length;k++)z[k]=[k];for(let k=0;k<=x.length;k++)z[0][k]=k;for(let k=1;k<=b.length;k++)for(let j=1;j<=x.length;j++)if(b.charAt(k-1)===x.charAt(j-1))z[k][j]=z[k-1][j-1];else z[k][j]=Math.min(z[k-1][j-1]+1,z[k][j-1]+1,z[k-1][j]+1);return z[b.length][x.length]};E.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(x)=>{try{if(await r(x))console.log("Documentation generated successfully."),w.exit(0);else console.error("Documentation generation failed."),w.exit(1)}catch(b){console.error("Error generating documentation:",b),w.exit(1)}}),E.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(x,b)=>{try{let{fetchCollections:z,generatePackage:k}=await import("./chunk-cjhpwef8.js");if(x==="list"){console.log(`
|
|
5
5
|
\uD83D\uDCDA Fetching available icon collections...
|
|
6
6
|
`);let j=await z(),W=Object.entries(j).sort((H,U)=>U[1].total-H[1].total);console.log(`Available collections:
|
|
@@ -69,7 +69,7 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
|
|
|
69
69
|
File not found: ${x}`),w.exit(1);if(!x.endsWith(".stx"))console.error(`
|
|
70
70
|
File must have .stx extension: ${x}`),w.exit(1)}let k=$.resolve(b.pages),j=$.resolve(b.out);if(!x&&!L.existsSync(k))console.error(`
|
|
71
71
|
Pages directory not found: ${k}`),console.log(`
|
|
72
|
-
Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-
|
|
72
|
+
Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-csjhh5t2.js");c();let H=await W({root:x?$.dirname(x):void 0,debug:b.verbose,ssg:{pagesDir:b.pages,outputDir:b.out,domain:b.domain,baseUrl:b.base,sitemap:b.sitemap,rss:b.rss,minify:b.minify,cache:b.cache!==!1,cleanOutput:b.clean,concurrency:Number.parseInt(b.concurrency,10)||10,publicDir:b.public,trailingSlash:b.trailingSlash,generate404:!0,hooks:b.verbose?{onPageStart:(Y)=>console.log(` Generating: ${Y}`),onPageEnd:(Y,Q)=>console.log(` Generated: ${Y} (${Q.length} bytes)`),onError:(Y,Q)=>console.error(` Error in ${Q}: ${Y.message}`)}:void 0},ssr:{outputDir:b.out==="dist"?".output":b.out,debug:b.verbose}}),U=((performance.now()-z)/1000).toFixed(2);if(H.mode==="ssr"&&H.ssr)console.log(`
|
|
73
73
|
Build complete! (SSR)
|
|
74
74
|
`),console.log(` Pages compiled: ${H.ssr.pageCount}`),console.log(` Output: ${H.ssr.outputDir}`),console.log(` Duration: ${U}s
|
|
75
75
|
`);else if(H.ssg){if(console.log(`
|
|
@@ -84,7 +84,7 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
|
|
|
84
84
|
Build completed with ${H.ssg.failedCount} error(s). Fix the issues above and try again.
|
|
85
85
|
`),w.exit(1);console.log(" To preview locally:"),console.log(` cd ${b.out||"dist"} && npx serve
|
|
86
86
|
`)}}catch(z){console.error(`
|
|
87
|
-
Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-
|
|
87
|
+
Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-hr7hvaf0.js");await z({outputDir:b,port:Number.parseInt(x.port,10)||3000})}catch(b){console.error(`
|
|
88
88
|
Failed to start production server:`,b instanceof Error?b.message:String(b)),w.exit(1)}}),E.command("deploy [directory]","Deploy built site to Netlify").option("--site-id <id>","Netlify site ID (or set NETLIFY_SITE_ID env var)").option("--token <token>","Auth token (or set NETLIFY_AUTH_TOKEN env var)").option("--production","Deploy to production (default: draft preview)").option("--message <msg>","Deploy message/title").option("--no-build","Skip build step before deploy").option("--open","Open deployed URL in browser").option("--dry-run","Preview deployment without uploading").option("--init","Initialize Netlify configuration for this project").example("stx deploy").example("stx deploy --production").example("stx deploy dist --site-id my-site-abc123").example("stx deploy --init").example("stx deploy --dry-run").action(async(x,b)=>{try{let{deploy:z,initNetlify:k,DeployError:j}=await import("./chunk-1xgva25g.js");if(console.log(`\x1B[1mstx deploy\x1B[0m \x1B[2mv${N}\x1B[0m`),b.init){console.log(`
|
|
89
89
|
\uD83D\uDCDD Initializing Netlify configuration...
|
|
90
90
|
`);let H=await k({directory:x||w.cwd(),siteId:b.siteId});if(console.log(`\u2713 Created ${H.configPath}`),H.siteId)console.log("\u2713 Saved site ID to .env.local");console.log(`
|
|
@@ -124,7 +124,7 @@ To view it in the development server:`),console.log(` stx dev ${x}
|
|
|
124
124
|
\uD83D\uDCDD ${$.relative(w.cwd(),Q)}:`),console.log("--- Original"),console.log("+++ Formatted"),console.log(`@@ Changes in ${$.basename(Q)} @@`),console.log("+ Formatted content would be applied");else await Bun.write(Q,q),console.log(`\u2705 Formatted ${$.relative(w.cwd(),Q)}`),U++}catch(X){console.error(`\u274C Error formatting ${$.relative(w.cwd(),Q)}:`,X),Y++}if(b.check&&Y>0)console.log(`
|
|
125
125
|
${Y} files need formatting. Run 'stx format' to fix.`),w.exit(1);else if(!b.check&&!b.diff)console.log(`\u2728 Formatted ${U} files successfully`)}catch(z){console.error("Error formatting files:",z),w.exit(1)}}),E.command("perf [command...]","Show performance statistics for STX operations").option("--clear","Clear performance statistics").option("--json","Output as JSON").example("stx perf").example("stx perf --clear").example("stx perf --json").action(async(x,b)=>{try{if(b.clear){A.clear(),console.log("\u2705 Performance statistics cleared");return}let z=A.getStats();if(Object.keys(z).length===0){if(b.json){console.log(JSON.stringify({},null,2));return}console.log("No performance data available. Run some STX commands first.");return}if(b.json)console.log(JSON.stringify(z,null,2));else{console.log(`
|
|
126
126
|
\uD83D\uDCCA STX Performance Statistics
|
|
127
|
-
`);for(let[k,j]of Object.entries(z))console.log(`\uD83D\uDD27 ${k}:`),console.log(` Count: ${j.count}`),console.log(` Average: ${j.avgTime.toFixed(2)}ms`),console.log(` Total: ${j.totalTime.toFixed(2)}ms`),console.log(` Min: ${j.minTime.toFixed(2)}ms`),console.log(` Max: ${j.maxTime.toFixed(2)}ms`),console.log("")}}catch(z){console.error("Error showing performance stats:",z),w.exit(1)}}),E.command("typecheck [patterns...]","Type-check the TypeScript inside .stx script blocks").option("--no-client","Skip <script client> and bare <script> blocks").option("--no-server","Skip <script server> blocks").option("--no-templates","Skip {{ }} and directive expressions in the markup").option("--lib <path>","Extra ambient declaration file (repeatable)").example("stx typecheck").example('stx typecheck "resources/views/**/*.stx"').action(async(x,b)=>{let{formatTypecheckDiagnostics:z,typecheckStxFiles:k}=await import("./chunk-
|
|
127
|
+
`);for(let[k,j]of Object.entries(z))console.log(`\uD83D\uDD27 ${k}:`),console.log(` Count: ${j.count}`),console.log(` Average: ${j.avgTime.toFixed(2)}ms`),console.log(` Total: ${j.totalTime.toFixed(2)}ms`),console.log(` Min: ${j.minTime.toFixed(2)}ms`),console.log(` Max: ${j.maxTime.toFixed(2)}ms`),console.log("")}}catch(z){console.error("Error showing performance stats:",z),w.exit(1)}}),E.command("typecheck [patterns...]","Type-check the TypeScript inside .stx script blocks").option("--no-client","Skip <script client> and bare <script> blocks").option("--no-server","Skip <script server> blocks").option("--no-templates","Skip {{ }} and directive expressions in the markup").option("--lib <path>","Extra ambient declaration file (repeatable)").example("stx typecheck").example('stx typecheck "resources/views/**/*.stx"').action(async(x,b)=>{let{formatTypecheckDiagnostics:z,typecheckStxFiles:k}=await import("./chunk-5kmwyys8.js"),{resolveStxTargets:j}=await import("./chunk-n27c7jvr.js"),W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx"],U=await j(H);if(U.length===0){console.log(`
|
|
128
128
|
No .stx files matched ${H.join(", ")}
|
|
129
129
|
`);return}let Y=m(w.argv,"--lib"),Q=Y.length>0?Y:b.lib?Array.isArray(b.lib)?b.lib:[b.lib]:[],X=await k(U,{client:b.client!==!1,server:b.server!==!1,templates:b.templates!==!1,extraLibs:Q});if(X.failure)console.error(`
|
|
130
130
|
Type-check did not run.
|
package/dist/stx-virtual-ts.d.ts
CHANGED
|
@@ -196,6 +196,28 @@ export declare function crossScopeCollisions(blocks: readonly ScriptBlock[]): st
|
|
|
196
196
|
* errors — `@click="open = !open"` assigns to what TypeScript sees as a
|
|
197
197
|
* `const`, and that form is documented stx syntax, not a mistake.
|
|
198
198
|
*/
|
|
199
|
+
/**
|
|
200
|
+
* The `@if` / `@unless` conditions that enclose a given offset, outermost first
|
|
201
|
+
* and already negated for `@else` / `@elseif` branches.
|
|
202
|
+
*
|
|
203
|
+
* Markup guards its own expressions, and the checker did not know it. A page
|
|
204
|
+
* that writes
|
|
205
|
+
*
|
|
206
|
+
* @if (comparison)
|
|
207
|
+
* {{ comparison.name }}
|
|
208
|
+
* @endif
|
|
209
|
+
*
|
|
210
|
+
* is safe, and `comparison` is `T | undefined` from the `.find()` above it, so
|
|
211
|
+
* every read inside the branch came back as "possibly undefined" - 75 of them
|
|
212
|
+
* in one application. Reported against markup that cannot fail is the fastest
|
|
213
|
+
* way to make a checker ignored, and the advice it implies (add a `?.`) makes
|
|
214
|
+
* the template worse.
|
|
215
|
+
*
|
|
216
|
+
* Conditions are emitted verbatim into `if (…)`, so a condition that does not
|
|
217
|
+
* compile is reported where it is written - as its own template expression -
|
|
218
|
+
* rather than twice.
|
|
219
|
+
*/
|
|
220
|
+
export declare function guardChainAt(source: string, offset: number): string[];
|
|
199
221
|
export declare function expressionStatement(expression: TemplateExpression): { text: string, prefixLength: number } | null;
|
|
200
222
|
/**
|
|
201
223
|
* Rewrite relative module specifiers to absolute paths against the real file.
|
|
@@ -268,7 +290,7 @@ export declare const UNWRAP_HELPER: '__StxTemplateValue';
|
|
|
268
290
|
* Mirrors what `serve.ts` puts in scope. Declaring these is what lets the
|
|
269
291
|
* checker report a genuine typo instead of suppressing every unresolved name.
|
|
270
292
|
*/
|
|
271
|
-
export declare const STX_SERVER_CONTEXT: readonly ['params', 'query', 'cookies', 'host', 'ip', 'setResponseStatus', 'setResponseHeader', 'notFound', 'request', 'url', 'definePageMeta', unknown, unknown, 'defineStore'];
|
|
293
|
+
export declare const STX_SERVER_CONTEXT: readonly ['params', 'query', 'cookies', 'host', 'ip', 'setResponseStatus', 'setResponseHeader', 'notFound', 'request', 'url', 'definePageMeta', unknown, unknown, 'defineStore', unknown, unknown, unknown, unknown, unknown, '$props'];
|
|
272
294
|
/** Marker comment so a generated preamble is recognisable in a dumped buffer. */
|
|
273
295
|
export declare const PAYLOAD_COMMENT: 'stx: types for the declared client payload (#1868)';
|
|
274
296
|
/** The same, for a page still relying on the name-scraping bridge. */
|
|
@@ -281,7 +303,7 @@ export declare const SCRAPED_COMMENT: 'stx: untyped bridge names — declare a d
|
|
|
281
303
|
* also dropped genuine typos; giving the names a declaration means an
|
|
282
304
|
* unrecognised one is still an error (#1852 ask 3).
|
|
283
305
|
*/
|
|
284
|
-
export declare const STX_TEMPLATE_GLOBALS: readonly ['$env', '$user', '$slot', '$slots', '$attrs', '$props', '$page', '$route', '$loop', '$errors', '$csrf', 'props', 'slot'];
|
|
306
|
+
export declare const STX_TEMPLATE_GLOBALS: readonly ['$env', '$user', '$slot', '$slots', '$attrs', '$props', '$page', '$route', '$loop', unknown, unknown, '$errors', '$csrf', 'props', 'slot'];
|
|
285
307
|
export declare interface ScriptBlock {
|
|
286
308
|
kind: ScriptKind
|
|
287
309
|
code: string
|
|
@@ -295,6 +317,7 @@ export declare interface TemplateExpression {
|
|
|
295
317
|
column: number
|
|
296
318
|
kind: 'interpolation' | 'directive'
|
|
297
319
|
attribute?: string
|
|
320
|
+
offset?: number
|
|
298
321
|
}
|
|
299
322
|
/** A synthetic line's origin, for diagnostics that land outside the source. */
|
|
300
323
|
export declare interface MappedLine {
|
package/dist/stx-virtual-ts.js
CHANGED
|
@@ -167,6 +167,7 @@ export function extractTemplateExpressions(source) {
|
|
|
167
167
|
code: code.trim(),
|
|
168
168
|
line: lineAt(masked, offset),
|
|
169
169
|
column: columnAt(masked, offset),
|
|
170
|
+
offset,
|
|
170
171
|
kind: "interpolation"
|
|
171
172
|
});
|
|
172
173
|
}
|
|
@@ -187,6 +188,7 @@ export function extractTemplateExpressions(source) {
|
|
|
187
188
|
code: substituteInterpolations(iterable.trim()),
|
|
188
189
|
line: lineAt(masked, offset + iterableStart),
|
|
189
190
|
column: columnAt(masked, offset + iterableStart),
|
|
191
|
+
offset: offset + iterableStart,
|
|
190
192
|
kind: "directive",
|
|
191
193
|
attribute: base
|
|
192
194
|
});
|
|
@@ -197,6 +199,7 @@ export function extractTemplateExpressions(source) {
|
|
|
197
199
|
code: substituteInterpolations(value.trim()),
|
|
198
200
|
line: lineAt(masked, offset + lead),
|
|
199
201
|
column: columnAt(masked, offset + lead),
|
|
202
|
+
offset: offset + lead,
|
|
200
203
|
kind: "directive",
|
|
201
204
|
attribute: base
|
|
202
205
|
});
|
|
@@ -283,7 +286,9 @@ export const STX_SERVER_CONTEXT = [
|
|
|
283
286
|
"url",
|
|
284
287
|
"definePageMeta",
|
|
285
288
|
"defineClientPayload",
|
|
286
|
-
"defineStore"
|
|
289
|
+
"defineStore",
|
|
290
|
+
"props",
|
|
291
|
+
"$props"
|
|
287
292
|
];
|
|
288
293
|
export function serverContextDeclarations() {
|
|
289
294
|
return STX_SERVER_CONTEXT.map((name) => `declare var ${name}: any`).join(`
|
|
@@ -459,6 +464,7 @@ export const STX_TEMPLATE_GLOBALS = [
|
|
|
459
464
|
"$page",
|
|
460
465
|
"$route",
|
|
461
466
|
"$loop",
|
|
467
|
+
"loop",
|
|
462
468
|
"$errors",
|
|
463
469
|
"$csrf",
|
|
464
470
|
"props",
|
|
@@ -474,6 +480,48 @@ export function crossScopeCollisions(blocks) {
|
|
|
474
480
|
return [...server].filter((name) => client.has(name)).sort();
|
|
475
481
|
}
|
|
476
482
|
const DIRECT_ASSIGNMENT_RE = /^\s*[A-Z_$][\w$]*\s*=[^=]/i;
|
|
483
|
+
export function guardChainAt(source, offset) {
|
|
484
|
+
const directive = /@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g, stack = [];
|
|
485
|
+
let match;
|
|
486
|
+
while ((match = directive.exec(source)) !== null) {
|
|
487
|
+
if (match.index >= offset)
|
|
488
|
+
break;
|
|
489
|
+
const name = match[1];
|
|
490
|
+
if (name === "endif" || name === "endunless") {
|
|
491
|
+
stack.pop();
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
let condition = "";
|
|
495
|
+
if (match[2] === "(") {
|
|
496
|
+
let depth = 0, index = match.index + match[0].length - 1;
|
|
497
|
+
const start = index + 1;
|
|
498
|
+
for (;index < source.length; index++) {
|
|
499
|
+
const char = source[index];
|
|
500
|
+
if (char === "(")
|
|
501
|
+
depth++;
|
|
502
|
+
else if (char === ")") {
|
|
503
|
+
depth--;
|
|
504
|
+
if (depth === 0)
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
condition = source.slice(start, index).trim();
|
|
509
|
+
directive.lastIndex = index + 1;
|
|
510
|
+
}
|
|
511
|
+
if (name === "if")
|
|
512
|
+
stack.push({ conditions: [condition] });
|
|
513
|
+
else if (name === "unless")
|
|
514
|
+
stack.push({ conditions: [`!(${condition})`] });
|
|
515
|
+
else if (name === "elseif" || name === "else") {
|
|
516
|
+
const current = stack[stack.length - 1];
|
|
517
|
+
if (!current)
|
|
518
|
+
continue;
|
|
519
|
+
const negated = current.conditions.map((c) => `!(${c})`);
|
|
520
|
+
current.conditions = name === "elseif" ? [...negated, condition] : negated;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return stack.flatMap((entry) => entry.conditions).filter(Boolean);
|
|
524
|
+
}
|
|
477
525
|
export function expressionStatement(expression) {
|
|
478
526
|
const code = expression.code.trim();
|
|
479
527
|
if (!code)
|
|
@@ -535,7 +583,7 @@ export function buildVirtualTypeScript(source, options = {}) {
|
|
|
535
583
|
if (options.templateExpressions !== !1) {
|
|
536
584
|
const statements = extractTemplateExpressions(source).map((expression) => ({ expression, statement: expressionStatement(expression) })).filter((entry) => entry.statement !== null);
|
|
537
585
|
if (statements.length > 0) {
|
|
538
|
-
const shadowed = [...new Set(blocks.flatMap((block) => collectBlockDeclarations(block.code)))].filter((name) => /^[A-Z_$][\w$]*$/i.test(name));
|
|
586
|
+
const maskedSource = maskNonTemplateRegions(source), shadowed = [...new Set(blocks.flatMap((block) => collectBlockDeclarations(block.code)))].filter((name) => /^[A-Z_$][\w$]*$/i.test(name));
|
|
539
587
|
let indent = 0;
|
|
540
588
|
if (shadowed.length > 0) {
|
|
541
589
|
append(UNWRAP_HELPER_DECL);
|
|
@@ -545,12 +593,12 @@ export function buildVirtualTypeScript(source, options = {}) {
|
|
|
545
593
|
indent = 1;
|
|
546
594
|
}
|
|
547
595
|
for (const { expression, statement } of statements) {
|
|
548
|
-
const pad = " ".repeat(indent);
|
|
549
|
-
append(pad + statement.text, {
|
|
596
|
+
const pad = " ".repeat(indent), guards = expression.offset === void 0 ? [] : guardChainAt(maskedSource, expression.offset), guardPrefix = guards.length > 0 ? `${guards.map((condition) => `if (${condition}) `).join("")}{ ` : "", guardSuffix = guards.length > 0 ? " }" : "";
|
|
597
|
+
append(pad + guardPrefix + statement.text + guardSuffix, {
|
|
550
598
|
line: expression.line,
|
|
551
599
|
column: expression.column,
|
|
552
600
|
expression,
|
|
553
|
-
prefixLength: statement.prefixLength + pad.length
|
|
601
|
+
prefixLength: statement.prefixLength + pad.length + guardPrefix.length
|
|
554
602
|
});
|
|
555
603
|
}
|
|
556
604
|
if (indent > 0)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.239",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"@cwcss/crosswind": "^0.2.19",
|
|
119
119
|
"@stacksjs/clapp": "^0.2.0",
|
|
120
|
-
"@stacksjs/desktop": "0.2.
|
|
121
|
-
"@stacksjs/sanitizer": "0.2.
|
|
120
|
+
"@stacksjs/desktop": "0.2.239",
|
|
121
|
+
"@stacksjs/sanitizer": "0.2.239",
|
|
122
122
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
123
|
-
"bun-plugin-stx": "0.2.
|
|
123
|
+
"bun-plugin-stx": "0.2.239",
|
|
124
124
|
"bunfig": "^0.15.17",
|
|
125
|
-
"stx-router": "0.2.
|
|
125
|
+
"stx-router": "0.2.239",
|
|
126
126
|
"ts-broadcasting": "^0.0.9",
|
|
127
127
|
"ts-images": "^0.2.11",
|
|
128
128
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-9g2rhkx8.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Is as Y}from"./chunk-1kg9sz9a.js";import{Ct as N}from"./chunk-5a1b5kjt.js";import C from"path";var O=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function x(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function R(K){let J=[],Q=x(K);O.lastIndex=0;let Z;while((Z=O.exec(Q))!==null){let j=(Z[1]||"").trim(),F=(Z[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=(Z[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=Z.index+F,$=Z.index+Z[0].length-z,U=K.slice(W,$);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let G=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",X=B(K,W);J.push({kind:G,code:U,startLine:X,attrs:j})}return J}function B(K,J){let Q=1;for(let Z=0;Z<J&&Z<K.length;Z++)if(K.charCodeAt(Z)===10)Q++;return Q}function M(K,J){let Q=K.lastIndexOf(`
|
|
3
|
-
`,J-1)+1;return J-Q+1}function k(K){let J=K.split(""),Q=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
|
|
4
|
-
`)J[z]=" "},Z=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of Z){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Q(F.index,F.index+F[0].length)}return J.join("")}function T(K){let J=0,Q="";for(let Z=0;Z<K.length;Z++){let j=K[Z];if(Q){if(j==="\\"){Z++;continue}if(j===Q)Q="";continue}if(j==='"'||j==="'"||j==="`"){Q=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[Z+1]==="|"){Z++;continue}if(K[Z-1]==="|")continue;return K.slice(0,Z)}}return K}var L=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,g="__stx_interpolated",D="__StxElement",A="__StxTemplateValue",E=`type ${A}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function P(K){return K.replace(/\{\{[\s\S]*?\}\}/g,g).replace(/\{!![\s\S]*?!!\}/g,g)}function Zj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
|
|
5
|
-
`).length-1,Z=J.length-Q;return`0${" ".repeat(Math.max(0,Z-1))}${`
|
|
6
|
-
`.repeat(Q)}`})}var b=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],u=new RegExp(String.raw`^[ \t]*@(?:${b.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function $j(K){return K.replace(u,(J)=>J.replace(/[^\n]/g," "))}var S=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function h(K){let J=k(K),Q=[],Z=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,j;while((j=Z.exec(J))!==null){if(j[1]||j[3])continue;let z=j[2]??j[4]??"",W=j[2]!==void 0?2:3,$=T(z);if(!$.trim())continue;let U=j.index+W+($.length-$.trimStart().length);Q.push({code:$.trim(),line:B(J,U),column:M(J,U),kind:"interpolation"})}w.lastIndex=0;while((j=w.exec(J))!==null){let F=j[1],z=j[3]??"",W=F.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(S.has(W)||S.has(F))continue;if(!z.trim())continue;let $=j.index+j[0].indexOf(j[2],j[0].indexOf(F)+F.length)+1;if(L.has(W)){let q=z.match(/\s+(?:in|of)\s+/);if(!q||q.index===void 0)continue;let G=z.slice(q.index+q[0].length),X=q.index+q[0].length+(G.length-G.trimStart().length);Q.push({code:P(G.trim()),line:B(J,$+X),column:M(J,$+X),kind:"directive",attribute:W});continue}let U=z.length-z.trimStart().length;Q.push({code:P(z.trim()),line:B(J,$+U),column:M(J,$+U),kind:"directive",attribute:W})}return Q.sort((F,z)=>F.line-z.line||F.column-z.column),Q}function p(K){let J=new Map,Q=(W,$)=>{let U=W.split(/[,[\]{}()\s]+/).filter(Boolean);for(let q of U){let G=q.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(G))continue;let X=U.length===1?$:void 0,H=J.get(G);if(!H)J.set(G,{name:G,iterable:X});else if(H.iterable!==X)H.iterable=void 0}},Z=/^\$?[A-Z_$][\w$]*$/i,j=(W)=>{let $=W.trim();return Z.test($)?$:void 0};for(let W of K.matchAll(/@for(?:each|else)\s*\(([\s\S]*?)\)/g)){let $=W[1].match(/^([\s\S]*?)\bas\b([\s\S]*)$/);if(!$)continue;Q($[2].replace(/=>/g," "),j($[1]))}for(let W of K.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)/g))Q(W[1]);let F=k(K);w.lastIndex=0;let z;while((z=w.exec(F))!==null){let W=z[1].replace(/\..*$/,"");if(!L.has(W))continue;let $=z[3].match(/\s+(?:in|of)\s+/);if(!$||$.index===void 0)continue;Q(z[3].slice(0,$.index),j(z[3].slice($.index+$[0].length)))}for(let W of K.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let $ of W[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))Q($[1]);return[...J.values()].sort((W,$)=>W.name.localeCompare($.name))}function V(K){let J=new Set;for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let Z of Q[1].split(",")){let j=Z.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(j))J.add(j)}return[...J].sort()}function m(){return["declare var window: any",...N.map((K)=>`declare var ${K}: any`)].join(`
|
|
7
|
-
`)}var l=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore"];function d(){return l.map((K)=>`declare var ${K}: any`).join(`
|
|
8
|
-
`)}function _(K){let J=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,Q,Z=!1,j=new Set,F=Y(K);while((Q=J.exec(F))!==null){Z=!0;for(let z of i(Q[1])){let W=z.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(W))j.add(W)}}return Z?[...j]:null}function i(K){let J=[],Q=0,Z="";for(let j of K){if(j===","&&Q===0){J.push(Z),Z="";continue}if(j==="("||j==="["||j==="{")Q++;else if(j===")"||j==="]"||j==="}")Q--;Z+=j}return J.push(Z),J.filter((j)=>j.trim().length>0)}function c(K){let J=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,Q=[],Z=K.replace(J,(j)=>{return Q.push(j.trim()),j.split(`
|
|
9
|
-
`).map(()=>"").join(`
|
|
10
|
-
`)});return{imports:Q.join(`
|
|
11
|
-
`),body:Z}}function f(K){let J=Y(K),Q=Array(J.length),Z=0;for(let W=0;W<J.length;W++){let $=J[W];if($==="}"||$===")"||$==="]")Z=Math.max(0,Z-1);if(Q[W]=Z,$==="{"||$==="("||$==="[")Z++}let j=[],F=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,z;while((z=F.exec(J))!==null){if(Q[z.index]!==0)continue;let W=z[1],$=z[2],U;if(W==="interface"){let q=J.indexOf("{",z.index);if(q===-1)continue;let G=0;U=-1;for(let X=q;X<J.length;X++)if(J[X]==="{")G++;else if(J[X]==="}"&&--G===0){U=X+1;break}if(U===-1)continue}else{let q=0;U=J.length;for(let G=J.indexOf("=",z.index)+1;G<J.length;G++){let X=J[G];if(X==="{"||X==="["||X==="("||X==="<")q++;else if(X==="}"||X==="]"||X===")"||X===">")q--;else if(q<=0&&(X===";"||X===`
|
|
12
|
-
`&&!/[=|&,<([{]\s*$/.test(J.slice(Math.max(0,G-40),G)))){U=X===";"?G+1:G;break}}}j.push({name:$,text:K.slice(z.index,U).replace(/^[ \t]*export[ \t]+/,"")}),F.lastIndex=U}return j}function o(K){return new Set(f(K).map((J)=>J.name))}function zj(K,J=""){let Q=_(K),Z=o(J),j=f(K).filter((U)=>!Z.has(U.name)).map((U)=>U.text);if(!Q){let U=V(K);if(U.length===0&&j.length===0)return"";return["",`// ${n}`,...j,...U.map((q)=>`declare var ${q}: any`)].join(`
|
|
13
|
-
`)}if(Q.length===0)return j.length>0?["",`// ${I}`,...j].join(`
|
|
14
|
-
`):"";let{imports:F,body:z}=c(K),W=z.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),$=["",`// ${I}`];if(F)$.push(F);return $.push(...j),$.push(`async function ${v}() {`,W,` return { ${Q.join(", ")} }`,"}",`type ${y} = Awaited<ReturnType<typeof ${v}>>`,...Q.map((U)=>`declare var ${U}: ${y}[${JSON.stringify(U)}]`)),$.join(`
|
|
15
|
-
`)}function r(K){let Q=Y(K).split(""),Z=0;for(let j=0;j<Q.length;j++){let F=Q[j];if(F==="{"||F==="("||F==="["){Z++;continue}if(F==="}"||F===")"||F==="]"){Z=Math.max(0,Z-1);continue}if(Z>0&&F!==`
|
|
16
|
-
`)Q[j]=" "}return V(Q.join(""))}function Wj(K,J){if(_(K)!==null)return[];let Q=Y(J),Z=new Set(N);return r(K).filter((j)=>{if(Z.has(j))return!1;if(V(J).includes(j))return!1;return new RegExp(`(?<![.#\\w$])${j}(?![\\w$])`).test(Q)})}var I="stx: types for the declared client payload (#1868)",n="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",v="__stxServerScope",y="__StxClientPayload";var a=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","$errors","$csrf","props","slot"];var s=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function t(K){let J=K.code.trim();if(!J)return null;if(K.attribute?.startsWith("@")){if(s.test(J))return null;let Z=";(($event: any): void => { ";return{text:`${Z}${J} });`,prefixLength:Z.length}}let Q=";void ((";return{text:`${Q}${J}));`,prefixLength:Q.length}}var e=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function jj(K,J){if(!J)return K;return K.replace(e,(Q,Z,j,F)=>{let z=C.resolve(J,F).replace(/\\/g,"/");return`${Z}${j}${z}${j}`})}function Fj(K,J={}){let Q=R(K),Z=K.split(`
|
|
17
|
-
`),j=Array.from({length:Z.length},()=>""),F=new Map;for(let W of Q)jj(W.code,J.originDir??"").split(`
|
|
18
|
-
`).forEach((U,q)=>{let G=W.startLine-1+q;if(G<j.length)j[G]=U});let z=(W,$)=>{if(j.push(W),$)F.set(j.length,$)};if(J.globals!==!1){if(z(""),J.runtimeGlobals!==!1)for(let $ of m().split(`
|
|
19
|
-
`))z($);for(let $ of d().split(`
|
|
20
|
-
`))z($);for(let $ of a)z(`declare var ${$}: any`);z(`declare var ${g}: any`);let W=new Set(Q.flatMap(($)=>V($.code)));z(`type ${D}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let $ of p(K)){if(W.has($.name))continue;let U=$.iterable&&W.has($.iterable)?`${D}<typeof ${$.iterable}>`:"any";z(`declare var ${$.name}: ${U}`)}}if(J.templateExpressions!==!1){let W=h(K).map(($)=>({expression:$,statement:t($)})).filter(($)=>$.statement!==null);if(W.length>0){let U=[...new Set(Q.flatMap((G)=>V(G.code)))].filter((G)=>/^[A-Z_$][\w$]*$/i.test(G)),q=0;if(U.length>0){z(E);for(let G of U)z(`type __StxT_${G} = ${A}<typeof ${G}>`);z(`;((${U.map((G)=>`${G}: __StxT_${G}`).join(", ")}) => {`),q=1}for(let{expression:G,statement:X}of W){let H=" ".repeat(q);z(H+X.text,{line:G.line,column:G.column,expression:G,prefixLength:X.prefixLength+H.length})}if(q>0)z("});")}}return z("export {}"),{text:j.join(`
|
|
21
|
-
`),lineMap:F,sourceLineCount:Z.length}}function Gj(K,J,Q){let Z=K.lineMap.get(J);if(!Z)return J<=K.sourceLineCount?{line:J,column:Q}:null;let j=Math.max(0,Q-1-(Z.prefixLength??0));return{line:Z.line,column:Z.column+j,expression:Z.expression}}
|
|
22
|
-
export{R as Mf,Zj as Nf,$j as Of,h as Pf,V as Qf,d as Rf,zj as Sf,Wj as Tf,jj as Uf,Fj as Vf,Gj as Wf};
|