@stacksjs/stx 0.2.780 → 0.2.782

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/chunk-02z88h3r.js +2 -0
  2. package/dist/{chunk-e41tnswv.js → chunk-13zfxwej.js} +2 -2
  3. package/dist/{chunk-15g4sg16.js → chunk-187s3a84.js} +1 -1
  4. package/dist/{chunk-xzgbhwty.js → chunk-1dp83080.js} +1 -1
  5. package/dist/{chunk-v6bsz059.js → chunk-1p8r3w08.js} +1 -1
  6. package/dist/{chunk-qnmncbs9.js → chunk-209674ms.js} +2 -2
  7. package/dist/{chunk-9e5jcbhp.js → chunk-267wdqtr.js} +2 -2
  8. package/dist/{chunk-7qcjeykk.js → chunk-2kztshb4.js} +1 -1
  9. package/dist/{chunk-y3ebjepx.js → chunk-2skv6cr7.js} +1 -1
  10. package/dist/{chunk-vfn745ae.js → chunk-311q3pa2.js} +1 -1
  11. package/dist/{chunk-xz60hh63.js → chunk-3xzzzrhw.js} +1 -1
  12. package/dist/{chunk-0tjn4hxp.js → chunk-41gq8324.js} +4 -4
  13. package/dist/{chunk-spfk1hj7.js → chunk-4q4vexpc.js} +1 -1
  14. package/dist/{chunk-ydjs3bzy.js → chunk-5smaktgt.js} +1 -1
  15. package/dist/{chunk-x93rbyyd.js → chunk-62xcwhfd.js} +1 -1
  16. package/dist/{chunk-kv7crjfs.js → chunk-6mdpttxy.js} +1 -1
  17. package/dist/{chunk-kn991pyq.js → chunk-7086efsc.js} +1 -1
  18. package/dist/{chunk-j23nska2.js → chunk-7r1tcffk.js} +2 -2
  19. package/dist/{chunk-2pyfw8k7.js → chunk-a623wybr.js} +4 -4
  20. package/dist/{chunk-hkh772yj.js → chunk-abzp0cp9.js} +1 -1
  21. package/dist/{chunk-jp02pcy5.js → chunk-avwsq94a.js} +1 -1
  22. package/dist/{chunk-02s307f1.js → chunk-axs1wrkr.js} +3 -3
  23. package/dist/{chunk-xcaq3zyx.js → chunk-ay2by639.js} +1 -1
  24. package/dist/{chunk-weka7k61.js → chunk-dd12079e.js} +1 -1
  25. package/dist/{chunk-d4jg4brt.js → chunk-de9dkzwy.js} +1 -1
  26. package/dist/{chunk-sxwmdxw2.js → chunk-dfn9cp6v.js} +1 -1
  27. package/dist/{chunk-57s05c7p.js → chunk-djqx359s.js} +1 -1
  28. package/dist/{chunk-qv2qrjcx.js → chunk-dnk3ahmm.js} +1 -1
  29. package/dist/{chunk-jfhzqcj9.js → chunk-f9rtfd58.js} +1 -1
  30. package/dist/{chunk-cdbgjwz8.js → chunk-fj7tedrt.js} +1 -1
  31. package/dist/{chunk-ty1tq0nw.js → chunk-fkn08jb3.js} +1 -1
  32. package/dist/chunk-fmzdvgka.js +2 -0
  33. package/dist/chunk-g9makcfg.js +2 -0
  34. package/dist/{chunk-w3aw4vw0.js → chunk-gpt1v08p.js} +1 -1
  35. package/dist/{chunk-gswn2c2y.js → chunk-kkkpgnj3.js} +1 -1
  36. package/dist/{chunk-b0zc96r4.js → chunk-km0tqwx1.js} +4 -4
  37. package/dist/{chunk-d3a5ftxf.js → chunk-m60qqnt6.js} +1 -1
  38. package/dist/chunk-m68scqz0.js +2 -0
  39. package/dist/{chunk-5t388a0x.js → chunk-mhmphbve.js} +5 -5
  40. package/dist/chunk-mpny7cmd.js +2 -0
  41. package/dist/{chunk-t5srthkt.js → chunk-mx0a1ax8.js} +1 -1
  42. package/dist/{chunk-k66x9s31.js → chunk-p23rgrsc.js} +2 -2
  43. package/dist/{chunk-7gs16p03.js → chunk-p5qtdqdt.js} +1 -1
  44. package/dist/{chunk-mnq9g3ra.js → chunk-ppnc68ta.js} +1 -1
  45. package/dist/chunk-pwetf855.js +2 -0
  46. package/dist/{chunk-fcf5cv08.js → chunk-q9w8rfve.js} +1 -1
  47. package/dist/{chunk-a46qpf2y.js → chunk-qgy1w573.js} +1 -1
  48. package/dist/{chunk-6sz69gvp.js → chunk-r0g70zrf.js} +6 -6
  49. package/dist/{chunk-566mkn3e.js → chunk-rvvc4twc.js} +1 -1
  50. package/dist/{chunk-tk8q2r05.js → chunk-ry7w14ax.js} +4 -4
  51. package/dist/{chunk-w1w8nj6n.js → chunk-smsjcnvm.js} +1 -1
  52. package/dist/{chunk-b6g1h863.js → chunk-t6z2ty9v.js} +2 -2
  53. package/dist/{chunk-yq2bpyjd.js → chunk-v1eakek3.js} +1 -1
  54. package/dist/chunk-vdx4zfq1.js +2 -0
  55. package/dist/chunk-wbhv5137.js +3 -0
  56. package/dist/{chunk-gy10h4mh.js → chunk-x2c3mjey.js} +1 -1
  57. package/dist/{chunk-kygx13s7.js → chunk-xcrrsq09.js} +1 -1
  58. package/dist/{chunk-w773zjcj.js → chunk-xqa9ze06.js} +1 -1
  59. package/dist/chunk-y209b8ch.js +2 -0
  60. package/dist/{chunk-y9vk93nk.js → chunk-y2q9f262.js} +1 -1
  61. package/dist/{chunk-67e85f7r.js → chunk-z04f6fy2.js} +1 -1
  62. package/dist/chunk-z5pvmtd7.js +2 -0
  63. package/dist/chunk-z79s860q.js +2 -0
  64. package/dist/{chunk-nrr0jfwq.js → chunk-zbeaatev.js} +1 -1
  65. package/dist/cli.js +7 -7
  66. package/dist/craft-entry.js +1 -1
  67. package/dist/craft.js +1 -1
  68. package/dist/native/runtime/craft-bridge.js +7 -0
  69. package/dist/native/runtime/craft.d.ts +23 -1
  70. package/dist/pwa.js +1 -1
  71. package/dist/ssg.js +2 -2
  72. package/package.json +5 -5
  73. package/dist/chunk-1ckn7fb6.js +0 -2
  74. package/dist/chunk-1jct3j13.js +0 -2
  75. package/dist/chunk-1mqymwsd.js +0 -2
  76. package/dist/chunk-3dx4gb3m.js +0 -2
  77. package/dist/chunk-7hb0ep9w.js +0 -2
  78. package/dist/chunk-85e7tay6.js +0 -2
  79. package/dist/chunk-fc765rv3.js +0 -2
  80. package/dist/chunk-g3yppmn6.js +0 -2
  81. package/dist/chunk-p42jm38c.js +0 -2
  82. package/dist/chunk-w0qzmr1n.js +0 -3
  83. package/dist/chunk-yfamk0xt.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ze,xn,Vs,vi,O}from"./chunk-27rzdq3n.js";import{vn}from"./chunk-xzgbhwty.js";import{Or,k,al,at,$i,cl}from"./chunk-9f6qx8b9.js";import{A}from"./chunk-2yxva96k.js";import{Us,u,f,jt,d,q,B,w,Xs,_e,Ve,Gs}from"./chunk-bq9xf8nq.js";import{s,ge}from"./chunk-m4mpyq3d.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-bmfk3b29.js";import Ge from"path";import kt from"process";import{AsyncLocalStorage as zo}from"async_hooks";var fr=new zo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function dr(e,n){return fr.run(mn(e),n)}async function pr(e,n){let t=fr.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=t.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let c=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),y=JSON.parse(c);return t.values.set(e,y),y}).catch((l)=>{throw t.pending.delete(e),l});return t.pending.set(e,a),a}function _r(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function z(e,n=!1){let t=s(e),i=[],a=new Set,l=0,c=0,y=t.length,v=()=>{if(l!==0)return;let E=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(n&&E[1]==="const")return;let P=E[2];if(!a.has(P))i.push(P),a.add(P);return}let R=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(R){if(n&&t.slice(c).startsWith("const"))return;R[1].split(",").forEach((P)=>{let D=P.trim();if(!D)return;let X=D.indexOf(":"),L=(X>=0?D.slice(X+1).trim():D).split(/[\s=]/)[0];if(L&&!a.has(L))i.push(L),a.add(L)});return}let M=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(n&&t.slice(c).startsWith("const"))return;M[1].split(",").forEach((P)=>{let D=P.trim().replace(/^\.\.\./,"");if(!D)return;let X=D.split(/[\s=]/)[0];if(X&&!a.has(X))i.push(X),a.add(X)});return}if(n)return;let N=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let P=N[1];if(!a.has(P))i.push(P),a.add(P);return}let j=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let P=j[1];if(!a.has(P))i.push(P),a.add(P)}};while(c<y){if(t[c]==="{"){l++,c++;continue}if(t[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))v();c++}return i.join(", ")}function As(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,n=z(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(z(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>t.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ps(e,n){let t=`{ ${Wo(e,n)} }`;return z(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import On from"fs";import We from"path";function H(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var gr=new Map;function yr(e,n=!0){let t=gr.get(e);if(n&&t)return t;let i=new Map,a=[We.join(e,"src"),We.join(e,"dist"),e];function l(c,y){if(y>6)return;let v;try{v=On.readdirSync(c,{withFileTypes:!0})}catch{return}for(let E of v){let R=We.join(c,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(R,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let M=E.name.slice(0,-4);if(!i.has(M))i.set(M,R);let N=M.toLowerCase();if(!i.has(N))i.set(N,R);let j=H(M);if(!i.has(j))i.set(j,R)}}}for(let c of a)if(l(c,0),i.size>0)break;if(n)gr.set(e,i);return i}function Is(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let t=n;while(!0){let i=We.join(t,"node_modules",e);try{if(On.statSync(i).isDirectory())return i}catch{}let a=We.dirname(t);if(a===t)return null;t=a}}function Os(e,n,t={}){return[We.resolve(We.dirname(n),`${e}.stx`),We.resolve(We.dirname(n),e),We.resolve(t.componentsDir||"components",`${e}.stx`),We.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function mr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,t=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=H(n);return[n,t,i]}function ri(e,n){let[t,i,a]=mr(e);for(let l of[t,t.toLowerCase(),i,a]){let c=n?.__importedComponents?.get(l);if(c!==void 0)return c}}function*si(e,n,t={},i){let a=mr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield We.resolve(We.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=t.projectRoot||process.cwd(),y=[...i?.__originalFilePath?[We.join(We.dirname(i.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],We.join(We.dirname(n),"components"),We.resolve(c,"src/components"),We.resolve(c,"components"),...import.meta.dir?[We.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield We.join(v,E);try{for(let E of On.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let R of l)yield We.join(v,E.name,R)}catch{}}}function hr(e,n,t={},i){let a=ri(e,i);if(a!==void 0)return a;for(let l of si(e,n,t,i))try{if(On.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ns(e,n=[],t={}){let i=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(t).map(([E,R])=>[E.replace(/[-_]/g,"").toLowerCase(),R])),l=a.get("alt"),c=a.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof c==="string"?!["false","0","off","no"].includes(c.trim().toLowerCase()):Boolean(c);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>i.has(E)))return!1;if([...n].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;return["fit","objectfit","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>i.has(E))}import Jn from"fs";import ce from"path";import ht from"path";import qt from"fs";var Fo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function ls(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return Fo.has(e.toLowerCase())}var $r=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),Er={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},Vo=new Set(["ctrl","alt","shift","meta"]),Ar={left:0,middle:1,right:2};function Rr(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let i=t.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(Vo.has(i))n.systemKeys.push(i);else if(i in Ar)n.mouse=i;else if(i in Er||/^[a-z]$/.test(i))n.keys.push(Er[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function Ir(e,n=""){let t=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,y,v]=l,E=l.index,R=E+c.length,M=`__stx_evt_${n}${i++}`,N=[],j=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=j.exec(v))!==null){let[,X,F]=P,L=X.split("."),Q=L[0];if(!$r.has(Q))continue;N.push({attribute:`@${X}`,event:Q,handler:F,modifiers:Rr(L.slice(1)),elementId:M})}let D=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=D.exec(v))!==null){let[,X,F]=P,L=X.split("."),Q=L[0];if(!$r.has(Q))continue;N.push({attribute:`@${X}`,event:Q,handler:F,modifiers:Rr(L.slice(1)),elementId:M})}if(N.length>0)t.push({originalTag:c,elementId:M,events:N,startIndex:E,endIndex:R})}return t}function Uo(e){let n=[],{modifiers:t}=e;if(t.self)n.push("if ($event.target !== $el) return");for(let i of t.systemKeys)n.push(`if (!$event.${i}Key) return`);if(t.keys.length>0){let i=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(t.mouse!==null){let i=Ar[t.mouse];n.push(`if ($event.button !== ${i}) return`)}if(t.prevent)n.push("$event.preventDefault()");if(t.stop)n.push("$event.stopPropagation()");return n.join("; ")}function Ho(e,n){let t=e;if(n.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${n.debounce})`;else if(n.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${n.throttle})`;return t}function us(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Ko(e){let{modifiers:n}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Uo(e),a=Ho(us(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(ls(e.event,n))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",y=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{ze,xn,Vs,vi,O}from"./chunk-27rzdq3n.js";import{vn}from"./chunk-1dp83080.js";import{Or,k,al,at,$i,cl}from"./chunk-9f6qx8b9.js";import{A}from"./chunk-2yxva96k.js";import{Us,u,f,jt,d,q,B,w,Xs,_e,Ve,Gs}from"./chunk-bq9xf8nq.js";import{s,ge}from"./chunk-m4mpyq3d.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-bmfk3b29.js";import Ge from"path";import kt from"process";import{AsyncLocalStorage as zo}from"async_hooks";var fr=new zo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function dr(e,n){return fr.run(mn(e),n)}async function pr(e,n){let t=fr.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=t.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let c=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),y=JSON.parse(c);return t.values.set(e,y),y}).catch((l)=>{throw t.pending.delete(e),l});return t.pending.set(e,a),a}function _r(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function z(e,n=!1){let t=s(e),i=[],a=new Set,l=0,c=0,y=t.length,v=()=>{if(l!==0)return;let E=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(n&&E[1]==="const")return;let P=E[2];if(!a.has(P))i.push(P),a.add(P);return}let R=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(R){if(n&&t.slice(c).startsWith("const"))return;R[1].split(",").forEach((P)=>{let D=P.trim();if(!D)return;let X=D.indexOf(":"),L=(X>=0?D.slice(X+1).trim():D).split(/[\s=]/)[0];if(L&&!a.has(L))i.push(L),a.add(L)});return}let M=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(n&&t.slice(c).startsWith("const"))return;M[1].split(",").forEach((P)=>{let D=P.trim().replace(/^\.\.\./,"");if(!D)return;let X=D.split(/[\s=]/)[0];if(X&&!a.has(X))i.push(X),a.add(X)});return}if(n)return;let N=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let P=N[1];if(!a.has(P))i.push(P),a.add(P);return}let j=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let P=j[1];if(!a.has(P))i.push(P),a.add(P)}};while(c<y){if(t[c]==="{"){l++,c++;continue}if(t[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))v();c++}return i.join(", ")}function As(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,n=z(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(z(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>t.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ps(e,n){let t=`{ ${Wo(e,n)} }`;return z(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import On from"fs";import We from"path";function H(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var gr=new Map;function yr(e,n=!0){let t=gr.get(e);if(n&&t)return t;let i=new Map,a=[We.join(e,"src"),We.join(e,"dist"),e];function l(c,y){if(y>6)return;let v;try{v=On.readdirSync(c,{withFileTypes:!0})}catch{return}for(let E of v){let R=We.join(c,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(R,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let M=E.name.slice(0,-4);if(!i.has(M))i.set(M,R);let N=M.toLowerCase();if(!i.has(N))i.set(N,R);let j=H(M);if(!i.has(j))i.set(j,R)}}}for(let c of a)if(l(c,0),i.size>0)break;if(n)gr.set(e,i);return i}function Is(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let t=n;while(!0){let i=We.join(t,"node_modules",e);try{if(On.statSync(i).isDirectory())return i}catch{}let a=We.dirname(t);if(a===t)return null;t=a}}function Os(e,n,t={}){return[We.resolve(We.dirname(n),`${e}.stx`),We.resolve(We.dirname(n),e),We.resolve(t.componentsDir||"components",`${e}.stx`),We.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function mr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,t=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=H(n);return[n,t,i]}function ri(e,n){let[t,i,a]=mr(e);for(let l of[t,t.toLowerCase(),i,a]){let c=n?.__importedComponents?.get(l);if(c!==void 0)return c}}function*si(e,n,t={},i){let a=mr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield We.resolve(We.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=t.projectRoot||process.cwd(),y=[...i?.__originalFilePath?[We.join(We.dirname(i.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],We.join(We.dirname(n),"components"),We.resolve(c,"src/components"),We.resolve(c,"components"),...import.meta.dir?[We.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield We.join(v,E);try{for(let E of On.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let R of l)yield We.join(v,E.name,R)}catch{}}}function hr(e,n,t={},i){let a=ri(e,i);if(a!==void 0)return a;for(let l of si(e,n,t,i))try{if(On.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ns(e,n=[],t={}){let i=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(t).map(([E,R])=>[E.replace(/[-_]/g,"").toLowerCase(),R])),l=a.get("alt"),c=a.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof c==="string"?!["false","0","off","no"].includes(c.trim().toLowerCase()):Boolean(c);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>i.has(E)))return!1;if([...n].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;return["fit","objectfit","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>i.has(E))}import Jn from"fs";import ce from"path";import ht from"path";import qt from"fs";var Fo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function ls(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return Fo.has(e.toLowerCase())}var $r=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),Er={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},Vo=new Set(["ctrl","alt","shift","meta"]),Ar={left:0,middle:1,right:2};function Rr(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let i=t.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(Vo.has(i))n.systemKeys.push(i);else if(i in Ar)n.mouse=i;else if(i in Er||/^[a-z]$/.test(i))n.keys.push(Er[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function Ir(e,n=""){let t=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,y,v]=l,E=l.index,R=E+c.length,M=`__stx_evt_${n}${i++}`,N=[],j=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=j.exec(v))!==null){let[,X,F]=P,L=X.split("."),Q=L[0];if(!$r.has(Q))continue;N.push({attribute:`@${X}`,event:Q,handler:F,modifiers:Rr(L.slice(1)),elementId:M})}let D=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=D.exec(v))!==null){let[,X,F]=P,L=X.split("."),Q=L[0];if(!$r.has(Q))continue;N.push({attribute:`@${X}`,event:Q,handler:F,modifiers:Rr(L.slice(1)),elementId:M})}if(N.length>0)t.push({originalTag:c,elementId:M,events:N,startIndex:E,endIndex:R})}return t}function Uo(e){let n=[],{modifiers:t}=e;if(t.self)n.push("if ($event.target !== $el) return");for(let i of t.systemKeys)n.push(`if (!$event.${i}Key) return`);if(t.keys.length>0){let i=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(t.mouse!==null){let i=Ar[t.mouse];n.push(`if ($event.button !== ${i}) return`)}if(t.prevent)n.push("$event.preventDefault()");if(t.stop)n.push("$event.stopPropagation()");return n.join("; ")}function Ho(e,n){let t=e;if(n.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${n.debounce})`;else if(n.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${n.throttle})`;return t}function us(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Ko(e){let{modifiers:n}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Uo(e),a=Ho(us(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(ls(e.event,n))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",y=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${t}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function Zo(e,n=""){let t=Ir(e,n);if(t.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=t.length-1;l>=0;l--){let c=t[l],y=c.originalTag;if(!y.includes(" id="))y=y.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let v=y.match(/id=["']([^"']+)["']/);if(v)for(let E of c.events)E.elementId=v[1]}for(let v of c.events){let E=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(`\\s*${E}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${E}\\s*=\\s*'[^']*'`,"g");y=y.replace(R,""),y=y.replace(M,"")}i=i.slice(0,c.startIndex)+y+i.slice(c.endIndex),a.push(...c.events)}return{template:i,bindings:a}}function Tr(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function Ec(e,n,t){if(cl(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:y,bindings:v}=Zo(e,Tr(n)),E=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...E,...v],y}let i=Ir(e,Tr(n));if(i.length===0)return e;let a=e;for(let y=i.length-1;y>=0;y--){let v=i[y],E=v.originalTag;if(!E.includes(" id="))E=E.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let R=E.match(/id=["']([^"']+)["']/);if(R)for(let M of v.events)M.elementId=R[1]}for(let R of v.events){let M=R.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),N=new RegExp(`\\s*${M}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${M}\\s*=\\s*'[^']*'`,"g");E=E.replace(N,""),E=E.replace(j,"")}a=a.slice(0,v.startIndex)+E+a.slice(v.endIndex)}let l=oi(i.flatMap((y)=>y.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+l+`
115
- `+a.slice(c);else a+=l;return a}function Pr(e,n){let t=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Rt(e,n){let t=s(e),{depths:i,balanced:a}=ge(t),l=(y)=>!a||i[y]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let y of t.matchAll(c)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Pr(y[1],!0).has(n))return!0;for(let y of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Pr(y[1],!1).has(n))return!0;return!1}var Mr="",Pn,lt=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Dr=["(","[","{"],jr=[")","]","}"],Xo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Jo(e){let n=s(e),t=[];for(let i of n.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=i.index??0;t.push({text:i[0],start:a,end:a+i[0].length})}return{code:n,tokens:t}}function fs(e){if(Pn&&e===Mr)return Pn;let{code:n,tokens:t}=Jo(e),i=new Map,a=[];for(let P=0;P<t.length;P++){let D=t[P].text;if(["(","[","{"].includes(D))a.push(P);else if([")","]","}"].includes(D)){let X=a.at(-1);if(X!==void 0&&["()","[]","{}"].includes(t[X].text+D))a.pop(),i.set(X,P),i.set(P,X)}}function l(P,D){let X=[],F=P;for(let L=P;L<D;L++){if(["(","[","{"].includes(t[L].text)&&(i.get(L)??D)<D){L=i.get(L);continue}if(t[L].text===",")X.push([F,L]),F=L+1}return X.push([F,D]),X}let c=[];function y(P,D,X,F=!1){if(t[P]?.text==="...")P++;if(P>=D)return;let L=t[P].text;if(lt.test(L)){if(X.add(L),X===R)c.push({name:L,token:P,functionScoped:F});return}if(L!=="{"&&L!=="[")return;let Q=i.get(P);if(Q===void 0||Q>=D)return;for(let[te,ae]of l(P+1,Q)){let ne=te;if(L==="{")for(let ue=te;ue<ae;ue++){if(t[ue].text===":"){ne=ue+1;break}if(t[ue].text==="=")break;if(["(","[","{"].includes(t[ue].text)&&i.has(ue))ue=i.get(ue)}y(ne,ae,X,F)}}function v(P,D){let X=new Set;for(let[F,L]of l(P,D))y(F,L,X);return X}function E(P){let D=P;for(;D<t.length;D++){let X=t[D].text;if(["(","[","{"].includes(X)&&i.has(D)){D=i.get(D);continue}if([",",";",")","]","}"].includes(X))break}return t[Math.max(P,D-1)]?.end??n.length}let R=new Set,M=[];for(let P=0;P<t.length;P++)if(t[P].text==="=>"){let D=P-1,X=D,F;if(t[D]?.text===")"&&i.has(D))X=i.get(D),F=v(X+1,D);else if(t[D]&&lt.test(t[D].text))F=new Set([t[D].text]);else continue;let L=P+1,Q=t[L]?.text==="{"&&i.has(L)?t[i.get(L)].end:E(L);M.push({start:t[X].start,end:Q,bodyStart:t[L]?.start??Q,functionBody:!0,names:F})}else if(t[P].text==="("&&i.has(P)){let D=t[P-1]?.text;if(!D||qo.has(D)||!lt.test(D)&&D!=="*"&&D!=="]")continue;let X=i.get(P),F=X+1;if(t[F]?.text===":"){F++;while(F<t.length&&!["{","=>",";","="].includes(t[F].text))F++}if(t[F]?.text!=="{"||!i.has(F))continue;M.push({start:t[P].start,end:t[i.get(F)].end,bodyStart:t[F].start,functionBody:D!=="catch",names:v(P+1,X)})}function N(P){let D=P;for(;D<t.length;D++){let X=t[D].text;if(Dr.includes(X)&&i.has(D)){D=i.get(D);continue}if(X===";"||jr.includes(X))break;let F=t[D-1];if(D>P&&Xo.has(X)&&F.text!==".")break;if(D>P&&/[\n\r]/.test(n.slice(F.end,t[D].start))&&(/^[\w$]+$/.test(F.text)||jr.includes(F.text)||['"',"'","`"].includes(F.text))&&lt.test(X)&&!["in","of","instanceof"].includes(X))break}return D}let j=[];for(let P=0;P<t.length;P++){if(t[P].text!=="for")continue;let D=t[P+1]?.text==="await"?P+2:P+1;if(t[D]?.text!=="("||!i.has(D))continue;let X=i.get(D),F=X+1,L=t[F]?.text==="{"&&i.has(F)?i.get(F):N(F),Q=t[L]?.text===";"||t[L]?.text==="}"?t[L].end:t[Math.max(F,L-1)]?.end??n.length;j.push({headStart:D,headEnd:X,start:t[D].start,end:Q})}for(let P=0;P<t.length;P++){let D=t[P].text,X=t[P-1]?.text;if(X==="."||t[P+1]?.text===":")continue;if(X==="as"||X==="<")continue;if(D==="const"||D==="let"||D==="var"){let F=N(P+1),L=P+1,Q=!1,te=!1,ae=0;for(let ne=P+1;ne<=F;ne++){let ue=t[ne]?.text;if(ne<F&&Dr.includes(ue)&&i.has(ne)&&i.get(ne)<F){ne=i.get(ne);continue}if(ne<F&&ue===":"&&!te)Q=!0;else if(ne<F&&ue==="="&&ae===0)Q=!1,te=!0;else if(ne<F&&Q&&ue==="<")ae++;else if(ne<F&&Q&&ue===">"&&ae>0)ae--;else if(ne===F||ue===","&&ae===0)y(L,ne,R,D==="var"),L=ne+1,Q=!1,te=!1}}else if(D==="function"||D==="class"){let F=P+1;if(t[F]?.text==="*")F++;if(t[F]&&lt.test(t[F].text)&&t[F].text!=="extends")R.add(t[F].text),c.push({name:t[F].text,token:F})}else if(D==="import"){let F=P+1;if(t[F]?.text==="*"&&t[F+1]?.text==="as")F+=2;let L=t[F]?.text;if(L&&lt.test(L)&&L!=="type"&&t[F+1]?.text!=="("&&t[F+1]?.text!==".")R.add(L),c.push({name:L,token:F,file:!0});let Q=t[F]?.text==="{"?F:t[F+1]?.text===","&&t[F+2]?.text==="{"?F+2:-1;if(Q!==-1&&i.has(Q)){let te=i.get(Q);for(let[ae,ne]of l(Q+1,te)){let ue=ne-1;while(ue>=ae&&!lt.test(t[ue].text))ue--;if(ue>=ae&&t[ue].text!=="type")c.push({name:t[ue].text,token:ue,file:!0})}}}}return Mr=e,Pn={code:n,scopes:M,loops:j,declarations:R,sites:c,tokens:t,pairs:i},Pn}function ds(e){let n=fs(e);return{code:n.code,shadows:(t,i)=>n.scopes.some((a)=>i>=a.start&&i<a.end&&a.names.has(t))}}function Mn(e){return new Set(fs(e).declarations)}function Ie(e,n){let{scopes:t,loops:i,sites:a,tokens:l,pairs:c}=fs(e),y=Array.from({length:l.length},()=>-1),v=[];for(let j=0;j<l.length;j++){y[j]=v.length?v[v.length-1]:-1;let P=l[j].text;if(P==="{"&&c.has(j))v.push(j);else if(P==="}"&&v.length&&c.get(j)===v[v.length-1])v.pop()}let E=new Set,R=new Map;for(let j of a){if(!n.has(j.name))continue;E.add(j.token);let P=j.file?-1:y[j.token],D=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(j.functionScoped){let F=l[j.token].start,L=t.filter((Q)=>Q.functionBody&&F>=Q.bodyStart&&F<Q.end).sort((Q,te)=>Q.end-Q.bodyStart-(te.end-te.bodyStart))[0];D=L?[L.bodyStart,L.end]:[0,Number.POSITIVE_INFINITY]}else if(!j.file){let F=i.filter((L)=>j.token>L.headStart&&j.token<L.headEnd).sort((L,Q)=>L.headEnd-L.headStart-(Q.headEnd-Q.headStart))[0];if(F)D=[F.start,F.end]}let X=R.get(j.name);if(X)X.push(D);else R.set(j.name,[D])}let M=new Set;for(let j=0;j<l.length;j++){if(l[j].text!=="import"||l[j-1]?.text===".")continue;let P=j+1;if(l[P]?.text==="type")P++;if(l[P]&&lt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let D=P+1;D<c.get(P);D++)M.add(D)}let N=new Set;for(let j=0;j<l.length;j++){let P=l[j].text;if(!n.has(P)||N.has(P)||E.has(j)||M.has(j))continue;let D=l[j-1]?.text;if(D==="#"||D==="."&&l[j-2]?.text!=="..")continue;if(l[j+1]?.text===":"&&(D==="{"||D===","))continue;let X=l[j].start;if(R.get(P)?.some(([F,L])=>X>=F&&X<L))continue;if(t.some((F)=>X>=F.start&&X<F.end&&F.names.has(P)))continue;N.add(P)}return N}var Pe="0.2.780";var Nr=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Yo(){let e=globalThis;return e[Nr]??=new Map,e[Nr]}function o(e,n){let t=Yo(),i=`${import.meta.url}\x00${e}`,a=t.get(i);if(a)return a;let l=n();return t.set(i,l),l.catch(()=>{if(t.get(i)===l)t.delete(i)}),l}var Qo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Qo,"<\\/$1")}import zr from"fs";class U{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(n):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var $t=new Map,ea=500;function At(e,n){if(n?.includes("g"))return new RegExp(e,n);let t=`${e}:${n||""}`;if(!$t.has(t)){if($t.size>=ea){let i=$t.keys().next().value;if(i)$t.delete(i)}$t.set(t,new RegExp(e,n))}return $t.get(t)}class Lr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),t=n.sort().join(","),i=this.pool.find((y)=>y.context.join(",")===t);if(i)return i.func;let a=this.fnCache,l=this.fnCacheMaxSize,c=(...y)=>(v)=>{try{let E=`${t}:${v}`,R=a.get(E);if(!R){if(a.size>=l){let M=a.keys().next().value;if(M)a.delete(M)}R=Function(...n,`
115
+ `+a.slice(c);else a+=l;return a}function Pr(e,n){let t=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Rt(e,n){let t=s(e),{depths:i,balanced:a}=ge(t),l=(y)=>!a||i[y]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let y of t.matchAll(c)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Pr(y[1],!0).has(n))return!0;for(let y of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Pr(y[1],!1).has(n))return!0;return!1}var Mr="",Pn,lt=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Dr=["(","[","{"],jr=[")","]","}"],Xo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Jo(e){let n=s(e),t=[];for(let i of n.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=i.index??0;t.push({text:i[0],start:a,end:a+i[0].length})}return{code:n,tokens:t}}function fs(e){if(Pn&&e===Mr)return Pn;let{code:n,tokens:t}=Jo(e),i=new Map,a=[];for(let P=0;P<t.length;P++){let D=t[P].text;if(["(","[","{"].includes(D))a.push(P);else if([")","]","}"].includes(D)){let X=a.at(-1);if(X!==void 0&&["()","[]","{}"].includes(t[X].text+D))a.pop(),i.set(X,P),i.set(P,X)}}function l(P,D){let X=[],F=P;for(let L=P;L<D;L++){if(["(","[","{"].includes(t[L].text)&&(i.get(L)??D)<D){L=i.get(L);continue}if(t[L].text===",")X.push([F,L]),F=L+1}return X.push([F,D]),X}let c=[];function y(P,D,X,F=!1){if(t[P]?.text==="...")P++;if(P>=D)return;let L=t[P].text;if(lt.test(L)){if(X.add(L),X===R)c.push({name:L,token:P,functionScoped:F});return}if(L!=="{"&&L!=="[")return;let Q=i.get(P);if(Q===void 0||Q>=D)return;for(let[te,ae]of l(P+1,Q)){let ne=te;if(L==="{")for(let ue=te;ue<ae;ue++){if(t[ue].text===":"){ne=ue+1;break}if(t[ue].text==="=")break;if(["(","[","{"].includes(t[ue].text)&&i.has(ue))ue=i.get(ue)}y(ne,ae,X,F)}}function v(P,D){let X=new Set;for(let[F,L]of l(P,D))y(F,L,X);return X}function E(P){let D=P;for(;D<t.length;D++){let X=t[D].text;if(["(","[","{"].includes(X)&&i.has(D)){D=i.get(D);continue}if([",",";",")","]","}"].includes(X))break}return t[Math.max(P,D-1)]?.end??n.length}let R=new Set,M=[];for(let P=0;P<t.length;P++)if(t[P].text==="=>"){let D=P-1,X=D,F;if(t[D]?.text===")"&&i.has(D))X=i.get(D),F=v(X+1,D);else if(t[D]&&lt.test(t[D].text))F=new Set([t[D].text]);else continue;let L=P+1,Q=t[L]?.text==="{"&&i.has(L)?t[i.get(L)].end:E(L);M.push({start:t[X].start,end:Q,bodyStart:t[L]?.start??Q,functionBody:!0,names:F})}else if(t[P].text==="("&&i.has(P)){let D=t[P-1]?.text;if(!D||qo.has(D)||!lt.test(D)&&D!=="*"&&D!=="]")continue;let X=i.get(P),F=X+1;if(t[F]?.text===":"){F++;while(F<t.length&&!["{","=>",";","="].includes(t[F].text))F++}if(t[F]?.text!=="{"||!i.has(F))continue;M.push({start:t[P].start,end:t[i.get(F)].end,bodyStart:t[F].start,functionBody:D!=="catch",names:v(P+1,X)})}function N(P){let D=P;for(;D<t.length;D++){let X=t[D].text;if(Dr.includes(X)&&i.has(D)){D=i.get(D);continue}if(X===";"||jr.includes(X))break;let F=t[D-1];if(D>P&&Xo.has(X)&&F.text!==".")break;if(D>P&&/[\n\r]/.test(n.slice(F.end,t[D].start))&&(/^[\w$]+$/.test(F.text)||jr.includes(F.text)||['"',"'","`"].includes(F.text))&&lt.test(X)&&!["in","of","instanceof"].includes(X))break}return D}let j=[];for(let P=0;P<t.length;P++){if(t[P].text!=="for")continue;let D=t[P+1]?.text==="await"?P+2:P+1;if(t[D]?.text!=="("||!i.has(D))continue;let X=i.get(D),F=X+1,L=t[F]?.text==="{"&&i.has(F)?i.get(F):N(F),Q=t[L]?.text===";"||t[L]?.text==="}"?t[L].end:t[Math.max(F,L-1)]?.end??n.length;j.push({headStart:D,headEnd:X,start:t[D].start,end:Q})}for(let P=0;P<t.length;P++){let D=t[P].text,X=t[P-1]?.text;if(X==="."||t[P+1]?.text===":")continue;if(X==="as"||X==="<")continue;if(D==="const"||D==="let"||D==="var"){let F=N(P+1),L=P+1,Q=!1,te=!1,ae=0;for(let ne=P+1;ne<=F;ne++){let ue=t[ne]?.text;if(ne<F&&Dr.includes(ue)&&i.has(ne)&&i.get(ne)<F){ne=i.get(ne);continue}if(ne<F&&ue===":"&&!te)Q=!0;else if(ne<F&&ue==="="&&ae===0)Q=!1,te=!0;else if(ne<F&&Q&&ue==="<")ae++;else if(ne<F&&Q&&ue===">"&&ae>0)ae--;else if(ne===F||ue===","&&ae===0)y(L,ne,R,D==="var"),L=ne+1,Q=!1,te=!1}}else if(D==="function"||D==="class"){let F=P+1;if(t[F]?.text==="*")F++;if(t[F]&&lt.test(t[F].text)&&t[F].text!=="extends")R.add(t[F].text),c.push({name:t[F].text,token:F})}else if(D==="import"){let F=P+1;if(t[F]?.text==="*"&&t[F+1]?.text==="as")F+=2;let L=t[F]?.text;if(L&&lt.test(L)&&L!=="type"&&t[F+1]?.text!=="("&&t[F+1]?.text!==".")R.add(L),c.push({name:L,token:F,file:!0});let Q=t[F]?.text==="{"?F:t[F+1]?.text===","&&t[F+2]?.text==="{"?F+2:-1;if(Q!==-1&&i.has(Q)){let te=i.get(Q);for(let[ae,ne]of l(Q+1,te)){let ue=ne-1;while(ue>=ae&&!lt.test(t[ue].text))ue--;if(ue>=ae&&t[ue].text!=="type")c.push({name:t[ue].text,token:ue,file:!0})}}}}return Mr=e,Pn={code:n,scopes:M,loops:j,declarations:R,sites:c,tokens:t,pairs:i},Pn}function ds(e){let n=fs(e);return{code:n.code,shadows:(t,i)=>n.scopes.some((a)=>i>=a.start&&i<a.end&&a.names.has(t))}}function Mn(e){return new Set(fs(e).declarations)}function Ie(e,n){let{scopes:t,loops:i,sites:a,tokens:l,pairs:c}=fs(e),y=Array.from({length:l.length},()=>-1),v=[];for(let j=0;j<l.length;j++){y[j]=v.length?v[v.length-1]:-1;let P=l[j].text;if(P==="{"&&c.has(j))v.push(j);else if(P==="}"&&v.length&&c.get(j)===v[v.length-1])v.pop()}let E=new Set,R=new Map;for(let j of a){if(!n.has(j.name))continue;E.add(j.token);let P=j.file?-1:y[j.token],D=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(j.functionScoped){let F=l[j.token].start,L=t.filter((Q)=>Q.functionBody&&F>=Q.bodyStart&&F<Q.end).sort((Q,te)=>Q.end-Q.bodyStart-(te.end-te.bodyStart))[0];D=L?[L.bodyStart,L.end]:[0,Number.POSITIVE_INFINITY]}else if(!j.file){let F=i.filter((L)=>j.token>L.headStart&&j.token<L.headEnd).sort((L,Q)=>L.headEnd-L.headStart-(Q.headEnd-Q.headStart))[0];if(F)D=[F.start,F.end]}let X=R.get(j.name);if(X)X.push(D);else R.set(j.name,[D])}let M=new Set;for(let j=0;j<l.length;j++){if(l[j].text!=="import"||l[j-1]?.text===".")continue;let P=j+1;if(l[P]?.text==="type")P++;if(l[P]&&lt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let D=P+1;D<c.get(P);D++)M.add(D)}let N=new Set;for(let j=0;j<l.length;j++){let P=l[j].text;if(!n.has(P)||N.has(P)||E.has(j)||M.has(j))continue;let D=l[j-1]?.text;if(D==="#"||D==="."&&l[j-2]?.text!=="..")continue;if(l[j+1]?.text===":"&&(D==="{"||D===","))continue;let X=l[j].start;if(R.get(P)?.some(([F,L])=>X>=F&&X<L))continue;if(t.some((F)=>X>=F.start&&X<F.end&&F.names.has(P)))continue;N.add(P)}return N}var Pe="0.2.782";var Nr=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Yo(){let e=globalThis;return e[Nr]??=new Map,e[Nr]}function o(e,n){let t=Yo(),i=`${import.meta.url}\x00${e}`,a=t.get(i);if(a)return a;let l=n();return t.set(i,l),l.catch(()=>{if(t.get(i)===l)t.delete(i)}),l}var Qo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Qo,"<\\/$1")}import zr from"fs";class U{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(n):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var $t=new Map,ea=500;function At(e,n){if(n?.includes("g"))return new RegExp(e,n);let t=`${e}:${n||""}`;if(!$t.has(t)){if($t.size>=ea){let i=$t.keys().next().value;if(i)$t.delete(i)}$t.set(t,new RegExp(e,n))}return $t.get(t)}class Lr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),t=n.sort().join(","),i=this.pool.find((y)=>y.context.join(",")===t);if(i)return i.func;let a=this.fnCache,l=this.fnCacheMaxSize,c=(...y)=>(v)=>{try{let E=`${t}:${v}`,R=a.get(E);if(!R){if(a.size>=l){let M=a.keys().next().value;if(M)a.delete(M)}R=Function(...n,`
116
116
  'use strict';
117
117
  try {
118
118
  return ${v};
@@ -193,7 +193,7 @@ else {
193
193
  // STX: auto-generated event bindings
194
194
  ${e.map((t,i)=>ba(t,i)).join(`
195
195
  `)}`}function Hr(e){let n=[],t=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,c=0;while(c<l){let y=i[c];if(y==="'"||y==='"'||y==="`"){let v=y;if(c++,v==="`"){let E=0;while(c<l){if(i[c]==="\\"){c+=2;continue}if(i[c]==="`"&&E===0){c++;break}if(i[c]==="$"&&i[c+1]==="{"){E++,c+=2;continue}if(i[c]==="}"&&E>0){E--,c++;continue}c++}}else while(c<l){if(i[c]==="\\"){c+=2;continue}if(i[c]===v){c++;break}c++}continue}if(y==="/"&&i[c+1]==="/"){while(c<l&&i[c]!==`
196
- `)c++;continue}if(y==="/"&&i[c+1]==="*"){c+=2;while(c<l-1&&!(i[c]==="*"&&i[c+1]==="/"))c++;c+=2;continue}if(y==="{"){a++,c++;continue}if(y==="}"){a--,c++;continue}if(a===0){let v=i.slice(c),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let N=E[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=E[0].length;continue}let R=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(R){R[1].split(",").forEach((N)=>{let j=N.trim(),P=j.indexOf(":"),D=P>=0?j.slice(P+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(D&&!D.startsWith("_")&&!t.has(D))n.push(D),t.add(D)}),c+=R[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let N=M[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=M[0].length;continue}}c++}return n}var _a=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function wa(e){let n=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(N){let j;while((j=t.exec(N))!==null){let P=j[0];if(!_a.has(P))n.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)i(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)i(l[1]);let R=/@model\s*=\s*["']([^"']*)["']/gi;while((l=R.exec(e))!==null)i(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)i(l[1]);return n}async function Le(e,n={}){let t=e,i="",a=!1,l=[],c=fi(t,{filePath:n.filePath,projectRoot:n.projectRoot});t=c.code;let y=gi(c.styles),v=Dt(t);t=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:R}=await o("stx/client-script-bundler",()=>import("./chunk-t5srthkt.js"));if(E(t))t=await R(t,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let Q=Wc(t);t=Q.code,i=qc(Q.stxImports,Q.browserImports.filter((te)=>!l.includes(te)))}if(i=`${yn(t,n.serverData)}${i}`,t=A(t),!a&&je(n.attrs||""))t=Be(t);let M=ya(n.eventBindings||[]),N=(n.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(N),P=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(j){let Q=N.replace(/\btype\s*=\s*["']module["']/i,"").trim(),te=`type="module" data-stx-scoped${P}${Q?` ${Q}`:""}`;return`${y}<script ${te}>
196
+ `)c++;continue}if(y==="/"&&i[c+1]==="*"){c+=2;while(c<l-1&&!(i[c]==="*"&&i[c+1]==="/"))c++;c+=2;continue}if(y==="{"){a++,c++;continue}if(y==="}"){a--,c++;continue}if(a===0){let v=i.slice(c),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let N=E[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=E[0].length;continue}let R=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(R){R[1].split(",").forEach((N)=>{let j=N.trim(),P=j.indexOf(":"),D=P>=0?j.slice(P+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(D&&!D.startsWith("_")&&!t.has(D))n.push(D),t.add(D)}),c+=R[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let N=M[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=M[0].length;continue}}c++}return n}var _a=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function wa(e){let n=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(N){let j;while((j=t.exec(N))!==null){let P=j[0];if(!_a.has(P))n.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)i(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)i(l[1]);let R=/@model\s*=\s*["']([^"']*)["']/gi;while((l=R.exec(e))!==null)i(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)i(l[1]);return n}async function Le(e,n={}){let t=e,i="",a=!1,l=[],c=fi(t,{filePath:n.filePath,projectRoot:n.projectRoot});t=c.code;let y=gi(c.styles),v=Dt(t);t=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:R}=await o("stx/client-script-bundler",()=>import("./chunk-mx0a1ax8.js"));if(E(t))t=await R(t,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let Q=Wc(t);t=Q.code,i=qc(Q.stxImports,Q.browserImports.filter((te)=>!l.includes(te)))}if(i=`${yn(t,n.serverData)}${i}`,t=A(t),!a&&je(n.attrs||""))t=Be(t);let M=ya(n.eventBindings||[]),N=(n.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(N),P=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(j){let Q=N.replace(/\btype\s*=\s*["']module["']/i,"").trim(),te=`type="module" data-stx-scoped${P}${Q?` ${Q}`:""}`;return`${y}<script ${te}>
197
197
  ${dn(`${i}${t}
198
198
  ${M}`)}
199
199
  </script>`}let D=$i(e),X=/function __stx_setup_/.test(t),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function L(Q){let te=Q.length>0?`
@@ -288,8 +288,8 @@ ${E.join(`
288
288
  `){let P=e[a];if(P==="\\"){a+=2;continue}if(P==="[")j=!0;else if(P==="]")j=!1;else if(P==="/"&&!j){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},N=()=>{if(i!==0)return;let j=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(j){let F=j[2].split(",").map((L)=>{let Q=L.trim().split(":");return Q[Q.length-1].trim()});for(let L of F)if(L&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(L)&&!t.has(L))n.push(L),t.add(L);return}let P=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(P){let F=P[2];if(!t.has(F))n.push(F),t.add(F);return}let D=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let F=D[1];if(!t.has(F))n.push(F),t.add(F);return}let X=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(X){let F=X[1];if(!t.has(F))n.push(F),t.add(F)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){y();continue}if(e[a]==="/"&&R()){M();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))N();a++}return n}function Tl(e){let n=[],t=0,i=0,a=null;for(let l=0;l<e.length;l++){let c=e[l];if(a){if(c==="\\"){l++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)n.push(e.slice(i,l)),i=l+1}if(i<e.length)n.push(e.slice(i));return n}function Al(e){let n=0,t=null;for(let i=0;i<e.length;i++){let a=e[i];if(t){if(a==="\\"){i++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")n++;else if(a===")"||a==="]"||a==="}")n--;else if(a==="="&&n===0){let l=e[i-1],c=e[i+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(c==="="||c===">")continue;return i}}return-1}function Il(e,n){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let i=t.index-1;while(i>=0&&/\s/.test(e[i]))i--;if(e[i]!=="}")return;let a=i,l=0,c=-1;for(;i>=0;i--){let v=e[i];if(v==="}")l++;else if(v==="{"){if(l--,l===0){c=i;break}}}if(c===-1)return;let y=e.slice(c+1,a);for(let v of Tl(y)){let E=v.trim();if(!E||E.startsWith("..."))continue;let R=Al(E);if(R===-1)continue;let M=E.slice(0,R).trim();if(!/^[A-Z_$][\w$]*$/i.test(M))continue;if(n[M]!==void 0)continue;let N=E.slice(R+1).trim();if(!N)continue;try{let j=Object.keys(n).filter(jt),P=Function(...j,`"use strict"; return (${N});`);n[M]=P(...j.map((D)=>n[D]))}catch{}}}catch{}}var Ol=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function lg(e,n){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let i=t[2].toLowerCase();if(!Ol.has(i))return null;let a=new RegExp(`<\\/?${i}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),l=S(e,(E,R)=>(a.lastIndex=R,a.exec(E)?.index===R?a.lastIndex:-1));if(i==="span"&&/\sdata-stx-scope\s*=/.test(l[0]?.token||""))return null;let c=0,y=!1;for(let E of l){if(c+=E.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(E.end).trim())return null;y=!0;break}}if(!y)return null;let v=t[0].length;return e.slice(0,v)+n+e.slice(v)}function $o(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=ce.relative(ce.resolve(i),ce.resolve(e));return!a.startsWith("..")&&!ce.isAbsolute(a)})}async function Cr(e,n,t,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,c=(ne)=>ne.split("-").map((ue)=>ue.charAt(0).toUpperCase()+ue.slice(1)).join(""),y=t.__importedComponents;if(y){for(let ne of[l,l.toLowerCase(),c(l),H(l)])if(y.has(ne))return!0}let v=[...new Set([`${l}.stx`,`${c(l)}.stx`,`${H(l)}.stx`])],E=typeof a.root==="string"?ce.resolve(a.root):void 0,R=E??ce.dirname(i),M=[],N=(ne)=>{if(ne&&!M.includes(ne))M.push(ne)},j=t.__originalFilePath;if(j)N(ce.join(ce.dirname(j),"components"));if($o(n,a))N(a._rootComponentsDir);N(n),N(a._rootComponentsDir),N(ce.join(ce.dirname(i),"components")),N(a.componentsDir);for(let ne of a.additionalComponentsDirs??[])N(ne);let P=a._targetComponentFallbackNames?.some((ne)=>ne.toLowerCase()===l.toLowerCase());if(!P)for(let ne of a._targetComponentDirs??[])N(ne);if(E)N(ce.resolve(E,"resources/views/components")),N(ce.resolve(E,"resources/components")),N(ce.resolve(E,"src/components")),N(ce.resolve(E,"components"));for(let ne of a._layerComponentDirs??[])N(ne);let D=a._pluginComponentDirs;if(Array.isArray(D))for(let ne of D)N(typeof ne==="string"?ne:null);if(N(a.fallbackComponentsDir),P)for(let ne of a._targetComponentDirs??[])N(ne);let X=a._nativePrimitivesFallback;if(X&&!X.except.some((ne)=>ne.toLowerCase()===l.toLowerCase()))N(X.dir);if(l.startsWith("./")||l.startsWith("../"))return r(ce.resolve(ce.dirname(i),`${l}.stx`));let F=ho(ce.resolve(import.meta.dir,"components")),L=M.map((ne)=>ce.isAbsolute(ne)?ne:ce.resolve(R,ne)),Q=`${v.join("\x00")}\x00\x00${L.join("\x00")}`,te=Js.get(Q);if(te!==void 0)return te;let ae=!1;e:for(let ne of L){if(ho(ne)===F)continue;for(let ue of v)if(await r(ce.join(ne,ue))){ae=!0;break e}}return Js.set(Q,ae),ae}function ho(e){let n=Ys.get(e);if(n!==void 0)return n;let t=e;try{t=Jn.realpathSync(e)}catch{}return Ys.set(e,t),t}function ug(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Kc(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function Pl(e,n,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let c;try{c=T(a,n)}catch{return l}if(c===void 0||c===null)return"";let y=String(c);if(/<\/style/i.test(y))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return y};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var xo=new Set;function bo(e,n,t,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&xo.has(a))return;xo.add(a);let l=n?` used in ${n}`:"",c=i?` Cause: ${i}.`:"",y=t.length>0?`
289
289
  searched:
290
290
  ${t.map((v)=>` - ${v}`).join(`
291
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${y}`)}function yo(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function hi(e){let n=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let i of e){let a;while((a=t.exec(i))!==null)n.add(a[1]);t.lastIndex=0}return[...n]}async function Fe(e,n,t,i,a,l,c,y=new Set,v,E=rt(a),R,M=e){let{extractVariables:N}=await o("stx/variable-extractor",()=>import("./chunk-hkh772yj.js")),j=y??new Set;if(j.has(e))return`[Circular component reference: ${e}]`;let P=new Set(j);P.add(e);let D=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let X=D&&D!=="load"&&ug(D)?D:"";try{let F=(se)=>se.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),L=M.endsWith(".stx")?M.slice(0,-4):M,Q=null,te=a.__importedComponents;if(te){let se=[L,L.toLowerCase(),F(L),H(L)];for(let le of se)if(te.has(le)){Q=te.get(le);break}}let ae=[];if(!Q){let se=[`${L}.stx`,`${F(L)}.stx`,`${H(L)}.stx`],le=[...new Set(se)],we=a.__originalFilePath,he=[];if(he.push(...c._layerComponentDirs??[]),we){let be=ce.join(ce.dirname(we),"components");he.push(be)}let He=c._rootComponentsDir;if(typeof He==="string"&&$o(i,c)&&!he.includes(He))he.push(He);if(i&&!he.includes(i))he.push(i);if(typeof He==="string"&&!he.includes(He))he.push(He);let Ce=ce.join(ce.dirname(l),"components");if(!he.includes(Ce))he.push(Ce);if(c.componentsDir&&c.componentsDir!==i&&!he.includes(c.componentsDir))he.push(c.componentsDir);for(let be of c.additionalComponentsDirs??[])if(be&&!he.includes(be))he.push(be);let ct=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(L),st=(R?.events??[]).map((be)=>be.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zt=Object.hasOwn(n,"checked")||Boolean(R?.reactiveProps?.includes("checked")),rs=Object.hasOwn(n,"value")||Boolean(R?.reactiveProps?.includes("value")),gt=!st.includes("valuechange")&&(Zt||st.includes("change")&&!rs),yt=c._nativeHostAttrs&&/^textinput$/i.test(L),ln=st.includes("update:value")&&!st.includes("input"),un=c._nativeHostAttrs&&/^video$/i.test(L),_n=c._nativeHostAttrs&&/^image$/i.test(L),_t=Ns([...Object.keys(n),...R?.reactiveProps??[]],R?.events,n),Sn=Object.hasOwn(n,"src")||Boolean(R?.reactiveProps?.includes("src")),$n=Object.hasOwn(n,"source")||Boolean(R?.reactiveProps?.includes("source")),En=un&&Sn&&!$n&&(R?.events??[]).every((be)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(be.replace(/^@/,"").split(".")[0])),mt=(be)=>Object.hasOwn(n,be)||Boolean(R?.reactiveProps?.includes(be)),kn=c._nativeHostAttrs&&/^button$/i.test(L)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!t.trim()),or=c._targetComponentFallbackNames?.some((be)=>be.toLowerCase()===L.toLowerCase())&&(!ct||gt)&&(!yt||ln)&&(!un||En)&&(!_n||_t)&&!kn;for(let be of or?[]:c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be);let wt=typeof c.root==="string"?ce.resolve(c.root):void 0,No=wt??ce.dirname(l),St=[];if(wt)St.push(ce.resolve(wt,"resources/views/components")),St.push(ce.resolve(wt,"resources/components")),St.push(ce.resolve(wt,"src/components")),St.push(ce.resolve(wt,"components"));St.push(ce.resolve(import.meta.dir,"components"));for(let be of St)if(!he.includes(be))he.push(be);let ar=c._pluginComponentDirs;if(Array.isArray(ar)){for(let be of ar)if(typeof be==="string"&&!he.includes(be))he.push(be)}if(c.fallbackComponentsDir&&!he.includes(c.fallbackComponentsDir))he.push(c.fallbackComponentsDir);if(or){for(let be of c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be)}let Rn=c._nativePrimitivesFallback;if(Rn&&!Rn.except.some((be)=>be.toLowerCase()===L.toLowerCase())&&!he.includes(Rn.dir))he.push(Rn.dir);let cr=[...new Set(he.map((be)=>{if(!be)return be;return ce.isAbsolute(be)?be:ce.resolve(No,be)}))];he.length=0,he.push(...cr);let is=`${L}\x00${l}\x00${cr.join("\x00")}`,os=qn.get(is);if(os)if(await r(os))Q=os;else qn.delete(is);if(!Q&&(L.startsWith("./")||L.startsWith("../")))Q=ce.resolve(ce.dirname(l),`${L}.stx`),ae.push(Q);else if(!Q)for(let be of he){if(!be)continue;for(let Cn of le){let Tn=ce.join(be,Cn);if(ae.push(Tn),await r(Tn)){Q=Tn;break}}if(Q)break;if(!Q)try{let Cn=await import("fs");if(!Cn.statSync(be,{throwIfNoEntry:!1})?.isDirectory())continue;let Lo=8,as=[{path:be,depth:0}];while(as.length>0&&!Q){let An=as.pop();if(An.depth>=Lo)continue;let lr;try{lr=Cn.readdirSync(An.path,{withFileTypes:!0})}catch{continue}for(let In of lr){if(!In.isDirectory())continue;if(In.name==="node_modules"||In.name.startsWith("."))continue;let ur=ce.join(An.path,In.name);for(let Bo of le){let cs=ce.join(ur,Bo);if(ae.push(cs),await r(cs)){Q=cs;break}}if(Q)break;as.push({path:ur,depth:An.depth+1})}}}catch{}if(Q)break}if(Q)qn.set(is,Q)}if(!Q||!await r(Q))return bo(e,l,ae),yo(e);v.add(Q);let ne;if(tn.has(Q)&&qs.get(Q)===po(Q))ne=tn.get(Q);else try{let se=po(Q);ne=await Bun.file(Q).text(),tn.set(Q,ne),qs.set(Q,se)}catch(se){let le=se instanceof Error?se.message:String(se);return bo(e,l,[Q],le),yo(e)}if(R)for(let se of new Set([...Object.keys(n),...R.reactiveProps??[]])){let le=se.toLowerCase();if(le.startsWith("aria-")||le.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(ne))R.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(ne)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(ne))R.consumedProps?.add(se)}let ue=new Set(["__originalFilePath","__importedComponents",Nn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[se,le]of Object.entries(a))if(!se.startsWith("__")||ue.has(se))Ee[se]=le;let Te=E.length>0?{[Vn]:[...E]}:{},Ae=t;if(t.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-gswn2c2y.js"));Ae=await se(t,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ae)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-w1w8nj6n.js"));Ae=await se(Ae,{...a,__processedComponents:j,...Te},l,c,v)}let ke=[];if(Kc(Ae)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-kygx13s7.js")),le=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Te}:E.length>0?{...a,...Te}:a;Ae=se(Ae,le,l);for(let we of Ae.matchAll(/\{\{([\s\S]*?)\}\}/g))ke.push(we[1].trim())}let Je=G(Ae),ut=[],Ct=Je.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,le)=>{let we=Je.scripts[Number(le)]||"",he=we.match(/^<script\b([^>]*)>/i)?.[1]||"",He=he.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ce=!He||["module","text/javascript","application/javascript"].includes(He),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${he}`);if(!/\bserver\b/i.test(he)&&Ce&&!ct)return ut.push(we),"";return we}),{extractSlotContent:Yn}=await o("stx/slots",()=>import("./chunk-xcaq3zyx.js")),ft=Yn(Ct),dt={};if(ft.defaultSlot?.trim())dt.default=ft.defaultSlot;for(let[se,le]of ft.namedSlots)dt[se]=le.content;let pt=a.__stx_scope_seq??={n:0,key:zs(String(a.__filename??l))},Tt=So(e,process.cwd()),it=`stx_${(Tt.endsWith(".stx")?Tt.slice(0,-4):Tt).replace(/[^a-zA-Z0-9]/g,"_")}_${++pt.n}_${pt.key}`,Ue={...Ee,$uid:it,$native:c._nativeHostAttrs===!0,...n,props:n,slot:Ct,$slots:dt,__processedComponents:P,__sections:{},__stx_signals_gate:Se(ne)||Kc(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...ke]};Il(ne,Ue);let Lt=ne,sn=de(Lt);if(sn)Lt=sn.content.trim();let Qn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Bt=[...ne.matchAll(Qn)];for(let[,se,le]of Bt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(le,Q,c.strict);let qe=[],zt=null,es=Bt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,Ye=null,Wt=null,rn=0,Ft=null;if(vl(c),es&&Qs>0){let se=El({props:n,slot:Ae,slotContext:t.trim()?kl(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:c._layerGraph?.layers.map((le)=>le.configFile),uid:it});if(se!==null){bt=`${Q}\x00${x(ne)}\x00${se}`;let le=Xn.get(bt);if(le){for(let we of le.dependencies)v.add(we);if(Qr(a,le.clientFactories),pt.n+=le.uidsConsumed,le.preservedClientExpressions.length>0){let we=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let he of le.preservedClientExpressions)we.add(he);a.__stx_preserved_client_expressions=[...we]}return le.output}Ye=new Set(v),Wt=Gr(a),rn=pt.n,Ft=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Vt=new Set;for(let se of Bt){let le=se[1]||"",we=se[2]||"",he=le.includes("server");if(je(le)&&we.trim())we=Be(we);if(he&&we){for(let Ce of De(we))Vt.add(Ce);try{await N(we,Ue,Q,{onFailure:(Ce)=>{if(Ce.kind!=="unknown")zt=Ce.kind}})}catch(Ce){}}if(!he){let Ce=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ce.includes("{{")&&Ce.includes("}}"),st=Ce.includes("{!!")&&Ce.includes("!!}");if(ct||st)Ce=bi(Ce,Ue,Q);let Zt=le.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");qe.push(`<script${Zt}>${Ce}</script>`)}}let Xe=G(ne).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ut=Xe?Xe[1]:"",ts=Xe?Xe[2]:"",Qe="",ee=Ut&&/\bscoped\b/i.test(Ut);if(Xe)Qe=`<style${Ut}>${Pl(ts,Ue,Q)}</style>`;let re=Lt;if(re=re.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Xe)re=re.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,le=[];if(re=re.replace(se,(we,he)=>{let He=he.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(He)le.push(`<style${He[1]}>${He[2]}</style>`);return""}),re=re.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),le.length>0)Qe=`${Qe}${le.join(`
292
- `)}`}if(t&&re.includes("{{ text || slot }}"))re=re.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:me}=await o("stx/slots",()=>import("./chunk-xcaq3zyx.js")),{defaultSlot:ye,namedSlots:Re}=ft,Ke=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ct),et=c._nativeHostAttrs===!0&&qe.length>0||Ke&&qe.length>0||qe.some((se)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(se)),ns=(se)=>et?Vi(se,it):se,ss=new Map([...Re].map(([se,le])=>[se,{...le,content:ns(le.content)}]));re=await me(re,ns(ye),ss,Ue,et?it:"");let on=hi(qe),Ht=(Array.isArray(Ue.__stx_client_signal_names)?Ue.__stx_client_signal_names:[]).filter((se)=>!Vt.has(se));if(on.length>0||Ht.length>0)Ue.__stx_client_signal_names=[...new Set([...Ht,...on])];else delete Ue.__stx_client_signal_names;let Kt=E.filter((se)=>!Vt.has(se)&&!(se in n));if(Kt.length>0)Ue[Vn]=Kt;let an={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:ce.dirname(Q),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||et||qe.length===0,defaultLayout:void 0};Ue.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:cn}=await o("stx/process",()=>import("./chunk-g3yppmn6.js")),tt=await cn(re,Ue,Q,an,v),ot=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let se of tt.matchAll(/\{\{([\s\S]*?)\}\}/g))ot.add(se[1].trim());if(ot.size>0)a.__stx_preserved_client_expressions=[...ot];let nt=it,Ze=tt;if(et){let se="";if(Object.keys(n).length>0)try{se=` data-stx-props="${Ks(JSON.stringify(n))}"`}catch{}let le=X?` stx-hydrate="${Ks(X)}"`:"",we=Object.fromEntries(Object.entries(dt).map(([gt,yt])=>[gt,Boolean(yt)])),he=Object.keys(we).length>0?` data-stx-slots="${Ks(JSON.stringify(we))}"`:"",He=` data-stx-scope="${nt}"${se}${he}${le}`,Ce=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(tt),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(tt),st=Ce?"span":"div",Zt=ct&&c._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Ce||ct?' style="display:contents"':"";Ze=lg(tt,He)??`<${st}${He} data-stx-component-wrapper${Zt}>${tt}</${st}>`;let rs=await Promise.all(qe.map(async(gt)=>{let yt=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!yt)return gt;let[,ln,un]=yt,_n=fo(gt,Ue,Q);if(_n!==null)return _n;let _t=await Dl(un,Q,c.buildMode==="compile"),Sn=yn(_t.clientCode,Me(Ue)),{vendorStyleTags:$n}=_t,En=Sn?`function(__scopeId) {
291
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${y}`)}function yo(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function hi(e){let n=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let i of e){let a;while((a=t.exec(i))!==null)n.add(a[1]);t.lastIndex=0}return[...n]}async function Fe(e,n,t,i,a,l,c,y=new Set,v,E=rt(a),R,M=e){let{extractVariables:N}=await o("stx/variable-extractor",()=>import("./chunk-abzp0cp9.js")),j=y??new Set;if(j.has(e))return`[Circular component reference: ${e}]`;let P=new Set(j);P.add(e);let D=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let X=D&&D!=="load"&&ug(D)?D:"";try{let F=(se)=>se.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),L=M.endsWith(".stx")?M.slice(0,-4):M,Q=null,te=a.__importedComponents;if(te){let se=[L,L.toLowerCase(),F(L),H(L)];for(let le of se)if(te.has(le)){Q=te.get(le);break}}let ae=[];if(!Q){let se=[`${L}.stx`,`${F(L)}.stx`,`${H(L)}.stx`],le=[...new Set(se)],we=a.__originalFilePath,he=[];if(he.push(...c._layerComponentDirs??[]),we){let be=ce.join(ce.dirname(we),"components");he.push(be)}let He=c._rootComponentsDir;if(typeof He==="string"&&$o(i,c)&&!he.includes(He))he.push(He);if(i&&!he.includes(i))he.push(i);if(typeof He==="string"&&!he.includes(He))he.push(He);let Ce=ce.join(ce.dirname(l),"components");if(!he.includes(Ce))he.push(Ce);if(c.componentsDir&&c.componentsDir!==i&&!he.includes(c.componentsDir))he.push(c.componentsDir);for(let be of c.additionalComponentsDirs??[])if(be&&!he.includes(be))he.push(be);let ct=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(L),st=(R?.events??[]).map((be)=>be.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zt=Object.hasOwn(n,"checked")||Boolean(R?.reactiveProps?.includes("checked")),rs=Object.hasOwn(n,"value")||Boolean(R?.reactiveProps?.includes("value")),gt=!st.includes("valuechange")&&(Zt||st.includes("change")&&!rs),yt=c._nativeHostAttrs&&/^textinput$/i.test(L),ln=st.includes("update:value")&&!st.includes("input"),un=c._nativeHostAttrs&&/^video$/i.test(L),_n=c._nativeHostAttrs&&/^image$/i.test(L),_t=Ns([...Object.keys(n),...R?.reactiveProps??[]],R?.events,n),Sn=Object.hasOwn(n,"src")||Boolean(R?.reactiveProps?.includes("src")),$n=Object.hasOwn(n,"source")||Boolean(R?.reactiveProps?.includes("source")),En=un&&Sn&&!$n&&(R?.events??[]).every((be)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(be.replace(/^@/,"").split(".")[0])),mt=(be)=>Object.hasOwn(n,be)||Boolean(R?.reactiveProps?.includes(be)),kn=c._nativeHostAttrs&&/^button$/i.test(L)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!t.trim()),or=c._targetComponentFallbackNames?.some((be)=>be.toLowerCase()===L.toLowerCase())&&(!ct||gt)&&(!yt||ln)&&(!un||En)&&(!_n||_t)&&!kn;for(let be of or?[]:c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be);let wt=typeof c.root==="string"?ce.resolve(c.root):void 0,No=wt??ce.dirname(l),St=[];if(wt)St.push(ce.resolve(wt,"resources/views/components")),St.push(ce.resolve(wt,"resources/components")),St.push(ce.resolve(wt,"src/components")),St.push(ce.resolve(wt,"components"));St.push(ce.resolve(import.meta.dir,"components"));for(let be of St)if(!he.includes(be))he.push(be);let ar=c._pluginComponentDirs;if(Array.isArray(ar)){for(let be of ar)if(typeof be==="string"&&!he.includes(be))he.push(be)}if(c.fallbackComponentsDir&&!he.includes(c.fallbackComponentsDir))he.push(c.fallbackComponentsDir);if(or){for(let be of c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be)}let Rn=c._nativePrimitivesFallback;if(Rn&&!Rn.except.some((be)=>be.toLowerCase()===L.toLowerCase())&&!he.includes(Rn.dir))he.push(Rn.dir);let cr=[...new Set(he.map((be)=>{if(!be)return be;return ce.isAbsolute(be)?be:ce.resolve(No,be)}))];he.length=0,he.push(...cr);let is=`${L}\x00${l}\x00${cr.join("\x00")}`,os=qn.get(is);if(os)if(await r(os))Q=os;else qn.delete(is);if(!Q&&(L.startsWith("./")||L.startsWith("../")))Q=ce.resolve(ce.dirname(l),`${L}.stx`),ae.push(Q);else if(!Q)for(let be of he){if(!be)continue;for(let Cn of le){let Tn=ce.join(be,Cn);if(ae.push(Tn),await r(Tn)){Q=Tn;break}}if(Q)break;if(!Q)try{let Cn=await import("fs");if(!Cn.statSync(be,{throwIfNoEntry:!1})?.isDirectory())continue;let Lo=8,as=[{path:be,depth:0}];while(as.length>0&&!Q){let An=as.pop();if(An.depth>=Lo)continue;let lr;try{lr=Cn.readdirSync(An.path,{withFileTypes:!0})}catch{continue}for(let In of lr){if(!In.isDirectory())continue;if(In.name==="node_modules"||In.name.startsWith("."))continue;let ur=ce.join(An.path,In.name);for(let Bo of le){let cs=ce.join(ur,Bo);if(ae.push(cs),await r(cs)){Q=cs;break}}if(Q)break;as.push({path:ur,depth:An.depth+1})}}}catch{}if(Q)break}if(Q)qn.set(is,Q)}if(!Q||!await r(Q))return bo(e,l,ae),yo(e);v.add(Q);let ne;if(tn.has(Q)&&qs.get(Q)===po(Q))ne=tn.get(Q);else try{let se=po(Q);ne=await Bun.file(Q).text(),tn.set(Q,ne),qs.set(Q,se)}catch(se){let le=se instanceof Error?se.message:String(se);return bo(e,l,[Q],le),yo(e)}if(R)for(let se of new Set([...Object.keys(n),...R.reactiveProps??[]])){let le=se.toLowerCase();if(le.startsWith("aria-")||le.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(ne))R.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(ne)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(ne))R.consumedProps?.add(se)}let ue=new Set(["__originalFilePath","__importedComponents",Nn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[se,le]of Object.entries(a))if(!se.startsWith("__")||ue.has(se))Ee[se]=le;let Te=E.length>0?{[Vn]:[...E]}:{},Ae=t;if(t.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-kkkpgnj3.js"));Ae=await se(t,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ae)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-smsjcnvm.js"));Ae=await se(Ae,{...a,__processedComponents:j,...Te},l,c,v)}let ke=[];if(Kc(Ae)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-xcrrsq09.js")),le=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Te}:E.length>0?{...a,...Te}:a;Ae=se(Ae,le,l);for(let we of Ae.matchAll(/\{\{([\s\S]*?)\}\}/g))ke.push(we[1].trim())}let Je=G(Ae),ut=[],Ct=Je.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,le)=>{let we=Je.scripts[Number(le)]||"",he=we.match(/^<script\b([^>]*)>/i)?.[1]||"",He=he.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ce=!He||["module","text/javascript","application/javascript"].includes(He),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${he}`);if(!/\bserver\b/i.test(he)&&Ce&&!ct)return ut.push(we),"";return we}),{extractSlotContent:Yn}=await o("stx/slots",()=>import("./chunk-ay2by639.js")),ft=Yn(Ct),dt={};if(ft.defaultSlot?.trim())dt.default=ft.defaultSlot;for(let[se,le]of ft.namedSlots)dt[se]=le.content;let pt=a.__stx_scope_seq??={n:0,key:zs(String(a.__filename??l))},Tt=So(e,process.cwd()),it=`stx_${(Tt.endsWith(".stx")?Tt.slice(0,-4):Tt).replace(/[^a-zA-Z0-9]/g,"_")}_${++pt.n}_${pt.key}`,Ue={...Ee,$uid:it,$native:c._nativeHostAttrs===!0,...n,props:n,slot:Ct,$slots:dt,__processedComponents:P,__sections:{},__stx_signals_gate:Se(ne)||Kc(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...ke]};Il(ne,Ue);let Lt=ne,sn=de(Lt);if(sn)Lt=sn.content.trim();let Qn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Bt=[...ne.matchAll(Qn)];for(let[,se,le]of Bt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(le,Q,c.strict);let qe=[],zt=null,es=Bt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,Ye=null,Wt=null,rn=0,Ft=null;if(vl(c),es&&Qs>0){let se=El({props:n,slot:Ae,slotContext:t.trim()?kl(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:c._layerGraph?.layers.map((le)=>le.configFile),uid:it});if(se!==null){bt=`${Q}\x00${x(ne)}\x00${se}`;let le=Xn.get(bt);if(le){for(let we of le.dependencies)v.add(we);if(Qr(a,le.clientFactories),pt.n+=le.uidsConsumed,le.preservedClientExpressions.length>0){let we=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let he of le.preservedClientExpressions)we.add(he);a.__stx_preserved_client_expressions=[...we]}return le.output}Ye=new Set(v),Wt=Gr(a),rn=pt.n,Ft=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Vt=new Set;for(let se of Bt){let le=se[1]||"",we=se[2]||"",he=le.includes("server");if(je(le)&&we.trim())we=Be(we);if(he&&we){for(let Ce of De(we))Vt.add(Ce);try{await N(we,Ue,Q,{onFailure:(Ce)=>{if(Ce.kind!=="unknown")zt=Ce.kind}})}catch(Ce){}}if(!he){let Ce=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ce.includes("{{")&&Ce.includes("}}"),st=Ce.includes("{!!")&&Ce.includes("!!}");if(ct||st)Ce=bi(Ce,Ue,Q);let Zt=le.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");qe.push(`<script${Zt}>${Ce}</script>`)}}let Xe=G(ne).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ut=Xe?Xe[1]:"",ts=Xe?Xe[2]:"",Qe="",ee=Ut&&/\bscoped\b/i.test(Ut);if(Xe)Qe=`<style${Ut}>${Pl(ts,Ue,Q)}</style>`;let re=Lt;if(re=re.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Xe)re=re.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,le=[];if(re=re.replace(se,(we,he)=>{let He=he.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(He)le.push(`<style${He[1]}>${He[2]}</style>`);return""}),re=re.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),le.length>0)Qe=`${Qe}${le.join(`
292
+ `)}`}if(t&&re.includes("{{ text || slot }}"))re=re.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:me}=await o("stx/slots",()=>import("./chunk-ay2by639.js")),{defaultSlot:ye,namedSlots:Re}=ft,Ke=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ct),et=c._nativeHostAttrs===!0&&qe.length>0||Ke&&qe.length>0||qe.some((se)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(se)),ns=(se)=>et?Vi(se,it):se,ss=new Map([...Re].map(([se,le])=>[se,{...le,content:ns(le.content)}]));re=await me(re,ns(ye),ss,Ue,et?it:"");let on=hi(qe),Ht=(Array.isArray(Ue.__stx_client_signal_names)?Ue.__stx_client_signal_names:[]).filter((se)=>!Vt.has(se));if(on.length>0||Ht.length>0)Ue.__stx_client_signal_names=[...new Set([...Ht,...on])];else delete Ue.__stx_client_signal_names;let Kt=E.filter((se)=>!Vt.has(se)&&!(se in n));if(Kt.length>0)Ue[Vn]=Kt;let an={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:ce.dirname(Q),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||et||qe.length===0,defaultLayout:void 0};Ue.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:cn}=await o("stx/process",()=>import("./chunk-z5pvmtd7.js")),tt=await cn(re,Ue,Q,an,v),ot=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let se of tt.matchAll(/\{\{([\s\S]*?)\}\}/g))ot.add(se[1].trim());if(ot.size>0)a.__stx_preserved_client_expressions=[...ot];let nt=it,Ze=tt;if(et){let se="";if(Object.keys(n).length>0)try{se=` data-stx-props="${Ks(JSON.stringify(n))}"`}catch{}let le=X?` stx-hydrate="${Ks(X)}"`:"",we=Object.fromEntries(Object.entries(dt).map(([gt,yt])=>[gt,Boolean(yt)])),he=Object.keys(we).length>0?` data-stx-slots="${Ks(JSON.stringify(we))}"`:"",He=` data-stx-scope="${nt}"${se}${he}${le}`,Ce=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(tt),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(tt),st=Ce?"span":"div",Zt=ct&&c._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Ce||ct?' style="display:contents"':"";Ze=lg(tt,He)??`<${st}${He} data-stx-component-wrapper${Zt}>${tt}</${st}>`;let rs=await Promise.all(qe.map(async(gt)=>{let yt=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!yt)return gt;let[,ln,un]=yt,_n=fo(gt,Ue,Q);if(_n!==null)return _n;let _t=await Dl(un,Q,c.buildMode==="compile"),Sn=yn(_t.clientCode,Me(Ue)),{vendorStyleTags:$n}=_t,En=Sn?`function(__scopeId) {
293
293
  ${Sn}
294
294
  return (${_t.factoryBody})(__scopeId);
295
295
  }`:_t.factoryBody,mt=X?null:ys(a,En),kn=mt?`window.__stxComponentFactories[${JSON.stringify(mt)}](${JSON.stringify(nt)});`:`(${En})(${JSON.stringify(nt)});`;if(X)return`${$n}<script type="stx/island" data-stx-island="${nt}" data-stx-scoped data-stx-owner="${nt}"${ln}>${kn}</script>`;return`${$n}<script data-stx-scoped data-stx-run="always" data-stx-owner="${nt}"${ln}>${kn}</script>`}));if(Ze=Ze+`
@@ -315,7 +315,7 @@ ${$e.yellow}${$e.bold}Message:${$e.reset} ${n}
315
315
  `,y)R+=`
316
316
  ${$e.blue}${$e.bold}Context:${$e.reset}
317
317
  ${$e.dim}${y}${$e.reset}
318
- `;return R}function fe(){tn.clear(),qs.clear(),qn.clear(),Js.clear(),Ys.clear(),Xn.clear()}function Wh(){return{size:tn.size,maxSize:500}}var Zs=b(128);async function Dl(e,n,t){let i=x(e,n,t),a=Zs.get(i);if(a){if(Ds(a.deps))return a;Zs.delete(i)}let l=fi(e,{filePath:n,projectRoot:process.cwd()}),c=l.code,y=gi(l.styles);c=Dt(c).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-t5srthkt.js")),R=[],M=!1;if(v(c)){let L=c;c=await E(L,n,{projectRoot:process.cwd(),minify:t,collectInputs:R}),M=c===L}let{stripStxRuntimeImports:N}=await o("stx/signal-processing",()=>import("./chunk-w3aw4vw0.js"));c=N(c);let j=A(c),P=Cl(j),D=new Set(z(j,!0).split(",").map((L)=>L.trim())),X=`function(__scopeId) {
318
+ `;return R}function fe(){tn.clear(),qs.clear(),qn.clear(),Js.clear(),Ys.clear(),Xn.clear()}function Wh(){return{size:tn.size,maxSize:500}}var Zs=b(128);async function Dl(e,n,t){let i=x(e,n,t),a=Zs.get(i);if(a){if(Ds(a.deps))return a;Zs.delete(i)}let l=fi(e,{filePath:n,projectRoot:process.cwd()}),c=l.code,y=gi(l.styles);c=Dt(c).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-mx0a1ax8.js")),R=[],M=!1;if(v(c)){let L=c;c=await E(L,n,{projectRoot:process.cwd(),minify:t,collectInputs:R}),M=c===L}let{stripStxRuntimeImports:N}=await o("stx/signal-processing",()=>import("./chunk-gpt1v08p.js"));c=N(c);let j=A(c),P=Cl(j),D=new Set(z(j,!0).split(",").map((L)=>L.trim())),X=`function(__scopeId) {
319
319
  ${at("const",[...al,...P],j)}
320
320
  const __scope = window.stx._scopes = window.stx._scopes || {};
321
321
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ul,dl}from"./chunk-9f6qx8b9.js";import{H,yr,Is,Os,ri,si,Ns,wr,Ne,pe,G,xr,ie,J,I,rt,Sr,ci,Cr,Fe,r,p,V,wn}from"./chunk-6sz69gvp.js";import{f,R,st,d}from"./chunk-bq9xf8nq.js";import{n}from"./chunk-w0qzmr1n.js";import{se}from"./chunk-he85ksa7.js";import{s}from"./chunk-m4mpyq3d.js";import{g}from"./chunk-0dve54ne.js";import{createHash as Rt}from"crypto";import Q from"fs";import K from"path";import{decode as on,generateThumbHash as an}from"ts-images";import{createImageDeliveryCatalog as bt}from"ts-images/delivery";import De from"fs";function Ce(e,t,i){let o=Buffer.alloc(i),a=De.readSync(e,o,0,i,t);return o.subarray(0,a)}function je(e){if(e.length<25)return!1;let t=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(t(0,4)!=="RIFF"||t(8,12)!=="WEBP")return!1;let i=t(12,16);if(i==="VP8X")return(e[20]&16)!==0;if(i==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Me(e){let t;try{t=De.openSync(e,"r");let i=Ce(t,0,33);if(i.length>=3&&i[0]===255&&i[1]===216&&i[2]===255)return"none";if(i.length>=26&&i[0]===137&&i.toString("latin1",1,4)==="PNG"){let o=i[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ce(t,a,8);if(l.length<8)return"unknown";let m=l.toString("latin1",4,8);if(m==="tRNS")return"possible";if(m==="IDAT"||m==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(i.length>=25&&i.toString("latin1",0,4)==="RIFF"&&i.toString("latin1",8,12)==="WEBP"){if(je(i))return"possible";let o=i.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(t!==void 0)De.closeSync(t)}}import Yt from"fs";import Re from"os";import{join as gt}from"path";import{fileURLToPath as mt}from"url";import{Worker as pt}from"worker_threads";var ke=Symbol("stx.image-worker.unavailable");function Qt(e=typeof Re.availableParallelism==="function"?Re.availableParallelism():Re.cpus().length){return Math.max(1,Math.min(2,e-1))}var Ae=0,yt=[];async function en(){if(Ae<Qt()){Ae++;return}await new Promise((e)=>yt.push(e)),Ae++}function tn(){Ae--,yt.shift()?.()}var nn="@stacksjs/stx/builtins/image-warmup-worker";function rn(e=process.cwd()){let t=import.meta.url.endsWith(".ts")?"ts":"js";try{let i=new URL(`./image-warmup-worker.${t}`,import.meta.url);if(i.protocol==="file:"&&Yt.existsSync(mt(i)))return mt(i)}catch{}try{let i=typeof Bun<"u"?Bun.resolveSync(nn,e):void 0;return i&&sn(i)?i:void 0}catch{return}}function sn(e,t=process.env){let i=e.replace(/\\/g,"/");if(i.split("/").some((a)=>/@\d[^/]*@@@\d+$/.test(a)))return!1;return![t.BUN_INSTALL_CACHE_DIR,gt(t.BUN_INSTALL||gt(Re.homedir(),".bun"),"install","cache")].filter((a)=>!!a).map((a)=>`${a.replace(/\\/g,"/").replace(/\/$/,"")}/`).some((a)=>i.startsWith(a))}var ht=!1;function he(e){if(!ht)ht=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return ke}function Le(e){return e instanceof Error?e.message:String(e)}async function ze(e,t){if(typeof pt!=="function")return he("node:worker_threads has no Worker in this runtime");let i=rn();if(!i)return he("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await en();try{return await new Promise((o,a)=>{let c;try{c=new pt(i)}catch(y){o(he(`could not start ${i}: ${Le(y)}`));return}let l=!1,m=!1,u=(y)=>{if(m)return;m=!0,y(),c.terminate()};c.on("message",(y)=>{if(y.type==="ready"){l=!0,c.postMessage({task:e,args:t});return}if(y.type==="result"){u(()=>o(y.value));return}let v=Error(y.error?.message??"image worker failed");if(y.error?.name)v.name=y.error.name;if(y.error?.stack)v.stack=y.error.stack;u(()=>a(v))}),c.on("error",(y)=>{u(()=>l?a(y instanceof Error?y:Error(Le(y)||"image worker crashed")):o(he(`the worker failed before it was ready: ${Le(y)}`)))}),c.on("exit",(y)=>{u(()=>l?a(Error("image worker exited before it finished")):o(he(`the worker exited with code ${y} before it was ready`)))})})}finally{tn()}}var cn=new Set([".avif",".jpeg",".jpg",".png",".webp"]),ln=[320,640,960,1280,1920],ye="/_stx/images",un=`stx:${ye}:alpha-1`,fn=`stx:${ye}:opaque-1`,dn=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Pe;function gn(e,t){let i=K.dirname(Bun.resolveSync(e,t));while(i!==K.dirname(i)){let o=K.join(i,"package.json");if(Q.existsSync(o)){let a=JSON.parse(Q.readFileSync(o,"utf8"));if(a.name===e)return a.version}i=K.dirname(i)}return}function xt(){if(Pe!==void 0)return Pe;let e;try{e=K.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Pe=dn.map((t)=>{let i;try{i=e?gn(t,e):void 0}catch{}return`${t.replace("@stacksjs/","")}@${i??"unknown"}`}).join("+"),Pe}var vt=Symbol.for("stx.image-delivery");function be(){let e=globalThis;return e[vt]??={catalog:new Map,transparent:new Set},e[vt]}var wt=new Set;function mn(e){return`/${e.split(K.sep).map(encodeURIComponent).join("/")}`}function pn(e){let t=K.extname(e),i=e.slice(0,-t.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=Rt("sha256").update(e).digest("hex").slice(0,8);return`${i||"image"}-${o}`}function $t(e,t=`stx:${ye}`){let i=(o)=>`${ye}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:t,async stat(o){let a=K.join(e,o);try{let c=await Q.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:i(o)}:null}catch{return null}},async write(o,a){let c=K.join(e,o);await Q.promises.mkdir(K.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await Q.promises.writeFile(l,a),await Q.promises.rename(l,c),{bytes:a.byteLength,path:c,url:i(o)}},url:i}}async function At(e,t=e){let i=await Q.promises.readdir(t,{withFileTypes:!0});i.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of i){let c=K.join(t,a.name);if(a.isDirectory()){o.push(...await At(e,c));continue}if(!a.isFile()||!cn.has(K.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:K.relative(e,c)})}return o}function St(e,t){return e.map((i)=>({key:mn(i.relativePath),input:i.absolutePath,name:pn(i.relativePath),...hn(i.absolutePath)?{options:{storage:t}}:{}}))}function hn(e){return Me(e)==="possible"}function yn(e){for(let t=3;t<e.length;t+=4)if(e[t]!==255)return!0;return!1}async function bn(e){let t=Object.entries(e).filter(([,a])=>a.fallback.format==="png"),i=new Set,o=8;for(let a=0;a<t.length;a+=8)await Promise.all(t.slice(a,a+8).map(async([c,l])=>{let m=l.variants.filter((u)=>u.format==="png").sort((u,y)=>u.width-y.width)[0];try{let u=await on(new Uint8Array(await Q.promises.readFile(m?.path??l.fallback.path)));if(yn(u.data))i.add(c)}catch{i.add(c)}}));return i}function xn(e,t){let i=[];for(let o of t){let a=e[o],c=a?.variants.filter((m)=>m.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((m)=>{let u;try{return u=Q.openSync(m.path,"r"),!je(Ce(u,0,32))}catch{return!0}finally{if(u!==void 0)Q.closeSync(u)}}))continue;if(a.variants=a.variants.filter((m)=>m.format!=="webp"),delete a.sources.webp,i.push(o),!wt.has(o))wt.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return i}async function vn(e){let t=[],i=8;for(let o=0;o<e.length;o+=8){let a=e.slice(o,o+8),c=await Promise.all(a.map(async(l)=>{try{return await an(l.absolutePath),l}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${l.relativePath}`),null}}));t.push(...c.filter((l)=>l!==null))}return t}function Ue(e){return K.join(e,"undecodable.json")}function $n(e){try{let t=Q.readFileSync(Ue(e),"utf-8"),i=JSON.parse(t);return i&&typeof i==="object"?i:{}}catch{return{}}}function Sn(e,t){try{Q.mkdirSync(K.dirname(Ue(e)),{recursive:!0}),Q.writeFileSync(Ue(e),JSON.stringify(t))}catch{}}function Ct(e){try{let t=Q.statSync(e);return{mtimeMs:t.mtimeMs,size:t.size}}catch{return}}function kt(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let t=e.split(/[?#]/,1)[0];if(!t)return;try{return`/${t.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function Do(e){let t=kt(e);return t?be().catalog.get(t):void 0}function Mo(e){let t=kt(e);return t?be().transparent.has(t):!1}function Lo(e){let t=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),i=t(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:t(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<i).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function Th(e){let t=Do(e);if(!t)return;return{src:t.fallback.url,srcset:t.sources[t.fallback.format]||"",sources:Lo(t).map(({format:i,srcset:o})=>({type:`image/${i}`,srcset:o})),width:t.source.width,height:t.source.height,placeholder:Mo(e)?void 0:t.placeholder?.dataUrl}}function cs(){let e=be();e.catalog=new Map,e.transparent=new Set}function Cn(e){let t=be();t.catalog=new Map(e.entries),t.transparent=new Set(e.transparent)}async function $h(e,t,i={}){if(!e||!Q.existsSync(e))return cs(),{count:0,fingerprint:""};if(i.offThread){let h=await ze("delivery",{publicDir:e,outputDir:t});if(h!==ke)return Cn(h.state),h.result}let o=await At(e);if(o.length===0)return cs(),{count:0,fingerprint:""};let a=$n(t),c=o.filter((h)=>{let w=a[h.relativePath];if(!w)return!0;let S=Ct(h.absolutePath);return!S||S.mtimeMs!==w.mtimeMs||S.size!==w.size});if(c.length===0)return cs(),{count:0,fingerprint:""};let l=$t(K.join(t,"_stx","images"),`${un}:${xt()}`),m={outDir:K.join(t,"_stx","images"),storage:$t(K.join(t,"_stx","images"),`${fn}:${xt()}`),baseUrl:ye,widths:ln,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},u=c,y;try{y=await bt({...m,entries:St(c,l)})}catch(h){if(u=await vn(c),u.length===c.length)throw h;let w=new Set(u.map((A)=>A.relativePath)),S=!1;for(let A of c){if(w.has(A.relativePath))continue;let P=Ct(A.absolutePath);if(!P)continue;a[A.relativePath]=P,S=!0}if(S)Sn(t,a);if(u.length===0)return cs(),{count:0,fingerprint:""};y=await bt({...m,entries:St(u,l)})}let v=await bn(y.entries),b=xn(y.entries,v),C=be();C.catalog=new Map(Object.entries(y.entries)),C.transparent=v;let x=v.size===0&&b.length===0?y.fingerprint:Rt("sha256").update(y.fingerprint).update(JSON.stringify({transparent:[...v].sort(),droppedWebp:b.sort()})).digest("hex");return{count:u.length,fingerprint:x}}class Pt{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let t of e.aliases)this.builtins.set(t.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,t,i,o){let a=ri(e,o);if(a!==void 0)return a;for(let c of si(e,t,i,o))if(await r(c))return c;return null}}var ue=new Pt;var re="\x00stx-boolean-attribute";function We(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var Rn=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function He(e){let t=e.toLowerCase();return t.startsWith("aria-")||t.startsWith("data-")||Rn.has(t)}function oe(e,t){let i=[];for(let[o,a]of Object.entries(e.static)){if(t.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)i.push(p(c));continue}if(a===re){i.push(p(c));continue}i.push(`${p(c)}="${wn(c,We(String(a)))}"`)}return i}function ae(e,t){let i=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(t.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){i.push(p(c));continue}if(typeof a==="object")continue;i.push(`${p(c)}="${wn(c,We(String(a)))}"`)}return i}function An(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var qe={name:"StxLink",aliases:["stx-link"],render(e,t,i){let o=An(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",m=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,u=[];if(o.reactive)u.push(`:href="${n(o.value)}"`);else u.push(`href="${n(wr(o.value,"navigable"))}"`);if(a)u.push(`class="${n(a)}"`);if(u.push("data-stx-link"),u.push(`data-stx-active-class="${n(c)}"`),u.push(`data-stx-exact-active-class="${n(l)}"`),m)u.push("data-stx-prefetch");let y=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(y)u.push(`data-stx-active-match="${n(y)}"`);let v=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return u.push(...oe(e,v)),u.push(...ae(e,v)),`<a ${u.join(" ")}>${t}</a>`}};var kn=new Map;function Xe(e){if(!e)return;let t=e.split("?")[0].split("#")[0];return kn.get(t)}var Pn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Ze=[320,640,768,1024,1280,1536,1920];function Z(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}function Ie(e,t,i=!1){let o=e.serverDynamic[t];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[t];if(a!==void 0)return a!=="false"&&a!==!1;return i}function Ve(e){if(e.includes("(")||e.includes(","))return e;let t=e.trim().split(/\s+/),i=[];for(let o of t)if(o.includes(":")){let[a,c]=o.split(":"),l=Pn[a];if(l)i.push(`(max-width: ${l}px) ${c}`);else{let m=Number.parseInt(a);if(!Number.isNaN(m))i.push(`(max-width: ${m}px) ${c}`)}}else i.push(o);return i.join(", ")}function Ge(e,t,i,o){return t.map((a)=>`${xe(e,a,void 0,i,o)} ${a}w`).join(", ")}function In(e,t,i,o,a){return t.map((c)=>{let l=i?i*c:void 0;return`${xe(e,l,void 0,o,a)} ${c}x`}).join(", ")}function xe(e,t,i,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(t)c.push(`w_${t}`);if(i)c.push(`h_${i}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(t)c.set("w",String(t));if(i)c.set("h",String(i));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(t)c.set("width",String(t));if(i)c.set("height",String(i));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function _n(e){return`var s=this.style;${e.map((t)=>`s.${t}=''`).join(";")}`}function En(e,t,i="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}"><rect width="100%" height="100%" fill="${i}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var Ke={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,t,i){let o=Z(e,"src")||"",a=Do(o),c=Z(e,"alt")||"",l=Z(e,"width")||(a?String(a.source.width):void 0),m=Z(e,"height")||(a?String(a.source.height):void 0),u=Z(e,"sizes"),y=Z(e,"srcset"),v=Z(e,"densities"),b=Z(e,"format"),C=Mo(o)||Xe(o)?.transparent===!0,x=Z(e,"placeholder")||(a&&!C?"thumbhash":void 0),h=Z(e,"placeholderColor")||"#e5e7eb",w=Z(e,"provider"),S=Z(e,"class")||Z(e,"className")||"",A=Z(e,"style")||"",P=Z(e,"objectFit")||Z(e,"fit"),k=Z(e,"objectPosition")||Z(e,"position"),O=Z(e,"quality"),W=Ie(e,"lazy",!0),z=Ie(e,"preload",!1),U=Ie(e,"priority",!1),q=Z(e,"loading"),B=Z(e,"decoding")||"async",N=!!a||Ie(e,"picture",!1)||!!b,T=l?Number.parseInt(l):void 0,j=m?Number.parseInt(m):void 0,F=y||"",X="";if(a)F=a.sources[a.fallback.format]||"",X=u?Ve(u):"100vw";else if(!F&&u&&w&&w!=="local"&&w!=="static")F=Ge(o,Ze,w,b),X=Ve(u);else if(!F&&v){let _=v.split(/\s+/).map((E)=>Number.parseFloat(E.replace("x","")));F=In(o,_,T,w,b)}else if(u)X=Ve(u);let L=[];if(A)L.push(A);if(P)L.push(`object-fit:${P}`);if(k)L.push(`object-position:${k}`);if(T&&j)L.push(`aspect-ratio:${T}/${j}`);let D=[],ce=x==="blur"||x==="color"||x==="thumbhash";if(ce&&!C){let _=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:h}:Xe(o);if(_&&x==="color")L.push(`background-color:${_.color}`),D.push("backgroundColor");else if(_)L.push(`background-color:${_.color}`),L.push(`background-image:url(${_.dataUrl})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),D.push("backgroundColor","backgroundImage");else{let E=En(T||16,j||9,h);L.push(`background-image:url(${E})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),D.push("backgroundImage")}}else if(!ce&&x&&x!=="empty"&&x!=="none")L.push(`background-image:url(${n(x)})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),D.push("backgroundImage");let $e=a?.fallback.url||xe(o,T,j,w,b),Y=[];if(Y.push(`src="${n(wr($e,"fetched"))}"`),Y.push(`alt="${n(c)}"`),l)Y.push(`width="${n(l)}"`);if(m)Y.push(`height="${n(m)}"`);let le=q||(U||z?"eager":W?"lazy":"");if(le)Y.push(`loading="${n(le)}"`);if(U)Y.push('fetchpriority="high"');if(Y.push(`decoding="${n(B)}"`),S)Y.push(`class="${n(S)}"`);if(L.length>0)Y.push(`style="${n(L.join(";"))}"`);if(F)Y.push(`srcset="${n(wr(F,"fetched"))}"`);if(X)Y.push(`sizes="${n(X)}"`);let te=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(D.length>0){let _=typeof e.static.onload==="string"?e.static.onload:"",E=_n(D)+(_?`;${_}`:"");Y.push(`onload="${n(E)}"`),te.add("onload")}Y.push(...oe(e,te)),Y.push(...ae(e,te));let Te=`<img ${Y.join(" ")} />`,M="";if(z){let E=b==="webp"?"image/webp":b==="avif"?"image/avif":"";M=`<link rel="preload" as="image" href="${n($e)}"${E?` type="${E}"`:""}${F?` imagesrcset="${n(F)}"`:""}${X?` imagesizes="${n(X)}"`:""} />
2
+ import{ul,dl}from"./chunk-9f6qx8b9.js";import{H,yr,Is,Os,ri,si,Ns,wr,Ne,pe,G,xr,ie,J,I,rt,Sr,ci,Cr,Fe,r,p,V,wn}from"./chunk-r0g70zrf.js";import{f,R,st,d}from"./chunk-bq9xf8nq.js";import{n}from"./chunk-wbhv5137.js";import{se}from"./chunk-he85ksa7.js";import{s}from"./chunk-m4mpyq3d.js";import{g}from"./chunk-0dve54ne.js";import{createHash as Rt}from"crypto";import Q from"fs";import K from"path";import{decode as on,generateThumbHash as an}from"ts-images";import{createImageDeliveryCatalog as bt}from"ts-images/delivery";import De from"fs";function Ce(e,t,i){let o=Buffer.alloc(i),a=De.readSync(e,o,0,i,t);return o.subarray(0,a)}function je(e){if(e.length<25)return!1;let t=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(t(0,4)!=="RIFF"||t(8,12)!=="WEBP")return!1;let i=t(12,16);if(i==="VP8X")return(e[20]&16)!==0;if(i==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Me(e){let t;try{t=De.openSync(e,"r");let i=Ce(t,0,33);if(i.length>=3&&i[0]===255&&i[1]===216&&i[2]===255)return"none";if(i.length>=26&&i[0]===137&&i.toString("latin1",1,4)==="PNG"){let o=i[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ce(t,a,8);if(l.length<8)return"unknown";let m=l.toString("latin1",4,8);if(m==="tRNS")return"possible";if(m==="IDAT"||m==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(i.length>=25&&i.toString("latin1",0,4)==="RIFF"&&i.toString("latin1",8,12)==="WEBP"){if(je(i))return"possible";let o=i.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(t!==void 0)De.closeSync(t)}}import Yt from"fs";import Re from"os";import{join as gt}from"path";import{fileURLToPath as mt}from"url";import{Worker as pt}from"worker_threads";var ke=Symbol("stx.image-worker.unavailable");function Qt(e=typeof Re.availableParallelism==="function"?Re.availableParallelism():Re.cpus().length){return Math.max(1,Math.min(2,e-1))}var Ae=0,yt=[];async function en(){if(Ae<Qt()){Ae++;return}await new Promise((e)=>yt.push(e)),Ae++}function tn(){Ae--,yt.shift()?.()}var nn="@stacksjs/stx/builtins/image-warmup-worker";function rn(e=process.cwd()){let t=import.meta.url.endsWith(".ts")?"ts":"js";try{let i=new URL(`./image-warmup-worker.${t}`,import.meta.url);if(i.protocol==="file:"&&Yt.existsSync(mt(i)))return mt(i)}catch{}try{let i=typeof Bun<"u"?Bun.resolveSync(nn,e):void 0;return i&&sn(i)?i:void 0}catch{return}}function sn(e,t=process.env){let i=e.replace(/\\/g,"/");if(i.split("/").some((a)=>/@\d[^/]*@@@\d+$/.test(a)))return!1;return![t.BUN_INSTALL_CACHE_DIR,gt(t.BUN_INSTALL||gt(Re.homedir(),".bun"),"install","cache")].filter((a)=>!!a).map((a)=>`${a.replace(/\\/g,"/").replace(/\/$/,"")}/`).some((a)=>i.startsWith(a))}var ht=!1;function he(e){if(!ht)ht=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return ke}function Le(e){return e instanceof Error?e.message:String(e)}async function ze(e,t){if(typeof pt!=="function")return he("node:worker_threads has no Worker in this runtime");let i=rn();if(!i)return he("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await en();try{return await new Promise((o,a)=>{let c;try{c=new pt(i)}catch(y){o(he(`could not start ${i}: ${Le(y)}`));return}let l=!1,m=!1,u=(y)=>{if(m)return;m=!0,y(),c.terminate()};c.on("message",(y)=>{if(y.type==="ready"){l=!0,c.postMessage({task:e,args:t});return}if(y.type==="result"){u(()=>o(y.value));return}let v=Error(y.error?.message??"image worker failed");if(y.error?.name)v.name=y.error.name;if(y.error?.stack)v.stack=y.error.stack;u(()=>a(v))}),c.on("error",(y)=>{u(()=>l?a(y instanceof Error?y:Error(Le(y)||"image worker crashed")):o(he(`the worker failed before it was ready: ${Le(y)}`)))}),c.on("exit",(y)=>{u(()=>l?a(Error("image worker exited before it finished")):o(he(`the worker exited with code ${y} before it was ready`)))})})}finally{tn()}}var cn=new Set([".avif",".jpeg",".jpg",".png",".webp"]),ln=[320,640,960,1280,1920],ye="/_stx/images",un=`stx:${ye}:alpha-1`,fn=`stx:${ye}:opaque-1`,dn=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Pe;function gn(e,t){let i=K.dirname(Bun.resolveSync(e,t));while(i!==K.dirname(i)){let o=K.join(i,"package.json");if(Q.existsSync(o)){let a=JSON.parse(Q.readFileSync(o,"utf8"));if(a.name===e)return a.version}i=K.dirname(i)}return}function xt(){if(Pe!==void 0)return Pe;let e;try{e=K.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Pe=dn.map((t)=>{let i;try{i=e?gn(t,e):void 0}catch{}return`${t.replace("@stacksjs/","")}@${i??"unknown"}`}).join("+"),Pe}var vt=Symbol.for("stx.image-delivery");function be(){let e=globalThis;return e[vt]??={catalog:new Map,transparent:new Set},e[vt]}var wt=new Set;function mn(e){return`/${e.split(K.sep).map(encodeURIComponent).join("/")}`}function pn(e){let t=K.extname(e),i=e.slice(0,-t.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=Rt("sha256").update(e).digest("hex").slice(0,8);return`${i||"image"}-${o}`}function $t(e,t=`stx:${ye}`){let i=(o)=>`${ye}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:t,async stat(o){let a=K.join(e,o);try{let c=await Q.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:i(o)}:null}catch{return null}},async write(o,a){let c=K.join(e,o);await Q.promises.mkdir(K.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await Q.promises.writeFile(l,a),await Q.promises.rename(l,c),{bytes:a.byteLength,path:c,url:i(o)}},url:i}}async function At(e,t=e){let i=await Q.promises.readdir(t,{withFileTypes:!0});i.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of i){let c=K.join(t,a.name);if(a.isDirectory()){o.push(...await At(e,c));continue}if(!a.isFile()||!cn.has(K.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:K.relative(e,c)})}return o}function St(e,t){return e.map((i)=>({key:mn(i.relativePath),input:i.absolutePath,name:pn(i.relativePath),...hn(i.absolutePath)?{options:{storage:t}}:{}}))}function hn(e){return Me(e)==="possible"}function yn(e){for(let t=3;t<e.length;t+=4)if(e[t]!==255)return!0;return!1}async function bn(e){let t=Object.entries(e).filter(([,a])=>a.fallback.format==="png"),i=new Set,o=8;for(let a=0;a<t.length;a+=8)await Promise.all(t.slice(a,a+8).map(async([c,l])=>{let m=l.variants.filter((u)=>u.format==="png").sort((u,y)=>u.width-y.width)[0];try{let u=await on(new Uint8Array(await Q.promises.readFile(m?.path??l.fallback.path)));if(yn(u.data))i.add(c)}catch{i.add(c)}}));return i}function xn(e,t){let i=[];for(let o of t){let a=e[o],c=a?.variants.filter((m)=>m.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((m)=>{let u;try{return u=Q.openSync(m.path,"r"),!je(Ce(u,0,32))}catch{return!0}finally{if(u!==void 0)Q.closeSync(u)}}))continue;if(a.variants=a.variants.filter((m)=>m.format!=="webp"),delete a.sources.webp,i.push(o),!wt.has(o))wt.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return i}async function vn(e){let t=[],i=8;for(let o=0;o<e.length;o+=8){let a=e.slice(o,o+8),c=await Promise.all(a.map(async(l)=>{try{return await an(l.absolutePath),l}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${l.relativePath}`),null}}));t.push(...c.filter((l)=>l!==null))}return t}function Ue(e){return K.join(e,"undecodable.json")}function $n(e){try{let t=Q.readFileSync(Ue(e),"utf-8"),i=JSON.parse(t);return i&&typeof i==="object"?i:{}}catch{return{}}}function Sn(e,t){try{Q.mkdirSync(K.dirname(Ue(e)),{recursive:!0}),Q.writeFileSync(Ue(e),JSON.stringify(t))}catch{}}function Ct(e){try{let t=Q.statSync(e);return{mtimeMs:t.mtimeMs,size:t.size}}catch{return}}function kt(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let t=e.split(/[?#]/,1)[0];if(!t)return;try{return`/${t.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function Do(e){let t=kt(e);return t?be().catalog.get(t):void 0}function Mo(e){let t=kt(e);return t?be().transparent.has(t):!1}function Lo(e){let t=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),i=t(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:t(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<i).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function Th(e){let t=Do(e);if(!t)return;return{src:t.fallback.url,srcset:t.sources[t.fallback.format]||"",sources:Lo(t).map(({format:i,srcset:o})=>({type:`image/${i}`,srcset:o})),width:t.source.width,height:t.source.height,placeholder:Mo(e)?void 0:t.placeholder?.dataUrl}}function cs(){let e=be();e.catalog=new Map,e.transparent=new Set}function Cn(e){let t=be();t.catalog=new Map(e.entries),t.transparent=new Set(e.transparent)}async function $h(e,t,i={}){if(!e||!Q.existsSync(e))return cs(),{count:0,fingerprint:""};if(i.offThread){let h=await ze("delivery",{publicDir:e,outputDir:t});if(h!==ke)return Cn(h.state),h.result}let o=await At(e);if(o.length===0)return cs(),{count:0,fingerprint:""};let a=$n(t),c=o.filter((h)=>{let w=a[h.relativePath];if(!w)return!0;let S=Ct(h.absolutePath);return!S||S.mtimeMs!==w.mtimeMs||S.size!==w.size});if(c.length===0)return cs(),{count:0,fingerprint:""};let l=$t(K.join(t,"_stx","images"),`${un}:${xt()}`),m={outDir:K.join(t,"_stx","images"),storage:$t(K.join(t,"_stx","images"),`${fn}:${xt()}`),baseUrl:ye,widths:ln,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},u=c,y;try{y=await bt({...m,entries:St(c,l)})}catch(h){if(u=await vn(c),u.length===c.length)throw h;let w=new Set(u.map((A)=>A.relativePath)),S=!1;for(let A of c){if(w.has(A.relativePath))continue;let P=Ct(A.absolutePath);if(!P)continue;a[A.relativePath]=P,S=!0}if(S)Sn(t,a);if(u.length===0)return cs(),{count:0,fingerprint:""};y=await bt({...m,entries:St(u,l)})}let v=await bn(y.entries),b=xn(y.entries,v),C=be();C.catalog=new Map(Object.entries(y.entries)),C.transparent=v;let x=v.size===0&&b.length===0?y.fingerprint:Rt("sha256").update(y.fingerprint).update(JSON.stringify({transparent:[...v].sort(),droppedWebp:b.sort()})).digest("hex");return{count:u.length,fingerprint:x}}class Pt{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let t of e.aliases)this.builtins.set(t.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,t,i,o){let a=ri(e,o);if(a!==void 0)return a;for(let c of si(e,t,i,o))if(await r(c))return c;return null}}var ue=new Pt;var re="\x00stx-boolean-attribute";function We(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var Rn=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function He(e){let t=e.toLowerCase();return t.startsWith("aria-")||t.startsWith("data-")||Rn.has(t)}function oe(e,t){let i=[];for(let[o,a]of Object.entries(e.static)){if(t.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)i.push(p(c));continue}if(a===re){i.push(p(c));continue}i.push(`${p(c)}="${wn(c,We(String(a)))}"`)}return i}function ae(e,t){let i=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(t.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){i.push(p(c));continue}if(typeof a==="object")continue;i.push(`${p(c)}="${wn(c,We(String(a)))}"`)}return i}function An(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var qe={name:"StxLink",aliases:["stx-link"],render(e,t,i){let o=An(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",m=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,u=[];if(o.reactive)u.push(`:href="${n(o.value)}"`);else u.push(`href="${n(wr(o.value,"navigable"))}"`);if(a)u.push(`class="${n(a)}"`);if(u.push("data-stx-link"),u.push(`data-stx-active-class="${n(c)}"`),u.push(`data-stx-exact-active-class="${n(l)}"`),m)u.push("data-stx-prefetch");let y=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(y)u.push(`data-stx-active-match="${n(y)}"`);let v=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return u.push(...oe(e,v)),u.push(...ae(e,v)),`<a ${u.join(" ")}>${t}</a>`}};var kn=new Map;function Xe(e){if(!e)return;let t=e.split("?")[0].split("#")[0];return kn.get(t)}var Pn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Ze=[320,640,768,1024,1280,1536,1920];function Z(e,t){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let i=e.static[t];if(typeof i==="string")return i;return}function Ie(e,t,i=!1){let o=e.serverDynamic[t];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[t];if(a!==void 0)return a!=="false"&&a!==!1;return i}function Ve(e){if(e.includes("(")||e.includes(","))return e;let t=e.trim().split(/\s+/),i=[];for(let o of t)if(o.includes(":")){let[a,c]=o.split(":"),l=Pn[a];if(l)i.push(`(max-width: ${l}px) ${c}`);else{let m=Number.parseInt(a);if(!Number.isNaN(m))i.push(`(max-width: ${m}px) ${c}`)}}else i.push(o);return i.join(", ")}function Ge(e,t,i,o){return t.map((a)=>`${xe(e,a,void 0,i,o)} ${a}w`).join(", ")}function In(e,t,i,o,a){return t.map((c)=>{let l=i?i*c:void 0;return`${xe(e,l,void 0,o,a)} ${c}x`}).join(", ")}function xe(e,t,i,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(t)c.push(`w_${t}`);if(i)c.push(`h_${i}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(t)c.set("w",String(t));if(i)c.set("h",String(i));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(t)c.set("width",String(t));if(i)c.set("height",String(i));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function _n(e){return`var s=this.style;${e.map((t)=>`s.${t}=''`).join(";")}`}function En(e,t,i="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}"><rect width="100%" height="100%" fill="${i}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var Ke={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,t,i){let o=Z(e,"src")||"",a=Do(o),c=Z(e,"alt")||"",l=Z(e,"width")||(a?String(a.source.width):void 0),m=Z(e,"height")||(a?String(a.source.height):void 0),u=Z(e,"sizes"),y=Z(e,"srcset"),v=Z(e,"densities"),b=Z(e,"format"),C=Mo(o)||Xe(o)?.transparent===!0,x=Z(e,"placeholder")||(a&&!C?"thumbhash":void 0),h=Z(e,"placeholderColor")||"#e5e7eb",w=Z(e,"provider"),S=Z(e,"class")||Z(e,"className")||"",A=Z(e,"style")||"",P=Z(e,"objectFit")||Z(e,"fit"),k=Z(e,"objectPosition")||Z(e,"position"),O=Z(e,"quality"),W=Ie(e,"lazy",!0),z=Ie(e,"preload",!1),U=Ie(e,"priority",!1),q=Z(e,"loading"),B=Z(e,"decoding")||"async",N=!!a||Ie(e,"picture",!1)||!!b,T=l?Number.parseInt(l):void 0,j=m?Number.parseInt(m):void 0,F=y||"",X="";if(a)F=a.sources[a.fallback.format]||"",X=u?Ve(u):"100vw";else if(!F&&u&&w&&w!=="local"&&w!=="static")F=Ge(o,Ze,w,b),X=Ve(u);else if(!F&&v){let _=v.split(/\s+/).map((E)=>Number.parseFloat(E.replace("x","")));F=In(o,_,T,w,b)}else if(u)X=Ve(u);let L=[];if(A)L.push(A);if(P)L.push(`object-fit:${P}`);if(k)L.push(`object-position:${k}`);if(T&&j)L.push(`aspect-ratio:${T}/${j}`);let D=[],ce=x==="blur"||x==="color"||x==="thumbhash";if(ce&&!C){let _=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:h}:Xe(o);if(_&&x==="color")L.push(`background-color:${_.color}`),D.push("backgroundColor");else if(_)L.push(`background-color:${_.color}`),L.push(`background-image:url(${_.dataUrl})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),D.push("backgroundColor","backgroundImage");else{let E=En(T||16,j||9,h);L.push(`background-image:url(${E})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),D.push("backgroundImage")}}else if(!ce&&x&&x!=="empty"&&x!=="none")L.push(`background-image:url(${n(x)})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),D.push("backgroundImage");let $e=a?.fallback.url||xe(o,T,j,w,b),Y=[];if(Y.push(`src="${n(wr($e,"fetched"))}"`),Y.push(`alt="${n(c)}"`),l)Y.push(`width="${n(l)}"`);if(m)Y.push(`height="${n(m)}"`);let le=q||(U||z?"eager":W?"lazy":"");if(le)Y.push(`loading="${n(le)}"`);if(U)Y.push('fetchpriority="high"');if(Y.push(`decoding="${n(B)}"`),S)Y.push(`class="${n(S)}"`);if(L.length>0)Y.push(`style="${n(L.join(";"))}"`);if(F)Y.push(`srcset="${n(wr(F,"fetched"))}"`);if(X)Y.push(`sizes="${n(X)}"`);let te=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(D.length>0){let _=typeof e.static.onload==="string"?e.static.onload:"",E=_n(D)+(_?`;${_}`:"");Y.push(`onload="${n(E)}"`),te.add("onload")}Y.push(...oe(e,te)),Y.push(...ae(e,te));let Te=`<img ${Y.join(" ")} />`,M="";if(z){let E=b==="webp"?"image/webp":b==="avif"?"image/avif":"";M=`<link rel="preload" as="image" href="${n($e)}"${E?` type="${E}"`:""}${F?` imagesrcset="${n(F)}"`:""}${X?` imagesizes="${n(X)}"`:""} />
3
3
  `}if(N){let _=[];if(a)for(let E of Lo(a))_.push(`<source type="image/${E.format}" srcset="${n(E.srcset)}"${X?` sizes="${n(X)}"`:""} />`);if(!a&&(b==="avif"||b==="auto")){let E=xe(o,T,j,w,"avif"),ee=F?Ge(o,Ze,w,"avif"):`${E}`;_.push(`<source type="image/avif" srcset="${n(ee)}"${X?` sizes="${n(X)}"`:""} />`)}if(!a&&(b==="webp"||b==="auto")){let E=xe(o,T,j,w,"webp"),ee=F?Ge(o,Ze,w,"webp"):`${E}`;_.push(`<source type="image/webp" srcset="${n(ee)}"${X?` sizes="${n(X)}"`:""} />`)}return`${M}<picture>
4
4
  ${_.join(`
5
5
  `)}
@@ -1,14 +1,14 @@
1
1
  // @bun
2
- import{fr}from"./chunk-yewd8836.js";import{Tr}from"./chunk-bq9xf8nq.js";import{a}from"./chunk-e41tnswv.js";import{L,Ye}from"./chunk-k3rcpnzm.js";import{lc}from"./chunk-kr8qdg0r.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function ar(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function X(e,r={}){return new fr(e,r).routes}import w from"path";var T=new Map;async function y(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=T.get(n);if(c)return c;let o=[];try{o=X(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return O(JSON.stringify(e))}function be(e){return e.includes("data-stx-runtime")}function ac(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function f(e,r){let t=ar(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
2
+ import{fr}from"./chunk-yewd8836.js";import{Tr}from"./chunk-bq9xf8nq.js";import{a}from"./chunk-13zfxwej.js";import{L,Ye}from"./chunk-k3rcpnzm.js";import{lc}from"./chunk-kr8qdg0r.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function ar(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function X(e,r={}){return new fr(e,r).routes}import w from"path";var T=new Map;async function y(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=T.get(n);if(c)return c;let o=[];try{o=X(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return O(JSON.stringify(e))}function be(e){return e.includes("data-stx-runtime")}function ac(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function f(e,r){let t=ar(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
3
3
  `+e.slice(t);let n=Tr(e);if(n!==null)return`${e.slice(0,n)}
4
4
  ${r}${e.slice(n)}`;if(e.includes("</head>")){let o=e.indexOf("</head>");return e.slice(0,o)+r+`
5
5
  `+e.slice(o)}if(L(e))return Ye(e,(o)=>`${o}
6
6
  ${r}`);return`${r}
7
- ${e}`}async function cr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-7gs16p03.js"),{url:c}=await n("runtime",r.debug===!0);return f(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return f(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-7gs16p03.js"),s=await t(r.debug);return f(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function cc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${lc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
7
+ ${e}`}async function cr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-p5qtdqdt.js"),{url:c}=await n("runtime",r.debug===!0);return f(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return f(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-p5qtdqdt.js"),s=await t(r.debug);return f(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function cc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${lc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
8
8
  ${r}`;return`${e.slice(0,t)}${r}
9
- ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function we(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let g=await y(r?.pagesDir,r?.root);if(g.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:h}=await import("./chunk-7gs16p03.js");n=`<script data-stx-owned-routes src="${h(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(g)};
9
+ ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function we(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let g=await y(r?.pagesDir,r?.root);if(g.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:h}=await import("./chunk-p5qtdqdt.js");n=`<script data-stx-owned-routes src="${h(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(g)};
10
10
  `)}"></script>
11
11
  `}else i.ownedRoutes=g}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${l(i)};</script>
12
- `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-7gs16p03.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
12
+ `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-p5qtdqdt.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
13
13
  </body>`+e.slice(d+7)}
14
14
  export{ar,X,be,ac,cr,cc,we};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Af,ls}from"./chunk-566mkn3e.js";import"./chunk-w0qzmr1n.js";import"./chunk-he85ksa7.js";import"./chunk-wj78td69.js";import{kr}from"./chunk-6sz69gvp.js";import"./chunk-xzgbhwty.js";import"./chunk-27rzdq3n.js";import{st}from"./chunk-bq9xf8nq.js";import"./chunk-2yxva96k.js";import"./chunk-9f6qx8b9.js";export{st as freeIdentifiers,ls as processComponents,Af as processESImports,kr as rendersAsElement};
2
+ import{Af,ls}from"./chunk-rvvc4twc.js";import"./chunk-wbhv5137.js";import"./chunk-he85ksa7.js";import"./chunk-wj78td69.js";import{kr}from"./chunk-r0g70zrf.js";import"./chunk-1dp83080.js";import"./chunk-27rzdq3n.js";import{st}from"./chunk-bq9xf8nq.js";import"./chunk-2yxva96k.js";import"./chunk-9f6qx8b9.js";export{st as freeIdentifiers,ls as processComponents,Af as processESImports,kr as rendersAsElement};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import{at,ll}from"./chunk-9f6qx8b9.js";import{A}from"./chunk-2yxva96k.js";import{z,Ps,o,dn,W,S,$c,Dt,yn,je,Be}from"./chunk-6sz69gvp.js";import{cr}from"./chunk-tk8q2r05.js";import{L}from"./chunk-k3rcpnzm.js";import{ln}from"./chunk-wj78td69.js";var D=`(?:"[^"]*"|'[^']*'|[^>"'])*`,q=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,J=65536,K=4,M=new Map;function Rh(){M.clear()}function Y(e){let i=[];for(let n of S(e,W)){let t=n.token.match(/^<script\b([^>]*)>/i),s=n.token.match(/<\/script\s*>$/i);if(!t||!s)continue;let a=t[0].length,f=n.token.length-s[0].length;i.push(Object.freeze({fullMatch:n.token,attrs:t[1],body:n.token.slice(a,f),start:n.start,end:n.end}))}return i}function ds(e,i={}){let n=e.length>=J,t=n?M.get(e):void 0;if(t===void 0){if(t=Y(e),n)$c(M,K),M.set(e,t)}let s=i.skipAttrs;if(!s)return t.slice();let a=[];for(let f of t)if(s.lastIndex=0,!s.test(f.attrs))a.push(f);return a}function zo(e){let i=e.trim(),n=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(n){let s=n[1].trim(),a=n[2].trim(),{itemVar:f,indexVar:c}=F(a);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:c}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let s=t[1].trim(),a=t[2].trim(),{itemVar:f,indexVar:c}=F(s);if(f)return{style:"in",iterable:a,itemVar:f,indexVar:c}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function F(e){let i=e.trim(),n=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(n)return{itemVar:n[2],indexVar:n[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let s=i.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function ps(e,i){return ll(e,i)}function ee(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,n=0,t;while((t=i.exec(e))!==null){let s=t[1];if(s.startsWith("if"))n++;else if(s==="endif")n--;else if(n===0)return!0}return!1}function ir(e){let i=new Set,n=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=n.exec(e))!==null){let a=s[1],f;while((f=t.exec(a))!==null)i.add(f[1])}return i}function te(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${D})>`,"iy"),n=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=S(e,(a,f)=>{i.lastIndex=f;let c=i.exec(a);if(!c||c.index!==f||!n.test(c[2]))return-1;return i.lastIndex}),s=[];for(let a of t){i.lastIndex=0;let f=i.exec(a.token);if(!f)continue;let c=f[2].match(n),p=zo(c?.[1]??c?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let r=f[1],g=/\/\s*>$/.test(a.token)||P.has(r.toLowerCase())?a.end:Z(e,a.start,r,a.end);if(g!==-1)s.push({start:a.start,end:g,vars:new Set(h)})}return s}var U=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ne(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function G(e,i,n,t){if(!e)return!1;let s=ne(e),a=!1,f=!1,c=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(s))!==null){let u=h[1];if(s.slice(0,h.index).trimEnd().endsWith("."))continue;if(U.has(u))continue;if(i.has(u)||t?.has(u))a=!0;else if(n&&u in n)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,l;while((l=r.exec(s))!==null){let u=l[1];if(s.slice(0,l.index).trimEnd().endsWith("."))continue;if(U.has(u)||n&&u in n)continue;c=!0}return(a||c)&&!f}function O(e,i,n){let t=n===void 0?` ${i}`:` ${i}="${n.replace(/"/g,"&quot;")}"`,s=e.trim(),a=s.match(q);if(a&&se(a[3],a[1])){let[,f,c,p]=a;return`<${f}${c}${t}>${p}</${f}>`}return`<template${t}>${s}</template>`}function se(e,i){let n=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,s;while((s=n.exec(e))!==null)if(s[1]){if(t--,t<0)return!1}else t++;return!0}function Ho(e,i){let n=ir(e);function t(s){let a=s,f=te(s),c=(l)=>{let g=new Set;for(let u of f)if(l>u.start&&l<u.end)for(let d of u.vars)g.add(d);return g},p=/@if\s*\(/g,h,r=[];while((h=p.exec(a))!==null){let l=h.index,g=l+h[0].length,u=1,d=g;while(d<a.length&&u>0){if(a[d]==="(")u++;else if(a[d]===")")u--;d++}if(u!==0)continue;let b=a.substring(g,d-1).trim(),w=d,E=1,y=w,m=/@(if\s*\(|endif)/g;m.lastIndex=w;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))E++;else if(x[1]==="endif"){if(E--,E===0){y=x.index+x[0].length;break}}if(E!==0)continue;let R=a.substring(w,y-6).trim(),v;if(ee(R)){let I=ln(a.substring(l,y));if(I.length===0)continue;let k=I[0].branches.filter((C)=>C.type!=="else"),V=c(l);if(!(k.length>0&&k.every((C)=>G(C.condition,n,i,V))))continue;v=I[0].branches.map((C)=>{let N=t(C.content);if(C.type==="elseif")return O(N,"@else-if",C.condition??"");if(C.type==="else")return O(N,"@else");return O(N,"@if",C.condition??"")}).join(`
2
+ import{at,ll}from"./chunk-9f6qx8b9.js";import{A}from"./chunk-2yxva96k.js";import{z,Ps,o,dn,W,S,$c,Dt,yn,je,Be}from"./chunk-r0g70zrf.js";import{cr}from"./chunk-ry7w14ax.js";import{L}from"./chunk-k3rcpnzm.js";import{ln}from"./chunk-wj78td69.js";var D=`(?:"[^"]*"|'[^']*'|[^>"'])*`,q=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,J=65536,K=4,M=new Map;function Rh(){M.clear()}function Y(e){let i=[];for(let n of S(e,W)){let t=n.token.match(/^<script\b([^>]*)>/i),s=n.token.match(/<\/script\s*>$/i);if(!t||!s)continue;let a=t[0].length,f=n.token.length-s[0].length;i.push(Object.freeze({fullMatch:n.token,attrs:t[1],body:n.token.slice(a,f),start:n.start,end:n.end}))}return i}function ds(e,i={}){let n=e.length>=J,t=n?M.get(e):void 0;if(t===void 0){if(t=Y(e),n)$c(M,K),M.set(e,t)}let s=i.skipAttrs;if(!s)return t.slice();let a=[];for(let f of t)if(s.lastIndex=0,!s.test(f.attrs))a.push(f);return a}function zo(e){let i=e.trim(),n=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(n){let s=n[1].trim(),a=n[2].trim(),{itemVar:f,indexVar:c}=F(a);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:c}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let s=t[1].trim(),a=t[2].trim(),{itemVar:f,indexVar:c}=F(s);if(f)return{style:"in",iterable:a,itemVar:f,indexVar:c}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function F(e){let i=e.trim(),n=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(n)return{itemVar:n[2],indexVar:n[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let s=i.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function ps(e,i){return ll(e,i)}function ee(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,n=0,t;while((t=i.exec(e))!==null){let s=t[1];if(s.startsWith("if"))n++;else if(s==="endif")n--;else if(n===0)return!0}return!1}function ir(e){let i=new Set,n=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=n.exec(e))!==null){let a=s[1],f;while((f=t.exec(a))!==null)i.add(f[1])}return i}function te(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${D})>`,"iy"),n=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=S(e,(a,f)=>{i.lastIndex=f;let c=i.exec(a);if(!c||c.index!==f||!n.test(c[2]))return-1;return i.lastIndex}),s=[];for(let a of t){i.lastIndex=0;let f=i.exec(a.token);if(!f)continue;let c=f[2].match(n),p=zo(c?.[1]??c?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let r=f[1],g=/\/\s*>$/.test(a.token)||P.has(r.toLowerCase())?a.end:Z(e,a.start,r,a.end);if(g!==-1)s.push({start:a.start,end:g,vars:new Set(h)})}return s}var U=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ne(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function G(e,i,n,t){if(!e)return!1;let s=ne(e),a=!1,f=!1,c=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(s))!==null){let u=h[1];if(s.slice(0,h.index).trimEnd().endsWith("."))continue;if(U.has(u))continue;if(i.has(u)||t?.has(u))a=!0;else if(n&&u in n)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,l;while((l=r.exec(s))!==null){let u=l[1];if(s.slice(0,l.index).trimEnd().endsWith("."))continue;if(U.has(u)||n&&u in n)continue;c=!0}return(a||c)&&!f}function O(e,i,n){let t=n===void 0?` ${i}`:` ${i}="${n.replace(/"/g,"&quot;")}"`,s=e.trim(),a=s.match(q);if(a&&se(a[3],a[1])){let[,f,c,p]=a;return`<${f}${c}${t}>${p}</${f}>`}return`<template${t}>${s}</template>`}function se(e,i){let n=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,s;while((s=n.exec(e))!==null)if(s[1]){if(t--,t<0)return!1}else t++;return!0}function Ho(e,i){let n=ir(e);function t(s){let a=s,f=te(s),c=(l)=>{let g=new Set;for(let u of f)if(l>u.start&&l<u.end)for(let d of u.vars)g.add(d);return g},p=/@if\s*\(/g,h,r=[];while((h=p.exec(a))!==null){let l=h.index,g=l+h[0].length,u=1,d=g;while(d<a.length&&u>0){if(a[d]==="(")u++;else if(a[d]===")")u--;d++}if(u!==0)continue;let b=a.substring(g,d-1).trim(),w=d,E=1,y=w,m=/@(if\s*\(|endif)/g;m.lastIndex=w;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))E++;else if(x[1]==="endif"){if(E--,E===0){y=x.index+x[0].length;break}}if(E!==0)continue;let R=a.substring(w,y-6).trim(),v;if(ee(R)){let I=ln(a.substring(l,y));if(I.length===0)continue;let k=I[0].branches.filter((C)=>C.type!=="else"),V=c(l);if(!(k.length>0&&k.every((C)=>G(C.condition,n,i,V))))continue;v=I[0].branches.map((C)=>{let N=t(C.content);if(C.type==="elseif")return O(N,"@else-if",C.condition??"");if(C.type==="else")return O(N,"@else");return O(N,"@if",C.condition??"")}).join(`
3
3
  `)}else{if(!G(b,n,i,c(l)))continue;v=O(t(R),"@if",b)}r.push({start:l,end:y,replacement:v}),p.lastIndex=y}for(let l=r.length-1;l>=0;l--){let{start:g,end:u,replacement:d}=r[l];a=a.substring(0,g)+d+a.substring(u)}return a}return t(e)}function re(e){let i=e.trim();if(i==="")return;if(i==="true")return!0;if(i==="false")return!1;if(i==="null")return!1;if(i==="undefined")return!1;if(i==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(i)){let s=Number(i);return s!==0&&!Number.isNaN(s)}let n=i.match(/^'((?:\\.|[^'\\])*)'$/);if(n)return n[1].length>0;let t=i.match(/^"((?:\\.|[^"\\])*)"$/);if(t)return t[1].length>0;return}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),X=/<(script|style)\b/iy,ie=/<\/script/gi,oe=/<\/style/gi;function Z(e,i,n,t){if(P.has(n.toLowerCase()))return t;let s=n.toLowerCase(),a=e.length,f=1,c=t;while(c<a){let p=e.indexOf("<",c);if(p===-1)return-1;if(c=p,e.startsWith("<!--",c)){let g=e.indexOf("-->",c+4);if(g===-1)return-1;c=g+3;continue}X.lastIndex=c;let h=X.exec(e);if(h){let g=e.indexOf(">",c);if(g===-1)return-1;if(e[g-1]==="/"){c=g+1;continue}let u=h[1].toLowerCase()==="script"?ie:oe;u.lastIndex=c;let d=u.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;c=b+1;continue}if(e[c+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(c,c+64));if(!g){c++;continue}if(g[1].toLowerCase()===s){if(f--,c+=g[0].length,f===0)return c;continue}c+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(c,c+64));if(!r){c++;continue}let l=e.indexOf(">",c);if(l===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(c,l+1);if(!(/\/\s*>$/.test(g)||P.has(s)))f++}c=l+1}return-1}var ce=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ae(e,i){let n=i,t=e.length;for(;;){while(n<t&&e[n]!=="<")n++;if(n>=t)return!1;if(e.startsWith("<!--",n)){let f=e.indexOf("-->",n+4);if(f===-1)return!1;n=f+3;continue}break}if(e[n+1]==="/")return!1;let s=e.indexOf(">",n);if(s===-1)return!1;let a=e.slice(n,s+1);return ce.test(a)}function Vo(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let i=[],n=/<([a-zA-Z][\w-]*)/y,t=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);S(e,(r,l)=>{n.lastIndex=l;let g=n.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let u=n.lastIndex,d;while(u<r.length){let b=u;while(u<r.length&&t.test(r[u]))u++;let w=u;if(r[w]==="/"){w++;while(w<r.length&&t.test(r[w]))w++}if(r[w]===">"){if(d)i.push({start:l,end:w+1,tag:g[1],...d});return-1}if(u===b)return-1;let E=u;while(u<r.length&&!t.test(r[u])&&r[u]!=="="&&r[u]!==">")u++;if(u===E)return-1;let y=r.slice(E,u);if(y.startsWith("@")&&y.includes("("))return-1;let m=u,x=u;while(x<r.length&&t.test(r[x]))x++;if(r[x]!=="="){u=m;continue}x++;while(x<r.length&&t.test(r[x]))x++;let R=r[x];if(R==='"'||R==="'"){let v=r.indexOf(R,x+1);if(v===-1)return-1;if(!d&&R==='"'&&s.has(y))d={attrName:y,attrStart:b,attrEnd:v+1,value:r.slice(x+1,v)};u=v+1}else{u=x;while(u<r.length&&!t.test(r[u])&&r[u]!==">")u++}}return-1});let a=[],f=-1;for(let r of i){let{start:l,end:g,tag:u,attrName:d,value:b}=r;if(l<f)continue;let w=re(b);if(w===void 0)continue;let m=/\/\s*>$/.test(e.slice(l,g))||P.has(u.toLowerCase())?g:Z(e,l,u,g);if(m===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ae(e,m))continue;if(w===!0){let R=e.slice(l,r.attrStart)+e.slice(r.attrEnd,g);a.push({start:l,end:g,replacement:R});continue}a.push({start:l,end:m,replacement:""}),f=m}if(a.length===0)return e;a.sort((r,l)=>r.start-l.start);let c=[],p=-1;for(let r of a){if(r.start<p)continue;c.push(r),p=r.end}let h=e;for(let r=c.length-1;r>=0;r--){let{start:l,end:g,replacement:u}=c[r];h=h.substring(0,l)+u+h.substring(g)}return h}var H=[":for","@for","x-for"];function If(e){let i=/(\s)((?::|@|x-|v-)[\w.:-]+)\s*=\s*"([^"]*\{\{[^"]*)"/g;return e.replace(i,(n,t,s,a)=>{let f=a.replace(/'((?:[^'\\]|\\.)*)'/g,(c,p)=>{if(!p.includes("{{"))return c;return`\`${p.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{\s*([^}]+?)\s*\}\}/g,(r,l)=>`\${${l}}`)}\``});return`${t}${s}="${f}"`})}function gs(e,i){if(!i||Object.keys(i).length===0)return e;if(!H.some((c)=>e.includes(`${c}=`)))return e;let n=ir(e);if(Array.isArray(i.__stx_client_signal_names)){for(let c of i.__stx_client_signal_names)if(typeof c==="string")n.add(c)}let t=e,s=[],a=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,f;while((f=a.exec(t))!==null){let[c,p,h]=f,r=f.index,l=r+c.length,g=H.map((v)=>({attr:v,m:new RegExp(`\\s${v}="([^"]*)"`).exec(h)})).find((v)=>v.m!==null);if(!g||!g.m)continue;let u=zo(g.m[1]);if(!u.iterable||!u.itemVar)continue;let d=u.iterable.trim().split(/[.[(]/)[0].trim();if(!d||n.has(d)||!(d in i))continue;let b=Z(t,r,p,l);if(b===-1)continue;let w=h.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),E=t.slice(l,b-`</${p}>`.length),y={...i,[u.itemVar]:void 0};if(u.indexVar)y[u.indexVar]=void 0;let m=gs(E,y),x=u.indexVar?`${u.iterable} as ${u.indexVar} => ${u.itemVar}`:`${u.iterable} as ${u.itemVar}`,R=p.toLowerCase()==="template"?m:`<${p}${w}>${m}</${p}>`;s.push({start:r,end:b,replacement:`@foreach(${x})${R}@endforeach`}),a.lastIndex=b}for(let c=s.length-1;c>=0;c--){let{start:p,end:h,replacement:r}=s[c];t=t.slice(0,p)+r+t.slice(h)}return t}function ms(e,i){let n=e,t=/@(for|foreach)\s*\(/g,s,a=[],f=[];while((s=t.exec(n))!==null){let c=s[1],p=s.index,h=p+s[0].length,r=1,l=h;while(l<n.length&&r>0){if(n[l]==="(")r++;else if(n[l]===")")r--;l++}if(r!==0)continue;let g=n.substring(h,l-1).trim(),u=l,d=zo(g),b=c==="for"?"@endfor":"@endforeach",w=1,E=u,y=c==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${c}\\s*\\(|end${c})`,"g");y.lastIndex=u;let m;while((m=y.exec(n))!==null)if(m[1].startsWith(c))w++;else if(w--,w===0){E=m.index+m[0].length;break}if(w!==0)continue;let x=()=>{let _=[d.itemVar,d.indexVar].filter(Boolean);if(_.length)f.push({start:p,end:E,vars:_})};if(d.iterable){let _=d.iterable.trim();if(_.startsWith("[")||_.startsWith("{")||_.startsWith("'")||_.startsWith('"')||_.startsWith("`")||/^-?\d/.test(_)){x();continue}let T=_.split(/[.[(]/)[0].trim(),C=i?T in i:!1,N=f.some((j)=>p>j.start&&p<j.end&&j.vars.includes(T));if(T&&(C||N)){x();continue}}if(d.style==="as")g=d.indexVar?`(${d.itemVar}, ${d.indexVar}) in ${d.iterable}`:`${d.itemVar} in ${d.iterable}`;let R=n.substring(u,E-b.length).trim(),v=i?{...i}:{};if(d.itemVar)delete v[d.itemVar];if(d.indexVar)delete v[d.indexVar];let I=If(ms(R,v)),k=I.match(q),V;if(k){let[,_,T,C]=k;V=`<${_}${T} @for="${g}">${C}</${_}>`}else V=`<template @for="${g}">${I}</template>`;a.push({start:p,end:E,replacement:V}),t.lastIndex=E}for(let c=a.length-1;c>=0;c--){let{start:p,end:h,replacement:r}=a[c];n=n.substring(0,p)+r+n.substring(h)}return n}function le(e){let i=new Set,n=[],t=0,s=0,a=e.length,f=(r)=>{let l=t+1;while(l<a){let g=e[l];if(g==="\\"){l+=2;continue}if(g===r)return l+1;l++}return a},c=()=>{let r=t+2;while(r<a&&e[r]!==`
4
4
  `)r++;return r},p=()=>{let r=t+2;while(r<a-1){if(e[r]==="*"&&e[r+1]==="/")return r+2;r++}return a},h=(r)=>{let l=r,g=0;while(l<a){let u=e[l];if(u==="/"&&e[l+1]==="/"){let d=l+2;while(d<a&&e[d]!==`
5
- `)d++;l=d;continue}if(u==="/"&&e[l+1]==="*"){let d=l+2;while(d<a-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;l=d+2;continue}if(u==='"'||u==="'"||u==="`"){let d=l+1;while(d<a){if(e[d]==="\\"){d+=2;continue}if(e[d]===u){d++;break}d++}l=d;continue}if(u==="("||u==="["||u==="{"){g++,l++;continue}if(u===")"||u==="]"||u==="}"){g--,l++;continue}if(u===";"&&g===0)return l+1;l++}return a};while(t<a){let r=e[t];if(r==="/"&&e[t+1]==="/"){let l=c();n.push(e.slice(t,l)),t=l;continue}if(r==="/"&&e[t+1]==="*"){let l=p();n.push(e.slice(t,l)),t=l;continue}if(r==='"'||r==="'"||r==="`"){let l=f(r);n.push(e.slice(t,l)),t=l;continue}if(r==="{"){s++,n.push(r),t++;continue}if(r==="}"){s--,n.push(r),t++;continue}if(s===0){let l=t>0?e[t-1]:"";if(l===""||/\s/.test(l)||l===";"||l==="}"||l==="{"){let u=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(u){let d=u[2],b=h(t+u[0].length);if(i.has(d)){n.push(`/* stx: deduped const ${d} */`),t=b;continue}i.add(d),n.push(e.slice(t,b)),t=b;continue}}}n.push(r),t++}return n.join("")}var ue=new Set(["script","style","html","head","meta","link","title","!doctype"]);function B(e,i,n){for(let t of n){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function fe(e,i,n){let t=0;while(t<e.length){let s=e.indexOf(i,t);if(s===-1)return!1;if(!B(s,s+i.length,n))return!0;t=s+i.length}return!1}function de(e,i){if(fe(e,"<body",i)){let s=new RegExp(`<body(${D})>`,"g"),a;while((a=s.exec(e))!==null)if(!B(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let n=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${D})>`,"gi"),t;while((t=n.exec(e))!==null){if(B(t.index,t.index+t[0].length,i))continue;if(ue.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function ge(e,i,n,t){let s=[],a=` data-stx="${t}"`,f=0,c=!1,p=(h)=>{if(n!==null&&!c&&n>=f&&n<=h)s.push(e.slice(f,n),a,e.slice(n,h)),c=!0;else s.push(e.slice(f,h))};for(let h of i){if(h.start<f)continue;p(h.start),f=h.end}return p(e.length),s.join("")}async function hs(e,i,n,t={}){let s=ds(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:c,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-t5srthkt.js"));for(let m of s){let x=m.body;if(je(m.attrs))x=Be(x);if(t.forceClientSetup||a.test(x)){f.push({content:x,start:m.start,end:m.end});continue}if(!c(x))continue;try{let R=await p(Dt(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(R))f.push({content:x,start:m.start,end:m.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${f.map((m)=>m.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,l=[];for(let m=0;m<f.length;m++){let x=f[m].bundled??Dt(f[m].content).code;if(!f[m].bundled&&c(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=wt(x);let R=A(x);l.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
5
+ `)d++;l=d;continue}if(u==="/"&&e[l+1]==="*"){let d=l+2;while(d<a-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;l=d+2;continue}if(u==='"'||u==="'"||u==="`"){let d=l+1;while(d<a){if(e[d]==="\\"){d+=2;continue}if(e[d]===u){d++;break}d++}l=d;continue}if(u==="("||u==="["||u==="{"){g++,l++;continue}if(u===")"||u==="]"||u==="}"){g--,l++;continue}if(u===";"&&g===0)return l+1;l++}return a};while(t<a){let r=e[t];if(r==="/"&&e[t+1]==="/"){let l=c();n.push(e.slice(t,l)),t=l;continue}if(r==="/"&&e[t+1]==="*"){let l=p();n.push(e.slice(t,l)),t=l;continue}if(r==='"'||r==="'"||r==="`"){let l=f(r);n.push(e.slice(t,l)),t=l;continue}if(r==="{"){s++,n.push(r),t++;continue}if(r==="}"){s--,n.push(r),t++;continue}if(s===0){let l=t>0?e[t-1]:"";if(l===""||/\s/.test(l)||l===";"||l==="}"||l==="{"){let u=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(u){let d=u[2],b=h(t+u[0].length);if(i.has(d)){n.push(`/* stx: deduped const ${d} */`),t=b;continue}i.add(d),n.push(e.slice(t,b)),t=b;continue}}}n.push(r),t++}return n.join("")}var ue=new Set(["script","style","html","head","meta","link","title","!doctype"]);function B(e,i,n){for(let t of n){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function fe(e,i,n){let t=0;while(t<e.length){let s=e.indexOf(i,t);if(s===-1)return!1;if(!B(s,s+i.length,n))return!0;t=s+i.length}return!1}function de(e,i){if(fe(e,"<body",i)){let s=new RegExp(`<body(${D})>`,"g"),a;while((a=s.exec(e))!==null)if(!B(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let n=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${D})>`,"gi"),t;while((t=n.exec(e))!==null){if(B(t.index,t.index+t[0].length,i))continue;if(ue.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function ge(e,i,n,t){let s=[],a=` data-stx="${t}"`,f=0,c=!1,p=(h)=>{if(n!==null&&!c&&n>=f&&n<=h)s.push(e.slice(f,n),a,e.slice(n,h)),c=!0;else s.push(e.slice(f,h))};for(let h of i){if(h.start<f)continue;p(h.start),f=h.end}return p(e.length),s.join("")}async function hs(e,i,n,t={}){let s=ds(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:c,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-mx0a1ax8.js"));for(let m of s){let x=m.body;if(je(m.attrs))x=Be(x);if(t.forceClientSetup||a.test(x)){f.push({content:x,start:m.start,end:m.end});continue}if(!c(x))continue;try{let R=await p(Dt(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(R))f.push({content:x,start:m.start,end:m.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${f.map((m)=>m.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,l=[];for(let m=0;m<f.length;m++){let x=f[m].bundled??Dt(f[m].content).code;if(!f[m].bundled&&c(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=wt(x);let R=A(x);l.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
6
6
  ${R}`)}let g=l.join(`
7
7
 
8
8
  `);g=le(g);let d=z(g).split(",").map((m)=>m.trim()).filter(Boolean),b=yn(g,n),w=`
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{U}from"./chunk-6sz69gvp.js";import{ze,O,Lt}from"./chunk-27rzdq3n.js";import{ft,Ce,M,qe,Ee,la,go,ua,In}from"./chunk-02s307f1.js";import{St,ue,et}from"./chunk-yewd8836.js";import{Ao}from"./chunk-gy10h4mh.js";import{On}from"./chunk-985afhhy.js";import{be}from"./chunk-tk8q2r05.js";import Z from"fs";import T from"path";var{serve:ce}=globalThis.Bun;import H from"zlib";import{promisify as Q}from"util";var K=Q(H.brotliCompress),ee=Q(H.gzip),te=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ne=["text/event-stream","multipart/x-mixed-replace"],re=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ne.some((a)=>e.startsWith(a)))return!1;return te.some((a)=>e.startsWith(a))}function oe(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ae(t){if(!t)return null;let e=oe(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,V=new Map,z=0;function ie(t,e){if(e.length>Y/8)return;V.set(t,e),z+=e.length;for(let[a,r]of V){if(z<=Y)break;V.delete(a),z-=r.length}}async function $n(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let r=ae(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(i.length<(a.threshold??re))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=V.get(g);if(!l)l=r==="br"?await K(i,{params:{[H.constants.BROTLI_PARAM_QUALITY]:h,[H.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await ee(i),ie(g,l);if(l.length>=i.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new U(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",M(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${Ce(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let b=new Headers(s.headers);return b.set("Cache-Control","private, no-store"),b.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:b})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let v=this.generation,_=async()=>{let s=await a();r=s;let b=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||b.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",M(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===v)this.entries.set(h,n);return n},x=this.pending.get(h);if(!x){if(this.pending.size>=1000)return i();x=_().finally(()=>{if(this.pending.get(h)===x)this.pending.delete(h)}),this.pending.set(h,x)}if(g&&m<e.maxAge+(e.swr??0))return x.catch(()=>{}),l(g);let A=await x;return A?l(A):i()}}var pe={".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 Ug(t={}){let e=T.resolve(t.outputDir||".output"),a=t.port??3000,r=la(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=On(r.routeRules),f=new G,h=Ao(e,r.apiRoutes??[]),g=Bun.file(T.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?O(l):void 0,v=new Map,_=new Map,x=new Map,A=new Map;for(let n of r.routes)try{let y=T.join(e,n.compiledPath),c=JSON.parse(await Bun.file(y).text());if(m)c.html=Lt(c.html,m);v.set(n.pattern,c),x.set(n.pattern,et(c.html)),A.set(n.pattern,be(c.html));let j=T.join(e,n.fragmentPath);if(qe(c.html,r.routerContainer||"main")&&await Bun.file(j).exists()){let P=await Bun.file(j).text();_.set(n.pattern,m?Lt(P,m):P)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,b=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:c}=ue(n.pattern,{page:!0});b.push({regex:y,route:n,paramNames:c})}else s.set(n.pattern,n);let E=ce({port:a,async fetch(n){return $n(n,await ze(m??O(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let j=await h(n);if(j)return j;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=T.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=T.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${T.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let R=T.extname(u).toLowerCase(),B=pe[R]||"application/octet-stream",X=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":B,"Cache-Control":X?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=Ce(n),C=null,q={};if(C=s.get(c)||null,!C)for(let{regex:p,route:d,paramNames:u}of b){let o=c.match(p);if(o){C=d,u.forEach((R,B)=>{q[R]=o[B+1]});break}}if(!C){let p=St(c)?null:s.get("/404")||null;if(p){let d=v.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let N=i(c),W=Object.keys(N).length>0;return f.respond(n,N.cache,async()=>{let p=v.get(C.pattern);if(P&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=_.get(C.pattern);if(o){let R=x.get(C.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...A.has(C.pattern)?{"X-STX-Runtime":A.get(C.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...M(),...N.cache?{}:{"Cache-Control":ft}}})}}let d=go(n.method),u=v.get(C.pattern);if(!u){let o=s.get("/500")||null;if(o){let R=v.get(o.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(C.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...M(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:R,redirect:B,cookies:X,status:F,headers:I}=await In(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(B)return ua(B,X,I);if(R&&R.length>0){let{renderStreamingPage:S,streamToResponse:D}=await import("./chunk-67e85f7r.js"),L=new Headers({...M(),...I,"Cache-Control":"private, no-store"});for(let k of X??[])L.append("Set-Cookie",k);if(P&&!d&&qe(o,r.routerContainer||"main")){let k=et(o);L.set("X-STX-Fragment","true"),L.set("X-STX-Runtime",be(o)?"true":"false"),L.set("X-STX-Layout",k.layout),L.set("X-STX-Layout-Group",k.group)}return D(S(P&&!d&&qe(o,r.routerContainer||"main")?Ee(o,r.routerContainer||"main",!0):o,R,{timeoutMs:30000}),{status:F??u.status??200,headers:L})}let w=new Headers({"Content-Type":"text/html",...M(),...N.cache?{}:{"Cache-Control":"private, no-store"}});for(let S of X??[])w.append("Set-Cookie",S);for(let[S,D]of Object.entries(I??{}))w.set(S,D);if(w.set("Vary",M(w.get("Vary")).Vary),P&&!d&&qe(o,r.routerContainer||"main")){let S=et(o);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",be(o)?"true":"false"),w.set("X-STX-Layout",S.layout),w.set("X-STX-Layout-Group",S.group),new Response(Ee(o,r.routerContainer||"main",!0),{status:F??u.status??200,headers:w})}return new Response(o,{status:F??u.status??200,headers:w})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${v.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
2
+ import{U}from"./chunk-r0g70zrf.js";import{ze,O,Lt}from"./chunk-27rzdq3n.js";import{ft,Ce,M,qe,Ee,la,go,ua,In}from"./chunk-axs1wrkr.js";import{St,ue,et}from"./chunk-yewd8836.js";import{Ao}from"./chunk-x2c3mjey.js";import{On}from"./chunk-985afhhy.js";import{be}from"./chunk-ry7w14ax.js";import Z from"fs";import T from"path";var{serve:ce}=globalThis.Bun;import H from"zlib";import{promisify as Q}from"util";var K=Q(H.brotliCompress),ee=Q(H.gzip),te=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ne=["text/event-stream","multipart/x-mixed-replace"],re=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ne.some((a)=>e.startsWith(a)))return!1;return te.some((a)=>e.startsWith(a))}function oe(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ae(t){if(!t)return null;let e=oe(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,V=new Map,z=0;function ie(t,e){if(e.length>Y/8)return;V.set(t,e),z+=e.length;for(let[a,r]of V){if(z<=Y)break;V.delete(a),z-=r.length}}async function $n(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let r=ae(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(i.length<(a.threshold??re))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=V.get(g);if(!l)l=r==="br"?await K(i,{params:{[H.constants.BROTLI_PARAM_QUALITY]:h,[H.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await ee(i),ie(g,l);if(l.length>=i.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new U(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",M(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${Ce(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let b=new Headers(s.headers);return b.set("Cache-Control","private, no-store"),b.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:b})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let v=this.generation,_=async()=>{let s=await a();r=s;let b=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||b.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",M(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===v)this.entries.set(h,n);return n},x=this.pending.get(h);if(!x){if(this.pending.size>=1000)return i();x=_().finally(()=>{if(this.pending.get(h)===x)this.pending.delete(h)}),this.pending.set(h,x)}if(g&&m<e.maxAge+(e.swr??0))return x.catch(()=>{}),l(g);let A=await x;return A?l(A):i()}}var pe={".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 Ug(t={}){let e=T.resolve(t.outputDir||".output"),a=t.port??3000,r=la(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=On(r.routeRules),f=new G,h=Ao(e,r.apiRoutes??[]),g=Bun.file(T.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?O(l):void 0,v=new Map,_=new Map,x=new Map,A=new Map;for(let n of r.routes)try{let y=T.join(e,n.compiledPath),c=JSON.parse(await Bun.file(y).text());if(m)c.html=Lt(c.html,m);v.set(n.pattern,c),x.set(n.pattern,et(c.html)),A.set(n.pattern,be(c.html));let j=T.join(e,n.fragmentPath);if(qe(c.html,r.routerContainer||"main")&&await Bun.file(j).exists()){let P=await Bun.file(j).text();_.set(n.pattern,m?Lt(P,m):P)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,b=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:c}=ue(n.pattern,{page:!0});b.push({regex:y,route:n,paramNames:c})}else s.set(n.pattern,n);let E=ce({port:a,async fetch(n){return $n(n,await ze(m??O(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let j=await h(n);if(j)return j;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=T.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=T.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${T.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let R=T.extname(u).toLowerCase(),B=pe[R]||"application/octet-stream",X=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":B,"Cache-Control":X?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=Ce(n),C=null,q={};if(C=s.get(c)||null,!C)for(let{regex:p,route:d,paramNames:u}of b){let o=c.match(p);if(o){C=d,u.forEach((R,B)=>{q[R]=o[B+1]});break}}if(!C){let p=St(c)?null:s.get("/404")||null;if(p){let d=v.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let N=i(c),W=Object.keys(N).length>0;return f.respond(n,N.cache,async()=>{let p=v.get(C.pattern);if(P&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=_.get(C.pattern);if(o){let R=x.get(C.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...A.has(C.pattern)?{"X-STX-Runtime":A.get(C.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...M(),...N.cache?{}:{"Cache-Control":ft}}})}}let d=go(n.method),u=v.get(C.pattern);if(!u){let o=s.get("/500")||null;if(o){let R=v.get(o.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(C.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...M(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:R,redirect:B,cookies:X,status:F,headers:I}=await In(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(B)return ua(B,X,I);if(R&&R.length>0){let{renderStreamingPage:S,streamToResponse:D}=await import("./chunk-z04f6fy2.js"),L=new Headers({...M(),...I,"Cache-Control":"private, no-store"});for(let k of X??[])L.append("Set-Cookie",k);if(P&&!d&&qe(o,r.routerContainer||"main")){let k=et(o);L.set("X-STX-Fragment","true"),L.set("X-STX-Runtime",be(o)?"true":"false"),L.set("X-STX-Layout",k.layout),L.set("X-STX-Layout-Group",k.group)}return D(S(P&&!d&&qe(o,r.routerContainer||"main")?Ee(o,r.routerContainer||"main",!0):o,R,{timeoutMs:30000}),{status:F??u.status??200,headers:L})}let w=new Headers({"Content-Type":"text/html",...M(),...N.cache?{}:{"Cache-Control":"private, no-store"}});for(let S of X??[])w.append("Set-Cookie",S);for(let[S,D]of Object.entries(I??{}))w.set(S,D);if(w.set("Vary",M(w.get("Vary")).Vary),P&&!d&&qe(o,r.routerContainer||"main")){let S=et(o);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",be(o)?"true":"false"),w.set("X-STX-Layout",S.layout),w.set("X-STX-Layout-Group",S.group),new Response(Ee(o,r.routerContainer||"main",!0),{status:F??u.status??200,headers:w})}return new Response(o,{status:F??u.status??200,headers:w})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${v.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
3
3
  export{$n,Ug};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{kl,_l}from"./chunk-mhmphbve.js";import"./chunk-9tec9eap.js";import"./chunk-1p8r3w08.js";import"./chunk-7086efsc.js";import"./chunk-v1eakek3.js";import"./chunk-yzs2afn7.js";import"./chunk-ady8cnpb.js";import"./chunk-6mdpttxy.js";import"./chunk-dnk3ahmm.js";import"./chunk-axs1wrkr.js";import"./chunk-cz8mka1b.js";import"./chunk-vct6dec8.js";import"./chunk-sxwgq49z.js";import"./chunk-2skv6cr7.js";import"./chunk-cfpw4c6b.js";import"./chunk-416jy1m5.js";import"./chunk-k0aejzg9.js";import"./chunk-gbx5vw81.js";import"./chunk-r1jzbqr3.js";import"./chunk-9ct3gbyv.js";import"./chunk-4q4vexpc.js";import"./chunk-3xzzzrhw.js";import"./chunk-x8anspa5.js";import"./chunk-td3qp5my.js";import"./chunk-eapt899m.js";import"./chunk-5mng4x26.js";import"./chunk-ppnc68ta.js";import"./chunk-dd12079e.js";import"./chunk-ra8f8sm2.js";import"./chunk-267wdqtr.js";import"./chunk-c0ejyxfj.js";import"./chunk-d18xd9x5.js";import{Qt}from"./chunk-de9dkzwy.js";import"./chunk-f9rtfd58.js";import"./chunk-x2c3mjey.js";import"./chunk-7sh9fa3q.js";import{Re,i}from"./chunk-41gq8324.js";import"./chunk-7r1tcffk.js";import"./chunk-km0tqwx1.js";import"./chunk-2gqhfge6.js";import"./chunk-rvvc4twc.js";import"./chunk-wbhv5137.js";import"./chunk-311q3pa2.js";import"./chunk-he85ksa7.js";import"./chunk-t6z2ty9v.js";import{we}from"./chunk-ry7w14ax.js";import"./chunk-wj78td69.js";import{lr,ur}from"./chunk-q9w8rfve.js";import{vs,j,a}from"./chunk-13zfxwej.js";import"./chunk-qgy1w573.js";import"./chunk-zxfptbac.js";import"./chunk-605b93pe.js";import"./chunk-x8js27hd.js";import"./chunk-yewd8836.js";import{m,Le}from"./chunk-r0g70zrf.js";import"./chunk-1dp83080.js";import"./chunk-27rzdq3n.js";import"./chunk-bq9xf8nq.js";import"./chunk-2yxva96k.js";import"./chunk-9f6qx8b9.js";import"./chunk-w9d18r1t.js";import"./chunk-kf8hzvb7.js";export{vs as buildWebComponents,ur as cacheTemplate,lr as checkCache,Qt as classifyAllScripts,kl as createMiddleware,_l as createRoute,j as defaultConfig,m as extractVariables,we as injectRouterScript,a as loadStxConfig,Le as processClientScript,i as processDirectives,Re as readMarkdownFile};