@stacksjs/stx 0.2.814 → 0.2.815

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 (82) hide show
  1. package/dist/chunk-053yyx5n.js +2 -0
  2. package/dist/{chunk-vgpnjrq4.js → chunk-080zb2qx.js} +1 -1
  3. package/dist/{chunk-33x11khy.js → chunk-0dnzcrb1.js} +1 -1
  4. package/dist/{chunk-526n626z.js → chunk-0x02gm7d.js} +1 -1
  5. package/dist/chunk-0xv48z98.js +3 -0
  6. package/dist/{chunk-46vd0375.js → chunk-0yf28g7v.js} +1 -1
  7. package/dist/chunk-0ywcbka3.js +2 -0
  8. package/dist/{chunk-ajg7tvn1.js → chunk-1cxf9chb.js} +4 -4
  9. package/dist/{chunk-9fhgy5y5.js → chunk-2gcvcpt8.js} +1 -1
  10. package/dist/chunk-2yngdnq6.js +2 -0
  11. package/dist/{chunk-v0kn4q29.js → chunk-3ht64v1a.js} +2 -2
  12. package/dist/{chunk-v6p8tf1x.js → chunk-3qr7dz76.js} +1 -1
  13. package/dist/{chunk-ethnqap6.js → chunk-5d8123c9.js} +4 -4
  14. package/dist/{chunk-49r48cjj.js → chunk-5h0p34jj.js} +1 -1
  15. package/dist/{chunk-vshskj73.js → chunk-6em1xeax.js} +1 -1
  16. package/dist/{chunk-dcc0ejtd.js → chunk-6vbtvpn4.js} +2 -2
  17. package/dist/{chunk-40zwjmta.js → chunk-72pek719.js} +1 -1
  18. package/dist/{chunk-pjv91e8z.js → chunk-74ck7kk1.js} +1 -1
  19. package/dist/chunk-74dw9yf0.js +2 -0
  20. package/dist/chunk-7bxk9mjy.js +2 -0
  21. package/dist/{chunk-86vcmh2x.js → chunk-7cwb7pyf.js} +1 -1
  22. package/dist/{chunk-fzzfy1yh.js → chunk-7qarrdq6.js} +1 -1
  23. package/dist/{chunk-pnbh9fgm.js → chunk-81pykb48.js} +1 -1
  24. package/dist/{chunk-5za58geh.js → chunk-84qv8bxe.js} +5 -5
  25. package/dist/{chunk-bkq60hpn.js → chunk-89pes7at.js} +1 -1
  26. package/dist/{chunk-qfqv3fjm.js → chunk-8taa0exz.js} +1 -1
  27. package/dist/{chunk-x94q5ptn.js → chunk-9k037sk6.js} +1 -1
  28. package/dist/chunk-as5ej9s8.js +2 -0
  29. package/dist/{chunk-cxsxb3bc.js → chunk-b0yvap9e.js} +1 -1
  30. package/dist/{chunk-8zexecar.js → chunk-b12wg4jp.js} +1 -1
  31. package/dist/{chunk-b682cfc9.js → chunk-c4y1pcf6.js} +2 -2
  32. package/dist/{chunk-jj5b4h6f.js → chunk-c5fved0k.js} +1 -1
  33. package/dist/{chunk-hhahbv6g.js → chunk-cea665ds.js} +1 -1
  34. package/dist/{chunk-rx5ak659.js → chunk-d2vr1169.js} +6 -6
  35. package/dist/{chunk-2a4dhkdw.js → chunk-eg95a7q7.js} +1 -1
  36. package/dist/{chunk-m5q50ct0.js → chunk-eqrjfceb.js} +1 -1
  37. package/dist/{chunk-aqnfzse9.js → chunk-few3k1dz.js} +1 -1
  38. package/dist/{chunk-1d6ef8g9.js → chunk-gt0csenq.js} +4 -4
  39. package/dist/{chunk-vyad54bv.js → chunk-h9cpa5jq.js} +1 -1
  40. package/dist/{chunk-7aqdqfwf.js → chunk-hbq922er.js} +1 -1
  41. package/dist/chunk-km00bn5z.js +2 -0
  42. package/dist/{chunk-hvdmhzad.js → chunk-kmr3cd71.js} +2 -2
  43. package/dist/{chunk-9bt479pb.js → chunk-m8w7rcmt.js} +1 -1
  44. package/dist/{chunk-he9zzsh4.js → chunk-m8zbae89.js} +2 -2
  45. package/dist/{chunk-kf96nks9.js → chunk-macvhhf0.js} +2 -2
  46. package/dist/{chunk-9jdqxsna.js → chunk-mjjfx1yp.js} +3 -3
  47. package/dist/{chunk-91re9xtj.js → chunk-p9y5hh4m.js} +1 -1
  48. package/dist/{chunk-3pz8yag9.js → chunk-pda7fv19.js} +1 -1
  49. package/dist/{chunk-0dm38zt6.js → chunk-q9ggx1jb.js} +1 -1
  50. package/dist/chunk-qfc662nf.js +2 -0
  51. package/dist/{chunk-qsepyy1p.js → chunk-qxr4teqr.js} +1 -1
  52. package/dist/chunk-rdsrc8wv.js +2 -0
  53. package/dist/{chunk-mmy3h4ye.js → chunk-rpw3f34s.js} +1 -1
  54. package/dist/{chunk-ta1yzmz8.js → chunk-rvb5gz33.js} +1 -1
  55. package/dist/chunk-s7db9xc4.js +2 -0
  56. package/dist/{chunk-p0qf405e.js → chunk-se251nhv.js} +1 -1
  57. package/dist/{chunk-nsph6c12.js → chunk-t6sddfv8.js} +4 -4
  58. package/dist/{chunk-p6g80v4p.js → chunk-tc15aznt.js} +1 -1
  59. package/dist/{chunk-w717cyka.js → chunk-vhe6p6b0.js} +1 -1
  60. package/dist/{chunk-ayq07qrz.js → chunk-vn5cd6av.js} +1 -1
  61. package/dist/{chunk-h7257fsm.js → chunk-xd5n2qx4.js} +1 -1
  62. package/dist/{chunk-54w0epxq.js → chunk-yacdg7kq.js} +1 -1
  63. package/dist/{chunk-3efaf8v0.js → chunk-z1edw8fc.js} +1 -1
  64. package/dist/{chunk-nq8bw7cm.js → chunk-z5b863fw.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.d.ts +1 -0
  69. package/dist/pwa.js +1 -1
  70. package/dist/ssg.js +2 -2
  71. package/package.json +5 -5
  72. package/dist/chunk-0gf0ny6y.js +0 -2
  73. package/dist/chunk-2m60sqvs.js +0 -2
  74. package/dist/chunk-7kj3g9bx.js +0 -2
  75. package/dist/chunk-88ftnhm9.js +0 -2
  76. package/dist/chunk-9107scv6.js +0 -2
  77. package/dist/chunk-9gyy6z1d.js +0 -2
  78. package/dist/chunk-e8zf4fqg.js +0 -2
  79. package/dist/chunk-jt6k606s.js +0 -2
  80. package/dist/chunk-nz0cgrt9.js +0 -2
  81. package/dist/chunk-skjwswd8.js +0 -3
  82. package/dist/chunk-z27n1z4f.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ze,xn,Ws,xi,N}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-qfqv3fjm.js";import{Nr,k,ll,at,Ri,ul}from"./chunk-ybjfr7e8.js";import{P}from"./chunk-r9e0r6jx.js";import{R,qs,u,f,jt,d,q,F,w,Js,_e,Ve,Ys}from"./chunk-gebb12ak.js";import{r,ge}from"./chunk-3vpgr6nk.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-c5vzr1va.js";import Qe from"path";import kt from"process";import{AsyncLocalStorage as Bo}from"async_hooks";var cr=new Bo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ar(e,t){return cr.run(mn(e),t)}async function lr(e,t){let i=cr.getStore();if(!i)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 n=i.pending.get(e);if(n)return n;let c=Promise.resolve().then(t).then((l)=>{let a=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(a);return i.values.set(e,y),y}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,c),c}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function H(e,t=!1){let i=r(e),n=[],c=new Set,l=0,a=0,y=i.length,v=()=>{if(l!==0)return;let E=i.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let I=E[2];if(!c.has(I))n.push(I),c.add(I);return}let A=i.slice(a).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(a).startsWith("const"))return;A[1].split(",").forEach((I)=>{let j=I.trim();if(!j)return;let Q=j.indexOf(":"),z=(Q>=0?j.slice(Q+1).trim():j).split(/[\s=]/)[0];if(z&&!c.has(z))n.push(z),c.add(z)});return}let M=i.slice(a).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(t&&i.slice(a).startsWith("const"))return;M[1].split(",").forEach((I)=>{let j=I.trim().replace(/^\.\.\./,"");if(!j)return;let Q=j.split(/[\s=]/)[0];if(Q&&!c.has(Q))n.push(Q),c.add(Q)});return}if(t)return;let B=i.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let I=B[1];if(!c.has(I))n.push(I),c.add(I);return}let D=i.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let I=D[1];if(!c.has(I))n.push(I),c.add(I)}};while(a<y){if(i[a]==="{"){l++,a++;continue}if(i[a]==="}"){l--,a++;continue}if(l===0&&/[a-z]/i.test(i[a])&&(a===0||/\s|[;{}()]/.test(i[a-1])))v();a++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,t=H(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(H(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Wo(e,t)} }`;return H(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import An from"fs";import Te from"path";function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ur=new Map;function yr(e,t=!0){let i=ur.get(e);if(t&&i)return i;let n=new Map,c=[Te.join(e,"src"),Te.join(e,"dist"),e];function l(a,y){if(y>6)return;let v;try{v=An.readdirSync(a,{withFileTypes:!0})}catch{return}for(let E of v){let A=Te.join(a,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let M=E.name.slice(0,-4);if(!n.has(M))n.set(M,A);let B=M.toLowerCase();if(!n.has(B))n.set(B,A);let D=V(M);if(!n.has(D))n.set(D,A)}}}for(let a of c)if(l(a,0),n.size>0)break;if(t)ur.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=Te.join(i,"node_modules",e);try{if(An.statSync(n).isDirectory())return n}catch{}let c=Te.dirname(i);if(c===i)return null;i=c}}function Ms(e,t,i={}){return[Te.resolve(Te.dirname(t),`${e}.stx`),Te.resolve(Te.dirname(t),e),Te.resolve(i.componentsDir||"components",`${e}.stx`),Te.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function fr(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),n=V(t);return[t,i,n]}function oi(e,t){let[i,n,c]=fr(e);for(let l of[i,i.toLowerCase(),n,c]){let a=t?.__importedComponents?.get(l);if(a!==void 0)return a}}function*ii(e,t,i={},n){let c=fr(e);if(c[0].startsWith("./")||c[0].startsWith("../")){yield Te.resolve(Te.dirname(t),`${c[0]}.stx`);return}let l=[...new Set(c.map((v)=>`${v}.stx`))],a=i.projectRoot||process.cwd(),y=[...n?.__originalFilePath?[Te.join(Te.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],Te.join(Te.dirname(t),"components"),Te.resolve(a,"src/components"),Te.resolve(a,"components"),...import.meta.dir?[Te.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield Te.join(v,E);try{for(let E of An.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield Te.join(v,E.name,A)}catch{}}}function pr(e,t,i={},n){let c=oi(e,n);if(c!==void 0)return c;for(let l of ii(e,t,i,n))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")||!n.has("alt")&&!n.has("decorative"))return!1;let c=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=c.get("alt"),a=c.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof a==="string"?!["false","0","off","no"].includes(a.trim().toLowerCase()):Boolean(a);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].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)=>n.has(E))}import Zn from"fs";import ce from"path";import ht from"path";import Kt from"fs";var zo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function cs(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return zo.has(e.toLowerCase())}var dr=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"]),gr={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"},Fo=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function mr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(Fo.has(n))t.systemKeys.push(n);else if(n in $r)t.mouse=n;else if(n in gr||/^[a-z]$/.test(n))t.keys.push(gr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let c=n.match(/debounce(?:\.(\d+))?/);t.debounce=c?.[1]?Number.parseInt(c[1],10):300}else if(n.startsWith("throttle")){let c=n.match(/throttle(?:\.(\d+))?/);t.throttle=c?.[1]?Number.parseInt(c[1],10):300}}return t}function Rr(e,t=""){let i=[],n=0,c=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=c.exec(e))!==null){let[a,y,v]=l,E=l.index,A=E+a.length,M=`__stx_evt_${t}${n++}`,B=[],D=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=D.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=j.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}if(B.length>0)i.push({originalTag:a,elementId:M,events:B,startIndex:E,endIndex:A})}return i}function Uo(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((c)=>`$event.key === '${c}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=$r[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function Vo(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function as(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function Ho(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=Uo(e),c=Vo(as(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(cs(e.event,t))l.push("passive: true");let a=l.length>0?`, { ${l.join(", ")} }`:"",y=c.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,Ws,xi,N}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-8taa0exz.js";import{Nr,k,ll,at,Ri,ul}from"./chunk-ybjfr7e8.js";import{P}from"./chunk-r9e0r6jx.js";import{R,qs,u,f,jt,d,q,F,w,Js,_e,Ve,Ys}from"./chunk-gebb12ak.js";import{r,ge}from"./chunk-3vpgr6nk.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-c5vzr1va.js";import Qe from"path";import kt from"process";import{AsyncLocalStorage as Bo}from"async_hooks";var cr=new Bo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ar(e,t){return cr.run(mn(e),t)}async function lr(e,t){let i=cr.getStore();if(!i)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 n=i.pending.get(e);if(n)return n;let c=Promise.resolve().then(t).then((l)=>{let a=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(a);return i.values.set(e,y),y}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,c),c}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function H(e,t=!1){let i=r(e),n=[],c=new Set,l=0,a=0,y=i.length,v=()=>{if(l!==0)return;let E=i.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let I=E[2];if(!c.has(I))n.push(I),c.add(I);return}let A=i.slice(a).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(a).startsWith("const"))return;A[1].split(",").forEach((I)=>{let j=I.trim();if(!j)return;let Q=j.indexOf(":"),z=(Q>=0?j.slice(Q+1).trim():j).split(/[\s=]/)[0];if(z&&!c.has(z))n.push(z),c.add(z)});return}let M=i.slice(a).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(t&&i.slice(a).startsWith("const"))return;M[1].split(",").forEach((I)=>{let j=I.trim().replace(/^\.\.\./,"");if(!j)return;let Q=j.split(/[\s=]/)[0];if(Q&&!c.has(Q))n.push(Q),c.add(Q)});return}if(t)return;let B=i.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let I=B[1];if(!c.has(I))n.push(I),c.add(I);return}let D=i.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let I=D[1];if(!c.has(I))n.push(I),c.add(I)}};while(a<y){if(i[a]==="{"){l++,a++;continue}if(i[a]==="}"){l--,a++;continue}if(l===0&&/[a-z]/i.test(i[a])&&(a===0||/\s|[;{}()]/.test(i[a-1])))v();a++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,t=H(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(H(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Wo(e,t)} }`;return H(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import An from"fs";import Te from"path";function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ur=new Map;function yr(e,t=!0){let i=ur.get(e);if(t&&i)return i;let n=new Map,c=[Te.join(e,"src"),Te.join(e,"dist"),e];function l(a,y){if(y>6)return;let v;try{v=An.readdirSync(a,{withFileTypes:!0})}catch{return}for(let E of v){let A=Te.join(a,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let M=E.name.slice(0,-4);if(!n.has(M))n.set(M,A);let B=M.toLowerCase();if(!n.has(B))n.set(B,A);let D=V(M);if(!n.has(D))n.set(D,A)}}}for(let a of c)if(l(a,0),n.size>0)break;if(t)ur.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=Te.join(i,"node_modules",e);try{if(An.statSync(n).isDirectory())return n}catch{}let c=Te.dirname(i);if(c===i)return null;i=c}}function Ms(e,t,i={}){return[Te.resolve(Te.dirname(t),`${e}.stx`),Te.resolve(Te.dirname(t),e),Te.resolve(i.componentsDir||"components",`${e}.stx`),Te.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function fr(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),n=V(t);return[t,i,n]}function oi(e,t){let[i,n,c]=fr(e);for(let l of[i,i.toLowerCase(),n,c]){let a=t?.__importedComponents?.get(l);if(a!==void 0)return a}}function*ii(e,t,i={},n){let c=fr(e);if(c[0].startsWith("./")||c[0].startsWith("../")){yield Te.resolve(Te.dirname(t),`${c[0]}.stx`);return}let l=[...new Set(c.map((v)=>`${v}.stx`))],a=i.projectRoot||process.cwd(),y=[...n?.__originalFilePath?[Te.join(Te.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],Te.join(Te.dirname(t),"components"),Te.resolve(a,"src/components"),Te.resolve(a,"components"),...import.meta.dir?[Te.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield Te.join(v,E);try{for(let E of An.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield Te.join(v,E.name,A)}catch{}}}function pr(e,t,i={},n){let c=oi(e,n);if(c!==void 0)return c;for(let l of ii(e,t,i,n))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")||!n.has("alt")&&!n.has("decorative"))return!1;let c=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=c.get("alt"),a=c.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof a==="string"?!["false","0","off","no"].includes(a.trim().toLowerCase()):Boolean(a);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].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)=>n.has(E))}import Zn from"fs";import ce from"path";import ht from"path";import Kt from"fs";var zo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function cs(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return zo.has(e.toLowerCase())}var dr=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"]),gr={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"},Fo=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function mr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(Fo.has(n))t.systemKeys.push(n);else if(n in $r)t.mouse=n;else if(n in gr||/^[a-z]$/.test(n))t.keys.push(gr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let c=n.match(/debounce(?:\.(\d+))?/);t.debounce=c?.[1]?Number.parseInt(c[1],10):300}else if(n.startsWith("throttle")){let c=n.match(/throttle(?:\.(\d+))?/);t.throttle=c?.[1]?Number.parseInt(c[1],10):300}}return t}function Rr(e,t=""){let i=[],n=0,c=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=c.exec(e))!==null){let[a,y,v]=l,E=l.index,A=E+a.length,M=`__stx_evt_${t}${n++}`,B=[],D=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=D.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=j.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}if(B.length>0)i.push({originalTag:a,elementId:M,events:B,startIndex:E,endIndex:A})}return i}function Uo(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((c)=>`$event.key === '${c}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=$r[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function Vo(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function as(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function Ho(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=Uo(e),c=Vo(as(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(cs(e.event,t))l.push("passive: true");let a=l.length>0?`, { ${l.join(", ")} }`:"",y=c.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('${i}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function Zo(e,t=""){let i=Rr(e,t);if(i.length===0)return{template:e,bindings:[]};let n=e,c=[];for(let l=i.length-1;l>=0;l--){let a=i[l],y=a.originalTag;if(!y.includes(" id="))y=y.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${a.elementId}"`);else{let v=y.match(/id=["']([^"']+)["']/);if(v)for(let E of a.events)E.elementId=v[1]}for(let v of a.events){let E=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(`\\s*${E}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${E}\\s*=\\s*'[^']*'`,"g");y=y.replace(A,""),y=y.replace(M,"")}n=n.slice(0,a.startIndex)+y+n.slice(a.endIndex),c.push(...a.events)}return{template:n,bindings:c}}function hr(e){let t=e.$uid;return typeof t==="string"&&t?`${t}_`:""}function $c(e,t,i){if(ul(e))return e;if(t.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:y,bindings:v}=Zo(e,hr(t)),E=t.__stx_event_bindings||[];return t.__stx_event_bindings=[...E,...v],y}let n=Rr(e,hr(t));if(n.length===0)return e;let c=e;for(let y=n.length-1;y>=0;y--){let v=n[y],E=v.originalTag;if(!E.includes(" id="))E=E.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let A=E.match(/id=["']([^"']+)["']/);if(A)for(let M of v.events)M.elementId=A[1]}for(let A of v.events){let M=A.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=new RegExp(`\\s*${M}\\s*=\\s*"[^"]*"`,"g"),D=new RegExp(`\\s*${M}\\s*=\\s*'[^']*'`,"g");E=E.replace(B,""),E=E.replace(D,"")}c=c.slice(0,v.startIndex)+E+c.slice(v.endIndex)}let l=ai(n.flatMap((y)=>y.events)),a=c.lastIndexOf("</body>");if(a!==-1)c=c.slice(0,a)+l+`
115
- `+c.slice(a);else c+=l;return c}function Ar(e,t){let i=new Set;for(let n of e.split(",")){let c=n.trim().replace(/^\.\.\./,"").trim();if(!c)continue;if(t){let l=c.lastIndexOf(":");if(l!==-1)c=c.slice(l+1).trim()}if(c=c.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(c))i.add(c)}return i}function Rt(e,t){let i=r(e),{depths:n,balanced:c}=ge(i),l=(y)=>!c||n[y]===0,a=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let y of i.matchAll(a)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Ar(y[1],!0).has(t))return!0;for(let y of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Ar(y[1],!1).has(t))return!0;return!1}var Tr=new R(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),ut=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Ir=["(","[","{"],Or=[")","]","}"],Ko=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Xo(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let c=n.index??0;i.push({text:n[0],start:c,end:c+n[0].length})}return{code:t,tokens:i}}function ls(e){let t=Tr.get(e);if(t)return t;let{code:i,tokens:n}=Xo(e),c=new Map,l=[];for(let Q=0;Q<n.length;Q++){let X=n[Q].text;if(["(","[","{"].includes(X))l.push(Q);else if([")","]","}"].includes(X)){let z=l.at(-1);if(z!==void 0&&["()","[]","{}"].includes(n[z].text+X))l.pop(),c.set(z,Q),c.set(Q,z)}}function a(Q,X){let z=[],L=Q;for(let ee=Q;ee<X;ee++){if(["(","[","{"].includes(n[ee].text)&&(c.get(ee)??X)<X){ee=c.get(ee);continue}if(n[ee].text===",")z.push([L,ee]),L=ee+1}return z.push([L,X]),z}let y=[];function v(Q,X,z,L=!1){if(n[Q]?.text==="...")Q++;if(Q>=X)return;let ee=n[Q].text;if(ut.test(ee)){if(z.add(ee),z===M)y.push({name:ee,token:Q,functionScoped:L});return}if(ee!=="{"&&ee!=="[")return;let te=c.get(Q);if(te===void 0||te>=X)return;for(let[re,me]of a(Q+1,te)){let he=re;if(ee==="{")for(let le=re;le<me;le++){if(n[le].text===":"){he=le+1;break}if(n[le].text==="=")break;if(["(","[","{"].includes(n[le].text)&&c.has(le))le=c.get(le)}v(he,me,z,L)}}function E(Q,X){let z=new Set;for(let[L,ee]of a(Q,X))v(L,ee,z);return z}function A(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(["(","[","{"].includes(z)&&c.has(X)){X=c.get(X);continue}if([",",";",")","]","}"].includes(z))break}return n[Math.max(Q,X-1)]?.end??i.length}let M=new Set,B=[];for(let Q=0;Q<n.length;Q++)if(n[Q].text==="=>"){let X=Q-1,z=X,L;if(n[X]?.text===")"&&c.has(X))z=c.get(X),L=E(z+1,X);else if(n[X]&&ut.test(n[X].text))L=new Set([n[X].text]);else continue;let ee=Q+1,te=n[ee]?.text==="{"&&c.has(ee)?n[c.get(ee)].end:A(ee);B.push({start:n[z].start,end:te,bodyStart:n[ee]?.start??te,functionBody:!0,names:L})}else if(n[Q].text==="("&&c.has(Q)){let X=n[Q-1]?.text;if(!X||qo.has(X)||!ut.test(X)&&X!=="*"&&X!=="]")continue;let z=c.get(Q),L=z+1;if(n[L]?.text===":"){L++;while(L<n.length&&!["{","=>",";","="].includes(n[L].text))L++}if(n[L]?.text!=="{"||!c.has(L))continue;B.push({start:n[Q].start,end:n[c.get(L)].end,bodyStart:n[L].start,functionBody:X!=="catch",names:E(Q+1,z)})}function D(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(Ir.includes(z)&&c.has(X)){X=c.get(X);continue}if(z===";"||Or.includes(z))break;let L=n[X-1];if(X>Q&&Ko.has(z)&&L.text!==".")break;if(X>Q&&/[\n\r]/.test(i.slice(L.end,n[X].start))&&(/^[\w$]+$/.test(L.text)||Or.includes(L.text)||['"',"'","`"].includes(L.text))&&ut.test(z)&&!["in","of","instanceof"].includes(z))break}return X}let I=[];for(let Q=0;Q<n.length;Q++){if(n[Q].text!=="for")continue;let X=n[Q+1]?.text==="await"?Q+2:Q+1;if(n[X]?.text!=="("||!c.has(X))continue;let z=c.get(X),L=z+1,ee=n[L]?.text==="{"&&c.has(L)?c.get(L):D(L),te=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(L,ee-1)]?.end??i.length;I.push({headStart:X,headEnd:z,start:n[X].start,end:te})}for(let Q=0;Q<n.length;Q++){let X=n[Q].text,z=n[Q-1]?.text;if(z==="."||n[Q+1]?.text===":")continue;if(z==="as"||z==="<")continue;if(X==="const"||X==="let"||X==="var"){let L=D(Q+1),ee=Q+1,te=!1,re=!1,me=0;for(let he=Q+1;he<=L;he++){let le=n[he]?.text;if(he<L&&Ir.includes(le)&&c.has(he)&&c.get(he)<L){he=c.get(he);continue}if(he<L&&le===":"&&!re)te=!0;else if(he<L&&le==="="&&me===0)te=!1,re=!0;else if(he<L&&te&&le==="<")me++;else if(he<L&&te&&le===">"&&me>0)me--;else if(he===L||le===","&&me===0)v(ee,he,M,X==="var"),ee=he+1,te=!1,re=!1}}else if(X==="function"||X==="class"){let L=Q+1;if(n[L]?.text==="*")L++;if(n[L]&&ut.test(n[L].text)&&n[L].text!=="extends")M.add(n[L].text),y.push({name:n[L].text,token:L})}else if(X==="import"){let L=Q+1;if(n[L]?.text==="*"&&n[L+1]?.text==="as")L+=2;let ee=n[L]?.text;if(ee&&ut.test(ee)&&ee!=="type"&&n[L+1]?.text!=="("&&n[L+1]?.text!==".")M.add(ee),y.push({name:ee,token:L,file:!0});let te=n[L]?.text==="{"?L:n[L+1]?.text===","&&n[L+2]?.text==="{"?L+2:-1;if(te!==-1&&c.has(te)){let re=c.get(te);for(let[me,he]of a(te+1,re)){let le=he-1;while(le>=me&&!ut.test(n[le].text))le--;if(le>=me&&n[le].text!=="type")y.push({name:n[le].text,token:le,file:!0})}}}}let j={code:i,scopes:B,loops:I,declarations:M,sites:y,tokens:n,pairs:c};return Tr.set(e,j),j}function qt(e){let t=ls(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((c)=>n>=c.start&&n<c.end&&c.names.has(i))}}function Tn(e){return new Set(ls(e).declarations)}function Ie(e,t){let{scopes:i,loops:n,sites:c,tokens:l,pairs:a}=ls(e),y=Array.from({length:l.length},()=>-1),v=[];for(let D=0;D<l.length;D++){y[D]=v.length?v[v.length-1]:-1;let I=l[D].text;if(I==="{"&&a.has(D))v.push(D);else if(I==="}"&&v.length&&a.get(D)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let D of c){if(!t.has(D.name))continue;E.add(D.token);let I=D.file?-1:y[D.token],j=I===-1?[0,Number.POSITIVE_INFINITY]:[l[I].start,l[a.get(I)].end];if(D.functionScoped){let X=l[D.token].start,z=i.filter((L)=>L.functionBody&&X>=L.bodyStart&&X<L.end).sort((L,ee)=>L.end-L.bodyStart-(ee.end-ee.bodyStart))[0];j=z?[z.bodyStart,z.end]:[0,Number.POSITIVE_INFINITY]}else if(!D.file){let X=n.filter((z)=>D.token>z.headStart&&D.token<z.headEnd).sort((z,L)=>z.headEnd-z.headStart-(L.headEnd-L.headStart))[0];if(X)j=[X.start,X.end]}let Q=A.get(D.name);if(Q)Q.push(j);else A.set(D.name,[j])}let M=new Set;for(let D=0;D<l.length;D++){if(l[D].text!=="import"||l[D-1]?.text===".")continue;let I=D+1;if(l[I]?.text==="type")I++;if(l[I]&&ut.test(l[I].text)&&l[I+1]?.text===",")I+=2;if(l[I]?.text==="{"&&a.has(I))for(let j=I+1;j<a.get(I);j++)M.add(j)}let B=new Set;for(let D=0;D<l.length;D++){let I=l[D].text;if(!t.has(I)||B.has(I)||E.has(D)||M.has(D))continue;let j=l[D-1]?.text;if(j==="#"||j==="."&&l[D-2]?.text!=="..")continue;if(l[D+1]?.text===":"&&(j==="{"||j===","))continue;let Q=l[D].start;if(A.get(I)?.some(([X,z])=>Q>=X&&Q<z))continue;if(i.some((X)=>Q>=X.start&&Q<X.end&&X.names.has(I)))continue;B.add(I)}return B}var Pe="0.2.814";var Pr=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Go(){let e=globalThis;return e[Pr]??=new Map,e[Pr]}function o(e,t){let i=Go(),n=`${import.meta.url}\x00${e}`,c=i.get(n);if(c)return c;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var Yo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Yo,"<\\/$1")}import Dr from"fs";var Mr=[];function b(e){let t=new R(e);return Mr.push(t),t}function Rc(){for(let e of Mr)e.clear()}function x(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function br(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Dr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Dr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var xe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var Qo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ec(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function tc(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(Kt.existsSync(n))return ht.dirname(n);let c=ht.dirname(i);if(c===i)return null;i=c}}function nc(e,t){if(!e||typeof e!=="object")return null;let i=(c)=>{if(typeof c==="string")return c;if(c&&typeof c==="object"){if(typeof c.import==="string")return c.import;if(typeof c.default==="string")return c.default;if(typeof c.import==="object")return i(c.import);if(typeof c.default==="object")return i(c.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let c of Object.keys(e)){let l=c.indexOf("*");if(l===-1)continue;let a=c.slice(0,l),y=c.slice(l+1);if(!t.startsWith(a)||!t.endsWith(y))continue;if(t.length<a.length+y.length)continue;if(!n||a.length>n.prefix.length)n={pattern:c,prefix:a,suffix:y}}if(n){let c=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",c)}return null}function sc(e,t){let i=ec(e);if(!i||!i.subpath)return null;let n=tc(i.pkg,t);if(!n)return null;let c;try{c=JSON.parse(Kt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,a=nc(c.exports,l);if(!a)return null;let y=ht.resolve(n,a);return Kt.existsSync(y)?y:null}function mi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),c=new Set,l=[],a=[];return{code:e.replace(Qo,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!Kt.existsSync(A))throw Error(`file not found: ${A}`)}else{let M=null;try{M=Bun.resolveSync(E,n)}catch{M=sc(E,n)}if(!M)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=M}}catch(M){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${M?.message||M}`),a.push(E),""}if(c.has(A))return"";c.add(A);try{let M=Kt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:M})}catch(M){console.warn(`[stx:vendor-css] could not read ${A}: ${M?.message||M}`),a.push(E)}return""}),styles:l,unresolved:a}}function rc(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function hi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${rc(t.source)}" data-stx-layer="vendor">
115
+ `+c.slice(a);else c+=l;return c}function Ar(e,t){let i=new Set;for(let n of e.split(",")){let c=n.trim().replace(/^\.\.\./,"").trim();if(!c)continue;if(t){let l=c.lastIndexOf(":");if(l!==-1)c=c.slice(l+1).trim()}if(c=c.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(c))i.add(c)}return i}function Rt(e,t){let i=r(e),{depths:n,balanced:c}=ge(i),l=(y)=>!c||n[y]===0,a=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let y of i.matchAll(a)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Ar(y[1],!0).has(t))return!0;for(let y of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Ar(y[1],!1).has(t))return!0;return!1}var Tr=new R(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),ut=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Ir=["(","[","{"],Or=[")","]","}"],Ko=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Xo(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let c=n.index??0;i.push({text:n[0],start:c,end:c+n[0].length})}return{code:t,tokens:i}}function ls(e){let t=Tr.get(e);if(t)return t;let{code:i,tokens:n}=Xo(e),c=new Map,l=[];for(let Q=0;Q<n.length;Q++){let X=n[Q].text;if(["(","[","{"].includes(X))l.push(Q);else if([")","]","}"].includes(X)){let z=l.at(-1);if(z!==void 0&&["()","[]","{}"].includes(n[z].text+X))l.pop(),c.set(z,Q),c.set(Q,z)}}function a(Q,X){let z=[],L=Q;for(let ee=Q;ee<X;ee++){if(["(","[","{"].includes(n[ee].text)&&(c.get(ee)??X)<X){ee=c.get(ee);continue}if(n[ee].text===",")z.push([L,ee]),L=ee+1}return z.push([L,X]),z}let y=[];function v(Q,X,z,L=!1){if(n[Q]?.text==="...")Q++;if(Q>=X)return;let ee=n[Q].text;if(ut.test(ee)){if(z.add(ee),z===M)y.push({name:ee,token:Q,functionScoped:L});return}if(ee!=="{"&&ee!=="[")return;let te=c.get(Q);if(te===void 0||te>=X)return;for(let[re,me]of a(Q+1,te)){let he=re;if(ee==="{")for(let le=re;le<me;le++){if(n[le].text===":"){he=le+1;break}if(n[le].text==="=")break;if(["(","[","{"].includes(n[le].text)&&c.has(le))le=c.get(le)}v(he,me,z,L)}}function E(Q,X){let z=new Set;for(let[L,ee]of a(Q,X))v(L,ee,z);return z}function A(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(["(","[","{"].includes(z)&&c.has(X)){X=c.get(X);continue}if([",",";",")","]","}"].includes(z))break}return n[Math.max(Q,X-1)]?.end??i.length}let M=new Set,B=[];for(let Q=0;Q<n.length;Q++)if(n[Q].text==="=>"){let X=Q-1,z=X,L;if(n[X]?.text===")"&&c.has(X))z=c.get(X),L=E(z+1,X);else if(n[X]&&ut.test(n[X].text))L=new Set([n[X].text]);else continue;let ee=Q+1,te=n[ee]?.text==="{"&&c.has(ee)?n[c.get(ee)].end:A(ee);B.push({start:n[z].start,end:te,bodyStart:n[ee]?.start??te,functionBody:!0,names:L})}else if(n[Q].text==="("&&c.has(Q)){let X=n[Q-1]?.text;if(!X||qo.has(X)||!ut.test(X)&&X!=="*"&&X!=="]")continue;let z=c.get(Q),L=z+1;if(n[L]?.text===":"){L++;while(L<n.length&&!["{","=>",";","="].includes(n[L].text))L++}if(n[L]?.text!=="{"||!c.has(L))continue;B.push({start:n[Q].start,end:n[c.get(L)].end,bodyStart:n[L].start,functionBody:X!=="catch",names:E(Q+1,z)})}function D(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(Ir.includes(z)&&c.has(X)){X=c.get(X);continue}if(z===";"||Or.includes(z))break;let L=n[X-1];if(X>Q&&Ko.has(z)&&L.text!==".")break;if(X>Q&&/[\n\r]/.test(i.slice(L.end,n[X].start))&&(/^[\w$]+$/.test(L.text)||Or.includes(L.text)||['"',"'","`"].includes(L.text))&&ut.test(z)&&!["in","of","instanceof"].includes(z))break}return X}let I=[];for(let Q=0;Q<n.length;Q++){if(n[Q].text!=="for")continue;let X=n[Q+1]?.text==="await"?Q+2:Q+1;if(n[X]?.text!=="("||!c.has(X))continue;let z=c.get(X),L=z+1,ee=n[L]?.text==="{"&&c.has(L)?c.get(L):D(L),te=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(L,ee-1)]?.end??i.length;I.push({headStart:X,headEnd:z,start:n[X].start,end:te})}for(let Q=0;Q<n.length;Q++){let X=n[Q].text,z=n[Q-1]?.text;if(z==="."||n[Q+1]?.text===":")continue;if(z==="as"||z==="<")continue;if(X==="const"||X==="let"||X==="var"){let L=D(Q+1),ee=Q+1,te=!1,re=!1,me=0;for(let he=Q+1;he<=L;he++){let le=n[he]?.text;if(he<L&&Ir.includes(le)&&c.has(he)&&c.get(he)<L){he=c.get(he);continue}if(he<L&&le===":"&&!re)te=!0;else if(he<L&&le==="="&&me===0)te=!1,re=!0;else if(he<L&&te&&le==="<")me++;else if(he<L&&te&&le===">"&&me>0)me--;else if(he===L||le===","&&me===0)v(ee,he,M,X==="var"),ee=he+1,te=!1,re=!1}}else if(X==="function"||X==="class"){let L=Q+1;if(n[L]?.text==="*")L++;if(n[L]&&ut.test(n[L].text)&&n[L].text!=="extends")M.add(n[L].text),y.push({name:n[L].text,token:L})}else if(X==="import"){let L=Q+1;if(n[L]?.text==="*"&&n[L+1]?.text==="as")L+=2;let ee=n[L]?.text;if(ee&&ut.test(ee)&&ee!=="type"&&n[L+1]?.text!=="("&&n[L+1]?.text!==".")M.add(ee),y.push({name:ee,token:L,file:!0});let te=n[L]?.text==="{"?L:n[L+1]?.text===","&&n[L+2]?.text==="{"?L+2:-1;if(te!==-1&&c.has(te)){let re=c.get(te);for(let[me,he]of a(te+1,re)){let le=he-1;while(le>=me&&!ut.test(n[le].text))le--;if(le>=me&&n[le].text!=="type")y.push({name:n[le].text,token:le,file:!0})}}}}let j={code:i,scopes:B,loops:I,declarations:M,sites:y,tokens:n,pairs:c};return Tr.set(e,j),j}function qt(e){let t=ls(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((c)=>n>=c.start&&n<c.end&&c.names.has(i))}}function Tn(e){return new Set(ls(e).declarations)}function Ie(e,t){let{scopes:i,loops:n,sites:c,tokens:l,pairs:a}=ls(e),y=Array.from({length:l.length},()=>-1),v=[];for(let D=0;D<l.length;D++){y[D]=v.length?v[v.length-1]:-1;let I=l[D].text;if(I==="{"&&a.has(D))v.push(D);else if(I==="}"&&v.length&&a.get(D)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let D of c){if(!t.has(D.name))continue;E.add(D.token);let I=D.file?-1:y[D.token],j=I===-1?[0,Number.POSITIVE_INFINITY]:[l[I].start,l[a.get(I)].end];if(D.functionScoped){let X=l[D.token].start,z=i.filter((L)=>L.functionBody&&X>=L.bodyStart&&X<L.end).sort((L,ee)=>L.end-L.bodyStart-(ee.end-ee.bodyStart))[0];j=z?[z.bodyStart,z.end]:[0,Number.POSITIVE_INFINITY]}else if(!D.file){let X=n.filter((z)=>D.token>z.headStart&&D.token<z.headEnd).sort((z,L)=>z.headEnd-z.headStart-(L.headEnd-L.headStart))[0];if(X)j=[X.start,X.end]}let Q=A.get(D.name);if(Q)Q.push(j);else A.set(D.name,[j])}let M=new Set;for(let D=0;D<l.length;D++){if(l[D].text!=="import"||l[D-1]?.text===".")continue;let I=D+1;if(l[I]?.text==="type")I++;if(l[I]&&ut.test(l[I].text)&&l[I+1]?.text===",")I+=2;if(l[I]?.text==="{"&&a.has(I))for(let j=I+1;j<a.get(I);j++)M.add(j)}let B=new Set;for(let D=0;D<l.length;D++){let I=l[D].text;if(!t.has(I)||B.has(I)||E.has(D)||M.has(D))continue;let j=l[D-1]?.text;if(j==="#"||j==="."&&l[D-2]?.text!=="..")continue;if(l[D+1]?.text===":"&&(j==="{"||j===","))continue;let Q=l[D].start;if(A.get(I)?.some(([X,z])=>Q>=X&&Q<z))continue;if(i.some((X)=>Q>=X.start&&Q<X.end&&X.names.has(I)))continue;B.add(I)}return B}var Pe="0.2.815";var Pr=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Go(){let e=globalThis;return e[Pr]??=new Map,e[Pr]}function o(e,t){let i=Go(),n=`${import.meta.url}\x00${e}`,c=i.get(n);if(c)return c;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var Yo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Yo,"<\\/$1")}import Dr from"fs";var Mr=[];function b(e){let t=new R(e);return Mr.push(t),t}function Rc(){for(let e of Mr)e.clear()}function x(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function br(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Dr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Dr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var xe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var Qo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ec(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function tc(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(Kt.existsSync(n))return ht.dirname(n);let c=ht.dirname(i);if(c===i)return null;i=c}}function nc(e,t){if(!e||typeof e!=="object")return null;let i=(c)=>{if(typeof c==="string")return c;if(c&&typeof c==="object"){if(typeof c.import==="string")return c.import;if(typeof c.default==="string")return c.default;if(typeof c.import==="object")return i(c.import);if(typeof c.default==="object")return i(c.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let c of Object.keys(e)){let l=c.indexOf("*");if(l===-1)continue;let a=c.slice(0,l),y=c.slice(l+1);if(!t.startsWith(a)||!t.endsWith(y))continue;if(t.length<a.length+y.length)continue;if(!n||a.length>n.prefix.length)n={pattern:c,prefix:a,suffix:y}}if(n){let c=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",c)}return null}function sc(e,t){let i=ec(e);if(!i||!i.subpath)return null;let n=tc(i.pkg,t);if(!n)return null;let c;try{c=JSON.parse(Kt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,a=nc(c.exports,l);if(!a)return null;let y=ht.resolve(n,a);return Kt.existsSync(y)?y:null}function mi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),c=new Set,l=[],a=[];return{code:e.replace(Qo,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!Kt.existsSync(A))throw Error(`file not found: ${A}`)}else{let M=null;try{M=Bun.resolveSync(E,n)}catch{M=sc(E,n)}if(!M)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=M}}catch(M){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${M?.message||M}`),a.push(E),""}if(c.has(A))return"";c.add(A);try{let M=Kt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:M})}catch(M){console.warn(`[stx:vendor-css] could not read ${A}: ${M?.message||M}`),a.push(E)}return""}),styles:l,unresolved:a}}function rc(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function hi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${rc(t.source)}" data-stx-layer="vendor">
116
116
  @layer vendor {
117
117
  ${t.contents}
118
118
  }
@@ -182,7 +182,7 @@ else {
182
182
  // STX: auto-generated event bindings
183
183
  ${e.map((i,n)=>mc(i,n)).join(`
184
184
  `)}`}function Wr(e){let t=[],i=new Set,n=e.replace(/^\s*import\s+.*$/gm,""),c=0,l=n.length,a=0;while(a<l){let y=n[a];if(y==="'"||y==='"'||y==="`"){let v=y;if(a++,v==="`"){let E=0;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"&&E===0){a++;break}if(n[a]==="$"&&n[a+1]==="{"){E++,a+=2;continue}if(n[a]==="}"&&E>0){E--,a++;continue}a++}}else while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]===v){a++;break}a++}continue}if(y==="/"&&n[a+1]==="/"){while(a<l&&n[a]!==`
185
- `)a++;continue}if(y==="/"&&n[a+1]==="*"){a+=2;while(a<l-1&&!(n[a]==="*"&&n[a+1]==="/"))a++;a+=2;continue}if(y==="{"){c++,a++;continue}if(y==="}"){c--,a++;continue}if(c===0){let v=n.slice(a),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let B=E[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((B)=>{let D=B.trim(),I=D.indexOf(":"),j=I>=0?D.slice(I+1).trim().split(/[\s=]/)[0]:D.split(/[\s=]/)[0];if(j&&!j.startsWith("_")&&!i.has(j))t.push(j),i.add(j)}),a+=A[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let B=M[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=M[0].length;continue}}a++}return t}var xc=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 bc(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(B){let D;while((D=i.exec(B))!==null){let I=D[0];if(!xc.has(I))t.add(I)}}let c=/\{\{([\s\S]*?)\}\}/g,l;while((l=c.exec(e))!==null)n(l[1]);let a=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=a.exec(e))!==null)n(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)n(l[1]);return t}async function Le(e,t={}){let i=e,n="",c=!1,l=[],a=mi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=a.code;let y=hi(a.styles),v=Nt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-526n626z.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),c=!0;if(t.autoImports!==!1){let L=qc(i);i=L.code,n=Kc(L.stxImports,L.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${yn(i,t.serverData)}${n}`,i=P(i),!c&&je(t.attrs||""))i=Be(i);let M=hc(t.eventBindings||[]),B=(t.attrs||"").trim(),D=/\btype\s*=\s*["']module["']/i.test(B),I=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(D){let L=B.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${I}${L?` ${L}`:""}`;return`${y}<script ${ee}>
185
+ `)a++;continue}if(y==="/"&&n[a+1]==="*"){a+=2;while(a<l-1&&!(n[a]==="*"&&n[a+1]==="/"))a++;a+=2;continue}if(y==="{"){c++,a++;continue}if(y==="}"){c--,a++;continue}if(c===0){let v=n.slice(a),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let B=E[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((B)=>{let D=B.trim(),I=D.indexOf(":"),j=I>=0?D.slice(I+1).trim().split(/[\s=]/)[0]:D.split(/[\s=]/)[0];if(j&&!j.startsWith("_")&&!i.has(j))t.push(j),i.add(j)}),a+=A[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let B=M[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=M[0].length;continue}}a++}return t}var xc=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 bc(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(B){let D;while((D=i.exec(B))!==null){let I=D[0];if(!xc.has(I))t.add(I)}}let c=/\{\{([\s\S]*?)\}\}/g,l;while((l=c.exec(e))!==null)n(l[1]);let a=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=a.exec(e))!==null)n(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)n(l[1]);return t}async function Le(e,t={}){let i=e,n="",c=!1,l=[],a=mi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=a.code;let y=hi(a.styles),v=Nt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-0x02gm7d.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),c=!0;if(t.autoImports!==!1){let L=qc(i);i=L.code,n=Kc(L.stxImports,L.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${yn(i,t.serverData)}${n}`,i=P(i),!c&&je(t.attrs||""))i=Be(i);let M=hc(t.eventBindings||[]),B=(t.attrs||"").trim(),D=/\btype\s*=\s*["']module["']/i.test(B),I=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(D){let L=B.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${I}${L?` ${L}`:""}`;return`${y}<script ${ee}>
186
186
  ${dn(`${n}${i}
187
187
  ${M}`)}
188
188
  </script>`}let j=Ri(e),Q=/function __stx_setup_/.test(i),X=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function z(L){let ee=L.length>0?`
@@ -285,8 +285,8 @@ ${E.join(`
285
285
  `){let I=e[c];if(I==="\\"){c+=2;continue}if(I==="[")D=!0;else if(I==="]")D=!1;else if(I==="/"&&!D){c++;while(c<l&&/[a-z]/i.test(e[c]))c++;return}c++}},B=()=>{if(n!==0)return;let D=e.slice(c).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(D){let X=D[2].split(",").map((z)=>{let L=z.trim().split(":");return L[L.length-1].trim()});for(let z of X)if(z&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(z)&&!i.has(z))t.push(z),i.add(z);return}let I=e.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(I){let X=I[2];if(!i.has(X))t.push(X),i.add(X);return}let j=e.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let X=j[1];if(!i.has(X))t.push(X),i.add(X);return}let Q=e.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Q){let X=Q[1];if(!i.has(X))t.push(X),i.add(X)}};while(c<l){if(v())continue;if(e[c]==="'"||e[c]==='"'){a(e[c]);continue}if(e[c]==="`"){y();continue}if(e[c]==="/"&&A()){M();continue}if(e[c]==="{"){n++,c++;continue}if(e[c]==="}"){n--,c++;continue}if(n===0&&/[a-z]/i.test(e[c])&&(c===0||/\s|[;{}()]/.test(e[c-1])))B();c++}return t}function kl(e){let t=[],i=0,n=0,c=null;for(let l=0;l<e.length;l++){let a=e[l];if(c){if(a==="\\"){l++;continue}if(a===c)c=null;continue}if(a==='"'||a==="'"||a==="`"){c=a;continue}if(a==="("||a==="["||a==="{")i++;else if(a===")"||a==="]"||a==="}")i--;else if(a===","&&i===0)t.push(e.slice(n,l)),n=l+1}if(n<e.length)t.push(e.slice(n));return t}function Rl(e){let t=0,i=null;for(let n=0;n<e.length;n++){let c=e[n];if(i){if(c==="\\"){n++;continue}if(c===i)i=null;continue}if(c==='"'||c==="'"||c==="`"){i=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c==="="&&t===0){let l=e[n-1],a=e[n+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(a==="="||a===">")continue;return n}}return-1}function Cl(e,t){try{let i=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!i)return;let n=i.index-1;while(n>=0&&/\s/.test(e[n]))n--;if(e[n]!=="}")return;let c=n,l=0,a=-1;for(;n>=0;n--){let v=e[n];if(v==="}")l++;else if(v==="{"){if(l--,l===0){a=n;break}}}if(a===-1)return;let y=e.slice(a+1,c);for(let v of kl(y)){let E=v.trim();if(!E||E.startsWith("..."))continue;let A=Rl(E);if(A===-1)continue;let M=E.slice(0,A).trim();if(!/^[A-Z_$][\w$]*$/i.test(M))continue;if(t[M]!==void 0)continue;let B=E.slice(A+1).trim();if(!B)continue;try{let D=Object.keys(t).filter(jt),I=Function(...D,`"use strict"; return (${B});`);t[M]=I(...D.map((j)=>t[j]))}catch{}}}catch{}}var Al=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function pg(e,t){let i=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!i)return null;let n=i[2].toLowerCase();if(!Al.has(n))return null;let c=new RegExp(`<\\/?${n}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),l=S(e,(E,A)=>(c.lastIndex=A,c.exec(E)?.index===A?c.lastIndex:-1));if(n==="span"&&/\sdata-stx-scope\s*=/.test(l[0]?.token||""))return null;let a=0,y=!1;for(let E of l){if(a+=E.token.startsWith("</")?-1:1,a<0)return null;if(a===0){if(e.slice(E.end).trim())return null;y=!0;break}}if(!y)return null;let v=i[0].length;return e.slice(0,v)+t+e.slice(v)}function wo(e,t){if(!e)return!1;return[...t.additionalComponentsDirs??[],...t.fallbackComponentsDir?[t.fallbackComponentsDir]:[]].some((n)=>{let c=ce.relative(ce.resolve(n),ce.resolve(e));return!c.startsWith("..")&&!ce.isAbsolute(c)})}async function Er(e,t,i,n,c){let l=e.endsWith(".stx")?e.slice(0,-4):e,a=(re)=>re.split("-").map((me)=>me.charAt(0).toUpperCase()+me.slice(1)).join(""),y=i.__importedComponents;if(y){for(let re of[l,l.toLowerCase(),a(l),V(l)])if(y.has(re))return!0}let v=[...new Set([`${l}.stx`,`${a(l)}.stx`,`${V(l)}.stx`])],E=typeof c.root==="string"?ce.resolve(c.root):void 0,A=E??ce.dirname(n),M=[],B=(re)=>{if(re&&!M.includes(re))M.push(re)},D=i.__originalFilePath;if(D)B(ce.join(ce.dirname(D),"components"));if(wo(t,c))B(c._rootComponentsDir);B(t),B(c._rootComponentsDir),B(ce.join(ce.dirname(n),"components")),B(c.componentsDir);for(let re of c.additionalComponentsDirs??[])B(re);let I=c._targetComponentFallbackNames?.some((re)=>re.toLowerCase()===l.toLowerCase());if(!I)for(let re of c._targetComponentDirs??[])B(re);if(E)B(ce.resolve(E,"resources/views/components")),B(ce.resolve(E,"resources/components")),B(ce.resolve(E,"src/components")),B(ce.resolve(E,"components"));for(let re of c._layerComponentDirs??[])B(re);let j=c._pluginComponentDirs;if(Array.isArray(j))for(let re of j)B(typeof re==="string"?re:null);if(B(c.fallbackComponentsDir),I)for(let re of c._targetComponentDirs??[])B(re);let Q=c._nativePrimitivesFallback;if(Q&&!Q.except.some((re)=>re.toLowerCase()===l.toLowerCase()))B(Q.dir);if(l.startsWith("./")||l.startsWith("../"))return s(ce.resolve(ce.dirname(n),`${l}.stx`));let X=po(ce.resolve(import.meta.dir,"components")),z=M.map((re)=>ce.isAbsolute(re)?re:ce.resolve(A,re)),L=`${v.join("\x00")}\x00\x00${z.join("\x00")}`,ee=Ps.get(L);if(ee!==void 0)return ee;let te=!1;e:for(let re of z){if(po(re)===X)continue;for(let me of v)if(await s(ce.join(re,me))){te=!0;break e}}return Ps.set(L,te),te}function po(e){let t=Zs.get(e);if(t!==void 0)return t;let i=e;try{i=Zn.realpathSync(e)}catch{}return Zs.set(e,i),i}function fg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Xc(e){if(!e)return!1;let t=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(t)}function Tl(e,t,i){if(!e.includes("{{")&&!e.includes("{!!"))return e;let n=(c,l)=>{let a;try{a=T(c,t)}catch{return l}if(a===void 0||a===null)return"";let y=String(a);if(/<\/style/i.test(y))return console.warn(`[stx] a <style> expression in ${i??"<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,(c,l)=>n(l,c)).replace(/\{\{([\s\S]*?)\}\}/g,(c,l)=>n(l,c))}var go=new Set;function mo(e,t,i,n){let c=`${e}\x00${t}\x00${n??""}`;if(!process.env.STX_DEBUG&&go.has(c))return;go.add(c);let l=t?` used in ${t}`:"",a=n?` Cause: ${n}.`:"",y=i.length>0?`
286
286
  searched:
287
287
  ${i.map((v)=>` - ${v}`).join(`
288
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${a}${y}`)}function ho(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Il=new Set(["for","if","show","key","ref","class","className","style"]),xo=new Set,So="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Gc=new RegExp(`\\b(?:${So})\\s*(?:<[^>]*>)?\\s*\\(`);function yi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${So})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let c;while((c=i.exec(n))!==null)t.add(c[1]);i.lastIndex=0}return[...t]}async function Fe(e,t,i,n,c,l,a,y=new Set,v,E=rt(c),A,M=e){let{extractVariables:B}=await o("stx/variable-extractor",()=>import("./chunk-7aqdqfwf.js")),D=y??new Set;if(D.has(e))return`[Circular component reference: ${e}]`;let I=new Set(D);I.add(e);let j=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let Q=j&&j!=="load"&&fg(j)?j:"";try{let X=(se)=>se.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),z=M.endsWith(".stx")?M.slice(0,-4):M,L=null,ee=c.__importedComponents;if(ee){let se=[z,z.toLowerCase(),X(z),V(z)];for(let ae of se)if(ee.has(ae)){L=ee.get(ae);break}}let te=[];if(!L){let se=[`${z}.stx`,`${X(z)}.stx`,`${V(z)}.stx`],ae=[...new Set(se)],we=c.__originalFilePath,be=[];if(be.push(...a._layerComponentDirs??[]),we){let ye=ce.join(ce.dirname(we),"components");be.push(ye)}let Ue=a._rootComponentsDir;if(typeof Ue==="string"&&wo(n,a)&&!be.includes(Ue))be.push(Ue);if(n&&!be.includes(n))be.push(n);if(typeof Ue==="string"&&!be.includes(Ue))be.push(Ue);let Ae=ce.join(ce.dirname(l),"components");if(!be.includes(Ae))be.push(Ae);if(a.componentsDir&&a.componentsDir!==n&&!be.includes(a.componentsDir))be.push(a.componentsDir);for(let ye of a.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ct=a._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(z),lt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),es=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),ts=!lt.includes("valuechange")&&(yt||lt.includes("change")&&!es),gt=a._nativeHostAttrs&&/^textinput$/i.test(z),_t=lt.includes("update:value")&&!lt.includes("input"),Ht=a._nativeHostAttrs&&/^video$/i.test(z),ns=a._nativeHostAttrs&&/^image$/i.test(z),ln=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),un=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),_n=Ht&&wt&&!un&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),mt=(ye)=>Object.hasOwn(t,ye)||Boolean(A?.reactiveProps?.includes(ye)),Sn=a._nativeHostAttrs&&/^button$/i.test(z)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!i.trim()),Zt=a._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&(!ct||ts)&&(!gt||_t)&&(!Ht||_n)&&(!ns||ln)&&!Sn;for(let ye of Zt?[]:a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof a.root==="string"?ce.resolve(a.root):void 0,jo=St??ce.dirname(l),$t=[];if(St)$t.push(ce.resolve(St,"resources/views/components")),$t.push(ce.resolve(St,"resources/components")),$t.push(ce.resolve(St,"src/components")),$t.push(ce.resolve(St,"components"));$t.push(ce.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let sr=a._pluginComponentDirs;if(Array.isArray(sr)){for(let ye of sr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(a.fallbackComponentsDir&&!be.includes(a.fallbackComponentsDir))be.push(a.fallbackComponentsDir);if(Zt){for(let ye of a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let $n=a._nativePrimitivesFallback;if($n&&!$n.except.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&!be.includes($n.dir))be.push($n.dir);let rr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ce.isAbsolute(ye)?ye:ce.resolve(jo,ye)}))];be.length=0,be.push(...rr);let ss=`${z}\x00${l}\x00${rr.join("\x00")}`,rs=Vn.get(ss);if(rs)if(await s(rs))L=rs;else Vn.delete(ss);if(!L&&(z.startsWith("./")||z.startsWith("../")))L=ce.resolve(ce.dirname(l),`${z}.stx`),te.push(L);else if(!L)for(let ye of be){if(!ye)continue;for(let En of ae){let kn=ce.join(ye,En);if(te.push(kn),await s(kn)){L=kn;break}}if(L)break;if(!L)try{let En=await import("fs");if(!En.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let No=8,is=[{path:ye,depth:0}];while(is.length>0&&!L){let Rn=is.pop();if(Rn.depth>=No)continue;let ir;try{ir=En.readdirSync(Rn.path,{withFileTypes:!0})}catch{continue}for(let Cn of ir){if(!Cn.isDirectory())continue;if(Cn.name==="node_modules"||Cn.name.startsWith("."))continue;let or=ce.join(Rn.path,Cn.name);for(let Lo of ae){let os=ce.join(or,Lo);if(te.push(os),await s(os)){L=os;break}}if(L)break;is.push({path:or,depth:Rn.depth+1})}}}catch{}if(L)break}if(L)Vn.set(ss,L)}if(!L||!await s(L))return mo(e,l,te),ho(e);v.add(L);let re;if(tn.has(L)&&Ts.get(L)===lo(L))re=tn.get(L);else try{let se=lo(L);re=await Bun.file(L).text(),tn.set(L,re),Ts.set(L,se)}catch(se){let ae=se instanceof Error?se.message:String(se);return mo(e,l,[L],ae),ho(e)}if(A)for(let se of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ae=se.toLowerCase();if(ae.startsWith("aria-")||ae.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(re))A.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(re))A.consumedProps?.add(se)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(re))for(let se of A.reactiveProps){if(Il.has(se)||A.consumedProps?.has(se))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(re))continue;let ae=`${L}\x00${se}`;if(xo.has(ae))continue;xo.add(ae),console.warn(`[stx] ${ce.basename(L)} reads \`${se}\` with defineProps(), which is not live, but ${ce.basename(l)} binds it (:${se}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${se}').`)}let me=new Set(["__originalFilePath","__importedComponents",Pn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[se,ae]of Object.entries(c))if(!se.startsWith("__")||me.has(se))he[se]=ae;let le=E.length>0?{[Bn]:[...E]}:{},ke=i;if(i.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-qsepyy1p.js"));ke=await se(i,c,l,a,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ke)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-pnbh9fgm.js")),ae={...c,__processedComponents:D,...le};ke=await se(ke,ae,l,a,v);let we=ae.__stx_preserved_client_expressions;if(Array.isArray(we)&&we.length>0)c.__stx_preserved_client_expressions=[...new Set([...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...we])]}let Re=[];if(Xc(ke)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-x94q5ptn.js")),ae=c.__stx_signals_gate===void 0?{...c,__stx_signals_gate:!0,...le}:E.length>0?{...c,...le}:c;ke=se(ke,ae,l);for(let we of ke.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(we[1].trim())}let He=G(ke),Xe=[],Ze=He.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,ae)=>{let we=He.scripts[Number(ae)]||"",be=we.match(/^<script\b([^>]*)>/i)?.[1]||"",Ue=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ae=!Ue||["module","text/javascript","application/javascript"].includes(Ue),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Ae&&!ct)return Xe.push(we),"";return we}),{extractSlotContent:Kn}=await o("stx/slots",()=>import("./chunk-w717cyka.js")),ft=Kn(Ze),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[se,ae]of ft.namedSlots)pt[se]=ae.content;let dt=c.__stx_scope_seq??={n:0,key:Vs(String(c.__filename??l))},Ct=_o(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,We={...he,$uid:it,$native:a._nativeHostAttrs===!0,...t,props:t,slot:Ze,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:Se(re)||Xc(i),__stx_preserved_client_expressions:[...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...Re]};Cl(re,We);let Tt=re,sn=de(Tt);if(sn)Tt=sn.content.trim();let Xn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Xn)];for(let[,se,ae]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(ae,L,a.strict);let Je=[],Lt=null,Jn=Dt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,et=null,Bt=null,rn=0,Wt=null;if(wl(a),Jn&&Ks>0){let se=Sl({props:t,slot:ke,slotContext:i.trim()?$l(he):void 0,buildMode:a.buildMode??"",skipEventDirectives:a.skipEventDirectives===!0,native:a._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:a._layerGraph?.layers.map((ae)=>ae.configFile),uid:it});if(se!==null){bt=`${L}\x00${x(re)}\x00${se}`;let ae=Hn.get(bt);if(ae){for(let we of ae.dependencies)v.add(we);if(Kr(c,ae.clientFactories),dt.n+=ae.uidsConsumed,ae.preservedClientExpressions.length>0){let we=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let be of ae.preservedClientExpressions)we.add(be);c.__stx_preserved_client_expressions=[...we]}return ae.output}et=new Set(v),Bt=Zr(c),rn=dt.n,Wt=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let se of Dt){let ae=se[1]||"",we=se[2]||"",be=ae.includes("server");if(je(ae)&&we.trim())we=Be(we);if(be&&we){for(let Ae of Me(we))zt.add(Ae);try{await B(we,We,L,{onFailure:(Ae)=>{if(Ae.kind!=="unknown")Lt=Ae.kind}})}catch(Ae){}}if(!be){let Ae=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ae.includes("{{")&&Ae.includes("}}"),lt=Ae.includes("{!!")&&Ae.includes("!!}");if(ct||lt)Ae=wi(Ae,We,L);let yt=ae.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${yt}>${Ae}</script>`)}}let Ge=G(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ge?Ge[1]:"",Gn=Ge?Ge[2]:"",tt="",ne=Ft&&/\bscoped\b/i.test(Ft);if(Ge)tt=`<style${Ft}>${Tl(Gn,We,L)}</style>`;let ie=Tt;if(ie=ie.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ge)ie=ie.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ae=[];if(ie=ie.replace(se,(we,be)=>{let Ue=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ue)ae.push(`<style${Ue[1]}>${Ue[2]}</style>`);return""}),ie=ie.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ae.length>0)tt=`${tt}${ae.join(`
289
- `)}`}if(i&&ie.includes("{{ text || slot }}"))ie=ie.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-w717cyka.js")),{defaultSlot:$e,namedSlots:Ce}=ft,qe=c.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ze),nt=a._nativeHostAttrs===!0&&Je.length>0||qe&&Je.length>0||Je.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)),Yn=(se)=>nt?Ni(se,it):se,Qn=new Map([...Ce].map(([se,ae])=>[se,{...ae,content:Yn(ae.content)}]));ie=await ue(ie,Yn($e),Qn,We,nt?it:"");let on=yi(Je),Ut=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((se)=>!zt.has(se));if(on.length>0||Ut.length>0)We.__stx_client_signal_names=[...new Set([...Ut,...on])];else delete We.__stx_client_signal_names;let Vt=E.filter((se)=>!zt.has(se)&&!(se in t));if(Vt.length>0)We[Bn]=Vt;let cn={...a,_rootComponentsDir:a._rootComponentsDir||a.componentsDir,componentsDir:ce.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:a._nativeHostAttrs===!0||nt||Je.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(c.__stxProcessingDepth||0)+1;let{processDirectives:an}=await o("stx/process",()=>import("./chunk-2m60sqvs.js")),Ye=await an(ie,We,L,cn,v),ot=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let se of Ye.matchAll(/\{\{([\s\S]*?)\}\}/g))ot.add(se[1].trim());if(ot.size>0)c.__stx_preserved_client_expressions=[...ot];let st=it,Ke=Ye;if(nt){let se="";if(Object.keys(t).length>0)try{se=` data-stx-props="${Cs(JSON.stringify(t))}"`}catch{}let ae=Q?` stx-hydrate="${Cs(Q)}"`:"",we=Object.fromEntries(Object.entries(pt).map(([gt,_t])=>[gt,Boolean(_t)])),be=Object.keys(we).length>0?` data-stx-slots="${Cs(JSON.stringify(we))}"`:"",Ue=` data-stx-scope="${st}"${se}${be}${ae}`,Ae=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Ye),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Ye),lt=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Ye),yt=Ae?"span":"div",es=ct&&a._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':lt&&a._nativeHostAttrs?' style="width:100%;height:100%"':Ae||ct?' style="display:contents"':"";Ke=pg(Ye,Ue)??`<${yt}${Ue} data-stx-component-wrapper${es}>${Ye}</${yt}>`;let ts=await Promise.all(Je.map(async(gt)=>{let _t=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return gt;let[,Ht,ns]=_t,ln=ao(gt,We,L);if(ln!==null)return ln;let wt=await Pl(ns,L,a.buildMode==="compile"),un=yn(wt.clientCode,De(We)),{vendorStyleTags:_n}=wt,mt=un?`function(__scopeId) {
288
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${a}${y}`)}function ho(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Il=new Set(["for","if","show","key","ref","class","className","style"]),xo=new Set,So="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Gc=new RegExp(`\\b(?:${So})\\s*(?:<[^>]*>)?\\s*\\(`);function yi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${So})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let c;while((c=i.exec(n))!==null)t.add(c[1]);i.lastIndex=0}return[...t]}async function Fe(e,t,i,n,c,l,a,y=new Set,v,E=rt(c),A,M=e){let{extractVariables:B}=await o("stx/variable-extractor",()=>import("./chunk-hbq922er.js")),D=y??new Set;if(D.has(e))return`[Circular component reference: ${e}]`;let I=new Set(D);I.add(e);let j=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let Q=j&&j!=="load"&&fg(j)?j:"";try{let X=(se)=>se.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),z=M.endsWith(".stx")?M.slice(0,-4):M,L=null,ee=c.__importedComponents;if(ee){let se=[z,z.toLowerCase(),X(z),V(z)];for(let ae of se)if(ee.has(ae)){L=ee.get(ae);break}}let te=[];if(!L){let se=[`${z}.stx`,`${X(z)}.stx`,`${V(z)}.stx`],ae=[...new Set(se)],we=c.__originalFilePath,be=[];if(be.push(...a._layerComponentDirs??[]),we){let ye=ce.join(ce.dirname(we),"components");be.push(ye)}let Ue=a._rootComponentsDir;if(typeof Ue==="string"&&wo(n,a)&&!be.includes(Ue))be.push(Ue);if(n&&!be.includes(n))be.push(n);if(typeof Ue==="string"&&!be.includes(Ue))be.push(Ue);let Ae=ce.join(ce.dirname(l),"components");if(!be.includes(Ae))be.push(Ae);if(a.componentsDir&&a.componentsDir!==n&&!be.includes(a.componentsDir))be.push(a.componentsDir);for(let ye of a.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ct=a._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(z),lt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),es=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),ts=!lt.includes("valuechange")&&(yt||lt.includes("change")&&!es),gt=a._nativeHostAttrs&&/^textinput$/i.test(z),_t=lt.includes("update:value")&&!lt.includes("input"),Ht=a._nativeHostAttrs&&/^video$/i.test(z),ns=a._nativeHostAttrs&&/^image$/i.test(z),ln=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),un=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),_n=Ht&&wt&&!un&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),mt=(ye)=>Object.hasOwn(t,ye)||Boolean(A?.reactiveProps?.includes(ye)),Sn=a._nativeHostAttrs&&/^button$/i.test(z)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!i.trim()),Zt=a._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&(!ct||ts)&&(!gt||_t)&&(!Ht||_n)&&(!ns||ln)&&!Sn;for(let ye of Zt?[]:a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof a.root==="string"?ce.resolve(a.root):void 0,jo=St??ce.dirname(l),$t=[];if(St)$t.push(ce.resolve(St,"resources/views/components")),$t.push(ce.resolve(St,"resources/components")),$t.push(ce.resolve(St,"src/components")),$t.push(ce.resolve(St,"components"));$t.push(ce.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let sr=a._pluginComponentDirs;if(Array.isArray(sr)){for(let ye of sr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(a.fallbackComponentsDir&&!be.includes(a.fallbackComponentsDir))be.push(a.fallbackComponentsDir);if(Zt){for(let ye of a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let $n=a._nativePrimitivesFallback;if($n&&!$n.except.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&!be.includes($n.dir))be.push($n.dir);let rr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ce.isAbsolute(ye)?ye:ce.resolve(jo,ye)}))];be.length=0,be.push(...rr);let ss=`${z}\x00${l}\x00${rr.join("\x00")}`,rs=Vn.get(ss);if(rs)if(await s(rs))L=rs;else Vn.delete(ss);if(!L&&(z.startsWith("./")||z.startsWith("../")))L=ce.resolve(ce.dirname(l),`${z}.stx`),te.push(L);else if(!L)for(let ye of be){if(!ye)continue;for(let En of ae){let kn=ce.join(ye,En);if(te.push(kn),await s(kn)){L=kn;break}}if(L)break;if(!L)try{let En=await import("fs");if(!En.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let No=8,is=[{path:ye,depth:0}];while(is.length>0&&!L){let Rn=is.pop();if(Rn.depth>=No)continue;let ir;try{ir=En.readdirSync(Rn.path,{withFileTypes:!0})}catch{continue}for(let Cn of ir){if(!Cn.isDirectory())continue;if(Cn.name==="node_modules"||Cn.name.startsWith("."))continue;let or=ce.join(Rn.path,Cn.name);for(let Lo of ae){let os=ce.join(or,Lo);if(te.push(os),await s(os)){L=os;break}}if(L)break;is.push({path:or,depth:Rn.depth+1})}}}catch{}if(L)break}if(L)Vn.set(ss,L)}if(!L||!await s(L))return mo(e,l,te),ho(e);v.add(L);let re;if(tn.has(L)&&Ts.get(L)===lo(L))re=tn.get(L);else try{let se=lo(L);re=await Bun.file(L).text(),tn.set(L,re),Ts.set(L,se)}catch(se){let ae=se instanceof Error?se.message:String(se);return mo(e,l,[L],ae),ho(e)}if(A)for(let se of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ae=se.toLowerCase();if(ae.startsWith("aria-")||ae.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(re))A.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(re))A.consumedProps?.add(se)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(re))for(let se of A.reactiveProps){if(Il.has(se)||A.consumedProps?.has(se))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(re))continue;let ae=`${L}\x00${se}`;if(xo.has(ae))continue;xo.add(ae),console.warn(`[stx] ${ce.basename(L)} reads \`${se}\` with defineProps(), which is not live, but ${ce.basename(l)} binds it (:${se}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${se}').`)}let me=new Set(["__originalFilePath","__importedComponents",Pn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[se,ae]of Object.entries(c))if(!se.startsWith("__")||me.has(se))he[se]=ae;let le=E.length>0?{[Bn]:[...E]}:{},ke=i;if(i.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-qxr4teqr.js"));ke=await se(i,c,l,a,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ke)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-81pykb48.js")),ae={...c,__processedComponents:D,...le};ke=await se(ke,ae,l,a,v);let we=ae.__stx_preserved_client_expressions;if(Array.isArray(we)&&we.length>0)c.__stx_preserved_client_expressions=[...new Set([...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...we])]}let Re=[];if(Xc(ke)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-9k037sk6.js")),ae=c.__stx_signals_gate===void 0?{...c,__stx_signals_gate:!0,...le}:E.length>0?{...c,...le}:c;ke=se(ke,ae,l);for(let we of ke.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(we[1].trim())}let He=G(ke),Xe=[],Ze=He.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,ae)=>{let we=He.scripts[Number(ae)]||"",be=we.match(/^<script\b([^>]*)>/i)?.[1]||"",Ue=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ae=!Ue||["module","text/javascript","application/javascript"].includes(Ue),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Ae&&!ct)return Xe.push(we),"";return we}),{extractSlotContent:Kn}=await o("stx/slots",()=>import("./chunk-vhe6p6b0.js")),ft=Kn(Ze),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[se,ae]of ft.namedSlots)pt[se]=ae.content;let dt=c.__stx_scope_seq??={n:0,key:Vs(String(c.__filename??l))},Ct=_o(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,We={...he,$uid:it,$native:a._nativeHostAttrs===!0,...t,props:t,slot:Ze,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:Se(re)||Xc(i),__stx_preserved_client_expressions:[...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...Re]};Cl(re,We);let Tt=re,sn=de(Tt);if(sn)Tt=sn.content.trim();let Xn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Xn)];for(let[,se,ae]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(ae,L,a.strict);let Je=[],Lt=null,Jn=Dt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,et=null,Bt=null,rn=0,Wt=null;if(wl(a),Jn&&Ks>0){let se=Sl({props:t,slot:ke,slotContext:i.trim()?$l(he):void 0,buildMode:a.buildMode??"",skipEventDirectives:a.skipEventDirectives===!0,native:a._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:a._layerGraph?.layers.map((ae)=>ae.configFile),uid:it});if(se!==null){bt=`${L}\x00${x(re)}\x00${se}`;let ae=Hn.get(bt);if(ae){for(let we of ae.dependencies)v.add(we);if(Kr(c,ae.clientFactories),dt.n+=ae.uidsConsumed,ae.preservedClientExpressions.length>0){let we=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let be of ae.preservedClientExpressions)we.add(be);c.__stx_preserved_client_expressions=[...we]}return ae.output}et=new Set(v),Bt=Zr(c),rn=dt.n,Wt=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let se of Dt){let ae=se[1]||"",we=se[2]||"",be=ae.includes("server");if(je(ae)&&we.trim())we=Be(we);if(be&&we){for(let Ae of Me(we))zt.add(Ae);try{await B(we,We,L,{onFailure:(Ae)=>{if(Ae.kind!=="unknown")Lt=Ae.kind}})}catch(Ae){}}if(!be){let Ae=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ae.includes("{{")&&Ae.includes("}}"),lt=Ae.includes("{!!")&&Ae.includes("!!}");if(ct||lt)Ae=wi(Ae,We,L);let yt=ae.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${yt}>${Ae}</script>`)}}let Ge=G(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ge?Ge[1]:"",Gn=Ge?Ge[2]:"",tt="",ne=Ft&&/\bscoped\b/i.test(Ft);if(Ge)tt=`<style${Ft}>${Tl(Gn,We,L)}</style>`;let ie=Tt;if(ie=ie.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ge)ie=ie.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ae=[];if(ie=ie.replace(se,(we,be)=>{let Ue=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ue)ae.push(`<style${Ue[1]}>${Ue[2]}</style>`);return""}),ie=ie.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ae.length>0)tt=`${tt}${ae.join(`
289
+ `)}`}if(i&&ie.includes("{{ text || slot }}"))ie=ie.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-vhe6p6b0.js")),{defaultSlot:$e,namedSlots:Ce}=ft,qe=c.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ze),nt=a._nativeHostAttrs===!0&&Je.length>0||qe&&Je.length>0||Je.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)),Yn=(se)=>nt?Ni(se,it):se,Qn=new Map([...Ce].map(([se,ae])=>[se,{...ae,content:Yn(ae.content)}]));ie=await ue(ie,Yn($e),Qn,We,nt?it:"");let on=yi(Je),Ut=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((se)=>!zt.has(se));if(on.length>0||Ut.length>0)We.__stx_client_signal_names=[...new Set([...Ut,...on])];else delete We.__stx_client_signal_names;let Vt=E.filter((se)=>!zt.has(se)&&!(se in t));if(Vt.length>0)We[Bn]=Vt;let cn={...a,_rootComponentsDir:a._rootComponentsDir||a.componentsDir,componentsDir:ce.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:a._nativeHostAttrs===!0||nt||Je.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(c.__stxProcessingDepth||0)+1;let{processDirectives:an}=await o("stx/process",()=>import("./chunk-s7db9xc4.js")),Ye=await an(ie,We,L,cn,v),ot=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let se of Ye.matchAll(/\{\{([\s\S]*?)\}\}/g))ot.add(se[1].trim());if(ot.size>0)c.__stx_preserved_client_expressions=[...ot];let st=it,Ke=Ye;if(nt){let se="";if(Object.keys(t).length>0)try{se=` data-stx-props="${Cs(JSON.stringify(t))}"`}catch{}let ae=Q?` stx-hydrate="${Cs(Q)}"`:"",we=Object.fromEntries(Object.entries(pt).map(([gt,_t])=>[gt,Boolean(_t)])),be=Object.keys(we).length>0?` data-stx-slots="${Cs(JSON.stringify(we))}"`:"",Ue=` data-stx-scope="${st}"${se}${be}${ae}`,Ae=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Ye),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Ye),lt=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Ye),yt=Ae?"span":"div",es=ct&&a._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':lt&&a._nativeHostAttrs?' style="width:100%;height:100%"':Ae||ct?' style="display:contents"':"";Ke=pg(Ye,Ue)??`<${yt}${Ue} data-stx-component-wrapper${es}>${Ye}</${yt}>`;let ts=await Promise.all(Je.map(async(gt)=>{let _t=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return gt;let[,Ht,ns]=_t,ln=ao(gt,We,L);if(ln!==null)return ln;let wt=await Pl(ns,L,a.buildMode==="compile"),un=yn(wt.clientCode,De(We)),{vendorStyleTags:_n}=wt,mt=un?`function(__scopeId) {
290
290
  ${un}
291
291
  return (${wt.factoryBody})(__scopeId);
292
292
  }`:wt.factoryBody,Sn=Q?null:hs(c,mt),Zt=Sn?`window.__stxComponentFactories[${JSON.stringify(Sn)}](${JSON.stringify(st)});`:`(${mt})(${JSON.stringify(st)});`;if(Q)return`${_n}<script type="stx/island" data-stx-island="${st}" data-stx-scoped data-stx-owner="${st}"${Ht}>${Zt}</script>`;return`${_n}<script data-stx-scoped data-stx-run="always" data-stx-owner="${st}"${Ht}>${Zt}</script>`}));if(Ke=Ke+`
@@ -312,7 +312,7 @@ ${Ee.yellow}${Ee.bold}Message:${Ee.reset} ${t}
312
312
  `,y)A+=`
313
313
  ${Ee.blue}${Ee.bold}Context:${Ee.reset}
314
314
  ${Ee.dim}${y}${Ee.reset}
315
- `;return A}function fe(){tn.clear(),Ts.clear(),Vn.clear(),Ps.clear(),Zs.clear(),Hn.clear()}function Xh(){return{size:tn.size,maxSize:500}}var As=b(128);async function Pl(e,t,i){let n=x(e,t,i),c=As.get(n);if(c){if(Ls(c.deps))return c;As.delete(n)}let l=mi(e,{filePath:t,projectRoot:process.cwd()}),a=l.code,y=hi(l.styles);a=Nt(a).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-526n626z.js")),A=[],M=!1;if(v(a)){let z=a;a=await E(z,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),M=a===z}let{stripStxRuntimeImports:B}=await o("stx/signal-processing",()=>import("./chunk-54w0epxq.js"));a=B(a);let D=P(a),I=El(D),j=new Set(H(D,!0).split(",").map((z)=>z.trim())),Q=`function(__scopeId) {
315
+ `;return A}function fe(){tn.clear(),Ts.clear(),Vn.clear(),Ps.clear(),Zs.clear(),Hn.clear()}function Xh(){return{size:tn.size,maxSize:500}}var As=b(128);async function Pl(e,t,i){let n=x(e,t,i),c=As.get(n);if(c){if(Ls(c.deps))return c;As.delete(n)}let l=mi(e,{filePath:t,projectRoot:process.cwd()}),a=l.code,y=hi(l.styles);a=Nt(a).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-0x02gm7d.js")),A=[],M=!1;if(v(a)){let z=a;a=await E(z,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),M=a===z}let{stripStxRuntimeImports:B}=await o("stx/signal-processing",()=>import("./chunk-yacdg7kq.js"));a=B(a);let D=P(a),I=El(D),j=new Set(H(D,!0).split(",").map((z)=>z.trim())),Q=`function(__scopeId) {
316
316
  ${at("const",[...ll,...I],D)}
317
317
  const __scope = window.stx._scopes = window.stx._scopes || {};
318
318
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ya,ou,Fn,Pm,iu,au,cu,Im}from"./chunk-8zexecar.js";import"./chunk-rx5ak659.js";import"./chunk-qfqv3fjm.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{Fn as Validator,ou as defineForm,iu as processErrorDirective,au as processErrorsDirective,Im as processFormValidationDirectives,cu as processHasErrorsDirective,ya as useForm,Pm as v};
2
+ import{ya,ou,Fn,Pm,iu,au,cu,Im}from"./chunk-b12wg4jp.js";import"./chunk-d2vr1169.js";import"./chunk-8taa0exz.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{Fn as Validator,ou as defineForm,iu as processErrorDirective,au as processErrorsDirective,Im as processFormValidationDirectives,cu as processHasErrorsDirective,ya as useForm,Pm as v};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-ybjfr7e8.js";import"./chunk-r9e0r6jx.js";import"./chunk-gebb12ak.js";import{b,x,C,Y}from"./chunk-rx5ak659.js";import"./chunk-m7hfcxt3.js";import"./chunk-qfqv3fjm.js";import f from"path";var h=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(h);var l=new Map,S=b(64),w=new Set,k=0,R=new Set(h);function T(){l.clear(),S.clear()}function P(n){let o=new Map;for(let r of n){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=o.get(t);if(i&&!i.endsWith(".js"))continue;o.set(t,r)}return[...o.values()].sort()}function I(n,o){let r=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(n)}function M(n){if(!n)return[];let o=x(n,k),r=S.get(o);if(r)return r.slice();let a=n.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(w.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),S.set(o,t),t.slice()}async function A(n,o){let r=M(n);if(r.length===0)return null;let a=o??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=Y({loader:"ts",target:"browser",define:C()}),O=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
2
+ import"./chunk-ybjfr7e8.js";import"./chunk-r9e0r6jx.js";import"./chunk-gebb12ak.js";import{b,x,C,Y}from"./chunk-d2vr1169.js";import"./chunk-m7hfcxt3.js";import"./chunk-8taa0exz.js";import f from"path";var h=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(h);var l=new Map,S=b(64),w=new Set,k=0,R=new Set(h);function T(){l.clear(),S.clear()}function P(n){let o=new Map;for(let r of n){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=o.get(t);if(i&&!i.endsWith(".js"))continue;o.set(t,r)}return[...o.values()].sort()}function I(n,o){let r=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(n)}function M(n){if(!n)return[];let o=x(n,k),r=S.get(o);if(r)return r.slice();let a=n.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(w.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),S.set(o,t),t.slice()}async function A(n,o){let r=M(n);if(r.length===0)return null;let a=o??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=Y({loader:"ts",target:"browser",define:C()}),O=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
3
3
  ${u.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let y=r.filter((s)=>!d.has(s)&&!I(n,s));if(y.length>0)console.warn(`[stx] could not bundle ${y.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return l.set(t,""),null;let E=[...d].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
4
4
  `),v=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
5
  ;(function(){
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{er,$e}from"./chunk-7sh9fa3q.js";import{H,b,br,Ls,C}from"./chunk-rx5ak659.js";import{a,I}from"./chunk-hvdmhzad.js";import{Oo}from"./chunk-9bt479pb.js";import{nt}from"./chunk-5emrarpf.js";import{c}from"./chunk-0rjcbqk3.js";import{r,ge}from"./chunk-3vpgr6nk.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function W(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||Oo(t,e,n)}var at=2;function wf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function st(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var rt=new Map;function wt(t){let e=p.resolve(t),n=rt.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),rt.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function vf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function jt(t){let e=G.get(t)??0;if(e>0&&e<vt){G.set(t,e+1);return}G.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=vf();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,w)=>w.at-o.at);for(let o of d.slice(i)){let w=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${w}.js`),{force:!0}),await B.promises.rm(p.join(t,`${w}.deps.json`),{force:!0})}A("pruned bundle cache to",i,"entries")}catch{}}function he(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function xf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function A(...t){if(xf())console.log("[stx:bundler]",...t)}var K=[];function ec(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function en(){return K.slice()}function tn(){K.length=0}var Q;function Sh(t){Q=t}function tc(){if(Q)return Q;try{let t=I.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function nn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return A("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return A("detected side-effect import:",l),!0}return!1}var Qn="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function Sf(t,e){return p.relative(t,e).split(p.sep).join("/")}function kf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(Qn)?`${i}${l}${o}${l}`:n})}function _f(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,w=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let w of d.split(",")){let D=w.trim();if(!D)continue;let M=D.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,w)=>{let D=w.slice(Qn.length),M=i(D),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(Qn.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var X=new xt;function os(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return X.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function rn(){return X.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,w,D,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,s,u)=>{if(W(s,t,w))return null;if(!d||!f(j)||!Bt.test(s))return null;try{if(!B.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(s);let E=`${Qn}${Sf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(j,s)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,s);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=it(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:s.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(s)=>{let u=p.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let O=v(s.importer,h,s.path);if(O)return O;return A(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${Qn}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(S.has(s.path))return{contents:S.get(s.path),loader:"ts"};if(W(s.path,t,w))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=p.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))l.add(s.path);let h=D?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(s.path,"utf8"),loader:E}})}}}var q=new Map,P=b(64),ot=Symbol.for("stx.client-bundle-build-queue");function Cf(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function sn(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,w=n.expose?.length?[...new Set(n.expose)].sort():void 0,D=n.cacheDir||wf(i),M=X.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${nt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${st(t,i)}\x00${st(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(D,`${f}.js`),y=P.get(v);if(y){if(Ls(y.files)&&y.files.every((h)=>!W(h.path,i,l))){A("memo hit:",f);let h=y.files.map((O)=>O.path);return Z(e,h),n.collectInputs?.push(...h),y.code}P.delete(v),A("memo invalidated by dep change:",f)}let j=p.join(D,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(j),O=!1,k=null;if(await h.exists())try{let N=JSON.parse(await h.text());if(N.metadataVersion===at&&Array.isArray(N.files)&&St(N.files,i))k=br(N.files.map((g)=>ct(g,i))),O=k.length===N.files.length&&!k.some((g)=>W(g.path,i,l))}catch{O=!1}if(O){if(A("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let N=await s.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),k)P.set(v,{code:N,files:k});return N}A("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(P.get(v)?.files??[]).map((O)=>O.path));return h}let E=Cf(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:D,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:w,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function nc(t){return`${t}-${process.pid}-${yt()}`}async function kh(t,e){let{projectRoot:n}=e,i=nc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,w=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${w++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[D,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),D,M,S,!1,new Map,void 0,X.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let s=o.get(j.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:w,depsPath:D,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=nc(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:O,balanced:k}=ge(h),N=(R)=>!k||O[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;s.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!N(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)s.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let pt=s.size>0?`
2
+ import{er,$e}from"./chunk-7sh9fa3q.js";import{H,b,br,Ls,C}from"./chunk-d2vr1169.js";import{a,I}from"./chunk-kmr3cd71.js";import{Oo}from"./chunk-m8w7rcmt.js";import{nt}from"./chunk-5emrarpf.js";import{c}from"./chunk-0rjcbqk3.js";import{r,ge}from"./chunk-3vpgr6nk.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function W(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||Oo(t,e,n)}var at=2;function wf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function st(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var rt=new Map;function wt(t){let e=p.resolve(t),n=rt.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),rt.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function vf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function jt(t){let e=G.get(t)??0;if(e>0&&e<vt){G.set(t,e+1);return}G.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=vf();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,w)=>w.at-o.at);for(let o of d.slice(i)){let w=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${w}.js`),{force:!0}),await B.promises.rm(p.join(t,`${w}.deps.json`),{force:!0})}A("pruned bundle cache to",i,"entries")}catch{}}function he(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function xf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function A(...t){if(xf())console.log("[stx:bundler]",...t)}var K=[];function ec(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function en(){return K.slice()}function tn(){K.length=0}var Q;function Sh(t){Q=t}function tc(){if(Q)return Q;try{let t=I.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function nn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return A("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return A("detected side-effect import:",l),!0}return!1}var Qn="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function Sf(t,e){return p.relative(t,e).split(p.sep).join("/")}function kf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(Qn)?`${i}${l}${o}${l}`:n})}function _f(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,w=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let w of d.split(",")){let D=w.trim();if(!D)continue;let M=D.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,w)=>{let D=w.slice(Qn.length),M=i(D),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(Qn.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var X=new xt;function os(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return X.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function rn(){return X.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,w,D,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,s,u)=>{if(W(s,t,w))return null;if(!d||!f(j)||!Bt.test(s))return null;try{if(!B.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(s);let E=`${Qn}${Sf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(j,s)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,s);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),j.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=it(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:s.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(s)=>{let u=p.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let O=v(s.importer,h,s.path);if(O)return O;return A(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${Qn}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(S.has(s.path))return{contents:S.get(s.path),loader:"ts"};if(W(s.path,t,w))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=p.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))l.add(s.path);let h=D?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(s.path,"utf8"),loader:E}})}}}var q=new Map,P=b(64),ot=Symbol.for("stx.client-bundle-build-queue");function Cf(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function sn(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,w=n.expose?.length?[...new Set(n.expose)].sort():void 0,D=n.cacheDir||wf(i),M=X.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${nt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${st(t,i)}\x00${st(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(D,`${f}.js`),y=P.get(v);if(y){if(Ls(y.files)&&y.files.every((h)=>!W(h.path,i,l))){A("memo hit:",f);let h=y.files.map((O)=>O.path);return Z(e,h),n.collectInputs?.push(...h),y.code}P.delete(v),A("memo invalidated by dep change:",f)}let j=p.join(D,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(j),O=!1,k=null;if(await h.exists())try{let N=JSON.parse(await h.text());if(N.metadataVersion===at&&Array.isArray(N.files)&&St(N.files,i))k=br(N.files.map((g)=>ct(g,i))),O=k.length===N.files.length&&!k.some((g)=>W(g.path,i,l))}catch{O=!1}if(O){if(A("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let N=await s.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),k)P.set(v,{code:N,files:k});return N}A("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(P.get(v)?.files??[]).map((O)=>O.path));return h}let E=Cf(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:D,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:w,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function nc(t){return`${t}-${process.pid}-${yt()}`}async function kh(t,e){let{projectRoot:n}=e,i=nc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,w=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${w++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[D,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),D,M,S,!1,new Map,void 0,X.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let s=o.get(j.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:w,depsPath:D,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=nc(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:O,balanced:k}=ge(h),N=(R)=>!k||O[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;s.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!N(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)s.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let pt=s.size>0?`
3
3
  export { ${[...s].join(", ")} }`:"";A("bundling:",o,"from:",p.basename(e));let tt=new Set,et=new Map;try{let R=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:l?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ut(i,j,v,t+pt,tt,M,et,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":l?'"production"':'"development"',...C()},root:i});if(!R.success){let F=R.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${p.basename(e)}`,z=er(R.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",F),ec(e||"",F,z),n.throwOnFailure||tc()==="error")throw Error(F);return t}let m="";for(let x of R.outputs){m=await x.text();break}let _=[];for(let x of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let z=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){_.push([z[2],z[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))_.push([T,T])}if(n.expose){let x=new Set(n.expose);for(let F=_.length-1;F>=0;F--)if(!x.has(_[F][0]))_.splice(F,1)}let L=[];m=_f(kf(m,et),L);let dt=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),l&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let V=`__stxBundle_${o}`,ft=new Set(H(t,!0).split(",").map((x)=>x.trim())),mt=_.map(([x,F])=>`get ${JSON.stringify(x)}() { return ${F} }${ft.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${F}) { ${F} = __stxValue_${F} }`:""}`).join(", "),gt=_.map(([x])=>`var ${x} = undefined;`).join(`
4
4
  `),ht=_.map(([x])=>`${x} = ${V}[${JSON.stringify(x)}];`).join(`
5
5
  `);if(m=`${dt.join(`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Lt,ie,u,f,A,t,ae,q,l,ke,ki,F,Sn,_i,Ft,Ci,rl,Rr,sl,it,ol,Ar,il,kn,Ei,al,Pr,Or,_e,Ti}from"./chunk-gebb12ak.js";import{ai,$c,o,C,Oe,pn,Ne,pe,G,vr,fn,Bs,jc,mn,Cr,zs,Hs,Bc,fi,Fc,zc,Hc,Vc,De,Le,Vs,Fe,s,bn,h,p,U,Z,Se,_,T}from"./chunk-rx5ak659.js";import{Dt}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-qfqv3fjm.js";import{y}from"./chunk-he9zzsh4.js";import{gr,Ps}from"./chunk-bmkm1c8s.js";import{pc,fc,dr,Qe,gc,I}from"./chunk-hvdmhzad.js";import{Zo,Qo,ei,ti}from"./chunk-3z0e637x.js";import{ac,ds}from"./chunk-91re9xtj.js";import{as,cs,ls}from"./chunk-ethnqap6.js";import{ms,Uo,Wo,hs,ys,qo}from"./chunk-v0kn4q29.js";import{ps,or}from"./chunk-0dm38zt6.js";import{Do}from"./chunk-c84pxd2k.js";import{se,Fo,zo,Ho}from"./chunk-y7sf7aj0.js";import{ar,be,lc,cr,uc}from"./chunk-ajg7tvn1.js";import{j,Ye}from"./chunk-cmnze7at.js";import{mc,hc}from"./chunk-jj5b4h6f.js";import{E,_n,$i}from"./chunk-c5vzr1va.js";import us from"fs";import ce from"path";function dt(){return`
2
+ import{Lt,ie,u,f,A,t,ae,q,l,ke,ki,F,Sn,_i,Ft,Ci,rl,Rr,sl,it,ol,Ar,il,kn,Ei,al,Pr,Or,_e,Ti}from"./chunk-gebb12ak.js";import{ai,$c,o,C,Oe,pn,Ne,pe,G,vr,fn,Bs,jc,mn,Cr,zs,Hs,Bc,fi,Fc,zc,Hc,Vc,De,Le,Vs,Fe,s,bn,h,p,U,Z,Se,_,T}from"./chunk-d2vr1169.js";import{Dt}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-8taa0exz.js";import{y}from"./chunk-m8zbae89.js";import{gr,Ps}from"./chunk-bmkm1c8s.js";import{pc,fc,dr,Qe,gc,I}from"./chunk-kmr3cd71.js";import{Zo,Qo,ei,ti}from"./chunk-3z0e637x.js";import{ac,ds}from"./chunk-p9y5hh4m.js";import{as,cs,ls}from"./chunk-5d8123c9.js";import{ms,Uo,Wo,hs,ys,qo}from"./chunk-3ht64v1a.js";import{ps,or}from"./chunk-q9ggx1jb.js";import{Do}from"./chunk-c84pxd2k.js";import{se,Fo,zo,Ho}from"./chunk-y7sf7aj0.js";import{ar,be,lc,cr,uc}from"./chunk-1cxf9chb.js";import{j,Ye}from"./chunk-cmnze7at.js";import{mc,hc}from"./chunk-c5fved0k.js";import{E,_n,$i}from"./chunk-c5vzr1va.js";import us from"fs";import ce from"path";function dt(){return`
3
3
  // STX Lifecycle Runtime
4
4
  (function() {
5
5
  if (typeof window === 'undefined') return;
@@ -1558,7 +1558,7 @@ ${M}
1558
1558
  </style>`;a=a.replace(x,O),v.lastIndex=0}catch(M){}}}return a}import ot from"path";var rs=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,ss=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function os(r,e){if(!e||!r.includes("/"))return r;let c=ot.dirname(e);return r.replace(rs,(a,d,n,g)=>{let v=ot.resolve(c,g);return`${d}${n}${v.split(ot.sep).join("/")}${n}`})}function un(r,e){if(!e||!r.includes("<script"))return r;return r.replace(ss,(c,a,d,n)=>`${a}${os(d,e)}${n}`)}var Te="<!--PARENT_CONTENT_PLACEHOLDER-->";function dn(r){return r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function En(r,e){let c=r.length,a=e,d=!0,n=[],g=(v)=>v+9<=c&&r[v]==="<"&&r[v+1]==="/"&&(r[v+2]==="s"||r[v+2]==="S")&&(r[v+3]==="c"||r[v+3]==="C")&&(r[v+4]==="r"||r[v+4]==="R")&&(r[v+5]==="i"||r[v+5]==="I")&&(r[v+6]==="p"||r[v+6]==="P")&&(r[v+7]==="t"||r[v+7]==="T")&&(r[v+8]===">"||/\s/.test(r[v+8]));while(a<c){let v=r[a];if(g(a))return a;if(v==="/"&&r[a+1]==="/"){if(a=r.indexOf(`
1559
1559
  `,a+2),a===-1)return-1;a+=1,d=!0;continue}if(v==="/"&&r[a+1]==="*"){let m=r.indexOf("*/",a+2);if(m===-1)return-1;a=m+2,d=!0;continue}if(v==="/"&&d){let m=a+1,x=!1;while(m<c){let b=r[m];if(b==="\\"){m+=2;continue}if(b==="[")x=!0;else if(b==="]")x=!1;else if(b==="/"&&!x){m++;break}else if(b===`
1560
1560
  `){m=-1;break}m++}if(m===-1){a++,d=!1;continue}while(m<c&&/[a-z]/.test(r[m]))m++;a=m,d=!1;continue}if(v==="'"||v==='"'){let m=v;a++;while(a<c){if(r[a]==="\\"){a+=2;continue}if(r[a]===m){a++;break}if(r[a]===`
1561
- `)break;a++}d=!1;continue}if(v==="`"){a++;while(a<c){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++;break}if(r[a]==="$"&&r[a+1]==="{"){n.push(!0),a+=2,d=!0;break}a++}if(n.length===0)d=!1;continue}if(v==="}"&&n.length>0){n.pop(),a++;while(a<c){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++,d=!1;break}if(r[a]==="$"&&r[a+1]==="{"){n.push(!0),a+=2,d=!0;break}a++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))d=!1;else d=!0;a++}return-1}function Tn(r,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(r);if(!a)return null;let d=a.index+a[0].length,n=r.indexOf("</script>",d);if(n===-1)return null;let g=r.indexOf(">",n);if(g===-1)return null;return{start:a.index,end:g+1}}var fs=4096;async function at(r,e,c){if(c.buildMode!=="serve"||e.length<fs)return null;let{registerServeModuleBundle:a}=await import("./chunk-bkq60hpn.js");return`<script ${r} src="${a(e)}"></script>`}async function tr(r,e,c,a){try{let{registeredModuleIdsIn:d,buildModuleRegistryScript:n}=await o("stx/client-module-registry",()=>import("./chunk-hhahbv6g.js")),g=[],v=await n(d(...r),{minify:$i(e.buildMode,e.minifyClient),collectInputs:g});for(let m of g)c?.add(m);if(a)a.inputs=g,a.code=v??void 0;if(!v)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:m}=await import("./chunk-bkq60hpn.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${m(v)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${v.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function gs(r,e,c,a){let d={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:S}=await o("stx/framework-composables",()=>import("./chunk-m5q50ct0.js"));d.frameworkScript=await S(r)}catch{}let n=null;try{n=await o("stx/store-loader",()=>import("./chunk-7kj3g9bx.js"))}catch{}let g=e.storesDir,v=!!a.__stx_native_screen||(n?.pageStoresAll()??!0),m=v?"":r.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],b=[],w=null;for(let S=0;S<8;S++){let k=null,D="",R=!1;try{if(n){let H=v?await n.getStoreScript(g).then((V)=>V?{code:V,stores:["*"],functions:null}:null):await n.getStoreScriptFor(g,[m],{reads:n.storesReadInFiles([...x,...b]),runOnce:!0});if(H)k=H.code,D=H.stores.join(","),R=!!H.functions&&!v}}catch{}if(w!==null&&D===w)break;w=D;let M=R?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",O=k?`<script ${M}>${k}</script>`:null;d.storeCode=k,d.storeTag=k?await at(M,k,e)??O:null;let N={};d.modulesTag=await tr([r,O],e,c,N),d.modulesCode=N.code??null,x=N.inputs??[],d.composableTag=null,d.composableCode=null,b=[];try{let{getComposableScript:H}=await o("stx/composable-loader",()=>import("./chunk-88ftnhm9.js")),V=e.composablesDir,P=[d.modulesCode??d.modulesTag,O,d.frameworkScript].filter((B)=>B!==null),L=await H(e._layerComposableDirs??V,r,P,b);if(L)d.composableCode=L,d.composableTag=await at('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(v||!n)break}return d}async function vs(r,e,c,a={}){let{withModuleSubstitutes:d,moduleSubstitutionKey:n}=await import("./chunk-526n626z.js"),g=await import("./chunk-cbx7qght.js"),{messages:v,webModules:m}=e,x=null,b=null,w=n()===""&&!a.__stx_native_screen;if(v&&g.pageMessagesEnabled(e)&&w)try{x=await g.loadPageMessages(process.cwd(),v)}catch(M){bs(M)}if(m&&Object.keys(m).length&&w)try{b=await(await import("./chunk-bfm5cedw.js")).loadWebModules(process.cwd(),m)}catch(M){ws(M)}let S=new Map([...b??[],...x?.stubs??[]]),k=()=>gs(r,e,c,a),D=S.size?await d(S,k):await k(),R=null;if(x){let M=g.messageAreasIn(D.modulesCode,D.storeCode,D.composableCode),O=g.pageMessagesScript(x,g.pageLanguages(r,x),M);if(O)R=await at('data-stx-scoped data-stx-run="always" data-stx-messages',O,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${O.replace(/<\/script/gi,"<\\/script")}</script>`}return[R,D.modulesTag,D.storeTag,D.composableTag,D.frameworkScript].filter((M)=>M!==null)}var gn=!1;function bs(r){if(gn)return;gn=!0,console.warn(`[stx] messages: ${r instanceof Error?r.message:String(r)}; pages ship every language`)}var hn=!1;function ws(r){if(hn)return;hn=!0,console.warn(`[stx] ${r instanceof Error?r.message:String(r)}; pages bundle the real modules`)}function xs(r,e=""){let c=Tn(r,"data-stx-runtime");if(!c)return r;let a=ar(r);if(a===-1||a===c.start){if(!e)return r;return r.slice(0,c.end)+e+r.slice(c.end)}if(a<c.start)return r.slice(0,a)+r.slice(c.start,c.end)+e+`
1561
+ `)break;a++}d=!1;continue}if(v==="`"){a++;while(a<c){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++;break}if(r[a]==="$"&&r[a+1]==="{"){n.push(!0),a+=2,d=!0;break}a++}if(n.length===0)d=!1;continue}if(v==="}"&&n.length>0){n.pop(),a++;while(a<c){if(r[a]==="\\"){a+=2;continue}if(r[a]==="`"){a++,d=!1;break}if(r[a]==="$"&&r[a+1]==="{"){n.push(!0),a+=2,d=!0;break}a++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))d=!1;else d=!0;a++}return-1}function Tn(r,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(r);if(!a)return null;let d=a.index+a[0].length,n=r.indexOf("</script>",d);if(n===-1)return null;let g=r.indexOf(">",n);if(g===-1)return null;return{start:a.index,end:g+1}}var fs=4096;async function at(r,e,c){if(c.buildMode!=="serve"||e.length<fs)return null;let{registerServeModuleBundle:a}=await import("./chunk-89pes7at.js");return`<script ${r} src="${a(e)}"></script>`}async function tr(r,e,c,a){try{let{registeredModuleIdsIn:d,buildModuleRegistryScript:n}=await o("stx/client-module-registry",()=>import("./chunk-cea665ds.js")),g=[],v=await n(d(...r),{minify:$i(e.buildMode,e.minifyClient),collectInputs:g});for(let m of g)c?.add(m);if(a)a.inputs=g,a.code=v??void 0;if(!v)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:m}=await import("./chunk-89pes7at.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${m(v)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${v.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function gs(r,e,c,a){let d={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:S}=await o("stx/framework-composables",()=>import("./chunk-eqrjfceb.js"));d.frameworkScript=await S(r)}catch{}let n=null;try{n=await o("stx/store-loader",()=>import("./chunk-km00bn5z.js"))}catch{}let g=e.storesDir,v=!!a.__stx_native_screen||(n?.pageStoresAll()??!0),m=v?"":r.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],b=[],w=null;for(let S=0;S<8;S++){let k=null,D="",R=!1;try{if(n){let H=v?await n.getStoreScript(g).then((V)=>V?{code:V,stores:["*"],functions:null}:null):await n.getStoreScriptFor(g,[m],{reads:n.storesReadInFiles([...x,...b]),runOnce:!0});if(H)k=H.code,D=H.stores.join(","),R=!!H.functions&&!v}}catch{}if(w!==null&&D===w)break;w=D;let M=R?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",O=k?`<script ${M}>${k}</script>`:null;d.storeCode=k,d.storeTag=k?await at(M,k,e)??O:null;let N={};d.modulesTag=await tr([r,O],e,c,N),d.modulesCode=N.code??null,x=N.inputs??[],d.composableTag=null,d.composableCode=null,b=[];try{let{getComposableScript:H}=await o("stx/composable-loader",()=>import("./chunk-7bxk9mjy.js")),V=e.composablesDir,P=[d.modulesCode??d.modulesTag,O,d.frameworkScript].filter((B)=>B!==null),L=await H(e._layerComposableDirs??V,r,P,b);if(L)d.composableCode=L,d.composableTag=await at('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(v||!n)break}return d}async function vs(r,e,c,a={}){let{withModuleSubstitutes:d,moduleSubstitutionKey:n}=await import("./chunk-0x02gm7d.js"),g=await import("./chunk-cbx7qght.js"),{messages:v,webModules:m}=e,x=null,b=null,w=n()===""&&!a.__stx_native_screen;if(v&&g.pageMessagesEnabled(e)&&w)try{x=await g.loadPageMessages(process.cwd(),v)}catch(M){bs(M)}if(m&&Object.keys(m).length&&w)try{b=await(await import("./chunk-bfm5cedw.js")).loadWebModules(process.cwd(),m)}catch(M){ws(M)}let S=new Map([...b??[],...x?.stubs??[]]),k=()=>gs(r,e,c,a),D=S.size?await d(S,k):await k(),R=null;if(x){let M=g.messageAreasIn(D.modulesCode,D.storeCode,D.composableCode),O=g.pageMessagesScript(x,g.pageLanguages(r,x),M);if(O)R=await at('data-stx-scoped data-stx-run="always" data-stx-messages',O,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${O.replace(/<\/script/gi,"<\\/script")}</script>`}return[R,D.modulesTag,D.storeTag,D.composableTag,D.frameworkScript].filter((M)=>M!==null)}var gn=!1;function bs(r){if(gn)return;gn=!0,console.warn(`[stx] messages: ${r instanceof Error?r.message:String(r)}; pages ship every language`)}var hn=!1;function ws(r){if(hn)return;hn=!0,console.warn(`[stx] ${r instanceof Error?r.message:String(r)}; pages bundle the real modules`)}function xs(r,e=""){let c=Tn(r,"data-stx-runtime");if(!c)return r;let a=ar(r);if(a===-1||a===c.start){if(!e)return r;return r.slice(0,c.end)+e+r.slice(c.end)}if(a<c.start)return r.slice(0,a)+r.slice(c.start,c.end)+e+`
1562
1562
  `+r.slice(a,c.start)+r.slice(c.end);let d=r.slice(c.start,c.end),n=r.slice(0,c.start)+r.slice(c.end),g=ar(n);if(g===-1)return d+e+`
1563
1563
  `+n;return n.slice(0,g)+d+e+`
1564
1564
  `+n.slice(g)}function Ss(r){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return r.replace(e,(c,a,d)=>{let n=r.slice(0,d);return n.lastIndexOf("<")>n.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(r,e,c,a,d){if(a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return r;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Se(r,c);let n=!e.__stxProcessingDepth;mn(e);for(let g of a._layerGraph?.configDependencies??[])d.add(g);if(n&&a.runtimeConfig)await vn(e,c,a.runtimeConfig);if(n)Hc(e),e.__stx_scope_seq??={n:0,key:Vs(String(e.__filename??c))},e.__stx_head_injections=Ci(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!E()&&!_n())&&c&&c.endsWith(".stx"))Do(r,c);try{return await ie.timeAsync("template-processing",async()=>{let g=await ks(r,e,c,a,d);if(n)g=fi(g);if(n&&a.autoShell&&a.buildMode!=="compile"){let v=_e(a.app?.head,{known:Or,source:"app.head"}),x=(e.__stx_runtime_head||null)??Ti(),b=(e.__stx_head_raw||"").trim(),w,S=b.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(S)w=S[1].trim(),b=b.replace(S[0],"").trim();let k=e.__sections?.title,D=k?_(k,e,c):void 0,R=x.title||w||D,M=!x.title&&(!!w||!!D),O=x.meta||[],N=new Set(O.map((X)=>it(X)).filter(Boolean)),H={...v,...R&&{title:R},meta:[...(v.meta||[]).filter((X)=>!N.has(it(X))),...O],link:[...v.link||[],...x.link||[]],script:[...v.script||[],...x.script||[]],headRaw:[v.headRaw,b].filter(Boolean).join(`
@@ -1573,7 +1573,7 @@ ${m.trim()}
1573
1573
  @endsection`}}if(O&&m.includes("<script")){let P=G(m),L=P.scripts.map((B)=>yn(B,c)??B);m=vr(P.output,L)}if(m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(P,L,B)=>(M[L]=B,"")),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(P,L,B)=>{if(/^(['"]).*\1$/.test(B.trim()))return P;try{let X=u(B.trim(),e);if(X===void 0)return P;let ee=(e.__stx_inline_section_values??=[]).push(X)-1;return M[L]=`{{ __stx_inline_section_values[${ee}] }}`,""}catch{return P}}),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(P,L,B)=>{if(B.includes("@parent"))M[L]=B.replace("@parent",Te);else M[L]=B.trim();return""}),e.__sections=M,m=m.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(P,L,B)=>M[L]||B||""),!("slot"in e)||e.slot===void 0)m=m.replace(/\{\{\s*slot\s*\}\}/g,()=>M.content||"");if(m=ls(m,R),O){let P=[],L=G(m),B=pe(L.output,pn,(X,K)=>`\x00STX_ORPHAN_STYLE_${K}\x00`);if(m=B.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(X,K,ee)=>{let te=K==="SCRIPT"?yn(L.scripts[Number(ee)],c):B.tokens[Number(ee)];if(te)P.push(te);return""}),P.length>0){let X=P.join(`
1574
1574
  `);M.content=M.content?`${M.content}
1575
1575
  ${X}`:X,e.__sections=M}}if(O)try{let P;if(ce.isAbsolute(O))P=O,d.add(O);else P=await ke(()=>bn(O,c,g,d),null,()=>{throw new ae(`Failed to resolve layout path: ${O}`,c,void 0,void 0,`Layout referenced from ${c}`)});if(!P){let te=(J)=>{if(!J)return[];try{let me=ce.isAbsolute(J)?J:ce.resolve(process.cwd(),J);return us.readdirSync(me).filter((we)=>we.endsWith(".stx")).map((we)=>we.replace(/\.stx$/,""))}catch{return[]}},ne=[...te(g.layoutsDir),...te(g.fallbackLayoutsDir)].filter((J,me,we)=>we.indexOf(J)===me).sort(),le=[g.layoutsDir,g.fallbackLayoutsDir].filter((J)=>typeof J==="string"&&J.length>0),de=le.length>0?` Searched: ${le.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",oe=`Layout not found: ${O} (referenced from ${c})`+(ne.length>0?`. Available layouts: ${ne.join(", ")}`:g.layoutsDir?`. No .stx layouts found in ${g.layoutsDir}`:"")+de;if(F.log(Error(oe),{layoutPath:O,filePath:c,available:ne},"error"),console.error(`[stx] ${oe}`),g.debug)throw new ae(oe,c);return m}let L=await ke(()=>Bun.file(P).text(),"",()=>{throw new ae(`Failed to read layout file: ${P}`,c,void 0,void 0,"Layout content could not be loaded")});L=un(L,P);let B=L.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(B){if(g.debug)console.log(`Found nested layout: ${B[1]} in ${P}`);let te={},ne=L.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(oe,J,me)=>(te[J]=me.trim(),""));for(let[oe,J]of Object.entries(te))if(M[oe]&&M[oe].includes(Te)){let me=M[oe].indexOf(Te);M[oe]=M[oe].slice(0,me)+J+M[oe].slice(me+Te.length)}else if(!M[oe])M[oe]=J;let le={...e,__sections:M},de=`@layout('${B[1]}')${ne}`;return await i(de,le,P,g,d)}let X=L.replace(/\{\{--[\s\S]*?--\}\}/g,""),K=cs(X,R),ee={};return K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(te,ne,le)=>(ee[ne]=le.trim(),`@slot('${ne}')`)),K=K.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(te,ne,le)=>{if(M[ne]){let de=M[ne];if(de.includes(Te)){let oe=ee[ne]||"",J=de.indexOf(Te);de=de.slice(0,J)+oe+de.slice(J+Te.length)}return de}return le||""}),K=$s(K,M),K=K.replace(/\{\{\s*slot\s*\}\}/g,()=>M.content||""),K=ls(K,R),e.__originalFilePath=c,m=await $n(K,e,P,g,d),m=`<!-- stx-layout: ${O} -->
1576
- ${m}`,w(m)}catch(P){if(P instanceof q)throw P;throw new ae(`Error processing layout ${O}: ${P instanceof Error?P.message:String(P)}`,c)}return w(await $n(m,e,c,g,d))}function $s(r,e){return r.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,d)=>{let n=e[a];if(n!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(n))return n}return d||""})}function Es(r,e){if(r.__stx_sfc_mode=!0,r.__stx_options=e,e.buildMode)r.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[d,n]of Object.entries(process.env))if(d.startsWith(c)&&n!==void 0)a[d]=n;r.$env=a}async function _s(r,e){await ke(()=>Jt(r,e),void 0,(c)=>{F.log(c,{filePath:r,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${r}: ${c.message}`)})}var ct="data-stx-source";function yn(r,e){if(!r)return r;let c=/^<script\b([^>]*)>/i.exec(r);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return r;return`<script ${ct}="${encodeURIComponent(e)}"${r.slice(7)}`}function Ts(r){let e=new RegExp(`${ct}="([^"]*)"`).exec(r);return e?decodeURIComponent(e[1]):void 0}function wn(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function xn(r,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${wn(r)}</span><span style="display:block;margin-top:4px">${wn(c)}</span></div>`}async function Cs(r,e,c,a){let{scanScriptTags:d}=await o("stx/signal-processing",()=>import("./chunk-54w0epxq.js")),n=[],g=!E()&&!_n();for(let m of d(r)){let x=m.attrs;if(!/\bserver\b/.test(x))continue;let b=m.start+m.fullMatch.indexOf(">")+1,w=En(r,b);if(w===-1)continue;let S=r.slice(b,w);if(!S.trim())continue;let k=Ts(x)??c,D={index:m.start,length:w+9-m.start};try{let{extractVariables:R}=await o("stx/variable-extractor",()=>import("./chunk-7aqdqfwf.js"));await R(S,e,k,{preserveExisting:!0,onFailure:(M)=>{if(M.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:k,kind:M.kind,message:M.message}),!g)return;n.push({...D,markup:xn(k,M.kind,M.message)})}})}catch(R){let M=R instanceof Error?R:Error(String(R));if(F.log(M,{filePath:k,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${k}: ${M.message}`),g)n.push({...D,markup:xn(k,"unknown",M.message)})}}if(n.length===0)return r;let v=r;for(let m of n.sort((x,b)=>b.index-x.index))v=v.slice(0,m.index)+m.markup+v.slice(m.index+m.length);return v}async function As(r,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-x94q5ptn.js"));return a(r,e,{skipServer:!0})}catch(a){let d=a instanceof Error?a:Error(String(a));return F.log(d,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${d.message}`),r}}async function $n(r,e,c,a,d){let n=r,g=a;if(n=await Cs(n,e,c,a),n=await qt(n,e,c),n=await Ut(n,e,c),n=await As(n,e,c),n=await Rt(n,e,c,g),Se(n))n=Uo(n,e),n=ys(n,e),n=hs(n,e);n=Wo(n);let{processStreamDirectives:v}=await o("stx/streaming",()=>import("./chunk-h7257fsm.js"));n=v(n,e),n=or(n,e,c,g,!0),n=await nn(n,e,c,g,d),n=await ds(n,e,c,g,d),n=pc(n,e,c,g);let{processDeferDirectives:m}=await o("stx/defer",()=>import("./chunk-bj6ax0he.js"));n=m(n,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-rxc1076r.js"));n=x(n,e,c);let{processTransitionDirectives:b,processTransitionAttributes:w}=await o("stx/transitions",()=>import("./chunk-d3gncxq1.js"));n=b(n,e,c),n=w(n);let{processErrorBoundaryDirectives:S,stripRenderFailedMarkers:k}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));n=S(n,e,c),n=k(n);let{processSuspenseDirectives:D}=await o("stx/suspense",()=>import("./chunk-1rwfgmmk.js"));n=D(n,e,c);let{processAsyncDirectives:R}=await o("stx/async-components",()=>import("./chunk-xgqyzkt2.js"));n=R(n,e,c);let{processKeepAliveDirectives:M}=await o("stx/keep-alive",()=>import("./chunk-cxpnkgvw.js"));n=M(n,e,c);let{processVirtualListDirectives:O,processVirtualGridDirectives:N,processInfiniteListDirectives:H}=await o("stx/virtual-scrolling",()=>import("./chunk-tzb0n60s.js"));n=O(n,e,c),n=N(n,e,c),n=H(n,e,c);let{processPartialHydrationDirectives:V,processStaticDirectives:P}=await o("stx/partial-hydration",()=>import("./chunk-da886asf.js"));n=V(n,e,c),n=P(n);let{processComputedDirectives:L,processWatchDirectives:B}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));n=L(n,e,c),n=B(n,e,c);let{processFormValidationDirectives:X}=await o("stx/forms-validation",()=>import("./chunk-2a4dhkdw.js"));n=X(n,e,c);let{processHeadDirective:K,processTitleDirective:ee,processMetaDirective:te,resetHead:ne}=await o("stx/head",()=>import("./chunk-ycr9bkww.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ne();let le=K(n);if(n=le.content,le.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${le.headContent}
1576
+ ${m}`,w(m)}catch(P){if(P instanceof q)throw P;throw new ae(`Error processing layout ${O}: ${P instanceof Error?P.message:String(P)}`,c)}return w(await $n(m,e,c,g,d))}function $s(r,e){return r.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,d)=>{let n=e[a];if(n!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(n))return n}return d||""})}function Es(r,e){if(r.__stx_sfc_mode=!0,r.__stx_options=e,e.buildMode)r.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[d,n]of Object.entries(process.env))if(d.startsWith(c)&&n!==void 0)a[d]=n;r.$env=a}async function _s(r,e){await ke(()=>Jt(r,e),void 0,(c)=>{F.log(c,{filePath:r,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${r}: ${c.message}`)})}var ct="data-stx-source";function yn(r,e){if(!r)return r;let c=/^<script\b([^>]*)>/i.exec(r);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return r;return`<script ${ct}="${encodeURIComponent(e)}"${r.slice(7)}`}function Ts(r){let e=new RegExp(`${ct}="([^"]*)"`).exec(r);return e?decodeURIComponent(e[1]):void 0}function wn(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function xn(r,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${wn(r)}</span><span style="display:block;margin-top:4px">${wn(c)}</span></div>`}async function Cs(r,e,c,a){let{scanScriptTags:d}=await o("stx/signal-processing",()=>import("./chunk-yacdg7kq.js")),n=[],g=!E()&&!_n();for(let m of d(r)){let x=m.attrs;if(!/\bserver\b/.test(x))continue;let b=m.start+m.fullMatch.indexOf(">")+1,w=En(r,b);if(w===-1)continue;let S=r.slice(b,w);if(!S.trim())continue;let k=Ts(x)??c,D={index:m.start,length:w+9-m.start};try{let{extractVariables:R}=await o("stx/variable-extractor",()=>import("./chunk-hbq922er.js"));await R(S,e,k,{preserveExisting:!0,onFailure:(M)=>{if(M.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:k,kind:M.kind,message:M.message}),!g)return;n.push({...D,markup:xn(k,M.kind,M.message)})}})}catch(R){let M=R instanceof Error?R:Error(String(R));if(F.log(M,{filePath:k,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${k}: ${M.message}`),g)n.push({...D,markup:xn(k,"unknown",M.message)})}}if(n.length===0)return r;let v=r;for(let m of n.sort((x,b)=>b.index-x.index))v=v.slice(0,m.index)+m.markup+v.slice(m.index+m.length);return v}async function As(r,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-9k037sk6.js"));return a(r,e,{skipServer:!0})}catch(a){let d=a instanceof Error?a:Error(String(a));return F.log(d,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${d.message}`),r}}async function $n(r,e,c,a,d){let n=r,g=a;if(n=await Cs(n,e,c,a),n=await qt(n,e,c),n=await Ut(n,e,c),n=await As(n,e,c),n=await Rt(n,e,c,g),Se(n))n=Uo(n,e),n=ys(n,e),n=hs(n,e);n=Wo(n);let{processStreamDirectives:v}=await o("stx/streaming",()=>import("./chunk-xd5n2qx4.js"));n=v(n,e),n=or(n,e,c,g,!0),n=await nn(n,e,c,g,d),n=await ds(n,e,c,g,d),n=pc(n,e,c,g);let{processDeferDirectives:m}=await o("stx/defer",()=>import("./chunk-bj6ax0he.js"));n=m(n,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-rxc1076r.js"));n=x(n,e,c);let{processTransitionDirectives:b,processTransitionAttributes:w}=await o("stx/transitions",()=>import("./chunk-d3gncxq1.js"));n=b(n,e,c),n=w(n);let{processErrorBoundaryDirectives:S,stripRenderFailedMarkers:k}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));n=S(n,e,c),n=k(n);let{processSuspenseDirectives:D}=await o("stx/suspense",()=>import("./chunk-1rwfgmmk.js"));n=D(n,e,c);let{processAsyncDirectives:R}=await o("stx/async-components",()=>import("./chunk-xgqyzkt2.js"));n=R(n,e,c);let{processKeepAliveDirectives:M}=await o("stx/keep-alive",()=>import("./chunk-cxpnkgvw.js"));n=M(n,e,c);let{processVirtualListDirectives:O,processVirtualGridDirectives:N,processInfiniteListDirectives:H}=await o("stx/virtual-scrolling",()=>import("./chunk-tzb0n60s.js"));n=O(n,e,c),n=N(n,e,c),n=H(n,e,c);let{processPartialHydrationDirectives:V,processStaticDirectives:P}=await o("stx/partial-hydration",()=>import("./chunk-da886asf.js"));n=V(n,e,c),n=P(n);let{processComputedDirectives:L,processWatchDirectives:B}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));n=L(n,e,c),n=B(n,e,c);let{processFormValidationDirectives:X}=await o("stx/forms-validation",()=>import("./chunk-eg95a7q7.js"));n=X(n,e,c);let{processHeadDirective:K,processTitleDirective:ee,processMetaDirective:te,resetHead:ne}=await o("stx/head",()=>import("./chunk-ycr9bkww.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ne();let le=K(n);if(n=le.content,le.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${le.headContent}
1577
1577
  `;if(n=ee(n,e),n=te(n,e,c),n=Gt(n),n=Fo(n,e),n=At(n),n=zt(n),n=await as(n,e,c,g,d),n=await ds(n,e,c,g,d),n=n.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),n=fi(n),n=se(n,e,c),n=ps(n),e.__stxProcessingDepth===1)n=Vc(n,e);if(n=jc(n,e,{filePath:c,buildMode:g.buildMode}),n=zo(n,e),n=Ho(n,e),n=We(n,e),n=Ht(n,e),n=Bt(n,e),n=await xt(n,e,c,g),n=await gc(n,e,c),n=await mc(n,e,c,g),n=hc(n,e,c,g),n=Zo(n,e,c,g),n=Qo(n,e,c),n=ei(n,e,c,g),n=Tt(n,e,c,g),n=zs(n,e),n=Hs(n),n=Bc(n),!g.skipEventDirectives)n=$c(n,e,c);if(n=wt(n,e,c),g.debug){let z=/\bx-data\s*=/.test(n),W=ms(r);if(z&&W)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
1578
1578
  Both work on the same page, but they manage separate scopes.
1579
1579
  Prefer signals (state/derived/effect) for new components.`)}n=ac(n,e),n=await _(n,e,c),n=Fc(n),n=zc(n),n=gt(n);let{processXElementDirectives:de}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));n=de(n);let oe=e.__originalFilePath||c,J=De(e);if(n=await qo(n,g,oe,J),n=Pt(n,e),n=await Kt(n,e,c,g),g.media?.image?.autoSiblings){let z=g.publicDir||"public",{rewriteImagesWithSiblings:W}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-9wmjmas8.js"));n=await W(n,{publicDir:z})}if(g.seo?.enabled)n=ti(n,e,g);let me=(z,W,Q=!0)=>{if(!W)return z;let he=W.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),re=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(z),fe=re?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(re[0]):null;if(he&&re&&fe){if(Q){let Ce=re.index+fe.index;z=z.slice(0,Ce)+he[0]+z.slice(Ce+fe[0].length)}if(W=W.replace(he[0],"").trim(),!W)return z}if(/<\/head>/i.test(z))return z.replace(/<\/head>/i,`${W}
@@ -1587,6 +1587,6 @@ ${dt()}
1587
1587
  `+Ce}else n=n.replace("</head>",`${W}
1588
1588
  </head>`)}else if(n.includes("<body"))n=n.replace(/<body([^>]*)>/,`<body$1>
1589
1589
  ${W}`);else n=W+`
1590
- `+n}{let{scanScriptTags:z}=await o("stx/signal-processing",()=>import("./chunk-54w0epxq.js")),W=[];for(let Q of z(n)){if(!/\bserver\b/i.test(Q.attrs))continue;let he=Q.start+Q.fullMatch.indexOf(">")+1,re=En(n,he);if(re===-1)continue;let fe=re+9;while(fe<n.length&&/\s/.test(n[fe]))fe++;W.push({start:Q.start,end:fe})}if(W.length>0){let Q=Array(W.length+1),he=0;for(let re=0;re<W.length;re++){let{start:fe,end:Ce}=W[re];Q[re]=n.slice(he,fe),he=Ce}Q[W.length]=n.slice(he),n=Q.join("")}}let lt=Bs(n,c);if(lt.hasScoped)n=lt.html;let Dn=e.__stx_event_bindings||[],Ke=!1,ut=[],In=/\s:[a-z][\w.-]*\s*=/.test(n),{scanScriptTags:On}=await o("stx/signal-processing",()=>import("./chunk-54w0epxq.js"));for(let z of On(n,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ut.push({match:z.fullMatch,attrs:z.attrs,content:z.body});for(let{match:z,attrs:W,content:Q}of ut){Ke=!0;let he=Q;Oe(Q,c,a.strict,e.__originalFilePath);let re=await Le(Q,{eventBindings:Dn,attrs:W,hasColonDirectives:In,templateContent:r,filePath:c,projectRoot:process.cwd(),production:$i(a.buildMode,a.minifyClient),serverData:J});n=n.replace(z,()=>re)}if(Ke)e.__stx_event_bindings=[];if(!Ke&&e.__stxProcessingDepth===1){let z=e.__stx_event_bindings||[];if(z.length>0){let W=ai(z);if(W){let Q=n.lastIndexOf("</body>");n=Q===-1?n+W:n.slice(0,Q)+W+`
1590
+ `+n}{let{scanScriptTags:z}=await o("stx/signal-processing",()=>import("./chunk-yacdg7kq.js")),W=[];for(let Q of z(n)){if(!/\bserver\b/i.test(Q.attrs))continue;let he=Q.start+Q.fullMatch.indexOf(">")+1,re=En(n,he);if(re===-1)continue;let fe=re+9;while(fe<n.length&&/\s/.test(n[fe]))fe++;W.push({start:Q.start,end:fe})}if(W.length>0){let Q=Array(W.length+1),he=0;for(let re=0;re<W.length;re++){let{start:fe,end:Ce}=W[re];Q[re]=n.slice(he,fe),he=Ce}Q[W.length]=n.slice(he),n=Q.join("")}}let lt=Bs(n,c);if(lt.hasScoped)n=lt.html;let Dn=e.__stx_event_bindings||[],Ke=!1,ut=[],In=/\s:[a-z][\w.-]*\s*=/.test(n),{scanScriptTags:On}=await o("stx/signal-processing",()=>import("./chunk-yacdg7kq.js"));for(let z of On(n,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ut.push({match:z.fullMatch,attrs:z.attrs,content:z.body});for(let{match:z,attrs:W,content:Q}of ut){Ke=!0;let he=Q;Oe(Q,c,a.strict,e.__originalFilePath);let re=await Le(Q,{eventBindings:Dn,attrs:W,hasColonDirectives:In,templateContent:r,filePath:c,projectRoot:process.cwd(),production:$i(a.buildMode,a.minifyClient),serverData:J});n=n.replace(z,()=>re)}if(Ke)e.__stx_event_bindings=[];if(!Ke&&e.__stxProcessingDepth===1){let z=e.__stx_event_bindings||[];if(z.length>0){let W=ai(z);if(W){let Q=n.lastIndexOf("</body>");n=Q===-1?n+W:n.slice(0,Q)+W+`
1591
1591
  `+n.slice(Q)}e.__stx_event_bindings=[]}}if(!be(n)&&lc(n))n=await cr(n,g);if(n=uc(n),g.csp?.enabled&&g.csp.useNonce&&typeof e.cspNonce==="string")n=_t(n,e.cspNonce);return n}
1592
1592
  export{yt,Re,rc,is,No,Mo,tr,i};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Lo,jo,Bo,Ah,us,Ph}from"./chunk-91re9xtj.js";export{us as clearImageDeliveryCatalog,Ah as deliveredImage,Bo as efficientDeliverySources,Lo as getImageDelivery,jo as isTransparentImage,Ph as prepareImageDelivery};
2
+ import{Lo,jo,Bo,Ah,us,Ph}from"./chunk-p9y5hh4m.js";export{us as clearImageDeliveryCatalog,Ah as deliveredImage,Bo as efficientDeliverySources,Lo as getImageDelivery,jo as isTransparentImage,Ph as prepareImageDelivery};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{hn,Yf,Zf,Qf,eg,tg,m,ng,gi,rg,Uc,Wc}from"./chunk-rx5ak659.js";import"./chunk-qfqv3fjm.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{hn as STX_ENGINE_BINDING_NAMES,gi as convertToCommonJS,Uc as extractScriptFromTemplate,m as extractVariables,Wc as hasVariables,ng as isCompleteImport,tg as isMissingBindingFailure,Qf as isModuleResolutionFailure,eg as isSyntaxFailure,rg as splitDeclaration,Yf as stripTypeScript,Zf as withoutStxReferrer};
2
+ import{hn,Yf,Zf,Qf,eg,tg,m,ng,gi,rg,Uc,Wc}from"./chunk-d2vr1169.js";import"./chunk-8taa0exz.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{hn as STX_ENGINE_BINDING_NAMES,gi as convertToCommonJS,Uc as extractScriptFromTemplate,m as extractVariables,Wc as hasVariables,ng as isCompleteImport,tg as isMissingBindingFailure,Qf as isModuleResolutionFailure,eg as isSyntaxFailure,rg as splitDeclaration,Yf as stripTypeScript,Zf as withoutStxReferrer};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{rh,bo,sh,oh,ih,ah}from"./chunk-6em1xeax.js";import"./chunk-few3k1dz.js";import"./chunk-m8w7rcmt.js";import"./chunk-7sh9fa3q.js";import"./chunk-3ht64v1a.js";import"./chunk-1cxf9chb.js";import"./chunk-1carv1dw.js";import"./chunk-kmr3cd71.js";import"./chunk-c5fved0k.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-d2vr1169.js";import"./chunk-8taa0exz.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{ah as clearStoreCache,rh as getStoreScript,ih as getStoreScriptFor,oh as pageStoresAll,bo as storesRead,sh as storesReadInFiles};