@stacksjs/stx 0.2.242 → 0.2.243

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.
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ import{Pl as C}from"./chunk-a0sagjwy.js";import{Js as Y}from"./chunk-mv2v3g62.js";import{Dt as D}from"./chunk-ax56kn66.js";import u from"path";var S=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function m(K){let J=[],Q=h(K);S.lastIndex=0;let $;while(($=S.exec(Q))!==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,Z=$.index+$[0].length-z,G=K.slice(W,Z);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 X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",U=B(K,W);J.push({kind:X,code:G,startLine:U,attrs:j})}return J}function B(K,J){let Q=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Q++;return Q}function N(K,J){let Q=K.lastIndexOf(`
3
+ `,J-1)+1;return J-Q+1}function g(K){let J=K.split(""),Q=(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)Q(F.index,F.index+F[0].length)}return J.join("")}function p(K){let J=0,Q="";for(let $=0;$<K.length;$++){let j=K[$];if(Q){if(j==="\\"){$++;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[$+1]==="|"){$++;continue}if(K[$-1]==="|")continue;return K.slice(0,$)}}return K}var R=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,O="__stx_interpolated",y="__StxElement",f="__StxTemplateValue",l=`type ${f}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function L(K){return K.replace(/\{\{[\s\S]*?\}\}/g,O).replace(/\{!![\s\S]*?!!\}/g,O)}function Vj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
5
+ `).length-1,$=J.length-Q;return`0${" ".repeat(Math.max(0,$-1))}${`
6
+ `.repeat(Q)}`})}var d=["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"],i=new RegExp(String.raw`^[ \t]*@(?:${d.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function Yj(K){return K.replace(i,(J)=>J.replace(/[^\n]/g," "))}var I=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function c(K){let J=g(K),Q=[],$=/(@?)\{\{([\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,Z=p(z);if(!Z.trim())continue;let G=j.index+W+(Z.length-Z.trimStart().length);Q.push({code:Z.trim(),line:B(J,G),column:N(J,G),offset:G,kind:"interpolation"})}w.lastIndex=0;while((j=w.exec(J))!==null){let F=j[1],z=j[3]??"",W=F.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(I.has(W)||I.has(F))continue;if(!z.trim())continue;let Z=j.index+j[0].indexOf(j[2],j[0].indexOf(F)+F.length)+1;if(R.has(W)){let q=z.match(/\s+(?:in|of)\s+/);if(!q||q.index===void 0)continue;let X=z.slice(q.index+q[0].length),U=q.index+q[0].length+(X.length-X.trimStart().length);Q.push({code:L(X.trim()),line:B(J,Z+U),column:N(J,Z+U),offset:Z+U,kind:"directive",attribute:W});continue}let G=z.length-z.trimStart().length;Q.push({code:L(z.trim()),line:B(J,Z+G),column:N(J,Z+G),offset:Z+G,kind:"directive",attribute:W})}return Q.sort((F,z)=>F.line-z.line||F.column-z.column),Q}var o=2000;function r(K,J){let Q=0,$=Math.min(K.length,J+o);for(let j=J;j<$;j++){let F=K[j];if(F==="(")Q++;else if(F===")"){if(Q--,Q===0)return K.slice(J+1,j)}}return null}function n(K){let J=new Map,Q=(W,Z)=>{let G=W.split(/[,[\]{}()\s]+/).filter(Boolean);for(let q of G){let X=q.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(X))continue;let U=G.length===1?Z:void 0,H=J.get(X);if(!H)J.set(X,{name:X,iterable:U});else if(H.iterable!==U)H.iterable=void 0}},$=/^\$?[A-Z_$][\w$]*$/i,j=(W)=>{let Z=W.trim();return $.test(Z)?Z:void 0};for(let W of K.matchAll(/@for(?:each|else)\s*\(/g)){let Z=r(K,W.index+W[0].length-1);if(Z===null)continue;let G=Z.match(/^([\s\S]*?)\bas\b([\s\S]*)$/);if(!G)continue;Q(G[2].replace(/=>/g," "),j(G[1]))}for(let W of K.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)/g))Q(W[1]);let F=g(K);w.lastIndex=0;let z;while((z=w.exec(F))!==null){let W=z[1].replace(/\..*$/,"");if(!R.has(W))continue;let Z=z[3].match(/\s+(?:in|of)\s+/);if(!Z||Z.index===void 0)continue;Q(z[3].slice(0,Z.index),j(z[3].slice(Z.index+Z[0].length)))}for(let W of K.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let Z of W[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))Q(Z[1]);return[...J.values()].sort((W,Z)=>W.name.localeCompare(Z.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 $ of Q[1].split(",")){let j=$.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(j))J.add(j)}return[...J].sort()}function a(){return["declare var window: any",...D.map((K)=>`declare var ${K}: any`)].join(`
7
+ `)}var s=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"];function t(){return s.map((K)=>`declare var ${K}: any`).join(`
8
+ `)}function T(K){let J=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,Q,$=!1,j=new Set,F=Y(K);while((Q=J.exec(F))!==null){$=!0;for(let z of e(Q[1])){let W=z.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(W))j.add(W)}}return $?[...j]:null}function e(K){let J=[],Q=0,$="";for(let j of K){if(j===","&&Q===0){J.push($),$="";continue}if(j==="("||j==="["||j==="{")Q++;else if(j===")"||j==="]"||j==="}")Q--;$+=j}return J.push($),J.filter((j)=>j.trim().length>0)}function jj(K){let J=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,Q=[],$=K.replace(J,(j)=>{return Q.push(j.trim()),j.split(`
9
+ `).map(()=>"").join(`
10
+ `)});return{imports:Q.join(`
11
+ `),body:$}}function x(K){let J=Y(K),Q=Array(J.length),$=0;for(let W=0;W<J.length;W++){let Z=J[W];if(Z==="}"||Z===")"||Z==="]")$=Math.max(0,$-1);if(Q[W]=$,Z==="{"||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=z[2],G;if(W==="interface"){let q=J.indexOf("{",z.index);if(q===-1)continue;let X=0;G=-1;for(let U=q;U<J.length;U++)if(J[U]==="{")X++;else if(J[U]==="}"&&--X===0){G=U+1;break}if(G===-1)continue}else{let q=0;G=J.length;for(let X=J.indexOf("=",z.index)+1;X<J.length;X++){let U=J[X];if(U==="{"||U==="["||U==="("||U==="<")q++;else if(U==="}"||U==="]"||U===")"||U===">")q--;else if(q<=0&&(U===";"||U===`
12
+ `&&!/[=|&,<([{]\s*$/.test(J.slice(Math.max(0,X-40),X)))){G=U===";"?X+1:X;break}}}j.push({name:Z,text:K.slice(z.index,G).replace(/^[ \t]*export[ \t]+/,"")}),F.lastIndex=G}return j}function Jj(K){return new Set(x(K).map((J)=>J.name))}function Bj(K,J=""){let Q=T(K),$=Jj(J),j=x(K).filter((G)=>!$.has(G.name)).map((G)=>G.text);if(!Q){let G=V(K);if(G.length===0&&j.length===0)return"";return["",`// ${Qj}`,...j,...G.map((q)=>`declare var ${q}: any`)].join(`
13
+ `)}if(Q.length===0)return j.length>0?["",`// ${k}`,...j].join(`
14
+ `):"";let{imports:F,body:z}=jj(K),W=z.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),Z=["",`// ${k}`];if(F)Z.push(F);return Z.push(...j),Z.push(`async function ${A}() {`,W,` return { ${Q.join(", ")} }`,"}",`type ${_} = Awaited<ReturnType<typeof ${A}>>`,...Q.map((G)=>`declare var ${G}: ${_}[${JSON.stringify(G)}]`)),Z.join(`
15
+ `)}function Kj(K){let Q=Y(K).split(""),$=0;for(let j=0;j<Q.length;j++){let F=Q[j];if(F==="{"||F==="("||F==="["){$++;continue}if(F==="}"||F===")"||F==="]"){$=Math.max(0,$-1);continue}if($>0&&F!==`
16
+ `)Q[j]=" "}return V(Q.join(""))}function wj(K,J){if(T(K)!==null)return[];let Q=Y(J),$=new Set(D);return Kj(K).filter((j)=>{if($.has(j))return!1;if(V(J).includes(j))return!1;return new RegExp(`(?<![.#\\w$])${j}(?![\\w$])`).test(Q)})}var k="stx: types for the declared client payload (#1868)",Qj="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",A="__stxServerScope",_="__StxClientPayload";var Zj=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","props","slot"];var $j=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function zj(K,J){let Q=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,$=[],j;while((j=Q.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,Z=j.index+j[0].length-1,G=Z+1;for(;Z<K.length;Z++){let q=K[Z];if(q==="(")W++;else if(q===")"){if(W--,W===0)break}}z=K.slice(G,Z).trim(),Q.lastIndex=Z+1}if(F==="if")$.push({seen:[],current:z});else if(F==="unless")$.push({seen:[],current:`!(${z})`});else if(F==="elseif"||F==="else"){let W=$[$.length-1];if(!W)continue;if(W.current)W.seen.push(W.current);W.current=F==="elseif"?z:null}}return $.flatMap((F)=>[...F.seen.map((z)=>`!(${z})`),...F.current?[F.current]:[]]).filter(Boolean)}function Wj(K){let J=K.code.trim();if(!J)return null;if(K.attribute?.startsWith("@")){if($j.test(J))return null;let $=";(($event: any): void => { ";return{text:`${$}${J} });`,prefixLength:$.length}}let Q=";void ((";return{text:`${Q}${J}));`,prefixLength:Q.length}}var Fj=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function Uj(K,J){if(!J)return K;return K.replace(Fj,(Q,$,j,F)=>{let z=u.resolve(J,F).replace(/\\/g,"/");return`${$}${j}${z}${j}`})}function Mj(K,J={}){let Q=m(K),$=K.split(`
17
+ `),j=Array.from({length:$.length},()=>""),F=new Map;for(let W of Q)Uj(W.code,J.originDir??"").split(`
18
+ `).forEach((G,q)=>{let X=W.startLine-1+q;if(X<j.length)j[X]=G});let z=(W,Z)=>{if(j.push(W),Z)F.set(j.length,Z)};if(J.globals!==!1){if(z(""),J.runtimeGlobals!==!1)for(let Z of a().split(`
19
+ `))z(Z);for(let Z of t().split(`
20
+ `))z(Z);for(let Z of C)z(`declare var ${Z}: any`);for(let Z of Zj)z(`declare var ${Z}: any`);z(`declare var ${O}: any`);let W=new Set(Q.flatMap((Z)=>V(Z.code)));z(`type ${y}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let Z of n(K)){if(W.has(Z.name))continue;let G=Z.iterable&&W.has(Z.iterable)?`${y}<typeof ${Z.iterable}>`:"any";z(`declare var ${Z.name}: ${G}`)}}if(J.templateExpressions!==!1){let W=c(K).map((Z)=>({expression:Z,statement:Wj(Z)})).filter((Z)=>Z.statement!==null);if(W.length>0){let Z=g(K),q=[...new Set(Q.flatMap((U)=>V(U.code)))].filter((U)=>/^[A-Z_$][\w$]*$/i.test(U)),X=0;if(q.length>0){z(l);for(let U of q)z(`type __StxT_${U} = ${f}<typeof ${U}>`);z(`;((${q.map((U)=>`${U}: __StxT_${U}`).join(", ")}) => {`),X=1}for(let{expression:U,statement:H}of W){let P=" ".repeat(X),M=U.offset===void 0?[]:zj(Z,U.offset),v=M.length>0?`${M.map((b)=>`if (${b}) `).join("")}{ `:"",E=M.length>0?" }":"";z(P+v+H.text+E,{line:U.line,column:U.column,expression:U,prefixLength:H.prefixLength+P.length+v.length})}if(X>0)z("});")}}return z("export {}"),{text:j.join(`
21
+ `),lineMap:F,sourceLineCount:$.length}}function Nj(K,J,Q){let $=K.lineMap.get(J);if(!$)return J<=K.sourceLineCount?{line:J,column:Q}:null;let j=Math.max(0,Q-1-($.prefixLength??0));return{line:$.line,column:$.column+j,expression:$.expression}}
22
+ export{m as Mf,Vj as Nf,Yj as Of,c as Pf,V as Qf,t as Rf,Bj as Sf,wj as Tf,Uj as Uf,Mj as Vf,Nj as Wf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ag as e,Cg as b,Lg as JJ,zg as t}from"./chunk-fnhvrp9g.js";import{Pm as u,Qm as l,ap as o,hm as y,im as P,rm as x,sp as g,ym as v}from"./chunk-a0sagjwy.js";import{Au as s,Eu as OJ,Zt as a}from"./chunk-z2gmz9ew.js";import{Ou as R}from"./chunk-qs0fp63n.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-k8y3m0kn.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-ysq64g2a.js"),{defaultConfig:z}=await import("./chunk-kd3hbecq.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-k8y3m0kn.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-b7tw429a.js";import{Pm as u,Qm as l,ap as o,hm as y,im as P,rm as x,sp as g,ym as v}from"./chunk-a0sagjwy.js";import{Au as s,Eu as OJ,Zt as a}from"./chunk-z2gmz9ew.js";import{Ou as R}from"./chunk-qs0fp63n.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-k8y3m0kn.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-ysq64g2a.js"),{defaultConfig:z}=await import("./chunk-kd3hbecq.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-k8y3m0kn.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,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-dk45sjgn.js";import{Mf as a,Pf as b}from"./chunk-87kz1190.js";import"./chunk-z5ecweqg.js";import"./chunk-ht51fz7w.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.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};
2
+ import{Af as f,Bf as g,Cf as h,xf as c,yf as d,zf as e}from"./chunk-p5mr2984.js";import{Mf as a,Pf as b}from"./chunk-380tnd2y.js";import"./chunk-z5ecweqg.js";import"./chunk-ht51fz7w.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.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,2 +1,2 @@
1
1
  // @bun
2
- import{Lf as a}from"./chunk-x1az3202.js";import"./chunk-87kz1190.js";import"./chunk-fnhvrp9g.js";import"./chunk-g553n48p.js";import"./chunk-nhmq45hh.js";import"./chunk-frp9fc7j.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{a as buildForProduction};
2
+ import{Lf as a}from"./chunk-eavhvfzr.js";import"./chunk-380tnd2y.js";import"./chunk-b7tw429a.js";import"./chunk-g553n48p.js";import"./chunk-nhmq45hh.js";import"./chunk-frp9fc7j.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{a as buildForProduction};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{jm as E,km as M,xq as T}from"./chunk-a0sagjwy.js";import{Bu as d,Du as c,Eu as i}from"./chunk-z2gmz9ew.js";import{Lu as m,Ou as p}from"./chunk-qs0fp63n.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-15bk9bn4.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>
2
+ import{jm as E,km as M,xq as T}from"./chunk-a0sagjwy.js";import{Bu as d,Du as c,Eu as i}from"./chunk-z2gmz9ew.js";import{Lu as m,Ou as p}from"./chunk-qs0fp63n.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-fm6z2zr9.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,3 +1,3 @@
1
1
  // @bun
2
- import{bs as E}from"./chunk-a0sagjwy.js";import{Ou as D}from"./chunk-qs0fp63n.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-rxvmgb8d.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}}
2
+ import{bs as E}from"./chunk-a0sagjwy.js";import{Ou as D}from"./chunk-qs0fp63n.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-6mtkpbz8.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,4 +1,4 @@
1
1
  // @bun
2
- import{Qf as p}from"./chunk-87kz1190.js";import{Gg as a,Ig as JF,Jg as ZF,Kg as qF}from"./chunk-fnhvrp9g.js";import{rj as C,sj as D}from"./chunk-g553n48p.js";import{Dk as QF,Ek as XF,Fk as YF}from"./chunk-frp9fc7j.js";import{$r as n,Aq as FF,Eq as c,Mm as u,_o as o,bs as N,dm as l,fm as d,fq as e,tq as t}from"./chunk-a0sagjwy.js";import{Zs as r}from"./chunk-7q6abr68.js";import{Cu as S,Eu as WF}from"./chunk-z2gmz9ew.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(`
2
+ import{Qf as p}from"./chunk-380tnd2y.js";import{Gg as a,Ig as JF,Jg as ZF,Kg as qF}from"./chunk-b7tw429a.js";import{rj as C,sj as D}from"./chunk-g553n48p.js";import{Dk as QF,Ek as XF,Fk as YF}from"./chunk-frp9fc7j.js";import{$r as n,Aq as FF,Eq as c,Mm as u,_o as o,bs as N,dm as l,fm as d,fq as e,tq as t}from"./chunk-a0sagjwy.js";import{Zs as r}from"./chunk-7q6abr68.js";import{Cu as S,Eu as WF}from"./chunk-z2gmz9ew.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 ll,$a as cn,$b as vo,$c as vp,$d as vq,A as Xj,Aa as nm,Ab as Pn,Ac as Wo,Ad as Wp,Ae as ar,B as Yj,Ba as om,Bb as Qn,Bc as Xo,Bd as Xp,Be as br,C as Zj,Ca as Bm,Cb as Rn,Cc as Yo,Cd as Yp,Ce as cr,D as _j,Da as Cm,Db as Sn,Dc as Zo,Dd as Zp,De as dr,E as Qk,Ea as Dm,Eb as Tn,Ec as _o,Ed as _p,Ee as er,F as Rk,Fa as Em,Fb as Un,Fc as $o,Fd as $p,Fe as fr,G as Sk,Ga as Fm,Gb as Vn,Gc as ap,Gd as aq,Ge as gr,H as Tk,Ha as Jm,Hb as Wn,Hc as bp,Hd as bq,He as hr,I as Uk,Ia as Km,Ib as Xn,Ic as cp,Id as cq,Ie as ir,J as Vk,Ja as Lm,Jb as Yn,Jc as dp,Jd as dq,Je as jr,K as Wk,Ka as Mm,Kb as Zn,Kc as ep,Kd as eq,Ke as kr,L as Xk,La as Nm,Lb as _n,Lc as fp,Ld as fq,Le as lr,M as Yk,Ma as Om,Mb as $n,Mc as gp,Md as gq,Me as mr,N as Zk,Na as Pm,Nb as ho,Nc as hp,Nd as hq,Ne as nr,O as _k,Oa as Qm,Ob as io,Oc as ip,Od as iq,Oe as or,P as $k,Pa as Rm,Pb as jo,Pc as jp,Pd as jq,Pe as pr,Q as al,Qa as Sm,Qb as ko,Qc as kp,Qd as kq,Qe as qr,R as bl,Ra as Tm,Rb as lo,Rc as lp,Rd as lq,Re as rr,S as cl,Sa as Um,Sb as mo,Sc as mp,Sd as mq,Se as sr,T as dl,Ta as Vm,Tb as no,Tc as np,Td as nq,Te as tr,U as el,Ua as Wm,Ub as oo,Uc as op,Ud as oq,Ue as ur,V as fl,Va as Xm,Vb as po,Vc as pp,Vd as pq,Ve as vr,W as gl,Wa as Ym,Wb as qo,Wc as qp,Wd as qq,We as wr,X as hl,Xa as _m,Xb as ro,Xc as rp,Xd as rq,Xe as xr,Y as il,Ya as $m,Yb as so,Yc as sp,Yd as sq,Z as jl,Za as an,Zb as to,Zc as tp,Zd as tq,_ as kl,_a as bn,_b as uo,_c as up,_d as uq,aa as ml,ab as dn,ac as wo,ad as wp,ae as wq,ba as nl,bb as en,bc as xo,bd as xp,be as xq,ca as ol,cb as fn,cc as yo,cd as yp,ce as yq,da as pl,db as gn,dc as zo,dd as zp,de as zq,ea as ql,eb as hn,ec as Ao,ed as Ap,ee as Aq,fa as rl,fb as jn,fc as Bo,fd as Bp,fe as Bq,ga as sl,gb as kn,gc as Co,gd as Cp,ge as Cq,ha as tl,hb as ln,hc as Do,hd as Dp,he as Dq,ia as ul,ib as mn,ic as Eo,id as Ep,ie as Eq,ja as vl,jb as nn,jc as Fo,jd as Fp,je as Fq,ka as wl,kb as on,kc as Go,kd as Gp,ke as Gq,la as xl,lb as pn,lc as Ho,ld as Hp,le as Hq,ma as yl,mb as qn,mc as Io,md as Ip,me as Iq,na as zl,nb as rn,nc as Jo,nd as Jp,ne as Jq,o as a,oa as Al,ob as un,oc as Ko,od as Kp,oe as Qq,p as Ij,pa as cm,pb as vn,pc as Lo,pd as Lp,pe as Rq,q as Jj,qa as dm,qb as wn,qc as Mo,qd as Mp,qe as Sq,r as Kj,ra as em,rb as xn,rc as No,rd as Np,re as Tq,s as Lj,sa as fm,sb as Dn,sc as Oo,sd as Op,se as Uq,t as Mj,ta as gm,tb as En,tc as Po,td as Pp,te as Vq,u as Nj,ua as hm,ub as Fn,uc as Qo,ud as Qp,ue as Wq,v as Oj,va as im,vb as Gn,vc as Ro,vd as Rp,ve as Xq,w as Pj,wa as jm,wb as Ln,wc as So,wd as Sp,we as Yq,x as Qj,xa as km,xb as Mn,xc as To,xd as Tp,xe as Zq,y as Vj,ya as lm,yb as Nn,yc as Uo,yd as Up,ye as _q,z as Wj,za as mm,zb as On,zc as Vo,zd as Vp,ze as $q}from"./chunk-bhx39765.js";import{$e as ck,Ye as $j,Ze as ak,_e as bk,af as dk,bf as ek,cf as fk,df as gk,ef as hk,ff as ik,gf as jk,hf as kk,if as lk,jf as mk,kf as nk}from"./chunk-jy6madxa.js";import{lf as Ek,mf as Fk,nf as Gk,of as Hk,pf as Ik,qf as Jk,rf as Kk,sf as Lk,tf as Mk,uf as Nk,vf as Ok,wf as Pk}from"./chunk-shh4byc3.js";import{Af as eo,Bf as fo,Cf as go,xf as ao,yf as bo,zf as co}from"./chunk-dk45sjgn.js";import{Df as sn,Ef as tn}from"./chunk-vzskgbqj.js";import{Ff as yn}from"./chunk-kvqkkwnd.js";import{Gf as Sl,Hf as Tl,If as Ul,Jf as Vl,Kf as Yl,Lf as am}from"./chunk-x1az3202.js";import{Mf as Wl,Pf as Xl}from"./chunk-87kz1190.js";import{$f as tm,Xf as pm,Yf as qm,Zf as rm,_f as sm,ag as um,bg as vm,cg as wm,dg as xm,eg as ym,fg as zm,gg as Am}from"./chunk-d19bydks.js";import{hg as Ck,ig as Dk}from"./chunk-1p0r6k2f.js";import{jg as bm}from"./chunk-0vfb2q94.js";import{kg as Gm,lg as Hm,mg as Im,ng as Zm,og as zn,pg as An,qg as Bn,rg as Cn,sg as Hn,tg as In,ug as Jn,vg as Kn}from"./chunk-ytxz3xcs.js";import{Ag as Fl,Bg as Gl,Cg as Hl,Dg as Il,Eg as Jl,Fg as Kl,Gg as Ll,Hg as Ml,Ig as Nl,Jg as Zl,Kg as _l,Lg as $l,wg as Bl,xg as Cl,yg as Dl,zg as El}from"./chunk-fnhvrp9g.js";import{Mg as Xi,Ng as Yi,Og as Zi,Pg as _i,Qg as $i,Rg as aj,Sg as bj,Tg as cj,Ug as dj,Vg as ej,Wg as fj}from"./chunk-n3tj3h1q.js";import{Xg as xj,Zg as yj}from"./chunk-cs1dc1n7.js";import{dh as ok,eh as pk,fh as qk,gh as rk,hh as sk,ih as tk,jh as uk,lh as vk,mh as wk,nh as xk,oh as yk,ph as zk,qh as Ak,th as Bk}from"./chunk-9228drk4.js";import{uh as hh,vh as ih,wh as jh,xh as kh}from"./chunk-tv4n71jy.js";import{Ch as lh}from"./chunk-rbke5wqk.js";import{Dh as sh,Eh as th,Fh as uh,Gh as vh,Hh as wh,Ih as xh}from"./chunk-vgmc978e.js";import{Jh as Mi,Kh as Ni,Lh as Oi,Ph as Pi,Qh as Qi,Rh as Ri}from"./chunk-78bpc81t.js";import{$h as Ki,Sh as Ci,Th as Di,Uh as Ei,Vh as Fi,Wh as Gi,Yh as Hi,Zh as Ii,_h as Ji,ai as Li}from"./chunk-j93x5fzs.js";import{bi as sg,ci as tg,di as ug,ei as vg,fi as wg,gi as xg}from"./chunk-ntnv2f7a.js";import{hi as yg,ii as zg,ji as Ag,ki as Bg,li as Cg}from"./chunk-1gdzz04h.js";import{mi as Dg,ni as Eg,oi as Fg,pi as Gg,qi as Hg}from"./chunk-ssfhndm6.js";import{ri as Ig,si as Jg,ti as Kg,ui as Lg,vi as Mg,wi as Ng,xi as Og}from"./chunk-94fee5jw.js";import{Ai as Rg,Bi as Sg,Ci as Tg,Di as Ug,yi as Pg,zi as Qg}from"./chunk-pv9at6r1.js";import{Fi as Vg,Gi as Wg,Hi as Xg,Ii as Yg,Ji as Zg,Ki as _g,Li as $g,Mi as ah,Ni as bh,Oi as ch,Pi as dh,Qi as eh,Ri as fh,Si as gh}from"./chunk-dq88kv1p.js";import{Ui as mg,Vi as ng}from"./chunk-jvs7azc8.js";import{Yi as og}from"./chunk-z5ecweqg.js";import"./chunk-ht51fz7w.js";import{aj as pg}from"./chunk-fvjh7rx0.js";import{bj as qg,cj as rg}from"./chunk-b6jhznkh.js";import{dj as fe,ej as ge,fj as he,gj as ie,hj as je,ij as ke,jj as le,kj as me,lj as ne,mj as oe,nj as pe,oj as qe,pj as re,qj as se}from"./chunk-4heeeaef.js";import{rj as Pe,sj as Qe}from"./chunk-g553n48p.js";import{Aj as Ce,Bj as De,Cj as Ee,Dj as Fe,Ej as Ge,Fj as He,Gj as Ie,Hj as Je,Ij as Ke,Jj as Le,Kj as Me,Lj as Ne,Mj as Oe,zj as Be}from"./chunk-nhmq45hh.js";import{Nj as Re,Oj as Se,Pj as Te,Qj as Ue,Rj as Ve,Sj as We,Tj as Xe,Uj as Ye,Vj as Ze,Wj as _e,Xj as $e}from"./chunk-dq48z0r7.js";import{pk as Kq,qk as Lq,rk as Mq,sk as Nq,tk as Oq,uk as Pq}from"./chunk-ggghr7tk.js";import{Ak as Pl,Bk as Ql,Ck as Rl,vk as Rj,wk as Sj,xk as Tj,yk as Uj,zk as Ol}from"./chunk-b212gjes.js";import"./chunk-frp9fc7j.js";import"./chunk-r84h7wxw.js";import{$m as Wb,$n as Wc,$o as Ae,$p as Jf,$q as Yh,$r as zj,Al as da,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 lg,Dr as Ai,El as ha,Em as Ab,En as zc,Eo as Pd,Ep as mf,Eq as mh,Er as Bi,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,Hm as Db,Hn as Cc,Ho as Sd,Hp as pf,Hq as ph,Hr as Ui,Il as za,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 rh,Jr as Wi,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 Ia,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,Vo as ee,Vp as Df,Vq as Jh,Vr as rj,Wl as Ta,Wm as Rb,Wn as Rc,Wp as Ef,Wq as Kh,Wr as sj,Xl as Ua,Xm as Sb,Xn as Sc,Xo as ye,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,Zp as Hf,Zq as Nh,Zr as vj,_l as Xa,_m as Vb,_n as Vc,_o as ze,_p as If,_q as Oh,_r as wj,an as Xb,ao as Xc,aq as Kf,ar as Zh,as as Aj,bn as Yb,bo as Yc,bp as af,bq as Lf,br as _h,bs as Bj,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,hs as Hj,il as s,im as bb,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,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 id,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,rq as $f,rr as oi,sl as C,sm as jb,sn as nc,so as Dd,sp as bf,sq as ag,sr as pi,tl as D,tm as kb,tn as oc,to as Ed,tq as bg,tr as qi,ul as E,um as lb,un as pc,uo as Fd,up as cf,uq as cg,ur as ri,vl as F,vm as mb,vn as qc,vo as Gd,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,zm as qb,zn as uc,zo as Kd,zp as gf,zq as hg,zr as wi}from"./chunk-a0sagjwy.js";import{is as d,js as e,ks as f,ls as g,ms as h,ns as i,os as j,ps as k,qs as l,rs as m,ss as n,ts as o,us as p,vs as q,ws as r}from"./chunk-092sm06a.js";import{As as Sh,Bs as Th,Cs as Uh,Ds as Vh,Es as Wh,Fs as Xh,xs as Ph,ys as Qh,zs as Rh}from"./chunk-19m7hed6.js";import{Gs as b,Hs as c}from"./chunk-nhn7qftp.js";import{Is as Ea,Js as Fa}from"./chunk-mv2v3g62.js";import{Ks as rb,Ls as sb,Ns as tb,Xs as ub,Ys as vb,Zs as wb}from"./chunk-7q6abr68.js";import{$s as ue,_s as te,at as ve,bt as we,et as xe}from"./chunk-2qkasmq1.js";import{ft as Ja,gt as Ka,ht as La,it as Ma,jt as Na,kt as Oa}from"./chunk-1px4xey5.js";import{At as yd,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-a8fx6wcb.js";import"./chunk-x41v697c.js";import{Dt as ja,Et as ka,Ft as la,Gt as ma,Ht as na,It as oa,Jt as pa,Kt as qa,Lt as ra,Mt as sa,Nt as ta,Ot as ua,Pt as va,Qt as wa,Rt as xa,St as ya}from"./chunk-ax56kn66.js";import{Au as ca,Wt as K,Xt as L,_t as M,du as N,eu as O,ku as P,lu as Q,mu as R,nu as S,ou as T,pu as U,qu as V,ru as W,su as X,tu as Y,uu as Z,vu as _,wu as $,xu as aa,yu as ba}from"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{jk as writeNetlifyConfig,_l as writeManifest,Ok as writeImageManifest,qo as wrapComponentForHMR,kr as withDefaults,wj as webComponentDirectiveHandler,fp as watermark,hq as watchViews,Yk as watchMultiple,Zk as watchEffect,Xk as watch,xe as warmImagePlaceholders,kl as waitForStore,Yd as waitForLocale,bo as virtualPathFor,jj as videoDirective,tc as validators,or as validated,Kd as validateValueEnhanced,nh as validateTemplate,kp as validateParams,Ld as validateFormEnhanced,Yp as validateFile,Gd as validateFields,Fd as validateField,ph as validateDirective,dd as validateCspDirectives,Ej as validateConfig,dm as validateComponentScripts,Bm as validateComponentProps,lg as validateClientScript,kh as v,jb as usesSignalsInScript,pa as usesReactiveRuntime,Ch as userComponentFileExists,Sg as useVirtualList,rd as useTitle,jl as useStoreOrThrow,Io as useStore,Vj as useStorage,sq as useSlots,Xj as useSessionStorage,od as useSeoMeta,ll as useRouteParams,nl as useRouteParamOrThrow,ml as useRouteParam,rd as usePageTitle,Oe as useOptimistic,pl as useMiddlewareValue,ol as useMiddlewareState,Wj as useLocalStorage,jo as useLoadingIndicator,md as useHead,hh as useForm,uq as useAttrs,_p as uploadFiles,Zp as uploadFile,gl as updateInstance,Me as untrack,Sh as unregisterDirective,hl as unmountInstance,qb as unescapeHtml,fo as typecheckStxFiles,Bh as transpileTypeScript,Zq as translate,w as transitionDirective,vm as toUsers,um as toUser,Qo as thumbnail,Rp as thumbHashToRGBA,Sp as thumbHashToDataURL,ra as templateNeedsRuntime,qa as templateHasReactiveContext,Re as templateCache,Mb as syncRecordedResponse,no as stxClientHelpers,wf as structuredDataDirective,ar as stripLocalePrefix,Ll as stripDocumentWrapper,Fa as stripCommentsAndLiterals,hn as stringToStream,Tc as strictCspPreset,ne as streamingSuspenseDirective,re as streamToResponse,le as streamTemplateSimple,fe as streamTemplate,Qj as stopHmrServer,rm as stopBroadcasting,Ma as stateDirName,Na as stateDir,Be as state,fg as startsDocument,Kn as startProductionServer,yn as startInteractive,qm as startBroadcasting,cr as stampLocaleLayoutGroup,D as staggerDirective,ip as srcsetUrls,E as springDirective,Cc as splitByPipe,Hl as spaNavVaryHeaders,co as sourcePathFor,pp as smartBatchSign,Eh as slotContentHasExpressions,np as signUrl,zh as shouldTranspileTypeScript,Nj as shouldReloadOnChange,sp as shouldRefreshSignature,Oj as shouldIgnoreFile,Kg as shouldCacheComponent,Uo as sharpen,rr as shape,La as setStateDir,tl as setRouteParams,ul as setMiddlewareState,we as setImagePlaceholder,mq as setGlobalProvide,Qb as setErrorLocale,Qk as setCurrentInstance,Zi as setCachedVideoResult,Oi as setCachedImageResult,Ii as setCached,ur as serveStxFile,wr as serveMultipleStxFiles,Ij as serveMarkdownFile,Un as serveFile,xr as serveApp,Tn as serve,to as serializeState,Zm as serializeSetCookie,Wo as sepia,pd as seoMetaToHeadConfig,x as scrollAnimateDirective,q as screenReaderDirective,nj as scopeHTML,mj as scopeCSS,zf as scanForSitemapEntries,k as scanA11yTargets,l as scanA11yIssues,_o as saturation,lp as sanitizeParams,vc as sanitizeFilePath,wc as sanitizeExpression,xc as sanitizeDirectiveParams,uc as sanitizeDirectiveParam,yc as sanitizeComponentProps,oc as safeExecuteAsync,nc as safeExecute,xa as runtimeHandledXAttrsLiteral,pf as runPreProcessingMiddleware,qf as runPostProcessingMiddleware,Bn as runPageAction,He as runMountCallbacks,ba as runMiddleware,el as runHooks,Sq as runDoctor,Ie as runDestroyCallbacks,Ef as runComposers,$o as rotate,lh as rewriteImagesWithSiblings,Nb as responseBindings,Ih as resolveTemplatePath,c as resolveStxTargets,Aj as resolveStxDirectories,Yq as resolveI18n,Oo as resize,Ya as resetPlaceholders,ld as resetHead,so as resetHMRHandler,bc as resetErrorConfig,mr as required,ab as replacePlaceholders,fq as renderView,gj as renderVideoComponent,Qa as renderVendorStyleTags,Bq as renderToString,Cq as renderToStream,Dq as renderToDOM,Qp as renderThumbhashToCanvas,Pq as renderTemplateString,Nq as renderTemplate,Oq as renderString,ie as renderStreamingPage,uh as renderSlot,Ag as renderSSRSuspense,Ap as renderProtectedVideo,zp as renderProtectedImg,mp as renderMediaUpload,Mq as renderMarkdownView,Ql as renderLayoutTypes,Si as renderImgComponent,Ek as renderImageComponent,td as renderHtmlAttrs,sd as renderHead,iq as renderEmail,Gh as renderComponentWithSlot,ud as renderBodyAttrs,Do as render,Vc as relaxedCspPreset,Ed as registerValidationRule,pe as registerStreamingDirectives,Ko as registerStoresClient,rl as registerStore,xf as registerSeoDirectives,V as registerMiddleware,eb as registerFilters,db as registerFilter,Sb as registerErrorMessages,Jd as registerEnhancedValidationRule,Ph as registerDirective,cd as registerCspDirectives,Em as registerComponentDirectives,J as registerAnimationDirectives,r as registerA11yDirectives,Uk as ref,qn as redirect,Ib as recordResponseStatus,Jb as recordResponseHeader,Oa as rebaseOntoStateDir,Kb as readResponseStatus,Lb as readResponseHeaders,Gj as readMarkdownFile,Se as readFileCached,Vk as reactive,dp as quality,xp as pruneSignatureCache,Li as pruneCache,kq as provide,Lq as protectCodeBlocks,lr as prop,If as processVueTemplate,Qg as processVirtualListDirectives,Ug as processVirtualGridDirectives,fj as processVideo,Hd as processValidateDirective,de as processTranslateDirective,ug as processTransitionDirectives,xg as processTransitionAttributes,xd as processTitleDirective,Ab as processTemplateBindings,qg as processTeleportDirectives,yg as processSuspenseDirectives,sf as processStructuredData,je as processStreamDirectives,Ob as processStatusDirective,fh as processStaticDirectives,nf as processStackReplacements,mf as processStackPushDirectives,vh as processSlots,Jl as processShell,Gf as processServerBindings,tf as processSeoDirective,qe as processSectionDirectives,Lf as processScopedStyles,yb as processReactiveBindings,Bp as processProtectedMedia,_g as processPartialHydrationDirectives,kg as processOnceDirective,of as processMiddleware,rf as processMetaDirectives,yd as processMetaDirective,Hj as processMarkdownFileDirectives,Nh as processMarkdownDirectives,gf as processLoops,Ig as processKeepAliveDirectives,jg as processJsonDirective,Tg as processInfiniteListDirectives,lf as processIncludes,Ui as processImgComponents,Gk as processImageComponents,tk as processImage,wd as processHeadDirective,Ad as processForms,Cd as processFormInputDirectives,nb as processExpressions,Ca as processEventDirectives,Dd as processErrorDirective,Jf as processDynamicComponents,mh as processDirectives,Xh as processDirectiveAttributes,pg as processDeferDirectives,hd as processCustomDirectives,$c as processCspDirectives,sr as processComponentProps,Xa as processClientScript,Bd as processBasicFormDirectives,Dg as processAsyncDirectives,id as processAppearanceBootstrapDirective,A as processAnimationDirectives,f as processA11yDirectives,Ud as preloadTranslationsBackground,Td as preloadTranslations,io as preloadIslandHandlers,ye as preloadIconCollection,mm as poolStrings,yj as pluginManager,ue as placeholdersWarmed,tg as performLeave,sg as performEnter,Je as pendingLifecycleCounts,Ne as peek,hf as partialsCache,hj as parseVideoDirectiveOptions,Mo as parseUrl,Tp as parseThumbhashString,Ic as parseSwitchBlock,sh as parseSlots,th as parseSlotElement,Nc as parseScriptDeclarations,uj as parseSFCComponent,Cp as parseProtectedArgs,ff as parseLoopBinding,Ti as parseImgComponent,ji as parseImageUrl,Fk as parseImageComponent,zn as parseFormBody,Kc as parseExpressionWithFilters,nn as parseCookies,Jm as parseContainerSelector,Fc as parseConditionalBlock,Lc as parseArguments,H as parseAnimationShorthand,nr as optional,nm as optimizeTemplate,Lk as optimizeImage,Mk as optimizeDirectory,pr as oneOf,jf as onceStore,bl as onUpdated,xb as onUpdate,dl as onUnmounted,yl as onServer,$k as onMounted,Fe as onMount,eh as onHydrated,qq as onErrorCaptured,Ge as onDestroy,Og as onDeactivated,xl as onClient,al as onBeforeUpdate,cl as onBeforeUnmount,_k as onBeforeMount,Ng as onActivated,Mp as observeElement,rn as notFound,Qf as normalizeCriticalHeadOrder,pq as nextTick,Hm as negotiateEncoding,P as navigateTo,fl as mountInstance,z as motionDirective,Uc as moderateCspPreset,lm as minifyHtml,vf as metaDirective,_f as metaDedupKey,No as mergeParams,ag as mergeHtmlAttrs,nd as mergeHeadConfigs,Yc as mergeCspDirectives,sb as mergeCrosswindConfig,M as matchRoute,Oh as markdownDirectiveHandler,Fj as markdownCache,b as looksLikeGlob,$q as localizePath,Vd as loadTranslationLazy,$d as loadTranslation,Bj as loadStxConfig,_ as loadMiddlewareFromDirectory,$l as loadManifest,Ip as loadElement,sm as loadChannels,gr as lintStxStrict,Kp as lazyLoadAll,Jp as lazyLoad,C as keyframeDirective,zq as jsxs,Aq as jsxDEV,yq as jsx,pn as jsonResponse,oe as islandDirective,_b as isTest,Ml as isSpaNavigation,Fl as isSpaNavRequest,qp as isSignatureValid,Ke as isSignal,rk as isSharpAvailable,an as isServerEnvironment,vl as isServer,ta as isRuntimeOwnedColonAttr,Yb as isProduction,d as isPresentationalRole,Fp as isNativeLazySupported,Kq as isMarkdownPath,Rd as isLoading,Sd as isLoaded,yh as isJavaScriptScript,Gp as isIntersectionObserverSupported,zk as isImageFile,sk as isImageBackendAvailable,be as isICUFormat,dh as isHydrated,Dh as isHydrateTrigger,Gb as isHttpStatus,$m as isEdgeEnvironment,hr as isDirectiveKind,Zb as isDevelopment,Le as isDerived,Mj as isCssOnlyChange,Gm as isCompressible,wl as isClient,Fg as isAsyncComponent,An as isActionableMethod,Xo as invert,Ue as invalidateFileCacheByDir,Te as invalidateFileCache,mb as interpolateScriptsInTemplate,kb as interpolateScriptExpressions,lb as interpolateScriptAttributes,kc as inlineError,Xq as injectThemeBootstrap,uf as injectSeoTags,Uq as injectSeo,af as injectRouterScript,Lj as injectHotReload,fa as injectHeatmap,Zc as injectCspMetaTag,wb as injectCrosswindCSS,hg as injectConfigHeadTags,Pf as injectColorModeBootScript,cg as injectCloakStyle,Wf as injectBuildId,Sa as injectBrowserCoreAutoImports,Cb as injectAnalytics,lq as inject,ql as initStoreRegistry,mk as initNetlify,ko as initLoadingIndicator,Hp as initLazyLoading,xn as initFile,Pp as initBlurUp,Vp as initAllBlurUp,Wi as imgDirective,Jk as imageDirective,In as hydrateTemplateStream,Hn as hydrateTemplate,ho as hydrateIslands,ah as hydrateIsland,Jn as hydrateFragment,bh as hydrateByStrategy,ch as hydrateAll,Ao as hydrate,Sn as htmlResponse,dg as hoistLeadingHeadTags,Rf as hoistColorModeBootScript,ga as heatmapDirective,Ei as hashString,$e as hashFilePath,Ci as hashFile,Di as hashBuffer,Hf as hasVueTemplateSyntax,ef as hasVariables,Fo as hasStore,bb as hasPlaceholders,kk as hasNetlifyConfig,X as hasMiddleware,Da as hasEventDirectives,gg as hasDocumentShell,qh as hasDirectives,h as hasDOMSupport,Ck as handleImageRequest,rq as handleError,Hq as h,yk as groupVariantsByFormat,Vo as grayscale,Ln as gitHash,fm as getUnusedDirectives,Wd as getTranslationSync,Pd as getTranslationCacheStats,Xd as getTranslationAsync,ce as getTranslation,fk as getTotalSize,rp as getTimeUntilExpiry,mg as getStoreScript,Go as getStoreNames,Eo as getStore,_j as getStorageSize,Zj as getStorageKeys,Jh as getSourceLineInfo,Ah as getSharedTranspiler,g as getScreenReaderOnlyStyle,oj as getScopeAttribute,Ae as getRouteParams,Ha as getPublicEnvDefine,Ia as getPublicEnv,oh as getPositionInfo,_a as getPlaceholderRegistry,Bi as getPlaceholderCacheStats,kd as getPageMeta,Pc as getNonce,Ak as getMimeType,Z as getMiddlewareNames,W as getMiddleware,Qd as getLoadingState,Zd as getLoadingLocales,te as getImagePlaceholder,uk as getImageMetadata,zo as getHydrationRuntime,sl as getHydratedStoreState,Pj as getHmrServer,jd as getHead,ro as getHMRHandler,ni as getFormatExtension,Gi as getFileMtime,xk as getFallbackVariant,Ub as getErrorMessage,Rb as getErrorLocale,ac as getErrorConfig,Xb as getErrorCodeName,Rh as getDirectives,Qh as getDirective,Rk as getCurrentInstance,Xc as getCspPreset,ed as getCspHeaderName,tb as getCrosswindServeAsset,Mh as getComponentCacheStats,Yi as getCachedVideoResult,vp as getCachedSignature,We as getCachedSignalsRuntime,Xe as getCachedRouterScript,zi as getCachedPlaceholder,Ni as getCachedImageResult,Hi as getCached,Ki as getCacheStats,Uf as getBuildId,pm as getBroadcastServer,mi as getBestVariant,fb as getAllFilters,ai as generateWidthSrcset,Rg as generateVirtualListCSS,aq as generateVideoPreview,Md as generateValidationScript,bq as generateUploadRuntime,gm as generateTreeShakenBundle,wg as generateTransitionRuntime,vg as generateTransitionCSS,aj as generateThumbnails,si as generateThumbhashPlaceholder,Sm as generateTemplatesDocs,Cg as generateSuspenseRuntime,Bg as generateSuspenseCSS,uo as generateStateScript,ki as generateSrcsetData,Ri as generateSrcset,vk as generateSrcSet,bj as generateSpriteSheet,jq as generateSpaShell,li as generateSourceTags,gi as generateSizesFromBreakpoints,fi as generateSizesAttribute,wk as generateSizes,yf as generateSitemapIndex,Vq as generateSitemap,Ep as generateSimpleMediaPicker,yp as generateSignatureRuntime,Qe as generateSignalsRuntimeDev,Pe as generateSignalsRuntime,Wa as generateServerDataBridge,lj as generateScopeId,vj as generateSFCWebComponent,Aa as generateRuntimeScript,K as generateRouteTypes,L as generateRouteManifest,Af as generateRobotsTxt,Wq as generateRobots,Qi as generateResponsiveVariants,rj as generateReactiveWebComponentTS,qj as generateReactiveWebComponent,tj as generateReactiveRuntime,sj as generateReactiveMixin,$i as generatePoster,yi as generatePlaceholderStyle,xi as generatePlaceholderCSS,ri as generatePlaceholder,$g as generatePartialHydrationCSS,Oc as generateNonce,gk as generateNetlifyToml,dq as generateMinifiedMediaRuntime,cq as generateMediaRuntime,Dp as generateMediaManagerEmbed,Zl as generateManifest,mo as generateLoadingIndicatorHtml,Op as generateLazyLoadRuntime,Rl as generateLayoutTypes,ui as generateLQIP,Mg as generateKeepAliveRuntime,Lg as generateKeepAliveCSS,gh as generateIslandManifest,$p as generateImagePreview,Nk as generateImageManifest,yo as generateHydrationScript,se as generateHydrationRuntime,Bo as generateHydrationCSS,Vg as generateHydrationBootstrap,Kj as generateHotReloadScript,ea as generateHeatmapScript,po as generateHMRClientScript,cj as generateHLSManifest,vo as generateEventBindings,ei as generateDprSrcsetWithVariableQuality,di as generateDprSrcset,eg as generateDocumentShell,Xm as generateDocs,Tm as generateDirectivesDocs,Wh as generateDirectiveRuntime,Bf as generateDefaultRobotsTxt,dj as generateDASHManifest,Sc as generateCspMetaTag,Rc as generateCspHeader,vb as generateCrosswindCSS,wq as generateCompositionRuntime,Rm as generateComponentsDocs,Wg as generateComponentManifest,Pm as generateComponentDoc,wi as generateColorPlaceholder,Of as generateColorModeBootScript,il as generateClientRuntime,Fi as generateCacheKey,Ua as generateBrowserAutoImportDestructuring,Wp as generateBlurUpRuntime,Xp as generateBlurUpCSS,zb as generateBindingsRuntime,bi as generateAutoWidthSrcset,Ta as generateAutoImportDestructuring,Hg as generateAsyncComponentRuntime,Gg as generateAsyncComponentCSS,I as generateAnimationRuntime,G as generateAnimationCSS,Bb as generateAnalyticsScript,go as formatTypecheckDiagnostics,$n as formatTypeErrors,un as formatStxContent,ek as formatSize,O as formatRoutes,vn as formatMarkdownContent,Vb as formatLocalizedError,ae as formatICU,cc as formatFilePath,jc as formatError,Tq as formatDoctorReport,Um as formatDocsAsMarkdown,Wm as formatDocsAsJson,Vm as formatDocsAsHtml,cp as format,km as foldConstants,bp as flipVertical,ap as flipHorizontal,Sl as fingerprint,eo as findRuntimeTypeDeclarations,Rq as findPantryPackage,Ec as findMatchingEndTag,Ac as findMatchingDelimiter,Ea as findInterpolationEnd,Gc as findIfBlocks,Jc as findExpressions,N as findErrorPage,Hc as findDirectiveBlocks,hm as findDeadCode,hm as findDeadBranches,Km as findContainerRegion,Qm as findComponentFiles,vr as findCommonDir,dk as filterRequiredFiles,Hh as fileExists,bf as extractVariables,Xl as extractTemplateExpressions,ke as extractStreamBoundaries,wo as extractState,wh as extractSlotContent,df as extractScriptFromTemplate,Wl as extractScriptBlocks,$a as extractPlaceholders,Dc as extractParenthesizedExpression,Hb as extractPageResponseStatus,ca as extractLayoutMetadata,vi as extractDominantColor,Mc as extractDirectiveParams,rh as extractDirectiveNames,Nl as extractContainerContent,Nm as extractComponentProps,Xg as extractComponentName,Om as extractComponentDescription,ub as extractClassNames,Va as extractBridgeData,Yg as extractBoundProps,Bc as extractBalancedExpression,Pa as extractAndStripCssImports,pj as extractAndScopeStyles,Ba as extractAndProcessEvents,Tj as externalizeSharedAssets,Uj as externalizeRepeatedAssets,Sj as externalizeHtml,pb as evaluateExpression,jm as evaluateConstant,Pb as evaluateAuthExpression,ib as escapeHtmlValue,hb as escapeHtml,pc as errorRecovery,rc as errorLogger,rg as ensureTeleportTargets,ig as ensureDocumentShell,Id as enhancedValidationRules,Lm as enableDevTools,im as eliminateDeadCode,De as effect,jp as dprUrls,Ym as docsCommand,Pl as discoverLayoutNames,Np as disconnectObserver,Mm as disableDevTools,sc as devHelpers,Il as detectShell,_m as detectRuntime,hk as detectProjectConfig,oi as detectFormat,cm as detectBuildMode,Ce as derived,lk as deploy,Dj as defineStxConfig,Jo as defineStore,tq as defineSlots,fr as defineSiteConfig,jr as definePropsWithValidation,ir as defineProps,xj as definePlugin,qd as definePageMeta,R as defineMiddleware,ih as defineForm,oq as defineExpose,nq as defineEmits,Th as defineDirective,Jq as defineCustomElement,Gn as defineConfig,Uh as defineClientDirective,Eg as defineAsyncComponent,eq as defaultMediaConfig,Pk as defaultImageConfig,Nd as defaultI18nConfig,da as defaultHeatmapConfig,zd as defaultFormClasses,cb as defaultFilters,gd as defaultCspConfig,zj as defaultConfig,tr as default,rb as deepMergeThemes,Kf as dedupeScopedStyles,ti as decodeThumbhash,bd as cspNonceDirective,ad as cspDirective,Up as crossfadeTransition,Po as crop,Pg as createVirtualList,ij as createVideoDirective,ln as createVercelHandler,Yn as createTypeChecker,ee as createTranslateFilter,gn as createTextEncoderStream,Iq as createStxApp,fn as createStreamingResponse,me as createStreamRenderer,Ho as createStore,U as createStorageManager,S as createServerCookieManager,Tk as createScope,zg as createSSRSuspense,ze as createRouter,$ as createRouteLocation,Wn as createRoute,Uk as createRef,Vk as createReactive,vq as createProvideContext,Nn as createProject,Fn as createProductionBuild,Za as createPlaceholder,om as createOptimizedBuild,mn as createNetlifyHandler,$j as createNetlifyClient,aa as createMiddlewareContext,Vn as createMiddleware,Lp as createLazyObserver,Jg as createKeepAliveCache,cn as createKVNamespace,Zg as createIslandRegistry,Vi as createImgDirective,Kk as createImagePlugin,Dk as createImageHandler,Ik as createImageDirective,ia as createHeatmapAggregator,ck as createFileManifest,bn as createEnvAccessor,mc as createEnhancedError,en as createEdgeHandler,dn as createEdgeCache,Kh as createDetailedErrorMessage,kn as createDenoHandler,ik as createDefaultNetlifyConfig,fd as createCspHeaders,on as createCookie,Wk as createComputed,Sk as createComponentInstance,jn as createCloudflareHandler,T as createClientCookieManager,Vh as createBuiltinDirectives,Iq as createApp,F as createAnimationTimeline,So as cover,cf as convertToCommonJS,Zo as contrast,Ro as contain,lc as consoleError,$b as configureErrorHandling,Cj as config,Wk as computed,Im as compressResponse,Df as composerPattern,Cf as composer,Kl as composeShellWithPage,Dm as componentDirective,Fh as componentClientSignalNames,Yl as compileTemplate,a as collectRepeatedFlag,bk as collectDeployFiles,_i as clearVideoCache,Od as clearTranslationCache,ng as clearStoreCache,Yj as clearStorage,wp as clearSignatureCache,Ai as clearPlaceholderCache,kf as clearOnceStore,Qc as clearNonce,Y as clearMiddleware,ve as clearImagePlaceholders,Hk as clearImageCache,Tb as clearErrorMessages,Ye as clearDevCaches,gb as clearCustomFilters,Ff as clearComposers,og as clearComposableCache,Lh as clearComponentCache,Ji as clearCache,lo as cleanupLoadingIndicator,Bl as classifyScript,Cl as classifyAllScripts,Zn as checkTemplateFile,_n as checkTemplate,Ze as checkCache,tp as checkAuthAccess,i as checkA11yWithRegex,j as checkA11y,ym as channel,tn as captureScreenshots,sn as captureScreenshot,_d as cancelPendingLoads,ak as calculateSha1,ci as calculateOptimalWidths,_e as cacheTemplate,kj as buildWebComponents,ao as buildVirtualSource,gq as buildViews,Lo as buildUrl,ge as buildSuspenseResolveScript,er as buildStaticSite,la as buildRuntimeGlobalsDestructure,Tl as buildRuntimeAsset,Ul as buildRouterAsset,dr as buildLangPickerScript,ii as buildImageUrl,$f as buildHtmlAttrs,am as buildForProduction,Fm as buildComponentLibrary,up as buildAuthParams,bm as buildApp,br as buildAlternateLinks,En as build,wm as broadcastPrivate,xm as broadcastPresence,tm as broadcast,Yo as brightness,To as blur,ya as blankInertHtmlRegions,op as batchSignUrls,Ee as batch,n as autoFixA11yFile,o as autoFixA11yDirectory,m as autoFixA11y,ep as auto,e as attributeValue,Vl as assetTags,za as asInvocableStatement,qr as arrayOf,_q as applyTranslations,Pi as applyTransformations,xh as applySlots,Cm as applyPropDefaults,hp as applyPreset,bg as applyHtmlAttrs,vd as applyHead,ob as applyFilters,Gl as appendVary,Wc as apiCspPreset,y as animationGroupDirective,ej as analyzeVideo,em as analyzeUsage,zl as analyzeTemplate,Al as analyzeProject,em as analyzeDirectiveUsage,Db as analyticsDirective,Qn as addStore,Pn as addPage,_c as addNonceToInlineContent,Rn as addLayout,On as addComponent,Cn as actionRedirectResponse,Q as abortNavigation,p as a11yDirective,Ve as __setSignalsGeneratorsForTest,Vf as __setBuildIdForTest,Xi as VideoProcessorCache,jh as Validator,s as TransitionType,u as TransitionEase,t as TransitionDirection,zc as Tokenizer,Xn as TemplateTypeChecker,wn as TEMPLATE_PRESETS,ic as StxValidationError,ec as StxSyntaxError,gc as StxSecurityError,fc as StxRuntimeError,hc as StxFileError,dc as StxError,Eq as Show,he as SUSPENSE_RESOLVER_RUNTIME,ja as STX_RUNTIME_GLOBALS,Ra as STX_AUTO_IMPORTS,Ka as STATE_DIR_ENV_VAR,B as SPRING_PRESETS,Dl as SPA_NAV_HEADER,sa as RUNTIME_OWNED_COLON_ATTRS,ua as RUNTIME_HANDLED_X_ATTRS,Eb as RESPONSE_STATUS_KEY,Fb as RESPONSE_HEADERS_KEY,oa as REACTIVE_RUNTIME_GLOBALS,Dn as ProductionBuild,Gq as Portal,Mn as PROJECT_TEMPLATES,gp as PRESETS,na as NON_CLIENT_PRIMITIVES,Co as MemorySessionStore,$h as MIME_TYPES,Yh as MEDIA_DEFAULT_WIDTHS,_h as MEDIA_DEFAULT_FORMATS,Ol as LAYOUT_TYPES_FILE,Mi as ImageProcessorCache,Bk as ImageProcessingError,xo as HydrationRuntime,Jj as HotReloadServer,ha as HeatmapAggregator,Zf as HTML_CLASS_MARKER,Yf as HTML_ATTRS_MARKER,xq as Fragment,Fq as For,El as FRAGMENT_CACHE_CONTROL,qc as ErrorLogger,Wb as ErrorCodes,Rj as EXTERNALIZED_ASSET_DIR,nk as DeployError,ok as DEFAULT_WIDTHS,v as DEFAULT_TRANSITION_OPTIONS,Ja as DEFAULT_STATE_DIR,qk as DEFAULT_QUALITY,pi as DEFAULT_PLACEHOLDER_OPTIONS,pk as DEFAULT_FORMATS,Zh as DEFAULT_DPR_VALUES,oo as ComponentHMRHandler,ka as COMPONENT_SCOPE_LOCAL_GLOBALS,wa as COMPONENT_PASSTHROUGH_X_ATTRS,ma as COMPILE_TIME_ONLY_GLOBALS,hi as COMMON_SIZES,Mf as COLOR_MODE_BOOT_MARKER,Nf as COLOR_MODE_BOOT_GLOBAL,Xf as CLOAK_STYLE,Am as BroadcastServer,zm as Broadcast,Sf as BUILD_ID_META,Tf as BUILD_ID_HEADER,Ga as BROWSER_CORE_IMPORTS,qi as BLUR_UP_CSS,va as ALPINE_BRIDGE_X_ATTRS,Qq as $path};
2
+ import{$ as ll,$a as cn,$b as vo,$c as vp,$d as vq,A as Xj,Aa as nm,Ab as Pn,Ac as Wo,Ad as Wp,Ae as ar,B as Yj,Ba as om,Bb as Qn,Bc as Xo,Bd as Xp,Be as br,C as Zj,Ca as Bm,Cb as Rn,Cc as Yo,Cd as Yp,Ce as cr,D as _j,Da as Cm,Db as Sn,Dc as Zo,Dd as Zp,De as dr,E as Qk,Ea as Dm,Eb as Tn,Ec as _o,Ed as _p,Ee as er,F as Rk,Fa as Em,Fb as Un,Fc as $o,Fd as $p,Fe as fr,G as Sk,Ga as Fm,Gb as Vn,Gc as ap,Gd as aq,Ge as gr,H as Tk,Ha as Jm,Hb as Wn,Hc as bp,Hd as bq,He as hr,I as Uk,Ia as Km,Ib as Xn,Ic as cp,Id as cq,Ie as ir,J as Vk,Ja as Lm,Jb as Yn,Jc as dp,Jd as dq,Je as jr,K as Wk,Ka as Mm,Kb as Zn,Kc as ep,Kd as eq,Ke as kr,L as Xk,La as Nm,Lb as _n,Lc as fp,Ld as fq,Le as lr,M as Yk,Ma as Om,Mb as $n,Mc as gp,Md as gq,Me as mr,N as Zk,Na as Pm,Nb as ho,Nc as hp,Nd as hq,Ne as nr,O as _k,Oa as Qm,Ob as io,Oc as ip,Od as iq,Oe as or,P as $k,Pa as Rm,Pb as jo,Pc as jp,Pd as jq,Pe as pr,Q as al,Qa as Sm,Qb as ko,Qc as kp,Qd as kq,Qe as qr,R as bl,Ra as Tm,Rb as lo,Rc as lp,Rd as lq,Re as rr,S as cl,Sa as Um,Sb as mo,Sc as mp,Sd as mq,Se as sr,T as dl,Ta as Vm,Tb as no,Tc as np,Td as nq,Te as tr,U as el,Ua as Wm,Ub as oo,Uc as op,Ud as oq,Ue as ur,V as fl,Va as Xm,Vb as po,Vc as pp,Vd as pq,Ve as vr,W as gl,Wa as Ym,Wb as qo,Wc as qp,Wd as qq,We as wr,X as hl,Xa as _m,Xb as ro,Xc as rp,Xd as rq,Xe as xr,Y as il,Ya as $m,Yb as so,Yc as sp,Yd as sq,Z as jl,Za as an,Zb as to,Zc as tp,Zd as tq,_ as kl,_a as bn,_b as uo,_c as up,_d as uq,aa as ml,ab as dn,ac as wo,ad as wp,ae as wq,ba as nl,bb as en,bc as xo,bd as xp,be as xq,ca as ol,cb as fn,cc as yo,cd as yp,ce as yq,da as pl,db as gn,dc as zo,dd as zp,de as zq,ea as ql,eb as hn,ec as Ao,ed as Ap,ee as Aq,fa as rl,fb as jn,fc as Bo,fd as Bp,fe as Bq,ga as sl,gb as kn,gc as Co,gd as Cp,ge as Cq,ha as tl,hb as ln,hc as Do,hd as Dp,he as Dq,ia as ul,ib as mn,ic as Eo,id as Ep,ie as Eq,ja as vl,jb as nn,jc as Fo,jd as Fp,je as Fq,ka as wl,kb as on,kc as Go,kd as Gp,ke as Gq,la as xl,lb as pn,lc as Ho,ld as Hp,le as Hq,ma as yl,mb as qn,mc as Io,md as Ip,me as Iq,na as zl,nb as rn,nc as Jo,nd as Jp,ne as Jq,o as a,oa as Al,ob as un,oc as Ko,od as Kp,oe as Qq,p as Ij,pa as cm,pb as vn,pc as Lo,pd as Lp,pe as Rq,q as Jj,qa as dm,qb as wn,qc as Mo,qd as Mp,qe as Sq,r as Kj,ra as em,rb as xn,rc as No,rd as Np,re as Tq,s as Lj,sa as fm,sb as Dn,sc as Oo,sd as Op,se as Uq,t as Mj,ta as gm,tb as En,tc as Po,td as Pp,te as Vq,u as Nj,ua as hm,ub as Fn,uc as Qo,ud as Qp,ue as Wq,v as Oj,va as im,vb as Gn,vc as Ro,vd as Rp,ve as Xq,w as Pj,wa as jm,wb as Ln,wc as So,wd as Sp,we as Yq,x as Qj,xa as km,xb as Mn,xc as To,xd as Tp,xe as Zq,y as Vj,ya as lm,yb as Nn,yc as Uo,yd as Up,ye as _q,z as Wj,za as mm,zb as On,zc as Vo,zd as Vp,ze as $q}from"./chunk-rnr9ffy1.js";import{$e as ck,Ye as $j,Ze as ak,_e as bk,af as dk,bf as ek,cf as fk,df as gk,ef as hk,ff as ik,gf as jk,hf as kk,if as lk,jf as mk,kf as nk}from"./chunk-jy6madxa.js";import{lf as Ek,mf as Fk,nf as Gk,of as Hk,pf as Ik,qf as Jk,rf as Kk,sf as Lk,tf as Mk,uf as Nk,vf as Ok,wf as Pk}from"./chunk-shh4byc3.js";import{Af as eo,Bf as fo,Cf as go,xf as ao,yf as bo,zf as co}from"./chunk-p5mr2984.js";import{Df as sn,Ef as tn}from"./chunk-vzskgbqj.js";import{Ff as yn}from"./chunk-kvqkkwnd.js";import{Gf as Sl,Hf as Tl,If as Ul,Jf as Vl,Kf as Yl,Lf as am}from"./chunk-eavhvfzr.js";import{Mf as Wl,Pf as Xl}from"./chunk-380tnd2y.js";import{$f as tm,Xf as pm,Yf as qm,Zf as rm,_f as sm,ag as um,bg as vm,cg as wm,dg as xm,eg as ym,fg as zm,gg as Am}from"./chunk-d19bydks.js";import{hg as Ck,ig as Dk}from"./chunk-1p0r6k2f.js";import{jg as bm}from"./chunk-c2xhf8re.js";import{kg as Gm,lg as Hm,mg as Im,ng as Zm,og as zn,pg as An,qg as Bn,rg as Cn,sg as Hn,tg as In,ug as Jn,vg as Kn}from"./chunk-3k3vrnk0.js";import{Ag as Fl,Bg as Gl,Cg as Hl,Dg as Il,Eg as Jl,Fg as Kl,Gg as Ll,Hg as Ml,Ig as Nl,Jg as Zl,Kg as _l,Lg as $l,wg as Bl,xg as Cl,yg as Dl,zg as El}from"./chunk-b7tw429a.js";import{Mg as Xi,Ng as Yi,Og as Zi,Pg as _i,Qg as $i,Rg as aj,Sg as bj,Tg as cj,Ug as dj,Vg as ej,Wg as fj}from"./chunk-n3tj3h1q.js";import{Xg as xj,Zg as yj}from"./chunk-cs1dc1n7.js";import{dh as ok,eh as pk,fh as qk,gh as rk,hh as sk,ih as tk,jh as uk,lh as vk,mh as wk,nh as xk,oh as yk,ph as zk,qh as Ak,th as Bk}from"./chunk-9228drk4.js";import{uh as hh,vh as ih,wh as jh,xh as kh}from"./chunk-tv4n71jy.js";import{Ch as lh}from"./chunk-rbke5wqk.js";import{Dh as sh,Eh as th,Fh as uh,Gh as vh,Hh as wh,Ih as xh}from"./chunk-vgmc978e.js";import{Jh as Mi,Kh as Ni,Lh as Oi,Ph as Pi,Qh as Qi,Rh as Ri}from"./chunk-78bpc81t.js";import{$h as Ki,Sh as Ci,Th as Di,Uh as Ei,Vh as Fi,Wh as Gi,Yh as Hi,Zh as Ii,_h as Ji,ai as Li}from"./chunk-j93x5fzs.js";import{bi as sg,ci as tg,di as ug,ei as vg,fi as wg,gi as xg}from"./chunk-ntnv2f7a.js";import{hi as yg,ii as zg,ji as Ag,ki as Bg,li as Cg}from"./chunk-1gdzz04h.js";import{mi as Dg,ni as Eg,oi as Fg,pi as Gg,qi as Hg}from"./chunk-ssfhndm6.js";import{ri as Ig,si as Jg,ti as Kg,ui as Lg,vi as Mg,wi as Ng,xi as Og}from"./chunk-94fee5jw.js";import{Ai as Rg,Bi as Sg,Ci as Tg,Di as Ug,yi as Pg,zi as Qg}from"./chunk-pv9at6r1.js";import{Fi as Vg,Gi as Wg,Hi as Xg,Ii as Yg,Ji as Zg,Ki as _g,Li as $g,Mi as ah,Ni as bh,Oi as ch,Pi as dh,Qi as eh,Ri as fh,Si as gh}from"./chunk-dq88kv1p.js";import{Ui as mg,Vi as ng}from"./chunk-jvs7azc8.js";import{Yi as og}from"./chunk-z5ecweqg.js";import"./chunk-ht51fz7w.js";import{aj as pg}from"./chunk-fvjh7rx0.js";import{bj as qg,cj as rg}from"./chunk-b6jhznkh.js";import{dj as fe,ej as ge,fj as he,gj as ie,hj as je,ij as ke,jj as le,kj as me,lj as ne,mj as oe,nj as pe,oj as qe,pj as re,qj as se}from"./chunk-4heeeaef.js";import{rj as Pe,sj as Qe}from"./chunk-g553n48p.js";import{Aj as Ce,Bj as De,Cj as Ee,Dj as Fe,Ej as Ge,Fj as He,Gj as Ie,Hj as Je,Ij as Ke,Jj as Le,Kj as Me,Lj as Ne,Mj as Oe,zj as Be}from"./chunk-nhmq45hh.js";import{Nj as Re,Oj as Se,Pj as Te,Qj as Ue,Rj as Ve,Sj as We,Tj as Xe,Uj as Ye,Vj as Ze,Wj as _e,Xj as $e}from"./chunk-dq48z0r7.js";import{pk as Kq,qk as Lq,rk as Mq,sk as Nq,tk as Oq,uk as Pq}from"./chunk-ggghr7tk.js";import{Ak as Pl,Bk as Ql,Ck as Rl,vk as Rj,wk as Sj,xk as Tj,yk as Uj,zk as Ol}from"./chunk-b212gjes.js";import"./chunk-frp9fc7j.js";import"./chunk-r84h7wxw.js";import{$m as Wb,$n as Wc,$o as Ae,$p as Jf,$q as Yh,$r as zj,Al as da,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 lg,Dr as Ai,El as ha,Em as Ab,En as zc,Eo as Pd,Ep as mf,Eq as mh,Er as Bi,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,Hm as Db,Hn as Cc,Ho as Sd,Hp as pf,Hq as ph,Hr as Ui,Il as za,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 rh,Jr as Wi,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 Ia,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,Vo as ee,Vp as Df,Vq as Jh,Vr as rj,Wl as Ta,Wm as Rb,Wn as Rc,Wp as Ef,Wq as Kh,Wr as sj,Xl as Ua,Xm as Sb,Xn as Sc,Xo as ye,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,Zp as Hf,Zq as Nh,Zr as vj,_l as Xa,_m as Vb,_n as Vc,_o as ze,_p as If,_q as Oh,_r as wj,an as Xb,ao as Xc,aq as Kf,ar as Zh,as as Aj,bn as Yb,bo as Yc,bp as af,bq as Lf,br as _h,bs as Bj,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,hs as Hj,il as s,im as bb,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,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 id,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,rq as $f,rr as oi,sl as C,sm as jb,sn as nc,so as Dd,sp as bf,sq as ag,sr as pi,tl as D,tm as kb,tn as oc,to as Ed,tq as bg,tr as qi,ul as E,um as lb,un as pc,uo as Fd,up as cf,uq as cg,ur as ri,vl as F,vm as mb,vn as qc,vo as Gd,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,zm as qb,zn as uc,zo as Kd,zp as gf,zq as hg,zr as wi}from"./chunk-a0sagjwy.js";import{is as d,js as e,ks as f,ls as g,ms as h,ns as i,os as j,ps as k,qs as l,rs as m,ss as n,ts as o,us as p,vs as q,ws as r}from"./chunk-092sm06a.js";import{As as Sh,Bs as Th,Cs as Uh,Ds as Vh,Es as Wh,Fs as Xh,xs as Ph,ys as Qh,zs as Rh}from"./chunk-19m7hed6.js";import{Gs as b,Hs as c}from"./chunk-nhn7qftp.js";import{Is as Ea,Js as Fa}from"./chunk-mv2v3g62.js";import{Ks as rb,Ls as sb,Ns as tb,Xs as ub,Ys as vb,Zs as wb}from"./chunk-7q6abr68.js";import{$s as ue,_s as te,at as ve,bt as we,et as xe}from"./chunk-2qkasmq1.js";import{ft as Ja,gt as Ka,ht as La,it as Ma,jt as Na,kt as Oa}from"./chunk-1px4xey5.js";import{At as yd,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-a8fx6wcb.js";import"./chunk-x41v697c.js";import{Dt as ja,Et as ka,Ft as la,Gt as ma,Ht as na,It as oa,Jt as pa,Kt as qa,Lt as ra,Mt as sa,Nt as ta,Ot as ua,Pt as va,Qt as wa,Rt as xa,St as ya}from"./chunk-ax56kn66.js";import{Au as ca,Wt as K,Xt as L,_t as M,du as N,eu as O,ku as P,lu as Q,mu as R,nu as S,ou as T,pu as U,qu as V,ru as W,su as X,tu as Y,uu as Z,vu as _,wu as $,xu as aa,yu as ba}from"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{jk as writeNetlifyConfig,_l as writeManifest,Ok as writeImageManifest,qo as wrapComponentForHMR,kr as withDefaults,wj as webComponentDirectiveHandler,fp as watermark,hq as watchViews,Yk as watchMultiple,Zk as watchEffect,Xk as watch,xe as warmImagePlaceholders,kl as waitForStore,Yd as waitForLocale,bo as virtualPathFor,jj as videoDirective,tc as validators,or as validated,Kd as validateValueEnhanced,nh as validateTemplate,kp as validateParams,Ld as validateFormEnhanced,Yp as validateFile,Gd as validateFields,Fd as validateField,ph as validateDirective,dd as validateCspDirectives,Ej as validateConfig,dm as validateComponentScripts,Bm as validateComponentProps,lg as validateClientScript,kh as v,jb as usesSignalsInScript,pa as usesReactiveRuntime,Ch as userComponentFileExists,Sg as useVirtualList,rd as useTitle,jl as useStoreOrThrow,Io as useStore,Vj as useStorage,sq as useSlots,Xj as useSessionStorage,od as useSeoMeta,ll as useRouteParams,nl as useRouteParamOrThrow,ml as useRouteParam,rd as usePageTitle,Oe as useOptimistic,pl as useMiddlewareValue,ol as useMiddlewareState,Wj as useLocalStorage,jo as useLoadingIndicator,md as useHead,hh as useForm,uq as useAttrs,_p as uploadFiles,Zp as uploadFile,gl as updateInstance,Me as untrack,Sh as unregisterDirective,hl as unmountInstance,qb as unescapeHtml,fo as typecheckStxFiles,Bh as transpileTypeScript,Zq as translate,w as transitionDirective,vm as toUsers,um as toUser,Qo as thumbnail,Rp as thumbHashToRGBA,Sp as thumbHashToDataURL,ra as templateNeedsRuntime,qa as templateHasReactiveContext,Re as templateCache,Mb as syncRecordedResponse,no as stxClientHelpers,wf as structuredDataDirective,ar as stripLocalePrefix,Ll as stripDocumentWrapper,Fa as stripCommentsAndLiterals,hn as stringToStream,Tc as strictCspPreset,ne as streamingSuspenseDirective,re as streamToResponse,le as streamTemplateSimple,fe as streamTemplate,Qj as stopHmrServer,rm as stopBroadcasting,Ma as stateDirName,Na as stateDir,Be as state,fg as startsDocument,Kn as startProductionServer,yn as startInteractive,qm as startBroadcasting,cr as stampLocaleLayoutGroup,D as staggerDirective,ip as srcsetUrls,E as springDirective,Cc as splitByPipe,Hl as spaNavVaryHeaders,co as sourcePathFor,pp as smartBatchSign,Eh as slotContentHasExpressions,np as signUrl,zh as shouldTranspileTypeScript,Nj as shouldReloadOnChange,sp as shouldRefreshSignature,Oj as shouldIgnoreFile,Kg as shouldCacheComponent,Uo as sharpen,rr as shape,La as setStateDir,tl as setRouteParams,ul as setMiddlewareState,we as setImagePlaceholder,mq as setGlobalProvide,Qb as setErrorLocale,Qk as setCurrentInstance,Zi as setCachedVideoResult,Oi as setCachedImageResult,Ii as setCached,ur as serveStxFile,wr as serveMultipleStxFiles,Ij as serveMarkdownFile,Un as serveFile,xr as serveApp,Tn as serve,to as serializeState,Zm as serializeSetCookie,Wo as sepia,pd as seoMetaToHeadConfig,x as scrollAnimateDirective,q as screenReaderDirective,nj as scopeHTML,mj as scopeCSS,zf as scanForSitemapEntries,k as scanA11yTargets,l as scanA11yIssues,_o as saturation,lp as sanitizeParams,vc as sanitizeFilePath,wc as sanitizeExpression,xc as sanitizeDirectiveParams,uc as sanitizeDirectiveParam,yc as sanitizeComponentProps,oc as safeExecuteAsync,nc as safeExecute,xa as runtimeHandledXAttrsLiteral,pf as runPreProcessingMiddleware,qf as runPostProcessingMiddleware,Bn as runPageAction,He as runMountCallbacks,ba as runMiddleware,el as runHooks,Sq as runDoctor,Ie as runDestroyCallbacks,Ef as runComposers,$o as rotate,lh as rewriteImagesWithSiblings,Nb as responseBindings,Ih as resolveTemplatePath,c as resolveStxTargets,Aj as resolveStxDirectories,Yq as resolveI18n,Oo as resize,Ya as resetPlaceholders,ld as resetHead,so as resetHMRHandler,bc as resetErrorConfig,mr as required,ab as replacePlaceholders,fq as renderView,gj as renderVideoComponent,Qa as renderVendorStyleTags,Bq as renderToString,Cq as renderToStream,Dq as renderToDOM,Qp as renderThumbhashToCanvas,Pq as renderTemplateString,Nq as renderTemplate,Oq as renderString,ie as renderStreamingPage,uh as renderSlot,Ag as renderSSRSuspense,Ap as renderProtectedVideo,zp as renderProtectedImg,mp as renderMediaUpload,Mq as renderMarkdownView,Ql as renderLayoutTypes,Si as renderImgComponent,Ek as renderImageComponent,td as renderHtmlAttrs,sd as renderHead,iq as renderEmail,Gh as renderComponentWithSlot,ud as renderBodyAttrs,Do as render,Vc as relaxedCspPreset,Ed as registerValidationRule,pe as registerStreamingDirectives,Ko as registerStoresClient,rl as registerStore,xf as registerSeoDirectives,V as registerMiddleware,eb as registerFilters,db as registerFilter,Sb as registerErrorMessages,Jd as registerEnhancedValidationRule,Ph as registerDirective,cd as registerCspDirectives,Em as registerComponentDirectives,J as registerAnimationDirectives,r as registerA11yDirectives,Uk as ref,qn as redirect,Ib as recordResponseStatus,Jb as recordResponseHeader,Oa as rebaseOntoStateDir,Kb as readResponseStatus,Lb as readResponseHeaders,Gj as readMarkdownFile,Se as readFileCached,Vk as reactive,dp as quality,xp as pruneSignatureCache,Li as pruneCache,kq as provide,Lq as protectCodeBlocks,lr as prop,If as processVueTemplate,Qg as processVirtualListDirectives,Ug as processVirtualGridDirectives,fj as processVideo,Hd as processValidateDirective,de as processTranslateDirective,ug as processTransitionDirectives,xg as processTransitionAttributes,xd as processTitleDirective,Ab as processTemplateBindings,qg as processTeleportDirectives,yg as processSuspenseDirectives,sf as processStructuredData,je as processStreamDirectives,Ob as processStatusDirective,fh as processStaticDirectives,nf as processStackReplacements,mf as processStackPushDirectives,vh as processSlots,Jl as processShell,Gf as processServerBindings,tf as processSeoDirective,qe as processSectionDirectives,Lf as processScopedStyles,yb as processReactiveBindings,Bp as processProtectedMedia,_g as processPartialHydrationDirectives,kg as processOnceDirective,of as processMiddleware,rf as processMetaDirectives,yd as processMetaDirective,Hj as processMarkdownFileDirectives,Nh as processMarkdownDirectives,gf as processLoops,Ig as processKeepAliveDirectives,jg as processJsonDirective,Tg as processInfiniteListDirectives,lf as processIncludes,Ui as processImgComponents,Gk as processImageComponents,tk as processImage,wd as processHeadDirective,Ad as processForms,Cd as processFormInputDirectives,nb as processExpressions,Ca as processEventDirectives,Dd as processErrorDirective,Jf as processDynamicComponents,mh as processDirectives,Xh as processDirectiveAttributes,pg as processDeferDirectives,hd as processCustomDirectives,$c as processCspDirectives,sr as processComponentProps,Xa as processClientScript,Bd as processBasicFormDirectives,Dg as processAsyncDirectives,id as processAppearanceBootstrapDirective,A as processAnimationDirectives,f as processA11yDirectives,Ud as preloadTranslationsBackground,Td as preloadTranslations,io as preloadIslandHandlers,ye as preloadIconCollection,mm as poolStrings,yj as pluginManager,ue as placeholdersWarmed,tg as performLeave,sg as performEnter,Je as pendingLifecycleCounts,Ne as peek,hf as partialsCache,hj as parseVideoDirectiveOptions,Mo as parseUrl,Tp as parseThumbhashString,Ic as parseSwitchBlock,sh as parseSlots,th as parseSlotElement,Nc as parseScriptDeclarations,uj as parseSFCComponent,Cp as parseProtectedArgs,ff as parseLoopBinding,Ti as parseImgComponent,ji as parseImageUrl,Fk as parseImageComponent,zn as parseFormBody,Kc as parseExpressionWithFilters,nn as parseCookies,Jm as parseContainerSelector,Fc as parseConditionalBlock,Lc as parseArguments,H as parseAnimationShorthand,nr as optional,nm as optimizeTemplate,Lk as optimizeImage,Mk as optimizeDirectory,pr as oneOf,jf as onceStore,bl as onUpdated,xb as onUpdate,dl as onUnmounted,yl as onServer,$k as onMounted,Fe as onMount,eh as onHydrated,qq as onErrorCaptured,Ge as onDestroy,Og as onDeactivated,xl as onClient,al as onBeforeUpdate,cl as onBeforeUnmount,_k as onBeforeMount,Ng as onActivated,Mp as observeElement,rn as notFound,Qf as normalizeCriticalHeadOrder,pq as nextTick,Hm as negotiateEncoding,P as navigateTo,fl as mountInstance,z as motionDirective,Uc as moderateCspPreset,lm as minifyHtml,vf as metaDirective,_f as metaDedupKey,No as mergeParams,ag as mergeHtmlAttrs,nd as mergeHeadConfigs,Yc as mergeCspDirectives,sb as mergeCrosswindConfig,M as matchRoute,Oh as markdownDirectiveHandler,Fj as markdownCache,b as looksLikeGlob,$q as localizePath,Vd as loadTranslationLazy,$d as loadTranslation,Bj as loadStxConfig,_ as loadMiddlewareFromDirectory,$l as loadManifest,Ip as loadElement,sm as loadChannels,gr as lintStxStrict,Kp as lazyLoadAll,Jp as lazyLoad,C as keyframeDirective,zq as jsxs,Aq as jsxDEV,yq as jsx,pn as jsonResponse,oe as islandDirective,_b as isTest,Ml as isSpaNavigation,Fl as isSpaNavRequest,qp as isSignatureValid,Ke as isSignal,rk as isSharpAvailable,an as isServerEnvironment,vl as isServer,ta as isRuntimeOwnedColonAttr,Yb as isProduction,d as isPresentationalRole,Fp as isNativeLazySupported,Kq as isMarkdownPath,Rd as isLoading,Sd as isLoaded,yh as isJavaScriptScript,Gp as isIntersectionObserverSupported,zk as isImageFile,sk as isImageBackendAvailable,be as isICUFormat,dh as isHydrated,Dh as isHydrateTrigger,Gb as isHttpStatus,$m as isEdgeEnvironment,hr as isDirectiveKind,Zb as isDevelopment,Le as isDerived,Mj as isCssOnlyChange,Gm as isCompressible,wl as isClient,Fg as isAsyncComponent,An as isActionableMethod,Xo as invert,Ue as invalidateFileCacheByDir,Te as invalidateFileCache,mb as interpolateScriptsInTemplate,kb as interpolateScriptExpressions,lb as interpolateScriptAttributes,kc as inlineError,Xq as injectThemeBootstrap,uf as injectSeoTags,Uq as injectSeo,af as injectRouterScript,Lj as injectHotReload,fa as injectHeatmap,Zc as injectCspMetaTag,wb as injectCrosswindCSS,hg as injectConfigHeadTags,Pf as injectColorModeBootScript,cg as injectCloakStyle,Wf as injectBuildId,Sa as injectBrowserCoreAutoImports,Cb as injectAnalytics,lq as inject,ql as initStoreRegistry,mk as initNetlify,ko as initLoadingIndicator,Hp as initLazyLoading,xn as initFile,Pp as initBlurUp,Vp as initAllBlurUp,Wi as imgDirective,Jk as imageDirective,In as hydrateTemplateStream,Hn as hydrateTemplate,ho as hydrateIslands,ah as hydrateIsland,Jn as hydrateFragment,bh as hydrateByStrategy,ch as hydrateAll,Ao as hydrate,Sn as htmlResponse,dg as hoistLeadingHeadTags,Rf as hoistColorModeBootScript,ga as heatmapDirective,Ei as hashString,$e as hashFilePath,Ci as hashFile,Di as hashBuffer,Hf as hasVueTemplateSyntax,ef as hasVariables,Fo as hasStore,bb as hasPlaceholders,kk as hasNetlifyConfig,X as hasMiddleware,Da as hasEventDirectives,gg as hasDocumentShell,qh as hasDirectives,h as hasDOMSupport,Ck as handleImageRequest,rq as handleError,Hq as h,yk as groupVariantsByFormat,Vo as grayscale,Ln as gitHash,fm as getUnusedDirectives,Wd as getTranslationSync,Pd as getTranslationCacheStats,Xd as getTranslationAsync,ce as getTranslation,fk as getTotalSize,rp as getTimeUntilExpiry,mg as getStoreScript,Go as getStoreNames,Eo as getStore,_j as getStorageSize,Zj as getStorageKeys,Jh as getSourceLineInfo,Ah as getSharedTranspiler,g as getScreenReaderOnlyStyle,oj as getScopeAttribute,Ae as getRouteParams,Ha as getPublicEnvDefine,Ia as getPublicEnv,oh as getPositionInfo,_a as getPlaceholderRegistry,Bi as getPlaceholderCacheStats,kd as getPageMeta,Pc as getNonce,Ak as getMimeType,Z as getMiddlewareNames,W as getMiddleware,Qd as getLoadingState,Zd as getLoadingLocales,te as getImagePlaceholder,uk as getImageMetadata,zo as getHydrationRuntime,sl as getHydratedStoreState,Pj as getHmrServer,jd as getHead,ro as getHMRHandler,ni as getFormatExtension,Gi as getFileMtime,xk as getFallbackVariant,Ub as getErrorMessage,Rb as getErrorLocale,ac as getErrorConfig,Xb as getErrorCodeName,Rh as getDirectives,Qh as getDirective,Rk as getCurrentInstance,Xc as getCspPreset,ed as getCspHeaderName,tb as getCrosswindServeAsset,Mh as getComponentCacheStats,Yi as getCachedVideoResult,vp as getCachedSignature,We as getCachedSignalsRuntime,Xe as getCachedRouterScript,zi as getCachedPlaceholder,Ni as getCachedImageResult,Hi as getCached,Ki as getCacheStats,Uf as getBuildId,pm as getBroadcastServer,mi as getBestVariant,fb as getAllFilters,ai as generateWidthSrcset,Rg as generateVirtualListCSS,aq as generateVideoPreview,Md as generateValidationScript,bq as generateUploadRuntime,gm as generateTreeShakenBundle,wg as generateTransitionRuntime,vg as generateTransitionCSS,aj as generateThumbnails,si as generateThumbhashPlaceholder,Sm as generateTemplatesDocs,Cg as generateSuspenseRuntime,Bg as generateSuspenseCSS,uo as generateStateScript,ki as generateSrcsetData,Ri as generateSrcset,vk as generateSrcSet,bj as generateSpriteSheet,jq as generateSpaShell,li as generateSourceTags,gi as generateSizesFromBreakpoints,fi as generateSizesAttribute,wk as generateSizes,yf as generateSitemapIndex,Vq as generateSitemap,Ep as generateSimpleMediaPicker,yp as generateSignatureRuntime,Qe as generateSignalsRuntimeDev,Pe as generateSignalsRuntime,Wa as generateServerDataBridge,lj as generateScopeId,vj as generateSFCWebComponent,Aa as generateRuntimeScript,K as generateRouteTypes,L as generateRouteManifest,Af as generateRobotsTxt,Wq as generateRobots,Qi as generateResponsiveVariants,rj as generateReactiveWebComponentTS,qj as generateReactiveWebComponent,tj as generateReactiveRuntime,sj as generateReactiveMixin,$i as generatePoster,yi as generatePlaceholderStyle,xi as generatePlaceholderCSS,ri as generatePlaceholder,$g as generatePartialHydrationCSS,Oc as generateNonce,gk as generateNetlifyToml,dq as generateMinifiedMediaRuntime,cq as generateMediaRuntime,Dp as generateMediaManagerEmbed,Zl as generateManifest,mo as generateLoadingIndicatorHtml,Op as generateLazyLoadRuntime,Rl as generateLayoutTypes,ui as generateLQIP,Mg as generateKeepAliveRuntime,Lg as generateKeepAliveCSS,gh as generateIslandManifest,$p as generateImagePreview,Nk as generateImageManifest,yo as generateHydrationScript,se as generateHydrationRuntime,Bo as generateHydrationCSS,Vg as generateHydrationBootstrap,Kj as generateHotReloadScript,ea as generateHeatmapScript,po as generateHMRClientScript,cj as generateHLSManifest,vo as generateEventBindings,ei as generateDprSrcsetWithVariableQuality,di as generateDprSrcset,eg as generateDocumentShell,Xm as generateDocs,Tm as generateDirectivesDocs,Wh as generateDirectiveRuntime,Bf as generateDefaultRobotsTxt,dj as generateDASHManifest,Sc as generateCspMetaTag,Rc as generateCspHeader,vb as generateCrosswindCSS,wq as generateCompositionRuntime,Rm as generateComponentsDocs,Wg as generateComponentManifest,Pm as generateComponentDoc,wi as generateColorPlaceholder,Of as generateColorModeBootScript,il as generateClientRuntime,Fi as generateCacheKey,Ua as generateBrowserAutoImportDestructuring,Wp as generateBlurUpRuntime,Xp as generateBlurUpCSS,zb as generateBindingsRuntime,bi as generateAutoWidthSrcset,Ta as generateAutoImportDestructuring,Hg as generateAsyncComponentRuntime,Gg as generateAsyncComponentCSS,I as generateAnimationRuntime,G as generateAnimationCSS,Bb as generateAnalyticsScript,go as formatTypecheckDiagnostics,$n as formatTypeErrors,un as formatStxContent,ek as formatSize,O as formatRoutes,vn as formatMarkdownContent,Vb as formatLocalizedError,ae as formatICU,cc as formatFilePath,jc as formatError,Tq as formatDoctorReport,Um as formatDocsAsMarkdown,Wm as formatDocsAsJson,Vm as formatDocsAsHtml,cp as format,km as foldConstants,bp as flipVertical,ap as flipHorizontal,Sl as fingerprint,eo as findRuntimeTypeDeclarations,Rq as findPantryPackage,Ec as findMatchingEndTag,Ac as findMatchingDelimiter,Ea as findInterpolationEnd,Gc as findIfBlocks,Jc as findExpressions,N as findErrorPage,Hc as findDirectiveBlocks,hm as findDeadCode,hm as findDeadBranches,Km as findContainerRegion,Qm as findComponentFiles,vr as findCommonDir,dk as filterRequiredFiles,Hh as fileExists,bf as extractVariables,Xl as extractTemplateExpressions,ke as extractStreamBoundaries,wo as extractState,wh as extractSlotContent,df as extractScriptFromTemplate,Wl as extractScriptBlocks,$a as extractPlaceholders,Dc as extractParenthesizedExpression,Hb as extractPageResponseStatus,ca as extractLayoutMetadata,vi as extractDominantColor,Mc as extractDirectiveParams,rh as extractDirectiveNames,Nl as extractContainerContent,Nm as extractComponentProps,Xg as extractComponentName,Om as extractComponentDescription,ub as extractClassNames,Va as extractBridgeData,Yg as extractBoundProps,Bc as extractBalancedExpression,Pa as extractAndStripCssImports,pj as extractAndScopeStyles,Ba as extractAndProcessEvents,Tj as externalizeSharedAssets,Uj as externalizeRepeatedAssets,Sj as externalizeHtml,pb as evaluateExpression,jm as evaluateConstant,Pb as evaluateAuthExpression,ib as escapeHtmlValue,hb as escapeHtml,pc as errorRecovery,rc as errorLogger,rg as ensureTeleportTargets,ig as ensureDocumentShell,Id as enhancedValidationRules,Lm as enableDevTools,im as eliminateDeadCode,De as effect,jp as dprUrls,Ym as docsCommand,Pl as discoverLayoutNames,Np as disconnectObserver,Mm as disableDevTools,sc as devHelpers,Il as detectShell,_m as detectRuntime,hk as detectProjectConfig,oi as detectFormat,cm as detectBuildMode,Ce as derived,lk as deploy,Dj as defineStxConfig,Jo as defineStore,tq as defineSlots,fr as defineSiteConfig,jr as definePropsWithValidation,ir as defineProps,xj as definePlugin,qd as definePageMeta,R as defineMiddleware,ih as defineForm,oq as defineExpose,nq as defineEmits,Th as defineDirective,Jq as defineCustomElement,Gn as defineConfig,Uh as defineClientDirective,Eg as defineAsyncComponent,eq as defaultMediaConfig,Pk as defaultImageConfig,Nd as defaultI18nConfig,da as defaultHeatmapConfig,zd as defaultFormClasses,cb as defaultFilters,gd as defaultCspConfig,zj as defaultConfig,tr as default,rb as deepMergeThemes,Kf as dedupeScopedStyles,ti as decodeThumbhash,bd as cspNonceDirective,ad as cspDirective,Up as crossfadeTransition,Po as crop,Pg as createVirtualList,ij as createVideoDirective,ln as createVercelHandler,Yn as createTypeChecker,ee as createTranslateFilter,gn as createTextEncoderStream,Iq as createStxApp,fn as createStreamingResponse,me as createStreamRenderer,Ho as createStore,U as createStorageManager,S as createServerCookieManager,Tk as createScope,zg as createSSRSuspense,ze as createRouter,$ as createRouteLocation,Wn as createRoute,Uk as createRef,Vk as createReactive,vq as createProvideContext,Nn as createProject,Fn as createProductionBuild,Za as createPlaceholder,om as createOptimizedBuild,mn as createNetlifyHandler,$j as createNetlifyClient,aa as createMiddlewareContext,Vn as createMiddleware,Lp as createLazyObserver,Jg as createKeepAliveCache,cn as createKVNamespace,Zg as createIslandRegistry,Vi as createImgDirective,Kk as createImagePlugin,Dk as createImageHandler,Ik as createImageDirective,ia as createHeatmapAggregator,ck as createFileManifest,bn as createEnvAccessor,mc as createEnhancedError,en as createEdgeHandler,dn as createEdgeCache,Kh as createDetailedErrorMessage,kn as createDenoHandler,ik as createDefaultNetlifyConfig,fd as createCspHeaders,on as createCookie,Wk as createComputed,Sk as createComponentInstance,jn as createCloudflareHandler,T as createClientCookieManager,Vh as createBuiltinDirectives,Iq as createApp,F as createAnimationTimeline,So as cover,cf as convertToCommonJS,Zo as contrast,Ro as contain,lc as consoleError,$b as configureErrorHandling,Cj as config,Wk as computed,Im as compressResponse,Df as composerPattern,Cf as composer,Kl as composeShellWithPage,Dm as componentDirective,Fh as componentClientSignalNames,Yl as compileTemplate,a as collectRepeatedFlag,bk as collectDeployFiles,_i as clearVideoCache,Od as clearTranslationCache,ng as clearStoreCache,Yj as clearStorage,wp as clearSignatureCache,Ai as clearPlaceholderCache,kf as clearOnceStore,Qc as clearNonce,Y as clearMiddleware,ve as clearImagePlaceholders,Hk as clearImageCache,Tb as clearErrorMessages,Ye as clearDevCaches,gb as clearCustomFilters,Ff as clearComposers,og as clearComposableCache,Lh as clearComponentCache,Ji as clearCache,lo as cleanupLoadingIndicator,Bl as classifyScript,Cl as classifyAllScripts,Zn as checkTemplateFile,_n as checkTemplate,Ze as checkCache,tp as checkAuthAccess,i as checkA11yWithRegex,j as checkA11y,ym as channel,tn as captureScreenshots,sn as captureScreenshot,_d as cancelPendingLoads,ak as calculateSha1,ci as calculateOptimalWidths,_e as cacheTemplate,kj as buildWebComponents,ao as buildVirtualSource,gq as buildViews,Lo as buildUrl,ge as buildSuspenseResolveScript,er as buildStaticSite,la as buildRuntimeGlobalsDestructure,Tl as buildRuntimeAsset,Ul as buildRouterAsset,dr as buildLangPickerScript,ii as buildImageUrl,$f as buildHtmlAttrs,am as buildForProduction,Fm as buildComponentLibrary,up as buildAuthParams,bm as buildApp,br as buildAlternateLinks,En as build,wm as broadcastPrivate,xm as broadcastPresence,tm as broadcast,Yo as brightness,To as blur,ya as blankInertHtmlRegions,op as batchSignUrls,Ee as batch,n as autoFixA11yFile,o as autoFixA11yDirectory,m as autoFixA11y,ep as auto,e as attributeValue,Vl as assetTags,za as asInvocableStatement,qr as arrayOf,_q as applyTranslations,Pi as applyTransformations,xh as applySlots,Cm as applyPropDefaults,hp as applyPreset,bg as applyHtmlAttrs,vd as applyHead,ob as applyFilters,Gl as appendVary,Wc as apiCspPreset,y as animationGroupDirective,ej as analyzeVideo,em as analyzeUsage,zl as analyzeTemplate,Al as analyzeProject,em as analyzeDirectiveUsage,Db as analyticsDirective,Qn as addStore,Pn as addPage,_c as addNonceToInlineContent,Rn as addLayout,On as addComponent,Cn as actionRedirectResponse,Q as abortNavigation,p as a11yDirective,Ve as __setSignalsGeneratorsForTest,Vf as __setBuildIdForTest,Xi as VideoProcessorCache,jh as Validator,s as TransitionType,u as TransitionEase,t as TransitionDirection,zc as Tokenizer,Xn as TemplateTypeChecker,wn as TEMPLATE_PRESETS,ic as StxValidationError,ec as StxSyntaxError,gc as StxSecurityError,fc as StxRuntimeError,hc as StxFileError,dc as StxError,Eq as Show,he as SUSPENSE_RESOLVER_RUNTIME,ja as STX_RUNTIME_GLOBALS,Ra as STX_AUTO_IMPORTS,Ka as STATE_DIR_ENV_VAR,B as SPRING_PRESETS,Dl as SPA_NAV_HEADER,sa as RUNTIME_OWNED_COLON_ATTRS,ua as RUNTIME_HANDLED_X_ATTRS,Eb as RESPONSE_STATUS_KEY,Fb as RESPONSE_HEADERS_KEY,oa as REACTIVE_RUNTIME_GLOBALS,Dn as ProductionBuild,Gq as Portal,Mn as PROJECT_TEMPLATES,gp as PRESETS,na as NON_CLIENT_PRIMITIVES,Co as MemorySessionStore,$h as MIME_TYPES,Yh as MEDIA_DEFAULT_WIDTHS,_h as MEDIA_DEFAULT_FORMATS,Ol as LAYOUT_TYPES_FILE,Mi as ImageProcessorCache,Bk as ImageProcessingError,xo as HydrationRuntime,Jj as HotReloadServer,ha as HeatmapAggregator,Zf as HTML_CLASS_MARKER,Yf as HTML_ATTRS_MARKER,xq as Fragment,Fq as For,El as FRAGMENT_CACHE_CONTROL,qc as ErrorLogger,Wb as ErrorCodes,Rj as EXTERNALIZED_ASSET_DIR,nk as DeployError,ok as DEFAULT_WIDTHS,v as DEFAULT_TRANSITION_OPTIONS,Ja as DEFAULT_STATE_DIR,qk as DEFAULT_QUALITY,pi as DEFAULT_PLACEHOLDER_OPTIONS,pk as DEFAULT_FORMATS,Zh as DEFAULT_DPR_VALUES,oo as ComponentHMRHandler,ka as COMPONENT_SCOPE_LOCAL_GLOBALS,wa as COMPONENT_PASSTHROUGH_X_ATTRS,ma as COMPILE_TIME_ONLY_GLOBALS,hi as COMMON_SIZES,Mf as COLOR_MODE_BOOT_MARKER,Nf as COLOR_MODE_BOOT_GLOBAL,Xf as CLOAK_STYLE,Am as BroadcastServer,zm as Broadcast,Sf as BUILD_ID_META,Tf as BUILD_ID_HEADER,Ga as BROWSER_CORE_IMPORTS,qi as BLUR_UP_CSS,va as ALPINE_BRIDGE_X_ATTRS,Qq as $path};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{vg as a}from"./chunk-ytxz3xcs.js";import"./chunk-fnhvrp9g.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{a as startProductionServer};
2
+ import{vg as a}from"./chunk-3k3vrnk0.js";import"./chunk-b7tw429a.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{a as startProductionServer};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{jg as a}from"./chunk-0vfb2q94.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{a as buildApp};
2
+ import{jg as a}from"./chunk-c2xhf8re.js";import"./chunk-a0sagjwy.js";import"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import"./chunk-qs0fp63n.js";export{a as buildApp};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Mf as v,Nf as i,Of as t,Rf as e,Sf as HH,Tf as KH,Uf as QH,Vf as YH,Wf as ZH}from"./chunk-87kz1190.js";import{Wi as s}from"./chunk-z5ecweqg.js";import{Pl as a}from"./chunk-a0sagjwy.js";import{jt as h}from"./chunk-1px4xey5.js";import{Dt as f}from"./chunk-ax56kn66.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
2
+ import{Mf as v,Nf as i,Of as t,Rf as e,Sf as HH,Tf as KH,Uf as QH,Vf as YH,Wf as ZH}from"./chunk-380tnd2y.js";import{Wi as s}from"./chunk-z5ecweqg.js";import{Pl as a}from"./chunk-a0sagjwy.js";import{jt as h}from"./chunk-1px4xey5.js";import{Dt as f}from"./chunk-ax56kn66.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
3
3
  `.repeat(K.startLine-1):"",N=t(i(K.code)),X=K.kind==="client"||K.kind==="plain"?HH(Q,K.code):"";return QH(`${L+N}
4
4
  ${X}
5
5
  export {}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{mg as _$,ng as K5}from"./chunk-ytxz3xcs.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-fnhvrp9g.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-dq48z0r7.js";import{xk as g5,yk as f5}from"./chunk-b212gjes.js";import{Ek as l7,Fk as i7}from"./chunk-frp9fc7j.js";import{hl as Q1}from"./chunk-r84h7wxw.js";import{$m as c1,$r as E$,Am as s$,Ap as m0,Eq as O0,Im as x6,Mm as Z5,Or as G$,Pm as N1,Qm as M1,Sq as Q6,Tq as E1,Wo as Z$,Xq as p0,_l as b7,_o as X5,am as X6,ap as S6,bp as z6,bs as d0,cn as L6,cq as g7,cs as M0,gs as V0,jq as P6,kn as n$,kq as b6,mn as o$,pn as l1,qm as u0,sp as j0,tn as t$,wn as Q$,xn as F6}from"./chunk-a0sagjwy.js";import{Ms as B,Us as W$,Vs as K$,Zs as o}from"./chunk-7q6abr68.js";import{jt as S0}from"./chunk-1px4xey5.js";import{$t as H6,Au as k6,Eu as A6,_t as $5,du as V6,eu as E6,tu as I6,uu as R6,vu as D6,wu as w6,xu as T6,yu as C6}from"./chunk-z2gmz9ew.js";import{Ou as p}from"./chunk-qs0fp63n.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`
2
+ import{mg as _$,ng as K5}from"./chunk-3k3vrnk0.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-b7tw429a.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-dq48z0r7.js";import{xk as g5,yk as f5}from"./chunk-b212gjes.js";import{Ek as l7,Fk as i7}from"./chunk-frp9fc7j.js";import{hl as Q1}from"./chunk-r84h7wxw.js";import{$m as c1,$r as E$,Am as s$,Ap as m0,Eq as O0,Im as x6,Mm as Z5,Or as G$,Pm as N1,Qm as M1,Sq as Q6,Tq as E1,Wo as Z$,Xq as p0,_l as b7,_o as X5,am as X6,ap as S6,bp as z6,bs as d0,cn as L6,cq as g7,cs as M0,gs as V0,jq as P6,kn as n$,kq as b6,mn as o$,pn as l1,qm as u0,sp as j0,tn as t$,wn as Q$,xn as F6}from"./chunk-a0sagjwy.js";import{Ms as B,Us as W$,Vs as K$,Zs as o}from"./chunk-7q6abr68.js";import{jt as S0}from"./chunk-1px4xey5.js";import{$t as H6,Au as k6,Eu as A6,_t as $5,du as V6,eu as E6,tu as I6,uu as R6,vu as D6,wu as w6,xu as T6,yu as C6}from"./chunk-z2gmz9ew.js";import{Ou as p}from"./chunk-qs0fp63n.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-15bk9bn4.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-p7a8mgns.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}
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-fm6z2zr9.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-p7a8mgns.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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}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-15bk9bn4.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-15bk9bn4.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-p7a8mgns.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-15bk9bn4.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-atbpj3dh.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-15bk9bn4.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-bc250je5.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-k8y3m0kn.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-np6b30jn.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-k8y3m0kn.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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}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-fm6z2zr9.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-fm6z2zr9.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-p7a8mgns.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-fm6z2zr9.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-atbpj3dh.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-fm6z2zr9.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-bc250je5.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-k8y3m0kn.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-np6b30jn.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-k8y3m0kn.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(`
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-bhx39765.js";import"./chunk-jy6madxa.js";import"./chunk-shh4byc3.js";import"./chunk-dk45sjgn.js";import"./chunk-vzskgbqj.js";import"./chunk-kvqkkwnd.js";import"./chunk-x1az3202.js";import"./chunk-87kz1190.js";import"./chunk-d19bydks.js";import"./chunk-1p0r6k2f.js";import"./chunk-0vfb2q94.js";import"./chunk-ytxz3xcs.js";import"./chunk-fnhvrp9g.js";import"./chunk-n3tj3h1q.js";import"./chunk-cs1dc1n7.js";import"./chunk-9228drk4.js";import"./chunk-tv4n71jy.js";import"./chunk-rbke5wqk.js";import"./chunk-vgmc978e.js";import"./chunk-78bpc81t.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-jvs7azc8.js";import"./chunk-z5ecweqg.js";import"./chunk-ht51fz7w.js";import"./chunk-fvjh7rx0.js";import"./chunk-b6jhznkh.js";import"./chunk-4heeeaef.js";import"./chunk-g553n48p.js";import"./chunk-nhmq45hh.js";import"./chunk-dq48z0r7.js";import"./chunk-ggghr7tk.js";import"./chunk-b212gjes.js";import"./chunk-frp9fc7j.js";import{$k as u,al as c}from"./chunk-gept2ha2.js";import"./chunk-r84h7wxw.js";import{Am as A}from"./chunk-a0sagjwy.js";import{ps as f}from"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import{Ou as B}from"./chunk-qs0fp63n.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.242";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(`
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-rnr9ffy1.js";import"./chunk-jy6madxa.js";import"./chunk-shh4byc3.js";import"./chunk-p5mr2984.js";import"./chunk-vzskgbqj.js";import"./chunk-kvqkkwnd.js";import"./chunk-eavhvfzr.js";import"./chunk-380tnd2y.js";import"./chunk-d19bydks.js";import"./chunk-1p0r6k2f.js";import"./chunk-c2xhf8re.js";import"./chunk-3k3vrnk0.js";import"./chunk-b7tw429a.js";import"./chunk-n3tj3h1q.js";import"./chunk-cs1dc1n7.js";import"./chunk-9228drk4.js";import"./chunk-tv4n71jy.js";import"./chunk-rbke5wqk.js";import"./chunk-vgmc978e.js";import"./chunk-78bpc81t.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-jvs7azc8.js";import"./chunk-z5ecweqg.js";import"./chunk-ht51fz7w.js";import"./chunk-fvjh7rx0.js";import"./chunk-b6jhznkh.js";import"./chunk-4heeeaef.js";import"./chunk-g553n48p.js";import"./chunk-nhmq45hh.js";import"./chunk-dq48z0r7.js";import"./chunk-ggghr7tk.js";import"./chunk-b212gjes.js";import"./chunk-frp9fc7j.js";import{$k as u,al as c}from"./chunk-gept2ha2.js";import"./chunk-r84h7wxw.js";import{Am as A}from"./chunk-a0sagjwy.js";import{ps as f}from"./chunk-092sm06a.js";import"./chunk-19m7hed6.js";import"./chunk-nhn7qftp.js";import"./chunk-mv2v3g62.js";import"./chunk-7q6abr68.js";import"./chunk-2qkasmq1.js";import"./chunk-1px4xey5.js";import"./chunk-a8fx6wcb.js";import"./chunk-x41v697c.js";import"./chunk-ax56kn66.js";import"./chunk-z2gmz9ew.js";import"./chunk-k26kt6fp.js";import{Ou as B}from"./chunk-qs0fp63n.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.243";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-0s88j6n8.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-mqgjwfvw.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(`
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-h3k1gzwg.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-2s7s4pmw.js");await z({outputDir:b,port:Number.parseInt(x.port,10)||3000})}catch(b){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-fpvksjwh.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-by3zs4ag.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-4k15x8g6.js"),{resolveStxTargets:j}=await import("./chunk-404eam50.js"),W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx"],U=await j(H);if(U.length===0){console.log(`
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-5e7zmgjk.js"),{resolveStxTargets:j}=await import("./chunk-404eam50.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.
@@ -529,18 +529,22 @@ export function guardChainAt(source, offset) {
529
529
  directive.lastIndex = index + 1;
530
530
  }
531
531
  if (name === "if")
532
- stack.push({ conditions: [condition] });
532
+ stack.push({ seen: [], current: condition });
533
533
  else if (name === "unless")
534
- stack.push({ conditions: [`!(${condition})`] });
534
+ stack.push({ seen: [], current: `!(${condition})` });
535
535
  else if (name === "elseif" || name === "else") {
536
- const current = stack[stack.length - 1];
537
- if (!current)
536
+ const open = stack[stack.length - 1];
537
+ if (!open)
538
538
  continue;
539
- const negated = current.conditions.map((c) => `!(${c})`);
540
- current.conditions = name === "elseif" ? [...negated, condition] : negated;
539
+ if (open.current)
540
+ open.seen.push(open.current);
541
+ open.current = name === "elseif" ? condition : null;
541
542
  }
542
543
  }
543
- return stack.flatMap((entry) => entry.conditions).filter(Boolean);
544
+ return stack.flatMap((entry) => [
545
+ ...entry.seen.map((seen) => `!(${seen})`),
546
+ ...entry.current ? [entry.current] : []
547
+ ]).filter(Boolean);
544
548
  }
545
549
  export function expressionStatement(expression) {
546
550
  const code = expression.code.trim();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.242",
4
+ "version": "0.2.243",
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.242",
121
- "@stacksjs/sanitizer": "0.2.242",
120
+ "@stacksjs/desktop": "0.2.243",
121
+ "@stacksjs/sanitizer": "0.2.243",
122
122
  "@stacksjs/ts-i18n": "^0.1.11",
123
- "bun-plugin-stx": "0.2.242",
123
+ "bun-plugin-stx": "0.2.243",
124
124
  "bunfig": "^0.15.17",
125
- "stx-router": "0.2.242",
125
+ "stx-router": "0.2.243",
126
126
  "ts-broadcasting": "^0.0.9",
127
127
  "ts-images": "^0.2.11",
128
128
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,22 +0,0 @@
1
- // @bun
2
- import{Pl as C}from"./chunk-a0sagjwy.js";import{Js as Y}from"./chunk-mv2v3g62.js";import{Dt as D}from"./chunk-ax56kn66.js";import u from"path";var g=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Z)=>Z.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function p(K){let J=[],Z=h(K);g.lastIndex=0;let $;while(($=g.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 q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",G=B(K,W);J.push({kind:X,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 P(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 m(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 R=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,O="__stx_interpolated",S="__StxElement",f="__StxTemplateValue",l=`type ${f}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function L(K){return K.replace(/\{\{[\s\S]*?\}\}/g,O).replace(/\{!![\s\S]*?!!\}/g,O)}function Vj(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 d=["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"],i=new RegExp(String.raw`^[ \t]*@(?:${d.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function Yj(K){return K.replace(i,(J)=>J.replace(/[^\n]/g," "))}var I=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function c(K){let J=P(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=m(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(I.has(W)||I.has(F))continue;if(!z.trim())continue;let Q=j.index+j[0].indexOf(j[2],j[0].indexOf(F)+F.length)+1;if(R.has(W)){let q=z.match(/\s+(?:in|of)\s+/);if(!q||q.index===void 0)continue;let X=z.slice(q.index+q[0].length),G=q.index+q[0].length+(X.length-X.trimStart().length);Z.push({code:L(X.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:L(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}var o=2000;function r(K,J){let Z=0,$=Math.min(K.length,J+o);for(let j=J;j<$;j++){let F=K[j];if(F==="(")Z++;else if(F===")"){if(Z--,Z===0)return K.slice(J+1,j)}}return null}function n(K){let J=new Map,Z=(W,Q)=>{let U=W.split(/[,[\]{}()\s]+/).filter(Boolean);for(let q of U){let X=q.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(X))continue;let G=U.length===1?Q:void 0,H=J.get(X);if(!H)J.set(X,{name:X,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*\(/g)){let Q=r(K,W.index+W[0].length-1);if(Q===null)continue;let U=Q.match(/^([\s\S]*?)\bas\b([\s\S]*)$/);if(!U)continue;Z(U[2].replace(/=>/g," "),j(U[1]))}for(let W of K.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)/g))Z(W[1]);let F=P(K);w.lastIndex=0;let z;while((z=w.exec(F))!==null){let W=z[1].replace(/\..*$/,"");if(!R.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 a(){return["declare var window: any",...D.map((K)=>`declare var ${K}: any`)].join(`
7
- `)}var s=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"];function t(){return s.map((K)=>`declare var ${K}: any`).join(`
8
- `)}function T(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 e(Z[1])){let W=z.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(W))j.add(W)}}return $?[...j]:null}function e(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 jj(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 q=J.indexOf("{",z.index);if(q===-1)continue;let X=0;U=-1;for(let G=q;G<J.length;G++)if(J[G]==="{")X++;else if(J[G]==="}"&&--X===0){U=G+1;break}if(U===-1)continue}else{let q=0;U=J.length;for(let X=J.indexOf("=",z.index)+1;X<J.length;X++){let G=J[X];if(G==="{"||G==="["||G==="("||G==="<")q++;else if(G==="}"||G==="]"||G===")"||G===">")q--;else if(q<=0&&(G===";"||G===`
12
- `&&!/[=|&,<([{]\s*$/.test(J.slice(Math.max(0,X-40),X)))){U=G===";"?X+1:X;break}}}j.push({name:Q,text:K.slice(z.index,U).replace(/^[ \t]*export[ \t]+/,"")}),F.lastIndex=U}return j}function Jj(K){return new Set(x(K).map((J)=>J.name))}function Bj(K,J=""){let Z=T(K),$=Jj(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["",`// ${Qj}`,...j,...U.map((q)=>`declare var ${q}: any`)].join(`
13
- `)}if(Z.length===0)return j.length>0?["",`// ${k}`,...j].join(`
14
- `):"";let{imports:F,body:z}=jj(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 ${A}() {`,W,` return { ${Z.join(", ")} }`,"}",`type ${_} = Awaited<ReturnType<typeof ${A}>>`,...Z.map((U)=>`declare var ${U}: ${_}[${JSON.stringify(U)}]`)),Q.join(`
15
- `)}function Kj(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 wj(K,J){if(T(K)!==null)return[];let Z=Y(J),$=new Set(D);return Kj(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)",Qj="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",A="__stxServerScope",_="__StxClientPayload";var Zj=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","props","slot"];var $j=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function zj(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 q=K[Q];if(q==="(")W++;else if(q===")"){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 Wj(K){let J=K.code.trim();if(!J)return null;if(K.attribute?.startsWith("@")){if($j.test(J))return null;let $=";(($event: any): void => { ";return{text:`${$}${J} });`,prefixLength:$.length}}let Z=";void ((";return{text:`${Z}${J}));`,prefixLength:Z.length}}var Fj=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function Uj(K,J){if(!J)return K;return K.replace(Fj,(Z,$,j,F)=>{let z=u.resolve(J,F).replace(/\\/g,"/");return`${$}${j}${z}${j}`})}function Mj(K,J={}){let Z=p(K),$=K.split(`
17
- `),j=Array.from({length:$.length},()=>""),F=new Map;for(let W of Z)Uj(W.code,J.originDir??"").split(`
18
- `).forEach((U,q)=>{let X=W.startLine-1+q;if(X<j.length)j[X]=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 a().split(`
19
- `))z(Q);for(let Q of t().split(`
20
- `))z(Q);for(let Q of C)z(`declare var ${Q}: any`);for(let Q of Zj)z(`declare var ${Q}: any`);z(`declare var ${O}: any`);let W=new Set(Z.flatMap((Q)=>V(Q.code)));z(`type ${S}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let Q of n(K)){if(W.has(Q.name))continue;let U=Q.iterable&&W.has(Q.iterable)?`${S}<typeof ${Q.iterable}>`:"any";z(`declare var ${Q.name}: ${U}`)}}if(J.templateExpressions!==!1){let W=c(K).map((Q)=>({expression:Q,statement:Wj(Q)})).filter((Q)=>Q.statement!==null);if(W.length>0){let Q=P(K),q=[...new Set(Z.flatMap((G)=>V(G.code)))].filter((G)=>/^[A-Z_$][\w$]*$/i.test(G)),X=0;if(q.length>0){z(l);for(let G of q)z(`type __StxT_${G} = ${f}<typeof ${G}>`);z(`;((${q.map((G)=>`${G}: __StxT_${G}`).join(", ")}) => {`),X=1}for(let{expression:G,statement:H}of W){let v=" ".repeat(X),M=G.offset===void 0?[]:zj(Q,G.offset),y=M.length>0?`${M.map((b)=>`if (${b}) `).join("")}{ `:"",E=M.length>0?" }":"";z(v+y+H.text+E,{line:G.line,column:G.column,expression:G,prefixLength:H.prefixLength+v.length+y.length})}if(X>0)z("});")}}return z("export {}"),{text:j.join(`
21
- `),lineMap:F,sourceLineCount:$.length}}function Nj(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{p as Mf,Vj as Nf,Yj as Of,c as Pf,V as Qf,t as Rf,Bj as Sf,wj as Tf,Uj as Uf,Mj as Vf,Nj as Wf};