@stacksjs/stx 0.2.679 → 0.2.682

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 (216) hide show
  1. package/dist/chunk-01ks1244.js +2 -0
  2. package/dist/{chunk-qr7a378v.js → chunk-03xn8244.js} +3 -3
  3. package/dist/{chunk-ccmc5rqj.js → chunk-0527ytat.js} +2 -2
  4. package/dist/chunk-0gmwqhs0.js +2 -0
  5. package/dist/chunk-18jfkg1q.js +2 -0
  6. package/dist/chunk-1gw26g89.js +31 -0
  7. package/dist/chunk-1t6dg4s8.js +2 -0
  8. package/dist/{chunk-n8wvqnfc.js → chunk-1y50gat7.js} +2 -2
  9. package/dist/chunk-23efje42.js +2 -0
  10. package/dist/chunk-247fg189.js +2 -0
  11. package/dist/{chunk-xnx06qqt.js → chunk-2a1eeywj.js} +2 -2
  12. package/dist/{chunk-hh58k0nh.js → chunk-2ajbhefk.js} +2 -2
  13. package/dist/{chunk-p9az13b2.js → chunk-2ar5g9pa.js} +2 -2
  14. package/dist/{chunk-7j7h1eg3.js → chunk-2hh6g3y1.js} +1 -1
  15. package/dist/chunk-2zepd4ps.js +2 -0
  16. package/dist/chunk-34ps2w1z.js +2 -0
  17. package/dist/chunk-3tkag58v.js +2 -0
  18. package/dist/{chunk-ga5kjf9b.js → chunk-3zbege39.js} +6 -6
  19. package/dist/{chunk-2933mvwr.js → chunk-42qtadka.js} +10 -10
  20. package/dist/chunk-47fwr1z7.js +2 -0
  21. package/dist/{chunk-fzc98qgn.js → chunk-49c5v5fh.js} +6 -6
  22. package/dist/chunk-4g9wrxkm.js +2 -0
  23. package/dist/chunk-4m5g3f2b.js +2 -0
  24. package/dist/{chunk-tx4wfk5v.js → chunk-4z4sqc8q.js} +5 -5
  25. package/dist/{chunk-6ycyaf5g.js → chunk-58dv14c3.js} +2 -2
  26. package/dist/{chunk-87em5xdg.js → chunk-5nfb4gxk.js} +82 -82
  27. package/dist/chunk-5nrqc6v4.js +20 -0
  28. package/dist/chunk-5rdfcpfe.js +2 -0
  29. package/dist/{chunk-xyk2zxkk.js → chunk-65jb75vz.js} +2 -2
  30. package/dist/{chunk-5z8mq37c.js → chunk-6e60jp4a.js} +4 -4
  31. package/dist/chunk-7jxj6cv1.js +2 -0
  32. package/dist/{chunk-dnjbzwwn.js → chunk-7yree929.js} +1 -1
  33. package/dist/chunk-8bwa63m3.js +2 -0
  34. package/dist/chunk-8d0rqqyx.js +2 -0
  35. package/dist/chunk-8j0zcyd7.js +2 -0
  36. package/dist/chunk-8jxqg7kb.js +2 -0
  37. package/dist/chunk-8nk56cs2.js +2 -0
  38. package/dist/chunk-8y7tpjfs.js +2 -0
  39. package/dist/{chunk-q3gactm1.js → chunk-912r15hr.js} +4 -4
  40. package/dist/chunk-96hkch4q.js +2 -0
  41. package/dist/{chunk-4fhbh04h.js → chunk-974prn41.js} +4 -4
  42. package/dist/{chunk-078qg8r5.js → chunk-9bgb9n12.js} +2 -2
  43. package/dist/chunk-9qx6ansy.js +2 -0
  44. package/dist/{chunk-tst8p27s.js → chunk-9tg4995v.js} +3 -3
  45. package/dist/{chunk-sr3hmrah.js → chunk-9wa3t87n.js} +1 -1
  46. package/dist/{chunk-k06n5bjp.js → chunk-ae12wgc5.js} +3 -3
  47. package/dist/chunk-b375wt1n.js +2 -0
  48. package/dist/chunk-b5vqp3b2.js +2 -0
  49. package/dist/{chunk-vg1pg6yt.js → chunk-b7z6rqfg.js} +1 -1
  50. package/dist/{chunk-wt7rp7wc.js → chunk-bmqker64.js} +6 -6
  51. package/dist/{chunk-53e9ta3g.js → chunk-bmv6spcd.js} +4 -4
  52. package/dist/chunk-bpf3xxng.js +3 -0
  53. package/dist/{chunk-chy90834.js → chunk-brcj3953.js} +5 -5
  54. package/dist/chunk-brftzqzj.js +3 -0
  55. package/dist/chunk-bv43s0gx.js +2 -0
  56. package/dist/chunk-c9jnkbdb.js +2 -0
  57. package/dist/{chunk-x7wr720m.js → chunk-d1ssvg9k.js} +5 -5
  58. package/dist/{chunk-5z0q3qv3.js → chunk-d7js6v1m.js} +5 -5
  59. package/dist/{chunk-vd5w1jaz.js → chunk-drabexxq.js} +3 -3
  60. package/dist/{chunk-k72jqz6a.js → chunk-e26pxzjj.js} +2 -2
  61. package/dist/{chunk-2pvcp0y6.js → chunk-e97xj3rf.js} +6 -6
  62. package/dist/chunk-ev1tnd36.js +2 -0
  63. package/dist/{chunk-j388n7v2.js → chunk-f1hxrs7b.js} +17 -17
  64. package/dist/{chunk-wr1gm35v.js → chunk-f4z9w4kc.js} +1 -1
  65. package/dist/chunk-f80aqbwm.js +2 -0
  66. package/dist/chunk-fbbp8j97.js +2 -0
  67. package/dist/{chunk-26ps9djm.js → chunk-fqts9wvd.js} +5 -5
  68. package/dist/chunk-fy1waxy0.js +2 -0
  69. package/dist/chunk-g2v6c7kf.js +2 -0
  70. package/dist/chunk-g5ep75vp.js +2 -0
  71. package/dist/{chunk-wejabf6y.js → chunk-g83qeh2x.js} +5 -5
  72. package/dist/chunk-g9a56wwk.js +2 -0
  73. package/dist/chunk-gkmh0xys.js +2 -0
  74. package/dist/{chunk-78yjmbbs.js → chunk-gtktv6nn.js} +2 -2
  75. package/dist/{chunk-f26n6y9p.js → chunk-gymmbbzc.js} +4 -4
  76. package/dist/{chunk-48ma0qcr.js → chunk-h3bdqqzy.js} +2 -2
  77. package/dist/chunk-h5r4c9v5.js +2 -0
  78. package/dist/{chunk-3xyv2fec.js → chunk-hg7ys8rn.js} +3 -3
  79. package/dist/{chunk-kxj8e1gd.js → chunk-hm69jxmh.js} +6 -6
  80. package/dist/{chunk-y4ncmvf2.js → chunk-hwaqwrc2.js} +3 -3
  81. package/dist/chunk-jecmxby7.js +2 -0
  82. package/dist/{chunk-a2zb5fgg.js → chunk-jkywbfb0.js} +2 -2
  83. package/dist/{chunk-haz2ezyk.js → chunk-k3e0hcv7.js} +2 -2
  84. package/dist/{chunk-drmgwjnb.js → chunk-ka3xmbrd.js} +76 -76
  85. package/dist/chunk-kerxevf9.js +2 -0
  86. package/dist/chunk-km37yrk4.js +43 -0
  87. package/dist/chunk-mdmwgthz.js +2 -0
  88. package/dist/chunk-myc60z74.js +2 -0
  89. package/dist/chunk-mzkyw4yx.js +2 -0
  90. package/dist/{chunk-nb3kkvet.js → chunk-n8jq9yjy.js} +11 -11
  91. package/dist/{chunk-y34tyrpb.js → chunk-nbjyed3q.js} +7 -7
  92. package/dist/{chunk-d40zjm6k.js → chunk-np3zdjhr.js} +6 -6
  93. package/dist/{chunk-wav0xbnb.js → chunk-pfn70zdr.js} +2 -2
  94. package/dist/{chunk-tbb4en1q.js → chunk-pmma4f1x.js} +4 -4
  95. package/dist/chunk-pqg3ghvh.js +2 -0
  96. package/dist/chunk-pvn0fc7j.js +2 -0
  97. package/dist/{chunk-q4rejyd2.js → chunk-pzxy40a2.js} +2 -2
  98. package/dist/chunk-q7mpearc.js +2 -0
  99. package/dist/{chunk-7z7zp8xq.js → chunk-qb806pks.js} +5 -5
  100. package/dist/{chunk-wscnjtss.js → chunk-qh7fvr2z.js} +2 -2
  101. package/dist/chunk-r8hszntk.js +2 -0
  102. package/dist/{chunk-wc5tt6da.js → chunk-remsyfdx.js} +2 -2
  103. package/dist/chunk-rk8kmshp.js +2 -0
  104. package/dist/chunk-rs67af2x.js +1592 -0
  105. package/dist/{chunk-97h9ga3b.js → chunk-rspe6qa5.js} +3 -3
  106. package/dist/{chunk-78x52gz3.js → chunk-ry501z40.js} +5 -5
  107. package/dist/chunk-s0wa7zjr.js +2 -0
  108. package/dist/{chunk-qvefcnyb.js → chunk-se4n8tth.js} +2 -2
  109. package/dist/chunk-sncp7jhv.js +2 -0
  110. package/dist/{chunk-jv021x8e.js → chunk-sq4w1e1g.js} +2 -2
  111. package/dist/chunk-sqvdrk81.js +2 -0
  112. package/dist/{chunk-9wdd7eq6.js → chunk-t6m5d64b.js} +2 -2
  113. package/dist/chunk-tdwqwxhf.js +25 -0
  114. package/dist/{chunk-dera8fmc.js → chunk-tenbwcts.js} +2 -2
  115. package/dist/chunk-th45zgbz.js +54 -0
  116. package/dist/{chunk-cxgremn0.js → chunk-tpdvgb3d.js} +1 -1
  117. package/dist/chunk-tq2m6m3j.js +2 -0
  118. package/dist/{chunk-aw3jfdca.js → chunk-veh25cv5.js} +1 -1
  119. package/dist/chunk-vqv5w6gs.js +2 -0
  120. package/dist/chunk-vt5e25xg.js +2 -0
  121. package/dist/{chunk-028e9fty.js → chunk-vxnf3xab.js} +2 -2
  122. package/dist/{chunk-mabja59q.js → chunk-vxrhvrr9.js} +2 -2
  123. package/dist/{chunk-tmqrbs98.js → chunk-w1wzydvp.js} +8 -5
  124. package/dist/{chunk-qwdcts9w.js → chunk-w28wc7mv.js} +13 -13
  125. package/dist/{chunk-yxw8gbnh.js → chunk-wfg5379k.js} +4 -4
  126. package/dist/chunk-wvz7rp5p.js +2 -0
  127. package/dist/{chunk-k4x8v39k.js → chunk-xfdfk4g4.js} +2 -2
  128. package/dist/chunk-xjx1xbey.js +2 -0
  129. package/dist/{chunk-mn47s2ef.js → chunk-xr9a0hcr.js} +5 -5
  130. package/dist/{chunk-1b9thkg5.js → chunk-xvnrm5c3.js} +2 -2
  131. package/dist/{chunk-mf19qxgv.js → chunk-xvs84gas.js} +2 -2
  132. package/dist/{chunk-8aq07a1j.js → chunk-y55pcfaj.js} +3 -3
  133. package/dist/{chunk-2hmyj5wh.js → chunk-yhfm939b.js} +2 -2
  134. package/dist/chunk-ykjzhfyf.js +2 -0
  135. package/dist/chunk-ypwetty7.js +21 -0
  136. package/dist/chunk-z4khbpx0.js +2 -0
  137. package/dist/{chunk-9rs12v0r.js → chunk-z5av310q.js} +9 -9
  138. package/dist/chunk-zr16mga0.js +2 -0
  139. package/dist/{chunk-dxh45gve.js → chunk-zt5hp5w5.js} +1 -1
  140. package/dist/chunk-zwawqx5q.js +2 -0
  141. package/dist/cli.js +20 -20
  142. package/dist/client/signals-manifest-hydration-runtime.js +4 -1
  143. package/dist/component-client-factories.js +14 -3
  144. package/dist/craft-entry.js +2 -2
  145. package/dist/craft.js +2 -2
  146. package/dist/dev-server/serve-app.js +10 -1
  147. package/dist/pwa.js +3 -3
  148. package/dist/ssg.js +6 -6
  149. package/dist/utils.js +13 -1
  150. package/package.json +5 -5
  151. package/dist/chunk-0fjwqs9h.js +0 -2
  152. package/dist/chunk-0gk78x3r.js +0 -2
  153. package/dist/chunk-0v35wpm7.js +0 -2
  154. package/dist/chunk-1dkcakve.js +0 -25
  155. package/dist/chunk-1gg5vxe8.js +0 -2
  156. package/dist/chunk-1j0sarne.js +0 -21
  157. package/dist/chunk-248a88mc.js +0 -2
  158. package/dist/chunk-2nqtmp8c.js +0 -2
  159. package/dist/chunk-2yzwrvq1.js +0 -2
  160. package/dist/chunk-3bfegbpw.js +0 -2
  161. package/dist/chunk-3wsm9g9c.js +0 -2
  162. package/dist/chunk-3xx9d934.js +0 -2
  163. package/dist/chunk-52x079ax.js +0 -2
  164. package/dist/chunk-54zkkxmb.js +0 -2
  165. package/dist/chunk-5fmxn52y.js +0 -2
  166. package/dist/chunk-61ww9d2z.js +0 -2
  167. package/dist/chunk-75zc8w68.js +0 -2
  168. package/dist/chunk-7b3phzx4.js +0 -2
  169. package/dist/chunk-8p92r2sc.js +0 -2
  170. package/dist/chunk-8xr8y9sq.js +0 -2
  171. package/dist/chunk-909ymsjz.js +0 -2
  172. package/dist/chunk-ac75vk0w.js +0 -2
  173. package/dist/chunk-arh1qgmp.js +0 -2
  174. package/dist/chunk-b0th3d8q.js +0 -888
  175. package/dist/chunk-bh19ezq0.js +0 -43
  176. package/dist/chunk-bm42rsaa.js +0 -2
  177. package/dist/chunk-cfm6a679.js +0 -2
  178. package/dist/chunk-cwmazy7y.js +0 -2
  179. package/dist/chunk-e492je6q.js +0 -2
  180. package/dist/chunk-ft1ht0b3.js +0 -2
  181. package/dist/chunk-ft3f9nj0.js +0 -2
  182. package/dist/chunk-ggwvnpwj.js +0 -2
  183. package/dist/chunk-gx6wxmbv.js +0 -2
  184. package/dist/chunk-hamk3dky.js +0 -2
  185. package/dist/chunk-hqj28381.js +0 -3
  186. package/dist/chunk-k093pr2w.js +0 -2
  187. package/dist/chunk-kcp392wy.js +0 -2
  188. package/dist/chunk-kejrhccx.js +0 -2
  189. package/dist/chunk-kmj127rm.js +0 -2
  190. package/dist/chunk-kqbpkg8n.js +0 -2
  191. package/dist/chunk-m0f3strn.js +0 -2
  192. package/dist/chunk-mjsebtg6.js +0 -2
  193. package/dist/chunk-n8f0zw1y.js +0 -31
  194. package/dist/chunk-nadgej53.js +0 -2
  195. package/dist/chunk-nh3kd03f.js +0 -2
  196. package/dist/chunk-nw2zh40z.js +0 -2
  197. package/dist/chunk-p01b07se.js +0 -54
  198. package/dist/chunk-p99an8rj.js +0 -2
  199. package/dist/chunk-pgvwysxq.js +0 -2
  200. package/dist/chunk-pz3mg7hr.js +0 -2
  201. package/dist/chunk-qyf3jcy1.js +0 -2
  202. package/dist/chunk-rc79yyqx.js +0 -2
  203. package/dist/chunk-s8qe247r.js +0 -2
  204. package/dist/chunk-sswy3tfc.js +0 -2
  205. package/dist/chunk-swxznm5v.js +0 -2
  206. package/dist/chunk-t3gmm1ja.js +0 -2
  207. package/dist/chunk-tsrf4zzy.js +0 -2
  208. package/dist/chunk-tz09earb.js +0 -2
  209. package/dist/chunk-vct8a1qf.js +0 -20
  210. package/dist/chunk-x4q4bx3q.js +0 -3
  211. package/dist/chunk-xna6b7km.js +0 -2
  212. package/dist/chunk-xw4rm5zj.js +0 -2
  213. package/dist/chunk-yar7fwrb.js +0 -2
  214. package/dist/chunk-yt33wzqk.js +0 -2
  215. package/dist/chunk-zcbp27x1.js +0 -2
  216. package/dist/chunk-zq7xbc1k.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Be,yn,ws,Ho,A}from"./chunk-9wdd7eq6.js";import{hn}from"./chunk-wc5tt6da.js";import{xr,x,lc,st,Jo,uc}from"./chunk-78yjmbbs.js";import{T}from"./chunk-6beg47t4.js";import{xs,l,p,Dt,u,V,D,y,Cs,Se,ze,Es}from"./chunk-qwdcts9w.js";import{r,fe}from"./chunk-tst8p27s.js";import{f}from"./chunk-b7e07ybq.js";import{U}from"./chunk-hh58k0nh.js";import Ge from"path";import Ct from"process";import{AsyncLocalStorage as lo}from"async_hooks";var or=new lo;function dn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function fr(e,i){return or.run(dn(e),i)}async function gr(e,i){let t=or.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let o=t.pending.get(e);if(o)return o;let a=Promise.resolve().then(i).then((h)=>{let c=JSON.stringify(h,(E,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),v=JSON.parse(c);return t.values.set(e,v),v}).catch((h)=>{throw t.pending.delete(e),h});return t.pending.set(e,a),a}function dr(e){let i=e.__stx_server_data;if(!i?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(i.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function L(e,i=!1){let t=r(e),o=[],a=new Set,h=0,c=0,v=t.length,E=()=>{if(h!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(i&&R[1]==="const")return;let I=R[2];if(!a.has(I))o.push(I),a.add(I);return}let C=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){if(i&&t.slice(c).startsWith("const"))return;C[1].split(",").forEach((I)=>{let P=I.trim();if(!P)return;let q=P.indexOf(":"),W=(q>=0?P.slice(q+1).trim():P).split(/[\s=]/)[0];if(W&&!a.has(W))o.push(W),a.add(W)});return}let O=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(O){if(i&&t.slice(c).startsWith("const"))return;O[1].split(",").forEach((I)=>{let P=I.trim().replace(/^\.\.\./,"");if(!P)return;let q=P.split(/[\s=]/)[0];if(q&&!a.has(q))o.push(q),a.add(q)});return}if(i)return;let M=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!a.has(I))o.push(I),a.add(I);return}let N=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!a.has(I))o.push(I),a.add(I)}};while(c<v){if(t[c]==="{"){h++,c++;continue}if(t[c]==="}"){h--,c++;continue}if(h===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))E();c++}return o.join(", ")}function os(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function uo(e,i=L(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(L(e,!0).split(",").map((o)=>o.trim()));return i.map((o)=>t.has(o)?`get ${o}() { return ${o} }, set ${o}(__stxValue_${o}) { ${o} = __stxValue_${o} }`:o).join(", ")}function is(e,i){let t=`{ ${uo(e,i)} }`;return L(e).split(",").some((o)=>o.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import Cn from"fs";import Ce from"path";function j(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var mr=new Map;function as(e,i=!0){let t=mr.get(e);if(i&&t)return t;let o=new Map,a=[Ce.join(e,"src"),Ce.join(e,"dist"),e];function h(c,v){if(v>6)return;let E;try{E=Cn.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of E){let C=Ce.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;h(C,v+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let O=R.name.slice(0,-4);if(!o.has(O))o.set(O,C);let M=O.toLowerCase();if(!o.has(M))o.set(M,C);let N=j(O);if(!o.has(N))o.set(N,C)}}}for(let c of a)if(h(c,0),o.size>0)break;if(i)mr.set(e,o);return o}function cs(e,i){if(e.startsWith(".")||e.startsWith("/"))return null;let t=i;while(!0){let o=Ce.join(t,"node_modules",e);try{if(Cn.statSync(o).isDirectory())return o}catch{}let a=Ce.dirname(t);if(a===t)return null;t=a}}function ls(e,i,t={}){return[Ce.resolve(Ce.dirname(i),`${e}.stx`),Ce.resolve(Ce.dirname(i),e),Ce.resolve(t.componentsDir||"components",`${e}.stx`),Ce.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function hr(e){let i=e.endsWith(".stx")?e.slice(0,-4):e,t=i.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),o=j(i);return[i,t,o]}function Co(e,i){let[t,o,a]=hr(e);for(let h of[t,t.toLowerCase(),o,a]){let c=i?.__importedComponents?.get(h);if(c!==void 0)return c}}function*Eo(e,i,t={},o){let a=hr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ce.resolve(Ce.dirname(i),`${a[0]}.stx`);return}let h=[...new Set(a.map((E)=>`${E}.stx`))],c=t.projectRoot||process.cwd(),v=[...o?.__originalFilePath?[Ce.join(Ce.dirname(o.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ce.join(Ce.dirname(i),"components"),Ce.resolve(c,"src/components"),Ce.resolve(c,"components"),...import.meta.dir?[Ce.resolve(import.meta.dir,"components")]:[]];for(let E of new Set(v)){for(let R of h)yield Ce.join(E,R);try{for(let R of Cn.readdirSync(E,{withFileTypes:!0}))if(R.isDirectory())for(let C of h)yield Ce.join(E,R.name,C)}catch{}}}function br(e,i,t={},o){let a=Co(e,o);if(a!==void 0)return a;for(let h of Eo(e,i,t,o))try{if(Cn.statSync(h,{throwIfNoEntry:!1})?.isFile())return h}catch{}return null}import qs from"fs";import le from"path";import dt from"path";import Kt from"fs";var fo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function ns(e,i){if(i.passive)return!0;if(i.prevent||i.nonpassive)return!1;return fo.has(e.toLowerCase())}var yr=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"]),_r={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"},po=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function wr(e){let i={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let o=t.toLowerCase();if(o==="prevent")i.prevent=!0;else if(o==="stop")i.stop=!0;else if(o==="once")i.once=!0;else if(o==="capture")i.capture=!0;else if(o==="self")i.self=!0;else if(o==="passive")i.passive=!0;else if(o==="nonpassive")i.nonpassive=!0;else if(po.has(o))i.systemKeys.push(o);else if(o in $r)i.mouse=o;else if(o in _r||/^[a-z]$/.test(o))i.keys.push(_r[o]||o.toUpperCase());else if(o.startsWith("debounce")){let a=o.match(/debounce(?:\.(\d+))?/);i.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(o.startsWith("throttle")){let a=o.match(/throttle(?:\.(\d+))?/);i.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return i}function vr(e,i=""){let t=[],o=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,h;while((h=a.exec(e))!==null){let[c,v,E]=h,R=h.index,C=R+c.length,O=`__stx_evt_${i}${o++}`,M=[],N=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=N.exec(E))!==null){let[,q,Z]=I,W=q.split("."),Y=W[0];if(!yr.has(Y))continue;M.push({attribute:`@${q}`,event:Y,handler:Z,modifiers:wr(W.slice(1)),elementId:O})}let P=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=P.exec(E))!==null){let[,q,Z]=I,W=q.split("."),Y=W[0];if(!yr.has(Y))continue;M.push({attribute:`@${q}`,event:Y,handler:Z,modifiers:wr(W.slice(1)),elementId:O})}if(M.length>0)t.push({originalTag:c,elementId:O,events:M,startIndex:R,endIndex:C})}return t}function go(e){let i=[],{modifiers:t}=e;if(t.self)i.push("if ($event.target !== $el) return");for(let o of t.systemKeys)i.push(`if (!$event.${o}Key) return`);if(t.keys.length>0){let o=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");i.push(`if (!(${o})) return`)}if(t.mouse!==null){let o=$r[t.mouse];i.push(`if ($event.button !== ${o}) return`)}if(t.prevent)i.push("$event.preventDefault()");if(t.stop)i.push("$event.stopPropagation()");return i.join("; ")}function mo(e,i){let t=e;if(i.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${i.debounce})`;else if(i.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${i.throttle})`;return t}function ss(e){let i=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(i))return e;return`if (typeof ${i} === 'function' && !${i}._isSignal) ${i}($event);`}function ho(e){let{modifiers:i}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),o=go(e),a=mo(ss(e.handler),i),h=[];if(i.once)h.push("once: true");if(i.capture)h.push("capture: true");if(ns(e.event,i))h.push("passive: true");let c=h.length>0?`, { ${h.join(", ")} }`:"",v=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{Be,yn,xs,Uo,A}from"./chunk-t6m5d64b.js";import{hn}from"./chunk-remsyfdx.js";import{xr,S,dc,st,Zo,pc}from"./chunk-gtktv6nn.js";import{T}from"./chunk-6beg47t4.js";import{Ss,l,p,Dt,u,U,D,y,Es,Se,ze,Ts}from"./chunk-w28wc7mv.js";import{r,fe}from"./chunk-9tg4995v.js";import{f}from"./chunk-b7e07ybq.js";import{W}from"./chunk-2ajbhefk.js";import Ge from"path";import Ct from"process";import{AsyncLocalStorage as uo}from"async_hooks";var or=new uo;function dn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function fr(e,i){return or.run(dn(e),i)}async function gr(e,i){let t=or.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let o=t.pending.get(e);if(o)return o;let a=Promise.resolve().then(i).then((h)=>{let c=JSON.stringify(h,(E,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),v=JSON.parse(c);return t.values.set(e,v),v}).catch((h)=>{throw t.pending.delete(e),h});return t.pending.set(e,a),a}function dr(e){let i=e.__stx_server_data;if(!i?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(i.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function L(e,i=!1){let t=r(e),o=[],a=new Set,h=0,c=0,v=t.length,E=()=>{if(h!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(i&&R[1]==="const")return;let I=R[2];if(!a.has(I))o.push(I),a.add(I);return}let C=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){if(i&&t.slice(c).startsWith("const"))return;C[1].split(",").forEach((I)=>{let P=I.trim();if(!P)return;let G=P.indexOf(":"),Z=(G>=0?P.slice(G+1).trim():P).split(/[\s=]/)[0];if(Z&&!a.has(Z))o.push(Z),a.add(Z)});return}let O=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(O){if(i&&t.slice(c).startsWith("const"))return;O[1].split(",").forEach((I)=>{let P=I.trim().replace(/^\.\.\./,"");if(!P)return;let G=P.split(/[\s=]/)[0];if(G&&!a.has(G))o.push(G),a.add(G)});return}if(i)return;let M=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!a.has(I))o.push(I),a.add(I);return}let N=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!a.has(I))o.push(I),a.add(I)}};while(c<v){if(t[c]==="{"){h++,c++;continue}if(t[c]==="}"){h--,c++;continue}if(h===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))E();c++}return o.join(", ")}function is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function fo(e,i=L(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(L(e,!0).split(",").map((o)=>o.trim()));return i.map((o)=>t.has(o)?`get ${o}() { return ${o} }, set ${o}(__stxValue_${o}) { ${o} = __stxValue_${o} }`:o).join(", ")}function as(e,i){let t=`{ ${fo(e,i)} }`;return L(e).split(",").some((o)=>o.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import Cn from"fs";import Te from"path";function j(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var mr=new Map;function cs(e,i=!0){let t=mr.get(e);if(i&&t)return t;let o=new Map,a=[Te.join(e,"src"),Te.join(e,"dist"),e];function h(c,v){if(v>6)return;let E;try{E=Cn.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of E){let C=Te.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;h(C,v+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let O=R.name.slice(0,-4);if(!o.has(O))o.set(O,C);let M=O.toLowerCase();if(!o.has(M))o.set(M,C);let N=j(O);if(!o.has(N))o.set(N,C)}}}for(let c of a)if(h(c,0),o.size>0)break;if(i)mr.set(e,o);return o}function ls(e,i){if(e.startsWith(".")||e.startsWith("/"))return null;let t=i;while(!0){let o=Te.join(t,"node_modules",e);try{if(Cn.statSync(o).isDirectory())return o}catch{}let a=Te.dirname(t);if(a===t)return null;t=a}}function us(e,i,t={}){return[Te.resolve(Te.dirname(i),`${e}.stx`),Te.resolve(Te.dirname(i),e),Te.resolve(t.componentsDir||"components",`${e}.stx`),Te.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function hr(e){let i=e.endsWith(".stx")?e.slice(0,-4):e,t=i.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),o=j(i);return[i,t,o]}function To(e,i){let[t,o,a]=hr(e);for(let h of[t,t.toLowerCase(),o,a]){let c=i?.__importedComponents?.get(h);if(c!==void 0)return c}}function*$o(e,i,t={},o){let a=hr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Te.resolve(Te.dirname(i),`${a[0]}.stx`);return}let h=[...new Set(a.map((E)=>`${E}.stx`))],c=t.projectRoot||process.cwd(),v=[...o?.__originalFilePath?[Te.join(Te.dirname(o.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Te.join(Te.dirname(i),"components"),Te.resolve(c,"src/components"),Te.resolve(c,"components"),...import.meta.dir?[Te.resolve(import.meta.dir,"components")]:[]];for(let E of new Set(v)){for(let R of h)yield Te.join(E,R);try{for(let R of Cn.readdirSync(E,{withFileTypes:!0}))if(R.isDirectory())for(let C of h)yield Te.join(E,R.name,C)}catch{}}}function br(e,i,t={},o){let a=To(e,o);if(a!==void 0)return a;for(let h of $o(e,i,t,o))try{if(Cn.statSync(h,{throwIfNoEntry:!1})?.isFile())return h}catch{}return null}import qs from"fs";import le from"path";import mt from"path";import Ht from"fs";var po=new Set(["touchstart","touchmove","wheel","mousewheel"]);function ns(e,i){if(i.passive)return!0;if(i.prevent||i.nonpassive)return!1;return po.has(e.toLowerCase())}var yr=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"]),_r={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"},go=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function wr(e){let i={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let o=t.toLowerCase();if(o==="prevent")i.prevent=!0;else if(o==="stop")i.stop=!0;else if(o==="once")i.once=!0;else if(o==="capture")i.capture=!0;else if(o==="self")i.self=!0;else if(o==="passive")i.passive=!0;else if(o==="nonpassive")i.nonpassive=!0;else if(go.has(o))i.systemKeys.push(o);else if(o in $r)i.mouse=o;else if(o in _r||/^[a-z]$/.test(o))i.keys.push(_r[o]||o.toUpperCase());else if(o.startsWith("debounce")){let a=o.match(/debounce(?:\.(\d+))?/);i.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(o.startsWith("throttle")){let a=o.match(/throttle(?:\.(\d+))?/);i.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return i}function vr(e,i=""){let t=[],o=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,h;while((h=a.exec(e))!==null){let[c,v,E]=h,R=h.index,C=R+c.length,O=`__stx_evt_${i}${o++}`,M=[],N=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=N.exec(E))!==null){let[,G,q]=I,Z=G.split("."),Q=Z[0];if(!yr.has(Q))continue;M.push({attribute:`@${G}`,event:Q,handler:q,modifiers:wr(Z.slice(1)),elementId:O})}let P=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=P.exec(E))!==null){let[,G,q]=I,Z=G.split("."),Q=Z[0];if(!yr.has(Q))continue;M.push({attribute:`@${G}`,event:Q,handler:q,modifiers:wr(Z.slice(1)),elementId:O})}if(M.length>0)t.push({originalTag:c,elementId:O,events:M,startIndex:R,endIndex:C})}return t}function mo(e){let i=[],{modifiers:t}=e;if(t.self)i.push("if ($event.target !== $el) return");for(let o of t.systemKeys)i.push(`if (!$event.${o}Key) return`);if(t.keys.length>0){let o=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");i.push(`if (!(${o})) return`)}if(t.mouse!==null){let o=$r[t.mouse];i.push(`if ($event.button !== ${o}) return`)}if(t.prevent)i.push("$event.preventDefault()");if(t.stop)i.push("$event.stopPropagation()");return i.join("; ")}function ho(e,i){let t=e;if(i.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${i.debounce})`;else if(i.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${i.throttle})`;return t}function ss(e){let i=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(i))return e;return`if (typeof ${i} === 'function' && !${i}._isSignal) ${i}($event);`}function xo(e){let{modifiers:i}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),o=mo(e),a=ho(ss(e.handler),i),h=[];if(i.once)h.push("once: true");if(i.capture)h.push("capture: true");if(ns(e.event,i))h.push("passive: true");let c=h.length>0?`, { ${h.join(", ")} }`:"",v=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${t}');
5
5
  if (!$el) return;
@@ -53,7 +53,7 @@ else {
53
53
  __stx_runHandler('${v}', $event, $el);
54
54
  }
55
55
  }${c});
56
- })();`}function To(e){if(e.length===0)return"";return`
56
+ })();`}function Ro(e){if(e.length===0)return"";return`
57
57
  <script data-stx-events>
58
58
  (function() {
59
59
  'use strict';
@@ -108,11 +108,11 @@ else {
108
108
  }
109
109
 
110
110
  // Event listeners
111
- ${e.map(ho).join(`
111
+ ${e.map(xo).join(`
112
112
  `)}
113
113
  })();
114
- </script>`}function xo(e,i=""){let t=vr(e,i);if(t.length===0)return{template:e,bindings:[]};let o=e,a=[];for(let h=t.length-1;h>=0;h--){let c=t[h],v=c.originalTag;if(!v.includes(" id="))v=v.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let E=v.match(/id=["']([^"']+)["']/);if(E)for(let R of c.events)R.elementId=E[1]}for(let E of c.events){let R=E.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(`\\s*${R}\\s*=\\s*"[^"]*"`,"g"),O=new RegExp(`\\s*${R}\\s*=\\s*'[^']*'`,"g");v=v.replace(C,""),v=v.replace(O,"")}o=o.slice(0,c.startIndex)+v+o.slice(c.endIndex),a.push(...c.events)}return{template:o,bindings:a}}function Sr(e){let i=e.$uid;return typeof i==="string"&&i?`${i}_`:""}function $a(e,i,t){if(uc(e))return e;if(i.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:v,bindings:E}=xo(e,Sr(i)),R=i.__stx_event_bindings||[];return i.__stx_event_bindings=[...R,...E],v}let o=vr(e,Sr(i));if(o.length===0)return e;let a=e;for(let v=o.length-1;v>=0;v--){let E=o[v],R=E.originalTag;if(!R.includes(" id="))R=R.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${E.elementId}"`);else{let C=R.match(/id=["']([^"']+)["']/);if(C)for(let O of E.events)O.elementId=C[1]}for(let C of E.events){let O=C.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),M=new RegExp(`\\s*${O}\\s*=\\s*"[^"]*"`,"g"),N=new RegExp(`\\s*${O}\\s*=\\s*'[^']*'`,"g");R=R.replace(M,""),R=R.replace(N,"")}a=a.slice(0,E.startIndex)+R+a.slice(E.endIndex)}let h=To(o.flatMap((v)=>v.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+h+`
115
- `+a.slice(c);else a+=h;return a}function Er(e,i){let t=new Set;for(let o of e.split(",")){let a=o.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(i){let h=a.lastIndexOf(":");if(h!==-1)a=a.slice(h+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Et(e,i){let t=r(e),{depths:o,balanced:a}=fe(t),h=(v)=>!a||o[v]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${i}\\b)`,"g");for(let v of t.matchAll(c)){let E=(v.index??0)+v[0].length-v[1].length;if(h(E))return!0}for(let v of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(h(v.index??0)&&Er(v[1],!0).has(i))return!0;for(let v of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(h(v.index??0)&&Er(v[1],!1).has(i))return!0;return!1}var kr="",Tn,ct=/^[A-Za-z_$][\w$]*$/,bo=new Set(["if","for","while","switch","with"]),Rr=["(","[","{"],Cr=[")","]","}"],yo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function _o(e){let i=r(e),t=[];for(let o of i.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=o.index??0;t.push({text:o[0],start:a,end:a+o[0].length})}return{code:i,tokens:t}}function rs(e){if(Tn&&e===kr)return Tn;let{code:i,tokens:t}=_o(e),o=new Map,a=[];for(let I=0;I<t.length;I++){let P=t[I].text;if(["(","[","{"].includes(P))a.push(I);else if([")","]","}"].includes(P)){let q=a.at(-1);if(q!==void 0&&["()","[]","{}"].includes(t[q].text+P))a.pop(),o.set(q,I),o.set(I,q)}}function h(I,P){let q=[],Z=I;for(let W=I;W<P;W++){if(["(","[","{"].includes(t[W].text)&&(o.get(W)??P)<P){W=o.get(W);continue}if(t[W].text===",")q.push([Z,W]),Z=W+1}return q.push([Z,P]),q}let c=[];function v(I,P,q,Z=!1){if(t[I]?.text==="...")I++;if(I>=P)return;let W=t[I].text;if(ct.test(W)){if(q.add(W),q===C)c.push({name:W,token:I,functionScoped:Z});return}if(W!=="{"&&W!=="[")return;let Y=o.get(I);if(Y===void 0||Y>=P)return;for(let[ee,te]of h(I+1,Y)){let ae=ee;if(W==="{")for(let me=ee;me<te;me++){if(t[me].text===":"){ae=me+1;break}if(t[me].text==="=")break;if(["(","[","{"].includes(t[me].text)&&o.has(me))me=o.get(me)}v(ae,te,q,Z)}}function E(I,P){let q=new Set;for(let[Z,W]of h(I,P))v(Z,W,q);return q}function R(I){let P=I;for(;P<t.length;P++){let q=t[P].text;if(["(","[","{"].includes(q)&&o.has(P)){P=o.get(P);continue}if([",",";",")","]","}"].includes(q))break}return t[Math.max(I,P-1)]?.end??i.length}let C=new Set,O=[];for(let I=0;I<t.length;I++)if(t[I].text==="=>"){let P=I-1,q=P,Z;if(t[P]?.text===")"&&o.has(P))q=o.get(P),Z=E(q+1,P);else if(t[P]&&ct.test(t[P].text))Z=new Set([t[P].text]);else continue;let W=I+1,Y=t[W]?.text==="{"&&o.has(W)?t[o.get(W)].end:R(W);O.push({start:t[q].start,end:Y,bodyStart:t[W]?.start??Y,functionBody:!0,names:Z})}else if(t[I].text==="("&&o.has(I)){let P=t[I-1]?.text;if(!P||bo.has(P)||!ct.test(P)&&P!=="*"&&P!=="]")continue;let q=o.get(I),Z=q+1;if(t[Z]?.text===":"){Z++;while(Z<t.length&&!["{","=>",";","="].includes(t[Z].text))Z++}if(t[Z]?.text!=="{"||!o.has(Z))continue;O.push({start:t[I].start,end:t[o.get(Z)].end,bodyStart:t[Z].start,functionBody:P!=="catch",names:E(I+1,q)})}function M(I){let P=I;for(;P<t.length;P++){let q=t[P].text;if(Rr.includes(q)&&o.has(P)){P=o.get(P);continue}if(q===";"||Cr.includes(q))break;let Z=t[P-1];if(P>I&&yo.has(q)&&Z.text!==".")break;if(P>I&&/[\n\r]/.test(i.slice(Z.end,t[P].start))&&(/^[\w$]+$/.test(Z.text)||Cr.includes(Z.text)||['"',"'","`"].includes(Z.text))&&ct.test(q)&&!["in","of","instanceof"].includes(q))break}return P}let N=[];for(let I=0;I<t.length;I++){if(t[I].text!=="for")continue;let P=t[I+1]?.text==="await"?I+2:I+1;if(t[P]?.text!=="("||!o.has(P))continue;let q=o.get(P),Z=q+1,W=t[Z]?.text==="{"&&o.has(Z)?o.get(Z):M(Z),Y=t[W]?.text===";"||t[W]?.text==="}"?t[W].end:t[Math.max(Z,W-1)]?.end??i.length;N.push({headStart:P,headEnd:q,start:t[P].start,end:Y})}for(let I=0;I<t.length;I++){let P=t[I].text,q=t[I-1]?.text;if(q==="."||t[I+1]?.text===":")continue;if(q==="as"||q==="<")continue;if(P==="const"||P==="let"||P==="var"){let Z=M(I+1),W=I+1,Y=!1,ee=!1,te=0;for(let ae=I+1;ae<=Z;ae++){let me=t[ae]?.text;if(ae<Z&&Rr.includes(me)&&o.has(ae)&&o.get(ae)<Z){ae=o.get(ae);continue}if(ae<Z&&me===":"&&!ee)Y=!0;else if(ae<Z&&me==="="&&te===0)Y=!1,ee=!0;else if(ae<Z&&Y&&me==="<")te++;else if(ae<Z&&Y&&me===">"&&te>0)te--;else if(ae===Z||me===","&&te===0)v(W,ae,C,P==="var"),W=ae+1,Y=!1,ee=!1}}else if(P==="function"||P==="class"){let Z=I+1;if(t[Z]?.text==="*")Z++;if(t[Z]&&ct.test(t[Z].text)&&t[Z].text!=="extends")C.add(t[Z].text),c.push({name:t[Z].text,token:Z})}else if(P==="import"){let Z=I+1;if(t[Z]?.text==="*"&&t[Z+1]?.text==="as")Z+=2;let W=t[Z]?.text;if(W&&ct.test(W)&&W!=="type"&&t[Z+1]?.text!=="("&&t[Z+1]?.text!==".")C.add(W),c.push({name:W,token:Z,file:!0});let Y=t[Z]?.text==="{"?Z:t[Z+1]?.text===","&&t[Z+2]?.text==="{"?Z+2:-1;if(Y!==-1&&o.has(Y)){let ee=o.get(Y);for(let[te,ae]of h(Y+1,ee)){let me=ae-1;while(me>=te&&!ct.test(t[me].text))me--;if(me>=te&&t[me].text!=="type")c.push({name:t[me].text,token:me,file:!0})}}}}return kr=e,Tn={code:i,scopes:O,loops:N,declarations:C,sites:c,tokens:t,pairs:o},Tn}function fs(e){let i=rs(e);return{code:i.code,shadows:(t,o)=>i.scopes.some((a)=>o>=a.start&&o<a.end&&a.names.has(t))}}function An(e){return new Set(rs(e).declarations)}function on(e,i){let{scopes:t,loops:o,sites:a,tokens:h,pairs:c}=rs(e),v=Array.from({length:h.length},()=>-1),E=[];for(let N=0;N<h.length;N++){v[N]=E.length?E[E.length-1]:-1;let I=h[N].text;if(I==="{"&&c.has(N))E.push(N);else if(I==="}"&&E.length&&c.get(N)===E[E.length-1])E.pop()}let R=new Set,C=new Map;for(let N of a){if(!i.has(N.name))continue;R.add(N.token);let I=N.file?-1:v[N.token],P=I===-1?[0,Number.POSITIVE_INFINITY]:[h[I].start,h[c.get(I)].end];if(N.functionScoped){let Z=h[N.token].start,W=t.filter((Y)=>Y.functionBody&&Z>=Y.bodyStart&&Z<Y.end).sort((Y,ee)=>Y.end-Y.bodyStart-(ee.end-ee.bodyStart))[0];P=W?[W.bodyStart,W.end]:[0,Number.POSITIVE_INFINITY]}else if(!N.file){let Z=o.filter((W)=>N.token>W.headStart&&N.token<W.headEnd).sort((W,Y)=>W.headEnd-W.headStart-(Y.headEnd-Y.headStart))[0];if(Z)P=[Z.start,Z.end]}let q=C.get(N.name);if(q)q.push(P);else C.set(N.name,[P])}let O=new Set;for(let N=0;N<h.length;N++){if(h[N].text!=="import"||h[N-1]?.text===".")continue;let I=N+1;if(h[I]?.text==="type")I++;if(h[I]&&ct.test(h[I].text)&&h[I+1]?.text===",")I+=2;if(h[I]?.text==="{"&&c.has(I))for(let P=I+1;P<c.get(I);P++)O.add(P)}let M=new Set;for(let N=0;N<h.length;N++){let I=h[N].text;if(!i.has(I)||M.has(I)||R.has(N)||O.has(N))continue;let P=h[N-1]?.text;if(P==="#"||P==="."&&h[N-2]?.text!=="..")continue;if(h[N+1]?.text===":"&&(P==="{"||P===","))continue;let q=h[N].start;if(C.get(I)?.some(([Z,W])=>q>=Z&&q<W))continue;if(t.some((Z)=>q>=Z.start&&q<Z.end&&Z.names.has(I)))continue;M.add(I)}return M}var Ae="0.2.679";var Tr=Symbol.for(`stx.lazy-module-promises.${Ae}`);function So(){let e=globalThis;return e[Tr]??=new Map,e[Tr]}function s(e,i){let t=So(),o=`${import.meta.url}\x00${e}`,a=t.get(o);if(a)return a;let h=i();return t.set(o,h),h.catch(()=>{if(t.get(o)===h)t.delete(o)}),h}var vo=/<\/(script)/gi;function an(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(vo,"<\\/$1")}import Or from"fs";class B{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,i){this.maxSize=e,this.options=i??null,this.sizes=i?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}}get(e){if(!this.cache.has(e))return;let i=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,i),i}set(e,i){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(i):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let o=this.cache.keys().next().value;if(o===void 0)break;this.delete(o)}if(this.cache.set(e,i),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let i=this.sizes.get(e);if(i!==void 0)this.bytes-=i,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,ko=500;function Tt(e,i){if(i?.includes("g"))return new RegExp(e,i);let t=`${e}:${i||""}`;if(!St.has(t)){if(St.size>=ko){let o=St.keys().next().value;if(o)St.delete(o)}St.set(t,new RegExp(e,i))}return St.get(t)}class Ar{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let i=Array.from(new Set(e)),t=i.sort().join(","),o=this.pool.find((v)=>v.context.join(",")===t);if(o)return o.func;let a=this.fnCache,h=this.fnCacheMaxSize,c=(...v)=>(E)=>{try{let R=`${t}:${E}`,C=a.get(R);if(!C){if(a.size>=h){let O=a.keys().next().value;if(O)a.delete(O)}C=Function(...i,`
114
+ </script>`}function bo(e,i=""){let t=vr(e,i);if(t.length===0)return{template:e,bindings:[]};let o=e,a=[];for(let h=t.length-1;h>=0;h--){let c=t[h],v=c.originalTag;if(!v.includes(" id="))v=v.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let E=v.match(/id=["']([^"']+)["']/);if(E)for(let R of c.events)R.elementId=E[1]}for(let E of c.events){let R=E.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(`\\s*${R}\\s*=\\s*"[^"]*"`,"g"),O=new RegExp(`\\s*${R}\\s*=\\s*'[^']*'`,"g");v=v.replace(C,""),v=v.replace(O,"")}o=o.slice(0,c.startIndex)+v+o.slice(c.endIndex),a.push(...c.events)}return{template:o,bindings:a}}function Sr(e){let i=e.$uid;return typeof i==="string"&&i?`${i}_`:""}function Aa(e,i,t){if(pc(e))return e;if(i.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:v,bindings:E}=bo(e,Sr(i)),R=i.__stx_event_bindings||[];return i.__stx_event_bindings=[...R,...E],v}let o=vr(e,Sr(i));if(o.length===0)return e;let a=e;for(let v=o.length-1;v>=0;v--){let E=o[v],R=E.originalTag;if(!R.includes(" id="))R=R.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${E.elementId}"`);else{let C=R.match(/id=["']([^"']+)["']/);if(C)for(let O of E.events)O.elementId=C[1]}for(let C of E.events){let O=C.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),M=new RegExp(`\\s*${O}\\s*=\\s*"[^"]*"`,"g"),N=new RegExp(`\\s*${O}\\s*=\\s*'[^']*'`,"g");R=R.replace(M,""),R=R.replace(N,"")}a=a.slice(0,E.startIndex)+R+a.slice(E.endIndex)}let h=Ro(o.flatMap((v)=>v.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+h+`
115
+ `+a.slice(c);else a+=h;return a}function Er(e,i){let t=new Set;for(let o of e.split(",")){let a=o.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(i){let h=a.lastIndexOf(":");if(h!==-1)a=a.slice(h+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Et(e,i){let t=r(e),{depths:o,balanced:a}=fe(t),h=(v)=>!a||o[v]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${i}\\b)`,"g");for(let v of t.matchAll(c)){let E=(v.index??0)+v[0].length-v[1].length;if(h(E))return!0}for(let v of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(h(v.index??0)&&Er(v[1],!0).has(i))return!0;for(let v of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(h(v.index??0)&&Er(v[1],!1).has(i))return!0;return!1}var kr="",Tn,lt=/^[A-Za-z_$][\w$]*$/,yo=new Set(["if","for","while","switch","with"]),Rr=["(","[","{"],Cr=[")","]","}"],_o=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function wo(e){let i=r(e),t=[];for(let o of i.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=o.index??0;t.push({text:o[0],start:a,end:a+o[0].length})}return{code:i,tokens:t}}function rs(e){if(Tn&&e===kr)return Tn;let{code:i,tokens:t}=wo(e),o=new Map,a=[];for(let I=0;I<t.length;I++){let P=t[I].text;if(["(","[","{"].includes(P))a.push(I);else if([")","]","}"].includes(P)){let G=a.at(-1);if(G!==void 0&&["()","[]","{}"].includes(t[G].text+P))a.pop(),o.set(G,I),o.set(I,G)}}function h(I,P){let G=[],q=I;for(let Z=I;Z<P;Z++){if(["(","[","{"].includes(t[Z].text)&&(o.get(Z)??P)<P){Z=o.get(Z);continue}if(t[Z].text===",")G.push([q,Z]),q=Z+1}return G.push([q,P]),G}let c=[];function v(I,P,G,q=!1){if(t[I]?.text==="...")I++;if(I>=P)return;let Z=t[I].text;if(lt.test(Z)){if(G.add(Z),G===C)c.push({name:Z,token:I,functionScoped:q});return}if(Z!=="{"&&Z!=="[")return;let Q=o.get(I);if(Q===void 0||Q>=P)return;for(let[te,ne]of h(I+1,Q)){let ae=te;if(Z==="{")for(let me=te;me<ne;me++){if(t[me].text===":"){ae=me+1;break}if(t[me].text==="=")break;if(["(","[","{"].includes(t[me].text)&&o.has(me))me=o.get(me)}v(ae,ne,G,q)}}function E(I,P){let G=new Set;for(let[q,Z]of h(I,P))v(q,Z,G);return G}function R(I){let P=I;for(;P<t.length;P++){let G=t[P].text;if(["(","[","{"].includes(G)&&o.has(P)){P=o.get(P);continue}if([",",";",")","]","}"].includes(G))break}return t[Math.max(I,P-1)]?.end??i.length}let C=new Set,O=[];for(let I=0;I<t.length;I++)if(t[I].text==="=>"){let P=I-1,G=P,q;if(t[P]?.text===")"&&o.has(P))G=o.get(P),q=E(G+1,P);else if(t[P]&&lt.test(t[P].text))q=new Set([t[P].text]);else continue;let Z=I+1,Q=t[Z]?.text==="{"&&o.has(Z)?t[o.get(Z)].end:R(Z);O.push({start:t[G].start,end:Q,bodyStart:t[Z]?.start??Q,functionBody:!0,names:q})}else if(t[I].text==="("&&o.has(I)){let P=t[I-1]?.text;if(!P||yo.has(P)||!lt.test(P)&&P!=="*"&&P!=="]")continue;let G=o.get(I),q=G+1;if(t[q]?.text===":"){q++;while(q<t.length&&!["{","=>",";","="].includes(t[q].text))q++}if(t[q]?.text!=="{"||!o.has(q))continue;O.push({start:t[I].start,end:t[o.get(q)].end,bodyStart:t[q].start,functionBody:P!=="catch",names:E(I+1,G)})}function M(I){let P=I;for(;P<t.length;P++){let G=t[P].text;if(Rr.includes(G)&&o.has(P)){P=o.get(P);continue}if(G===";"||Cr.includes(G))break;let q=t[P-1];if(P>I&&_o.has(G)&&q.text!==".")break;if(P>I&&/[\n\r]/.test(i.slice(q.end,t[P].start))&&(/^[\w$]+$/.test(q.text)||Cr.includes(q.text)||['"',"'","`"].includes(q.text))&&lt.test(G)&&!["in","of","instanceof"].includes(G))break}return P}let N=[];for(let I=0;I<t.length;I++){if(t[I].text!=="for")continue;let P=t[I+1]?.text==="await"?I+2:I+1;if(t[P]?.text!=="("||!o.has(P))continue;let G=o.get(P),q=G+1,Z=t[q]?.text==="{"&&o.has(q)?o.get(q):M(q),Q=t[Z]?.text===";"||t[Z]?.text==="}"?t[Z].end:t[Math.max(q,Z-1)]?.end??i.length;N.push({headStart:P,headEnd:G,start:t[P].start,end:Q})}for(let I=0;I<t.length;I++){let P=t[I].text,G=t[I-1]?.text;if(G==="."||t[I+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(P==="const"||P==="let"||P==="var"){let q=M(I+1),Z=I+1,Q=!1,te=!1,ne=0;for(let ae=I+1;ae<=q;ae++){let me=t[ae]?.text;if(ae<q&&Rr.includes(me)&&o.has(ae)&&o.get(ae)<q){ae=o.get(ae);continue}if(ae<q&&me===":"&&!te)Q=!0;else if(ae<q&&me==="="&&ne===0)Q=!1,te=!0;else if(ae<q&&Q&&me==="<")ne++;else if(ae<q&&Q&&me===">"&&ne>0)ne--;else if(ae===q||me===","&&ne===0)v(Z,ae,C,P==="var"),Z=ae+1,Q=!1,te=!1}}else if(P==="function"||P==="class"){let q=I+1;if(t[q]?.text==="*")q++;if(t[q]&&lt.test(t[q].text)&&t[q].text!=="extends")C.add(t[q].text),c.push({name:t[q].text,token:q})}else if(P==="import"){let q=I+1;if(t[q]?.text==="*"&&t[q+1]?.text==="as")q+=2;let Z=t[q]?.text;if(Z&&lt.test(Z)&&Z!=="type"&&t[q+1]?.text!=="("&&t[q+1]?.text!==".")C.add(Z),c.push({name:Z,token:q,file:!0});let Q=t[q]?.text==="{"?q:t[q+1]?.text===","&&t[q+2]?.text==="{"?q+2:-1;if(Q!==-1&&o.has(Q)){let te=o.get(Q);for(let[ne,ae]of h(Q+1,te)){let me=ae-1;while(me>=ne&&!lt.test(t[me].text))me--;if(me>=ne&&t[me].text!=="type")c.push({name:t[me].text,token:me,file:!0})}}}}return kr=e,Tn={code:i,scopes:O,loops:N,declarations:C,sites:c,tokens:t,pairs:o},Tn}function os(e){let i=rs(e);return{code:i.code,shadows:(t,o)=>i.scopes.some((a)=>o>=a.start&&o<a.end&&a.names.has(t))}}function An(e){return new Set(rs(e).declarations)}function on(e,i){let{scopes:t,loops:o,sites:a,tokens:h,pairs:c}=rs(e),v=Array.from({length:h.length},()=>-1),E=[];for(let N=0;N<h.length;N++){v[N]=E.length?E[E.length-1]:-1;let I=h[N].text;if(I==="{"&&c.has(N))E.push(N);else if(I==="}"&&E.length&&c.get(N)===E[E.length-1])E.pop()}let R=new Set,C=new Map;for(let N of a){if(!i.has(N.name))continue;R.add(N.token);let I=N.file?-1:v[N.token],P=I===-1?[0,Number.POSITIVE_INFINITY]:[h[I].start,h[c.get(I)].end];if(N.functionScoped){let q=h[N.token].start,Z=t.filter((Q)=>Q.functionBody&&q>=Q.bodyStart&&q<Q.end).sort((Q,te)=>Q.end-Q.bodyStart-(te.end-te.bodyStart))[0];P=Z?[Z.bodyStart,Z.end]:[0,Number.POSITIVE_INFINITY]}else if(!N.file){let q=o.filter((Z)=>N.token>Z.headStart&&N.token<Z.headEnd).sort((Z,Q)=>Z.headEnd-Z.headStart-(Q.headEnd-Q.headStart))[0];if(q)P=[q.start,q.end]}let G=C.get(N.name);if(G)G.push(P);else C.set(N.name,[P])}let O=new Set;for(let N=0;N<h.length;N++){if(h[N].text!=="import"||h[N-1]?.text===".")continue;let I=N+1;if(h[I]?.text==="type")I++;if(h[I]&&lt.test(h[I].text)&&h[I+1]?.text===",")I+=2;if(h[I]?.text==="{"&&c.has(I))for(let P=I+1;P<c.get(I);P++)O.add(P)}let M=new Set;for(let N=0;N<h.length;N++){let I=h[N].text;if(!i.has(I)||M.has(I)||R.has(N)||O.has(N))continue;let P=h[N-1]?.text;if(P==="#"||P==="."&&h[N-2]?.text!=="..")continue;if(h[N+1]?.text===":"&&(P==="{"||P===","))continue;let G=h[N].start;if(C.get(I)?.some(([q,Z])=>G>=q&&G<Z))continue;if(t.some((q)=>G>=q.start&&G<q.end&&q.names.has(I)))continue;M.add(I)}return M}var Ae="0.2.682";var Tr=Symbol.for(`stx.lazy-module-promises.${Ae}`);function vo(){let e=globalThis;return e[Tr]??=new Map,e[Tr]}function s(e,i){let t=vo(),o=`${import.meta.url}\x00${e}`,a=t.get(o);if(a)return a;let h=i();return t.set(o,h),h.catch(()=>{if(t.get(o)===h)t.delete(o)}),h}var Eo=/<\/(script)/gi;function an(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Eo,"<\\/$1")}import Or from"fs";class B{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,i){this.maxSize=e,this.options=i??null,this.sizes=i?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}}get(e){if(!this.cache.has(e))return;let i=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,i),i}set(e,i){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(i):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let o=this.cache.keys().next().value;if(o===void 0)break;this.delete(o)}if(this.cache.set(e,i),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let i=this.sizes.get(e);if(i!==void 0)this.bytes-=i,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,ko=500;function Tt(e,i){if(i?.includes("g"))return new RegExp(e,i);let t=`${e}:${i||""}`;if(!St.has(t)){if(St.size>=ko){let o=St.keys().next().value;if(o)St.delete(o)}St.set(t,new RegExp(e,i))}return St.get(t)}class Ar{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let i=Array.from(new Set(e)),t=i.sort().join(","),o=this.pool.find((v)=>v.context.join(",")===t);if(o)return o.func;let a=this.fnCache,h=this.fnCacheMaxSize,c=(...v)=>(E)=>{try{let R=`${t}:${E}`,C=a.get(R);if(!C){if(a.size>=h){let O=a.keys().next().value;if(O)a.delete(O)}C=Function(...i,`
116
116
  'use strict';
117
117
  try {
118
118
  return ${E};
@@ -123,18 +123,18 @@ catch (e) {
123
123
  }
124
124
  throw e;
125
125
  }
126
- `),a.set(R,C)}return C(...v)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:c,context:i.slice()});return c}clear(){this.pool.length=0,this.fnCache.clear()}}var wu=new Ar;class Ir{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,i){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...i})}setBudgets(e){for(let[i,t]of Object.entries(e))this.setBudget(i,t)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[i,t]of this.budgets.entries())e[i]=t;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let i=this.violationHandlers.indexOf(e);if(i!==-1)this.violationHandlers.splice(i,1)}time(e,i){if(!this.enabled)return i();let t=performance.now(),o=i(),a=performance.now()-t;return this.recordTime(e,a),this.checkBudget(e,a),o}async timeAsync(e,i){if(!this.enabled)return i();let t=performance.now(),o=await i(),a=performance.now()-t;return this.recordTime(e,a),this.checkBudget(e,a),o}checkBudget(e,i){let t=this.budgets.get(e);if(!t)return;let o=i/t.maxTime*100,a=t.warnThreshold!==void 0?i>=t.maxTime*t.warnThreshold&&i<t.maxTime:!1,h=i>=t.maxTime;if(!a&&!h)return;let c={label:e,actualTime:i,budgetTime:t.maxTime,exceedancePercent:o,timestamp:new Date,isWarning:a};this.violations.push(c);while(this.violations.length>this.maxViolations)this.violations.shift();for(let E of this.violationHandlers)try{E(c)}catch{}let v=a?`[Performance Warning] "${e}" took ${i.toFixed(2)}ms (${o.toFixed(1)}% of ${t.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${i.toFixed(2)}ms (exceeded ${t.maxTime}ms budget by ${(o-100).toFixed(1)}%)`;switch(t.action){case"log":console.log(v);break;case"warn":console.warn(v);break;case"error":console.error(v);break;case"throw":if(h)throw Error(v);else console.warn(v);break}}recordTime(e,i){let t=this.metrics.get(e);if(t)t.count++,t.totalTime+=i,t.maxTime=Math.max(t.maxTime,i),t.minTime=Math.min(t.minTime,i);else this.metrics.set(e,{count:1,totalTime:i,maxTime:i,minTime:i})}getStats(e){if(e){let t=this.metrics.get(e);if(!t)return{};let o=this.budgets.get(e);return{count:t.count,avgTime:t.totalTime/t.count,totalTime:t.totalTime,maxTime:t.maxTime,minTime:t.minTime,budget:o?.maxTime,budgetUtilization:o?t.totalTime/t.count/o.maxTime*100:void 0}}let i={};for(let[t,o]of this.metrics.entries()){let a=this.budgets.get(t);i[t]={count:o.count,avgTime:o.totalTime/o.count,totalTime:o.totalTime,maxTime:o.maxTime,minTime:o.minTime,budget:a?.maxTime,budgetUtilization:a?o.totalTime/o.count/a.maxTime*100:void 0}}return i}getViolations(e){if(e)return this.violations.filter((i)=>i.label===e);return[...this.violations]}getViolationStats(){let e={},i=0,t=0;for(let o of this.violations)if(e[o.label]=(e[o.label]||0)+1,o.isWarning)i++;else t++;return{total:this.violations.length,byLabel:e,warnings:i,errors:t}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var _s=null;function zo(){if(!_s)_s=new Ir;return _s}var re=new Proxy({},{get(e,i){return zo()[i]}});var Pr=[];function b(e){let i=new B(e);return Pr.push(i),i}function Ra(){for(let e of Pr)e.clear()}function w(e,...i){return`${i.map((t)=>String(t??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function ir(e){let i=[];for(let t of new Set(e))try{i.push({path:t,mtimeMs:Or.statSync(t).mtimeMs})}catch{}return i}function us(e){for(let i of e)try{if(Or.statSync(i.path).mtimeMs!==i.mtimeMs)return!1}catch{return!1}return!0}var ve=["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 Wo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function Vo(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let t=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}let i=e.match(/^([^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}function Uo(e,i){let t=i;while(!0){let o=dt.join(t,"node_modules",e,"package.json");if(Kt.existsSync(o))return dt.dirname(o);let a=dt.dirname(t);if(a===t)return null;t=a}}function Ko(e,i){if(!e||typeof e!=="object")return null;let t=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return t(a.import);if(typeof a.default==="object")return t(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,i))return t(e[i]);let o=null;for(let a of Object.keys(e)){let h=a.indexOf("*");if(h===-1)continue;let c=a.slice(0,h),v=a.slice(h+1);if(!i.startsWith(c)||!i.endsWith(v))continue;if(i.length<c.length+v.length)continue;if(!o||c.length>o.prefix.length)o={pattern:a,prefix:c,suffix:v}}if(o){let a=i.slice(o.prefix.length,i.length-o.suffix.length),h=t(e[o.pattern]);if(h)return h.replace("*",a)}return null}function Zo(e,i){let t=Vo(e);if(!t||!t.subpath)return null;let o=Uo(t.pkg,i);if(!o)return null;let a;try{a=JSON.parse(Kt.readFileSync(dt.join(o,"package.json"),"utf8"))}catch{return null}let h=`.${t.subpath}`,c=Ko(a.exports,h);if(!c)return null;let v=dt.resolve(o,c);return Kt.existsSync(v)?v:null}function Do(e,i){let t=i.filePath?dt.dirname(i.filePath):i.projectRoot||process.cwd(),o=i.projectRoot||process.cwd(),a=new Set,h=[],c=[];return{code:e.replace(Wo,(E,R)=>{let C;try{if(R.startsWith("./")||R.startsWith("../")||R.startsWith("/")){if(C=R.startsWith("/")?R:dt.resolve(t,R),!Kt.existsSync(C))throw Error(`file not found: ${C}`)}else{let O=null;try{O=Bun.resolveSync(R,o)}catch{O=Zo(R,o)}if(!O)throw Error(`could not resolve ${R} (Bun.resolveSync + exports fallback both failed)`);C=O}}catch(O){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(R)} (from ${i.filePath||"<unknown>"}): ${O?.message||O}`),c.push(R),""}if(a.has(C))return"";a.add(C);try{let O=Kt.readFileSync(C,"utf8");h.push({source:R,resolvedPath:C,contents:O})}catch(O){console.warn(`[stx:vendor-css] could not read ${C}: ${O?.message||O}`),c.push(R)}return""}),styles:h,unresolved:c}}function qo(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Mo(e){if(e.length===0)return"";return`${e.map((i)=>`<style data-stx-vendor="${qo(i.source)}" data-stx-layer="vendor">
126
+ `),a.set(R,C)}return C(...v)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:c,context:i.slice()});return c}clear(){this.pool.length=0,this.fnCache.clear()}}var Su=new Ar;class Ir{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,i){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...i})}setBudgets(e){for(let[i,t]of Object.entries(e))this.setBudget(i,t)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[i,t]of this.budgets.entries())e[i]=t;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let i=this.violationHandlers.indexOf(e);if(i!==-1)this.violationHandlers.splice(i,1)}time(e,i){if(!this.enabled)return i();let t=performance.now(),o=i(),a=performance.now()-t;return this.recordTime(e,a),this.checkBudget(e,a),o}async timeAsync(e,i){if(!this.enabled)return i();let t=performance.now(),o=await i(),a=performance.now()-t;return this.recordTime(e,a),this.checkBudget(e,a),o}checkBudget(e,i){let t=this.budgets.get(e);if(!t)return;let o=i/t.maxTime*100,a=t.warnThreshold!==void 0?i>=t.maxTime*t.warnThreshold&&i<t.maxTime:!1,h=i>=t.maxTime;if(!a&&!h)return;let c={label:e,actualTime:i,budgetTime:t.maxTime,exceedancePercent:o,timestamp:new Date,isWarning:a};this.violations.push(c);while(this.violations.length>this.maxViolations)this.violations.shift();for(let E of this.violationHandlers)try{E(c)}catch{}let v=a?`[Performance Warning] "${e}" took ${i.toFixed(2)}ms (${o.toFixed(1)}% of ${t.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${i.toFixed(2)}ms (exceeded ${t.maxTime}ms budget by ${(o-100).toFixed(1)}%)`;switch(t.action){case"log":console.log(v);break;case"warn":console.warn(v);break;case"error":console.error(v);break;case"throw":if(h)throw Error(v);else console.warn(v);break}}recordTime(e,i){let t=this.metrics.get(e);if(t)t.count++,t.totalTime+=i,t.maxTime=Math.max(t.maxTime,i),t.minTime=Math.min(t.minTime,i);else this.metrics.set(e,{count:1,totalTime:i,maxTime:i,minTime:i})}getStats(e){if(e){let t=this.metrics.get(e);if(!t)return{};let o=this.budgets.get(e);return{count:t.count,avgTime:t.totalTime/t.count,totalTime:t.totalTime,maxTime:t.maxTime,minTime:t.minTime,budget:o?.maxTime,budgetUtilization:o?t.totalTime/t.count/o.maxTime*100:void 0}}let i={};for(let[t,o]of this.metrics.entries()){let a=this.budgets.get(t);i[t]={count:o.count,avgTime:o.totalTime/o.count,totalTime:o.totalTime,maxTime:o.maxTime,minTime:o.minTime,budget:a?.maxTime,budgetUtilization:a?o.totalTime/o.count/a.maxTime*100:void 0}}return i}getViolations(e){if(e)return this.violations.filter((i)=>i.label===e);return[...this.violations]}getViolationStats(){let e={},i=0,t=0;for(let o of this.violations)if(e[o.label]=(e[o.label]||0)+1,o.isWarning)i++;else t++;return{total:this.violations.length,byLabel:e,warnings:i,errors:t}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var fs=null;function Co(){if(!fs)fs=new Ir;return fs}var se=new Proxy({},{get(e,i){return Co()[i]}});var Pr=[];function b(e){let i=new B(e);return Pr.push(i),i}function Pa(){for(let e of Pr)e.clear()}function w(e,...i){return`${i.map((t)=>String(t??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function ir(e){let i=[];for(let t of new Set(e))try{i.push({path:t,mtimeMs:Or.statSync(t).mtimeMs})}catch{}return i}function ds(e){for(let i of e)try{if(Or.statSync(i.path).mtimeMs!==i.mtimeMs)return!1}catch{return!1}return!0}var ve=["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 Wo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function Vo(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let t=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}let i=e.match(/^([^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}function Ko(e,i){let t=i;while(!0){let o=mt.join(t,"node_modules",e,"package.json");if(Ht.existsSync(o))return mt.dirname(o);let a=mt.dirname(t);if(a===t)return null;t=a}}function qo(e,i){if(!e||typeof e!=="object")return null;let t=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return t(a.import);if(typeof a.default==="object")return t(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,i))return t(e[i]);let o=null;for(let a of Object.keys(e)){let h=a.indexOf("*");if(h===-1)continue;let c=a.slice(0,h),v=a.slice(h+1);if(!i.startsWith(c)||!i.endsWith(v))continue;if(i.length<c.length+v.length)continue;if(!o||c.length>o.prefix.length)o={pattern:a,prefix:c,suffix:v}}if(o){let a=i.slice(o.prefix.length,i.length-o.suffix.length),h=t(e[o.pattern]);if(h)return h.replace("*",a)}return null}function Xo(e,i){let t=Vo(e);if(!t||!t.subpath)return null;let o=Ko(t.pkg,i);if(!o)return null;let a;try{a=JSON.parse(Ht.readFileSync(mt.join(o,"package.json"),"utf8"))}catch{return null}let h=`.${t.subpath}`,c=qo(a.exports,h);if(!c)return null;let v=mt.resolve(o,c);return Ht.existsSync(v)?v:null}function Lo(e,i){let t=i.filePath?mt.dirname(i.filePath):i.projectRoot||process.cwd(),o=i.projectRoot||process.cwd(),a=new Set,h=[],c=[];return{code:e.replace(Wo,(E,R)=>{let C;try{if(R.startsWith("./")||R.startsWith("../")||R.startsWith("/")){if(C=R.startsWith("/")?R:mt.resolve(t,R),!Ht.existsSync(C))throw Error(`file not found: ${C}`)}else{let O=null;try{O=Bun.resolveSync(R,o)}catch{O=Xo(R,o)}if(!O)throw Error(`could not resolve ${R} (Bun.resolveSync + exports fallback both failed)`);C=O}}catch(O){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(R)} (from ${i.filePath||"<unknown>"}): ${O?.message||O}`),c.push(R),""}if(a.has(C))return"";a.add(C);try{let O=Ht.readFileSync(C,"utf8");h.push({source:R,resolvedPath:C,contents:O})}catch(O){console.warn(`[stx:vendor-css] could not read ${C}: ${O?.message||O}`),c.push(R)}return""}),styles:h,unresolved:c}}function Jo(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function jo(e){if(e.length===0)return"";return`${e.map((i)=>`<style data-stx-vendor="${Jo(i.source)}" data-stx-layer="vendor">
127
127
  @layer vendor {
128
128
  ${i.contents}
129
129
  }
130
130
  </style>`).join(`
131
131
  `)}
132
- `}var Yl=x,Mr=b(256);function It(e){let i=w(e),t=Mr.get(i);if(!t)t=Xo(e),Mr.set(i,t);return{code:t.code,imports:[...t.imports],models:[...t.models]}}function Xo(e){let i=r(e),t=new Set;for(let v of e.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let E of v[1].split(",")){let R=E.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(R)t.add(R)}let o=An(i),a=ve.filter((v)=>{if(t.has(v)||o.has(v))return!1;return Lo(i,v,!0)}),h=Lr(i).filter((v)=>!t.has(v)&&!o.has(v));if(a.length===0&&h.length===0)return{code:e,imports:a,models:h};return{code:`${[a.length>0?`import { ${a.join(", ")} } from '@stacksjs/browser'`:"",h.length>0?"import '@stacksjs/browser'":"",h.length>0?`const { ${h.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
132
+ `}var Ql=S,Mr=b(256);function It(e){let i=w(e),t=Mr.get(i);if(!t)t=Go(e),Mr.set(i,t);return{code:t.code,imports:[...t.imports],models:[...t.models]}}function Go(e){let i=r(e),t=new Set;for(let v of e.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let E of v[1].split(",")){let R=E.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(R)t.add(R)}let o=An(i),a=ve.filter((v)=>{if(t.has(v)||o.has(v))return!1;return Bo(i,v,!0)}),h=Lr(i).filter((v)=>!t.has(v)&&!o.has(v));if(a.length===0&&h.length===0)return{code:e,imports:a,models:h};return{code:`${[a.length>0?`import { ${a.join(", ")} } from '@stacksjs/browser'`:"",h.length>0?"import '@stacksjs/browser'":"",h.length>0?`const { ${h.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
133
133
  `)}
134
- ${e}`,imports:a,models:h}}var Go=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function Lr(e){let i=new Set,t=fs(e),o=An(e),a=/(?<![\w$.])([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g;for(let h of t.code.matchAll(a)){let c=h[1];if(Go.has(c)||o.has(c)||c.length<3)continue;if(t.shadows(c,h.index??0))continue;i.add(c)}return Array.from(i)}function Yo(e){return An(e)}var Dr=b(128);function Ka(e){let i=w(e),t=Dr.get(i);if(!t)t=Qo(e),Dr.set(i,t);return{code:t.code,stxImports:[...t.stxImports],browserImports:[...t.browserImports]}}function Qo(e){let i=new Set,t=new Set,o=e;o=o.replace(/^[ \t]*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"][ \t]*;?[ \t]*$/gm,"// [type import stripped]");let a=new Set,h=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,c;while((c=h.exec(e))!==null){let O=c[1],M=c[2];if(c[0].includes("import type"))continue;let N=[];for(let P of O.split(",")){let q=P.trim();if(!q||q.startsWith("type "))continue;let Z=q.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!Z)continue;let W=Z[1],Y=Z[2]||W;if(a.add(W),a.add(Y),M==="stx"||M==="@stacksjs/stx")i.add(W);else t.add(W);if(Y!==W)N.push(`${Y} = ${W}`)}let I=N.length>0?`var ${N.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";o=o.replace(c[0],I)}let v=Yo(o);for(let O of Yl){if(a.has(O)||v.has(O))continue;if(Lo(o,O,!0))i.add(O)}let E=r(o),R=new Set;for(let O of o.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let M of O[1].split(",")){let N=M.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let I of N){let P=I.trim();if(P)R.add(P)}}for(let O of ve){if(a.has(O)||v.has(O)||R.has(O))continue;if(Lo(E,O))t.add(O)}let C=Lr(E);for(let O of C)if(!a.has(O)&&!v.has(O))t.add(O);return{code:o,stxImports:Array.from(i),browserImports:Array.from(t)}}function Lo(e,i,t=!1){let o=fs(e);e=o.code;let a=new RegExp(`\\b${i.replace(/[$]/g,"\\$")}\\b`,"g");for(let h of e.matchAll(a)){let c=h.index??0;if(o.shadows(i,c))continue;let v=c+i.length,E=c-1;while(E>=0&&/\s/.test(e[E]))E--;if(e[E]==="."&&e.slice(Math.max(0,E-2),E+1)!=="...")continue;let R=v;while(R<e.length&&/\s/.test(e[R]))R++;if(e[R]===":"&&e[R+1]!==":"&&(e[E]==="{"||e[E]===","))continue;if(t&&!/^\s*(?:<[^>]*>)?\s*\(/.test(e.slice(v)))continue;if(ea(e,v))continue;return!0}return!1}function ea(e,i){let t=i;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;if(e[t]!=="(")return!1;let o=0;for(;t<e.length;t++){let a=e[t];if(a==="(")o++;else if(a===")"){if(o--,o===0)break}}if(o!==0)return!1;t++;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;return e[t]==="{"}function Ga(e,i){let t=[];if(e.length>0)t.push(` var { ${e.join(", ")} } = window.stx || window;`);if(i.length>0)t.push(` var { ${i.join(", ")} } = window.StacksBrowser || {};`);if(t.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
134
+ ${e}`,imports:a,models:h}}var Yo=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function Lr(e){let i=new Set,t=os(e),o=An(e),a=/(?<![\w$.])([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g;for(let h of t.code.matchAll(a)){let c=h[1];if(Yo.has(c)||o.has(c)||c.length<3)continue;if(t.shadows(c,h.index??0))continue;i.add(c)}return Array.from(i)}function Qo(e){return An(e)}var Dr=b(128);function Xa(e){let i=w(e),t=Dr.get(i);if(!t)t=ea(e),Dr.set(i,t);return{code:t.code,stxImports:[...t.stxImports],browserImports:[...t.browserImports]}}function ea(e){let i=new Set,t=new Set,o=e;o=o.replace(/^[ \t]*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"][ \t]*;?[ \t]*$/gm,"// [type import stripped]");let a=new Set,h=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,c;while((c=h.exec(e))!==null){let O=c[1],M=c[2];if(c[0].includes("import type"))continue;let N=[];for(let P of O.split(",")){let G=P.trim();if(!G||G.startsWith("type "))continue;let q=G.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!q)continue;let Z=q[1],Q=q[2]||Z;if(a.add(Z),a.add(Q),M==="stx"||M==="@stacksjs/stx")i.add(Z);else t.add(Z);if(Q!==Z)N.push(`${Q} = ${Z}`)}let I=N.length>0?`var ${N.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";o=o.replace(c[0],I)}let v=Qo(o);for(let O of Ql){if(a.has(O)||v.has(O))continue;if(Bo(o,O,!0))i.add(O)}let E=r(o),R=new Set;for(let O of o.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let M of O[1].split(",")){let N=M.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let I of N){let P=I.trim();if(P)R.add(P)}}for(let O of ve){if(a.has(O)||v.has(O)||R.has(O))continue;if(Bo(E,O))t.add(O)}let C=Lr(E);for(let O of C)if(!a.has(O)&&!v.has(O))t.add(O);return{code:o,stxImports:Array.from(i),browserImports:Array.from(t)}}function Bo(e,i,t=!1){let o=os(e);e=o.code;let a=new RegExp(`\\b${i.replace(/[$]/g,"\\$")}\\b`,"g");for(let h of e.matchAll(a)){let c=h.index??0;if(o.shadows(i,c))continue;let v=c+i.length,E=c-1;while(E>=0&&/\s/.test(e[E]))E--;if(e[E]==="."&&e.slice(Math.max(0,E-2),E+1)!=="...")continue;let R=v;while(R<e.length&&/\s/.test(e[R]))R++;if(e[R]===":"&&e[R+1]!==":"&&(e[E]==="{"||e[E]===","))continue;if(t&&!/^\s*(?:<[^>]*>)?\s*\(/.test(e.slice(v)))continue;if(ta(e,v))continue;return!0}return!1}function ta(e,i){let t=i;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;if(e[t]!=="(")return!1;let o=0;for(;t<e.length;t++){let a=e[t];if(a==="(")o++;else if(a===")"){if(o--,o===0)break}}if(o!==0)return!1;t++;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;return e[t]==="{"}function Ja(e,i){let t=[];if(e.length>0)t.push(` var { ${e.join(", ")} } = window.stx || window;`);if(i.length>0)t.push(` var { ${i.join(", ")} } = window.StacksBrowser || {};`);if(t.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
135
135
  ${t.join(`
136
136
  `)}
137
- ${ta(e,i)}`;return""}function Pp(e,i=[]){let{browserImports:t}=Ka(e),o=new Set(i);return Ga([],t.filter((a)=>!o.has(a)))}function ta(e,i){let t=[...e.map((o)=>`['${o}', typeof ${o}, 'stx']`),...i.map((o)=>`['${o}', typeof ${o}, '@stacksjs/browser']`)];if(t.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
137
+ ${na(e,i)}`;return""}function Op(e,i=[]){let{browserImports:t}=Xa(e),o=new Set(i);return Ja([],t.filter((a)=>!o.has(a)))}function na(e,i){let t=[...e.map((o)=>`['${o}', typeof ${o}, 'stx']`),...i.map((o)=>`['${o}', typeof ${o}, '@stacksjs/browser']`)];if(t.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
138
138
  [${t.join(", ")}].forEach(function (e) {
139
139
  if (e[1] !== 'undefined') return;
140
140
  console.error(
@@ -143,10 +143,10 @@ ${ta(e,i)}`;return""}function Pp(e,i=[]){let{browserImports:t}=Ka(e),o=new Set(i
143
143
  + 'or it should be imported from a relative path so the bundler includes it.'
144
144
  );
145
145
  });
146
- `}function Ne(e){let i=e.__stxClientPayload;if(i&&typeof i==="object"){let o={};for(let a in i){let h=i[a];if(typeof h==="function")continue;o[a]=h}return o.__stxDeclaredPayload=!0,o}let t={};for(let o in e){if(o.startsWith("__")||o.startsWith("$"))continue;let a=e[o];if(typeof a==="function")continue;t[o]=a}return t}var na=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,jr=new Set;function sa(e,i){let t=na.test(e),o=i.length>32768;if(!t&&!o)return;if(jr.has(e))return;if(jr.add(e),t)console.warn(`[stx] server\u2192client bridge is publishing "${e}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(o)console.warn(`[stx] server\u2192client bridge is publishing ${(i.length/1024).toFixed(1)}KB under "${e}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function fn(e,i){if(!i)return"";let t=on(e,new Set(Object.keys(i))),o=i.__stxDeclaredPayload===!0,a=[],h=Object.entries(i).sort(([c],[v])=>c<v?-1:c>v?1:0);for(let[c,v]of h){if(!/^[A-Za-z_$][\w$]*$/.test(c))continue;if(c.startsWith("__")||c.startsWith("$"))continue;if(!o&&!t.has(c))continue;if(Et(e,c)){if(o)console.warn(`[stx] defineClientPayload declares "${c}", but this client block also declares "${c}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${c}" from defineClientPayload.`);continue}let E;try{E=JSON.stringify(v)}catch{continue}if(E===void 0)continue;sa(c,E),a.push(` var ${c} = ${E.replace(/</g,"\\u003c")};`)}if(a.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
146
+ `}function Ne(e){let i=e.__stxClientPayload;if(i&&typeof i==="object"){let o={};for(let a in i){let h=i[a];if(typeof h==="function")continue;o[a]=h}return o.__stxDeclaredPayload=!0,o}let t={};for(let o in e){if(o.startsWith("__")||o.startsWith("$"))continue;let a=e[o];if(typeof a==="function")continue;t[o]=a}return t}var sa=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,jr=new Set;function ra(e,i){let t=sa.test(e),o=i.length>32768;if(!t&&!o)return;if(jr.has(e))return;if(jr.add(e),t)console.warn(`[stx] server\u2192client bridge is publishing "${e}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(o)console.warn(`[stx] server\u2192client bridge is publishing ${(i.length/1024).toFixed(1)}KB under "${e}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function fn(e,i){if(!i)return"";let t=on(e,new Set(Object.keys(i))),o=i.__stxDeclaredPayload===!0,a=[],h=Object.entries(i).sort(([c],[v])=>c<v?-1:c>v?1:0);for(let[c,v]of h){if(!/^[A-Za-z_$][\w$]*$/.test(c))continue;if(c.startsWith("__")||c.startsWith("$"))continue;if(!o&&!t.has(c))continue;if(Et(e,c)){if(o)console.warn(`[stx] defineClientPayload declares "${c}", but this client block also declares "${c}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${c}" from defineClientPayload.`);continue}let E;try{E=JSON.stringify(v)}catch{continue}if(E===void 0)continue;ra(c,E),a.push(` var ${c} = ${E.replace(/</g,"\\u003c")};`)}if(a.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
147
147
  ${a.join(`
148
148
  `)}
149
- `}var ra={left:0,middle:1,right:2};function ia(e){let i=[];if(e.self)i.push("if ($event.target !== $el) return");for(let t of e.systemKeys)i.push(`if (!$event.${t}Key) return`);if(e.keys.length>0){let t=e.keys.map((o)=>`$event.key === '${o}'`).join(" || ");i.push(`if (!(${t})) return`)}if(e.mouse!==null){let t=ra[e.mouse];i.push(`if ($event.button !== ${t}) return`)}if(e.prevent)i.push("$event.preventDefault()");if(e.stop)i.push("$event.stopPropagation()");return i.join("; ")}function oa(e,i){let{elementId:t,event:o,modifiers:a}=e,h=ss(e.handler),c=ia(a),v=[];if(a.once)v.push("once: true");if(a.capture)v.push("capture: true");if(ns(o,a))v.push("passive: true");let E=v.length>0?`, { ${v.join(", ")} }`:"",R="";if(c)R+=`${c}; `;let C=h.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),O=`var $emit = function(name, detail) {
149
+ `}var ia={left:0,middle:1,right:2};function oa(e){let i=[];if(e.self)i.push("if ($event.target !== $el) return");for(let t of e.systemKeys)i.push(`if (!$event.${t}Key) return`);if(e.keys.length>0){let t=e.keys.map((o)=>`$event.key === '${o}'`).join(" || ");i.push(`if (!(${t})) return`)}if(e.mouse!==null){let t=ia[e.mouse];i.push(`if ($event.button !== ${t}) return`)}if(e.prevent)i.push("$event.preventDefault()");if(e.stop)i.push("$event.stopPropagation()");return i.join("; ")}function aa(e,i){let{elementId:t,event:o,modifiers:a}=e,h=ss(e.handler),c=oa(a),v=[];if(a.once)v.push("once: true");if(a.capture)v.push("capture: true");if(ns(o,a))v.push("passive: true");let E=v.length>0?`, { ${v.join(", ")} }`:"",R="";if(c)R+=`${c}; `;let C=h.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),O=`var $emit = function(name, detail) {
150
150
  $el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
151
151
  };`;function M(N){if(/\$emit\s*\(/.test(N))return`${O}
152
152
  ${N}`;return`var scope = $el.closest('[data-stx-scope]');
@@ -189,25 +189,25 @@ else {
189
189
  else {
190
190
  ${h}
191
191
  }
192
- }${E})`}function aa(e){if(e.length===0)return"";return`
192
+ }${E})`}function ca(e){if(e.length===0)return"";return`
193
193
  // STX: auto-generated event bindings
194
- ${e.map((t,o)=>oa(t,o)).join(`
194
+ ${e.map((t,o)=>aa(t,o)).join(`
195
195
  `)}`}function Nr(e){let i=[],t=new Set,o=e.replace(/^\s*import\s+.*$/gm,""),a=0,h=o.length,c=0;while(c<h){let v=o[c];if(v==="'"||v==='"'||v==="`"){let E=v;if(c++,E==="`"){let R=0;while(c<h){if(o[c]==="\\"){c+=2;continue}if(o[c]==="`"&&R===0){c++;break}if(o[c]==="$"&&o[c+1]==="{"){R++,c+=2;continue}if(o[c]==="}"&&R>0){R--,c++;continue}c++}}else while(c<h){if(o[c]==="\\"){c+=2;continue}if(o[c]===E){c++;break}c++}continue}if(v==="/"&&o[c+1]==="/"){while(c<h&&o[c]!==`
196
- `)c++;continue}if(v==="/"&&o[c+1]==="*"){c+=2;while(c<h-1&&!(o[c]==="*"&&o[c+1]==="/"))c++;c+=2;continue}if(v==="{"){a++,c++;continue}if(v==="}"){a--,c++;continue}if(a===0){let E=o.slice(c),R=E.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let M=R[1];if(!M.startsWith("_")&&!t.has(M))i.push(M),t.add(M);c+=R[0].length;continue}let C=E.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){C[1].split(",").forEach((M)=>{let N=M.trim(),I=N.indexOf(":"),P=I>=0?N.slice(I+1).trim().split(/[\s=]/)[0]:N.split(/[\s=]/)[0];if(P&&!P.startsWith("_")&&!t.has(P))i.push(P),t.add(P)}),c+=C[0].length;continue}let O=E.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(O){let M=O[1];if(!M.startsWith("_")&&!t.has(M))i.push(M),t.add(M);c+=O[0].length;continue}}c++}return i}var ca=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 la(e){let i=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function o(M){let N;while((N=t.exec(M))!==null){let I=N[0];if(!ca.has(I))i.add(I)}}let a=/\{\{([\s\S]*?)\}\}/g,h;while((h=a.exec(e))!==null)o(h[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((h=c.exec(e))!==null)o(h[1]);let v=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((h=v.exec(e))!==null)o(h[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((h=E.exec(e))!==null)o(h[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((h=R.exec(e))!==null)o(h[1]);let C=/@model\s*=\s*["']([^"']*)["']/gi;while((h=C.exec(e))!==null)o(h[1]);let O=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((h=O.exec(e))!==null)o(h[1]);return i}async function De(e,i={}){let t=e,o="",a=!1,h=[],c=Do(t,{filePath:i.filePath,projectRoot:i.projectRoot});t=c.code;let v=Mo(c.styles),E=It(t);t=E.code,h=[...E.imports,...E.models];let{hasUserImports:R,bundleClientScript:C}=await s("stx/client-script-bundler",()=>import("./chunk-t3gmm1ja.js"));if(R(t))t=await C(t,i.filePath||"",{projectRoot:i.projectRoot,minify:i.production}),a=!0;if(i.autoImports!==!1){let Y=Ka(t);t=Y.code,o=Ga(Y.stxImports,Y.browserImports.filter((ee)=>!h.includes(ee)))}if(o=`${fn(t,i.serverData)}${o}`,t=T(t),!a&&Me(i.attrs||""))t=Le(t);let O=aa(i.eventBindings||[]),M=(i.attrs||"").trim(),N=/\btype\s*=\s*["']module["']/i.test(M),I=i.instanceId?` data-stx-instance="${i.instanceId}"`:"";if(N){let Y=M.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${I}${Y?` ${Y}`:""}`;return`${v}<script ${ee}>
196
+ `)c++;continue}if(v==="/"&&o[c+1]==="*"){c+=2;while(c<h-1&&!(o[c]==="*"&&o[c+1]==="/"))c++;c+=2;continue}if(v==="{"){a++,c++;continue}if(v==="}"){a--,c++;continue}if(a===0){let E=o.slice(c),R=E.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let M=R[1];if(!M.startsWith("_")&&!t.has(M))i.push(M),t.add(M);c+=R[0].length;continue}let C=E.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){C[1].split(",").forEach((M)=>{let N=M.trim(),I=N.indexOf(":"),P=I>=0?N.slice(I+1).trim().split(/[\s=]/)[0]:N.split(/[\s=]/)[0];if(P&&!P.startsWith("_")&&!t.has(P))i.push(P),t.add(P)}),c+=C[0].length;continue}let O=E.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(O){let M=O[1];if(!M.startsWith("_")&&!t.has(M))i.push(M),t.add(M);c+=O[0].length;continue}}c++}return i}var la=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 ua(e){let i=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function o(M){let N;while((N=t.exec(M))!==null){let I=N[0];if(!la.has(I))i.add(I)}}let a=/\{\{([\s\S]*?)\}\}/g,h;while((h=a.exec(e))!==null)o(h[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((h=c.exec(e))!==null)o(h[1]);let v=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((h=v.exec(e))!==null)o(h[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((h=E.exec(e))!==null)o(h[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((h=R.exec(e))!==null)o(h[1]);let C=/@model\s*=\s*["']([^"']*)["']/gi;while((h=C.exec(e))!==null)o(h[1]);let O=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((h=O.exec(e))!==null)o(h[1]);return i}async function De(e,i={}){let t=e,o="",a=!1,h=[],c=Lo(t,{filePath:i.filePath,projectRoot:i.projectRoot});t=c.code;let v=jo(c.styles),E=It(t);t=E.code,h=[...E.imports,...E.models];let{hasUserImports:R,bundleClientScript:C}=await s("stx/client-script-bundler",()=>import("./chunk-1t6dg4s8.js"));if(R(t))t=await C(t,i.filePath||"",{projectRoot:i.projectRoot,minify:i.production}),a=!0;if(i.autoImports!==!1){let Q=Xa(t);t=Q.code,o=Ja(Q.stxImports,Q.browserImports.filter((te)=>!h.includes(te)))}if(o=`${fn(t,i.serverData)}${o}`,t=T(t),!a&&Me(i.attrs||""))t=Le(t);let O=ca(i.eventBindings||[]),M=(i.attrs||"").trim(),N=/\btype\s*=\s*["']module["']/i.test(M),I=i.instanceId?` data-stx-instance="${i.instanceId}"`:"";if(N){let Q=M.replace(/\btype\s*=\s*["']module["']/i,"").trim(),te=`type="module" data-stx-scoped${I}${Q?` ${Q}`:""}`;return`${v}<script ${te}>
197
197
  ${an(`${o}${t}
198
198
  ${O}`)}
199
- </script>`}let P=Jo(e),q=/function __stx_setup_/.test(t),Z=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function W(Y){let ee=Y.length>0?`
200
- return ${is(t,Y)};`:"",te=JSON.stringify(`[stx] client block failed${i.filePath?` (${i.filePath})`:""}; this block will not hydrate`);return`${v}<script data-stx-scoped data-stx-run="always"${I}>
199
+ </script>`}let P=Zo(e),G=/function __stx_setup_/.test(t),q=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function Z(Q){let te=Q.length>0?`
200
+ return ${as(t,Q)};`:"",ne=JSON.stringify(`[stx] client block failed${i.filePath?` (${i.filePath})`:""}; this block will not hydrate`);return`${v}<script data-stx-scoped data-stx-run="always"${I}>
201
201
  window.stx.mount(function() {
202
202
  'use strict';
203
203
  try {
204
204
  ${an(`${o}${t}
205
- ${O}${ee}`)}
205
+ ${O}${te}`)}
206
206
  } catch (error) {
207
- console.error(${te}, error);
207
+ console.error(${ne}, error);
208
208
  return {};
209
209
  }
210
- })</script>`}if(!Z&&!q){if(P)return W(Nr(e));if(i.templateContent){let Y=Nr(e);if(Y.length>0){let ee=la(i.templateContent);if(Y.some((ae)=>ee.has(ae)))return W(Y)}}}return`${v}<script data-stx-scoped data-stx-run="always"${I}>
210
+ })</script>`}if(!q&&!G){if(P)return Z(Nr(e));if(i.templateContent){let Q=Nr(e);if(Q.length>0){let te=ua(i.templateContent);if(Q.some((ae)=>te.has(ae)))return Z(Q)}}}return`${v}<script data-stx-scoped data-stx-run="always"${I}>
211
211
  ;(function() {
212
212
  'use strict';
213
213
  try {
@@ -216,22 +216,22 @@ ${O}`)}
216
216
  } catch (error) {
217
217
  console.error(${JSON.stringify(`[stx] client block failed${i.filePath?` (${i.filePath})`:""}; this block will not hydrate`)}, error);
218
218
  }
219
- })()</script>`}import{createHash as ua}from"crypto";var In="__stx_component_client_factories";function On(e){let i=e[In];return i instanceof Map?i:null}function Va(e){e[In]=new Map}function Ss(e,i){let t=On(e);if(!t)return null;let o=ua("sha256").update(i).digest("hex").slice(0,16),a=t.get(o);if(a)a.instances++;else t.set(o,{body:i,instances:1});return o}function Ua(e,i){let t=On(i);if(!t?.size)return e;let o=new Map;for(let[C,O]of t)if(O.instances===1)o.set(C,O.body);let a=[];if(o.size>0){let C=[...o.keys()].map((N)=>JSON.stringify(N).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),O=new RegExp(`window\\.__stxComponentFactories\\[(${C})\\]\\(("[^"]+")\\);`,"g"),M=O.exec(e);while(M!==null){let N=o.get(JSON.parse(M[1]));if(N!==void 0)a.push({start:M.index,end:M.index+M[0].length,replacement:`(${N})(${M[2]});`});M=O.exec(e)}}let h=[...t].filter(([,C])=>C.instances>1);if(h.length===0)return Br(e,a);let v=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
219
+ })()</script>`}import{createHash as xa}from"crypto";var In=/<script\b[^>]*>/iy,Rs=/<\/script\s*>/ig,On=/<style\b[^>]*>/iy,Cs=/<\/style\s*>/ig;function Br(e,i,t,o){t.lastIndex=i;let a=t.exec(e);if(!a||a.index!==i)return-1;o.lastIndex=t.lastIndex;let h=o.exec(e);if(!h)return-1;return h.index+h[0].length}function F(e,i){return Br(e,i,In,Rs)}function cn(e,i){return Br(e,i,On,Cs)}function Ie(e,i){if(!e.startsWith("<!--",i))return-1;let t=e.indexOf("-->",i+4);if(t===-1)return-1;return t+3}function zr(e,i){if(e.startsWith("<!--",i)){let a=Ie(e,i);return a===-1?e.length:a}if(In.lastIndex=i,In.exec(e)?.index===i){Rs.lastIndex=In.lastIndex;let a=Rs.exec(e);return a?a.index+a[0].length:e.length}if(On.lastIndex=i,On.exec(e)?.index===i){Cs.lastIndex=On.lastIndex;let a=Cs.exec(e);return a?a.index+a[0].length:e.length}return-1}function z(e,i){let t=[],o=0,a=e.length,h=!1,c=null;while(o<a){let v=e[o];if(h){if(c){if(v===c)c=null}else if(v==='"'||v==="'")c=v;else if(v===">")h=!1;o++;continue}if(v!=="<"){let O=e.indexOf("<",o+1);if(O===-1)break;o=O;continue}let E=i(e,o);if(E>o){t.push({start:o,end:E,token:e.slice(o,E)}),o=E;continue}let R=zr(e,o);if(R>o){o=R;continue}let C=e.charCodeAt(o+1);if(C>=65&&C<=90||C>=97&&C<=122)h=!0;o++}return t}function Wr(e){let i=0,t=0,o=0,a=!1,h=null;while(o<e.length){if(a){let O=e[o];if(h){if(O===h)h=null}else if(O==='"'||O==="'")h=O;else if(O===">")a=!1;o++;continue}let c=e.indexOf("<",o),v=c===-1?e.length:c;while(o<v){let O=e[o++];if(O==="{")i++;else if(O==="}")t++;if(i>=2&&t>=2)return!0}if(c===-1)break;let E=zr(e,c);if(E>c){o=E;continue}let R=e.charCodeAt(c+1),C=R===47?e.charCodeAt(c+2):R;if(C>=65&&C<=90||C>=97&&C<=122)a=!0;o=c+1}return!1}function Ia(e,i){while(e.size>=i){let t=e.keys().next();if(t.done)return;e.delete(t.value)}}var fa=1024,pa=16777216,vt=new Map,_s=0;function da(e,i){vt.set(e,i),_s+=e.length+i.output.length;for(let[t,o]of vt){if(_s<=pa)break;vt.delete(t),_s-=t.length+o.output.length}}function de(e,i,t,o){let a=o!==void 0&&e.length>=fa,h=a?`${o}\x00${e}`:"";if(a){let C=vt.get(h);if(C)return vt.delete(h),vt.set(h,C),{output:C.output,tokens:C.tokens.slice()}}let c=z(e,i);if(c.length===0)return{output:e,tokens:[]};let v=c.map((C)=>C.token),E="",R=0;for(let C=0;C<c.length;C++){let O=c[C];E+=e.slice(R,O.start),E+=t(O.token,C),R=O.end}if(E+=e.slice(R),a)return da(h,{output:E,tokens:v}),{output:E,tokens:v.slice()};return{output:E,tokens:v}}var ga=1024,ma=16777216,kt=new Map,$s=0;function ha(e,i){kt.set(e,i),$s+=e.length+i.output.length;for(let[t,o]of kt){if($s<=ma)break;kt.delete(t),$s-=t.length+o.output.length}}function ks(e,i,t){return{output:i,scripts:t,restore:(o)=>o===i?e:cr(o,t)}}function K(e){let i=e.length>=ga;if(i){let a=kt.get(e);if(a)return kt.delete(e),kt.set(e,a),ks(e,a.output,a.scripts.slice())}let{output:t,tokens:o}=de(e,F,(a,h)=>`\x00STX_SCRIPT_${h}\x00`);if(i)return ha(e,{output:t,scripts:o}),ks(e,t,o.slice());return ks(e,t,o)}function cr(e,i){if(i.length===0)return e;return e.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(t,o)=>i[+o]??"")}var Pn="__stx_component_client_factories";function Mn(e){let i=e[Pn];return i instanceof Map?i:null}function Wa(e){e[Pn]=new Map}function As(e,i){let t=Mn(e);if(!t)return null;let o=xa("sha256").update(i).digest("hex").slice(0,16),a=t.get(o);if(a)a.instances++;else t.set(o,{body:i,instances:1});return o}function qa(e,i){let t=Mn(i);if(!t?.size)return e;let o=new Map;for(let[C,O]of t)if(O.instances===1)o.set(C,O.body);let a=[];if(o.size>0){let C=[...o.keys()].map((N)=>JSON.stringify(N).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),O=new RegExp(`window\\.__stxComponentFactories\\[(${C})\\]\\(("[^"]+")\\);`,"g"),M=O.exec(e);while(M!==null){let N=o.get(JSON.parse(M[1]));if(N!==void 0)a.push({start:M.index,end:M.index+M[0].length,replacement:`(${N})(${M[2]});`});M=O.exec(e)}}let h=[...t].filter(([,C])=>C.instances>1);if(h.length===0)return Fr(e,a);let v=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
220
220
  (function() {
221
221
  const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
222
222
  ${h.map(([C,O])=>` try { factories[${JSON.stringify(C)}] = factories[${JSON.stringify(C)}] || ${O.body}; }
223
223
  catch (e) { console.error('[stx] component factory ' + ${JSON.stringify(C)} + ' failed to register; instances of it will not hydrate.', e); }`).join(`
224
224
  `)}
225
225
  })();
226
- </script>`,E=e.search(/<script\b(?=[^>]*\bdata-stx-scoped\b)/i),R=E<0?0:E;return a.push({start:R,end:R,replacement:`${v}
227
- `}),Br(e,a)}function Br(e,i){if(i.length===0)return e;i.sort((h,c)=>h.start-c.start||h.end-c.end);let t=Array(i.length*2+1),o=0,a=0;for(let h of i)t[a++]=e.slice(o,h.start),t[a++]=h.replacement,o=h.end;return t[a]=e.slice(o),t.join("")}function zr(e){let i=On(e),t=new Map;if(i)for(let[o,a]of i)t.set(o,a.instances);return t}function Wr(e,i){let t=On(e);if(!t)return[];let o=[];for(let[a,h]of t){let c=h.instances-(i.get(a)??0);if(c>0)o.push({body:h.body,count:c})}return o}function Fr(e,i){for(let{body:t,count:o}of i)for(let a=0;a<o;a++)Ss(e,t)}function be(e,i,t=2){let o=0,a=null;for(let h=i+t;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="{"){o++;continue}if(c==="}"){if(o>0){o--;continue}let v=0;while(e[h+v]==="}")v++;if(v>=t)return h}}return-1}import Qr from"fs";var Vr=0,$s=new Map;function Ya(){Vr=0,$s.clear()}function Pn(e,i){let t=Vr++,o=`<!--__STX_${e.toUpperCase()}_${t}__-->`;return $s.set(o,{type:e,expression:i}),o}function Za(){let e={};for(let[i,t]of $s)e[i]={type:t.type,expression:t.expression};return e}function Qa(e,i){let t=e;for(let[o,a]of i)t=t.split(o).join(a);return t}function Bo(e){return e.includes("<!--__STX_")}var fa=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function pa(e){return Array.from({length:e},()=>"&#123;").join("&#8288;")}function Ur(e){return e.replace(/\{{2,}/g,(i)=>pa(i.length)).replace(/\{(?=!)/g,"&#123;&#8288;").replace(fa,"&#64;")}function ds(e,i,t=!1){let{openTag:o,tail:a}=t?da(e,i):ga(e).at(i);return ha(a,o,t)}function da(e,i){let t="",o=0;for(let c=0;c<i;c++){if(!e.startsWith("{{",c))continue;let v=be(e,c);if(v<0||v+2>i)break;t+=e.slice(o,c)+"x",c=v+1,o=v+2}t+=e.slice(o,i);let a=-1,h=null;for(let c=0;c<t.length;c++){let v=t[c];if(h){if(v===h)h=null;continue}if(v==='"'||v==="'"){h=v;continue}if(v===">"){a=-1;continue}if(v==="<")a=c}return{openTag:a,tail:a>=0?t.slice(a+1):t}}var Mn=null;function ga(e){if(Mn&&Mn.source===e)return Mn.scanner;let i=ma(e);return Mn={source:e,scanner:i},i}function ma(e){let i=0,t=-1,o=null,a=-1,h=(v,E)=>{let R=e[v];if(E.quote){if(R===E.quote)E.quote=null;return}if(E.openTag>=0){if(R==='"'||R==="'"){E.quote=R;return}if(R===">"){E.openTag=-1;return}}if(R==="<")E.openTag=v},c=(v,E)=>{if(E.openTag>=0||!e.startsWith("<!--",v))return-1;let R=e.indexOf("-->",v+4);return R<0?e.length:R+3};return{at(v){if(v<i)i=0,t=-1,o=null,a=-1;let E={openTag:t,quote:o},R=!1;while(i<v){if(a<0&&e.startsWith("{{",i)){let P=be(e,i);if(P<0)a=i;else if(P+2<=v){i=P+2;continue}else break}let I=c(i,E);if(I>=0){if(I>v){R=!0;break}i=I;continue}h(i,E),i++}if(t=E.openTag,o=E.quote,R)return{openTag:-1,tail:""};let C=a>=0?a:i,O={openTag:t,quote:o};for(let I=i;I<v;I++){let P=c(I,O);if(P>=0){if(P>v)return{openTag:-1,tail:""};I=P-1;continue}h(I,O)}if(O.openTag<0)return{openTag:-1,tail:""};let M="",N=O.openTag+1;for(let I=N;I<Math.min(v,C);I++){if(!e.startsWith("{{",I))continue;let P=be(e,I);M+=e.slice(N,I)+"x",I=P+1,N=P+2}return M+=e.slice(N,v),{openTag:O.openTag,tail:M}}}}function ha(e,i,t){if(i<0&&!t)return null;if(i>=0&&/^\s*[!/?]/.test(e))return/^\s*\/?\s*$/.test(e)?{kind:"tag-name"}:null;if(i>=0&&/^\s*$/.test(e))return{kind:"tag-name"};let o=0;if(i>=0)while(o<e.length&&!/\s/.test(e[o]))o++;while(o<e.length){while(/\s/.test(e[o]??"")&&o<e.length)o++;let a=o;while(o<e.length&&!/[\s=/>]/.test(e[o]))o++;let h=e.slice(a,o);if(!h)break;while(o<e.length&&/\s/.test(e[o]))o++;if(e[o]!=="=")continue;o++;while(o<e.length&&/\s/.test(e[o]))o++;let c=e[o];if(c==='"'||c==="'"){let v=++o,E=e.indexOf(c,o);if(E===-1)return{kind:"attribute",name:h,quote:c,valuePrefix:e.slice(v)};o=E+1}else{let v=o;while(o<e.length&&!/\s/.test(e[o]))o++;if(o===e.length)return{kind:"attribute",name:h,quote:null,valuePrefix:e.slice(v)}}}return{kind:"tag"}}class oe extends Error{attribute;near;constructor(e,i){super(`Unsafe interpolation in ${e}: ${i}`);this.name="UnsafeInterpolationContextError",this.attribute=e}locate(e,i){if(this.near===void 0)this.near=e.slice(Math.max(0,i-160),i).replace(/\s+/g," ").trim(),this.message+=` (after: ${JSON.stringify(this.near)})`;return this}}var Hr="unsafe:";var xa=/^(?:javascript|vbscript|livescript|mocha|view-source):/,ba=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,ya=/^data:(?:text\/html|application\/xhtml\+xml)/,_a=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function wa(e){return e.replace(_a,"").toLowerCase()}function ks(e){let i=e.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(i))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(i))return"fetched";return null}function Dn(e,i="navigable"){let t=wa(e);if(xa.test(t))return!0;return i==="navigable"?ba.test(t):ya.test(t)}function ar(e,i="navigable"){return Dn(e,i)?"unsafe:"+e:e}function Sa(e){let i=e.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!i)return null;if(i[3].trim()!=="")return null;return ks(i[1])}function Kr(e,i,t=256){if(i<=t)return e.slice(0,i);let o=e.slice(i-t,i),a=o.search(/[\s"'`/]/);return a===-1?"":o.slice(a)}function Zr(e,i,t=i){let o=Sa(e);return o&&Dn(i,o)?"unsafe:"+t:t}var jn=/<script\b[^>]*>/iy,Is=/<\/script\s*>/ig,Nn=/<style\b[^>]*>/iy,Os=/<\/style\s*>/ig;function qr(e,i,t,o){t.lastIndex=i;let a=t.exec(e);if(!a||a.index!==i)return-1;o.lastIndex=t.lastIndex;let h=o.exec(e);if(!h)return-1;return h.index+h[0].length}function F(e,i){return qr(e,i,jn,Is)}function cn(e,i){return qr(e,i,Nn,Os)}function Ie(e,i){if(!e.startsWith("<!--",i))return-1;let t=e.indexOf("-->",i+4);if(t===-1)return-1;return t+3}function Xr(e,i){if(e.startsWith("<!--",i)){let a=Ie(e,i);return a===-1?e.length:a}if(jn.lastIndex=i,jn.exec(e)?.index===i){Is.lastIndex=jn.lastIndex;let a=Is.exec(e);return a?a.index+a[0].length:e.length}if(Nn.lastIndex=i,Nn.exec(e)?.index===i){Os.lastIndex=Nn.lastIndex;let a=Os.exec(e);return a?a.index+a[0].length:e.length}return-1}function se(e,i){let t=[],o=0,a=e.length,h=!1,c=null;while(o<a){let v=e[o];if(h){if(c){if(v===c)c=null}else if(v==='"'||v==="'")c=v;else if(v===">")h=!1;o++;continue}if(v!=="<"){let O=e.indexOf("<",o+1);if(O===-1)break;o=O;continue}let E=i(e,o);if(E>o){t.push({start:o,end:E,token:e.slice(o,E)}),o=E;continue}let R=Xr(e,o);if(R>o){o=R;continue}let C=e.charCodeAt(o+1);if(C>=65&&C<=90||C>=97&&C<=122)h=!0;o++}return t}function Jr(e){let i=0,t=0,o=0,a=!1,h=null;while(o<e.length){if(a){let O=e[o];if(h){if(O===h)h=null}else if(O==='"'||O==="'")h=O;else if(O===">")a=!1;o++;continue}let c=e.indexOf("<",o),v=c===-1?e.length:c;while(o<v){let O=e[o++];if(O==="{")i++;else if(O==="}")t++;if(i>=2&&t>=2)return!0}if(c===-1)break;let E=Xr(e,c);if(E>c){o=E;continue}let R=e.charCodeAt(c+1),C=R===47?e.charCodeAt(c+2):R;if(C>=65&&C<=90||C>=97&&C<=122)a=!0;o=c+1}return!1}function Aa(e,i){while(e.size>=i){let t=e.keys().next();if(t.done)return;e.delete(t.value)}}var va=1024,Ea=16777216,vt=new Map,Rs=0;function ka(e,i){vt.set(e,i),Rs+=e.length+i.output.length;for(let[t,o]of vt){if(Rs<=Ea)break;vt.delete(t),Rs-=t.length+o.output.length}}function de(e,i,t,o){let a=o!==void 0&&e.length>=va,h=a?`${o}\x00${e}`:"";if(a){let C=vt.get(h);if(C)return vt.delete(h),vt.set(h,C),{output:C.output,tokens:C.tokens.slice()}}let c=se(e,i);if(c.length===0)return{output:e,tokens:[]};let v=c.map((C)=>C.token),E="",R=0;for(let C=0;C<c.length;C++){let O=c[C];E+=e.slice(R,O.start),E+=t(O.token,C),R=O.end}if(E+=e.slice(R),a)return ka(h,{output:E,tokens:v}),{output:E,tokens:v.slice()};return{output:E,tokens:v}}var Ca=1024,Ta=16777216,kt=new Map,Ts=0;function ec(e,i){kt.set(e,i),Ts+=e.length+i.output.length;for(let[t,o]of kt){if(Ts<=Ta)break;kt.delete(t),Ts-=t.length+o.output.length}}function As(e,i,t){return{output:i,scripts:t,restore:(o)=>o===i?e:cr(o,t)}}function K(e){let i=e.length>=Ca;if(i){let a=kt.get(e);if(a)return kt.delete(e),kt.set(e,a),As(e,a.output,a.scripts.slice())}let{output:t,tokens:o}=de(e,F,(a,h)=>`\x00STX_SCRIPT_${h}\x00`);if(i)return ec(e,{output:t,scripts:o}),As(e,t,o.slice());return As(e,t,o)}function cr(e,i){if(i.length===0)return e;return e.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(t,o)=>i[+o]??"")}function $t(e){let i=e.indexOf(" as ");if(i!==-1){let h=e.slice(0,i).trim(),c=e.slice(i+4).trim();return h&&c?{arrayExpr:h,itemVar:c}:null}let t=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!t)return null;let o=t[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),a=t[2].trim();return o&&a?{arrayExpr:a,itemVar:o}:null}function Ln(e){let i=[],t=0,o="",a=0;for(let h=0;h<e.length;h++){let c=e[h];if(o){if(c==="\\")h++;else if(c===o)o="";continue}if(c==="'"||c==='"'||c==="`")o=c;else if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)i.push(e.slice(a,h)),a=h+1}return i.push(e.slice(a)),i}function Gr(e,i){let t=0;for(let o=0;o<e.length;o++){let a=e[o];if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;else if(a===i&&t===0)return o}return-1}function Yr(e){let i=0;for(let t=0;t<e.length;t++){let o=e[t];if(o==="("||o==="["||o==="{")i++;else if((o===")"||o==="]"||o==="}")&&--i===0)return t}return-1}function gt(e,i){let t=e.trim().replace(/^\.\.\./,"").trim(),o=Gr(t,"=");if(o!==-1&&t[o+1]!==">")t=t.slice(0,o).trim();if(!t)return;if(t.startsWith("{")&&t.endsWith("}")){for(let a of Ln(t.slice(1,-1))){let h=a.trim();if(!h)continue;if(h.startsWith("...")){gt(h,i);continue}let c=Gr(h,":");gt(c===-1?h:h.slice(c+1),i)}return}if(t.startsWith("[")&&t.endsWith("]")){for(let a of Ln(t.slice(1,-1)))gt(a,i);return}if(/^[A-Z_$][\w$]*$/i.test(t))i.push(t)}function G(e){let i=e.trim(),t=[],o=0;for(let h=0;h<i.length;h++){let c=i[h];if(c==="("||c==="["||c==="{")o++;else if(c===")"||c==="]"||c==="}")o--;else if(o===0&&/\s/.test(c)){if(!/^\s+(?:in|of)\s/.exec(i.slice(h)))continue;let E=i.slice(0,h).trim();if(E.startsWith("(")&&Yr(E)===E.length-1)E=E.slice(1,-1);for(let R of Ln(E))gt(R,t);if(t.length>0)return t;break}}let a=/^[\s\S]+?\s+as\s+([\s\S]+)$/.exec(i);if(a){let h=a[1].trim();if(h.startsWith("(")&&Yr(h)===h.length-1)h=h.slice(1,-1);let c=/^([\w$]+)\s*=>\s*([\s\S]+)$/.exec(h);if(c)gt(c[2],t),gt(c[1],t);else for(let v of Ln(h))gt(v,t)}return t}function z(e,i){let t=i instanceof Set?i:new Set(i);if(t.size===0)return!1;let c=e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g," ").replace(/`(?:[^`\\$]|\\.|\$(?!\{))*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:(?!:))/g,"$1$2");for(let v of c.match(/[a-zA-Z_$][\w$]*/g)||[])if(t.has(v))return!0;return!1}var Bn="__stx_client_loop_names";function et(e){let i=e?.[Bn];return Array.isArray(i)?i:[]}function zn(e){if(!e.includes("#")&&!e.includes("v-slot:")&&!e.includes("data-stx-slot-binding"))return[];let i=[],t=[],o=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let a of e.matchAll(o)){let h=a[0];if(/^<\/template\s*>$/i.test(h)){let c=t.pop();if(c)c.end=a.index}else if(/^<template\b/i.test(h)&&!/\/\s*>$/.test(h)){let v=[...h.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((C)=>/^(?:#[\w-]+|v-slot:[\w-]+|data-stx-slot-binding)$/i.test(C[1])),E=(v?.[2]??v?.[3])?.trim();if(E&&v?.[1]==="data-stx-slot-binding")try{E=decodeURIComponent(E)}catch{E=void 0}let R=E?{start:a.index+h.length,end:e.length,binding:E}:void 0;if(t.push(R),R)i.push(R)}}return i}var qt={},ei=new Map;function tc(e){let i=ei.get(e);if(!i){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=new RegExp(`:${t}(?!\\w)`,"g"),ei.set(e,i)}return i.lastIndex=0,i}var vs={uppercase:(e,i)=>e!==void 0&&e!==null?String(e).toUpperCase():"",lowercase:(e,i)=>e!==void 0&&e!==null?String(e).toLowerCase():"",capitalize:(e,i)=>{if(e===void 0||e===null)return"";let t=String(e);return t.charAt(0).toUpperCase()+t.slice(1)},number:(e,i,t=0)=>{if(e===void 0||e===null)return"";try{let o=Number(e);return Number.isNaN(o)?"":o.toFixed(Number.parseInt(String(t),10))}catch{return""}},fmt:(e,i,t="en-US")=>{if(e===void 0||e===null)return"";try{let o=Number(e);if(Number.isNaN(o))return String(e);return o.toLocaleString(t)}catch{return String(e)}},join:(e,i,t=",")=>{if(!Array.isArray(e))return"";return e.join(String(t))},escape:(e,i)=>{if(e===void 0||e===null)return"";return H(String(e))},translate:(e,i,t={})=>{if(!i||!i.__translations)return e;let o=i.__translations,a=i.__i18nConfig?.fallbackToKey??!0,h=String(e).split("."),c=o;for(let E of h){if(c===void 0||c===null)break;c=c[E]}if(c===void 0||c===null)return a?e:"";let v=String(c);return Object.entries(t).forEach(([E,R])=>{v=v.replace(tc(E),()=>String(R))}),v},t:(e,i,t={})=>vs.translate(e,i,t),truncate:(e,i,t=50,o="...")=>{if(e===void 0||e===null)return"";let a=String(e);if(a.length<=t)return a;if(t<=o.length)return o.substring(0,t);return a.substring(0,t-o.length)+o},date:(e,i,t="short",o="en-US")=>{if(e===void 0||e===null)return"";try{let a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return String(e);let h={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(t==="iso")return a.toISOString();return new Intl.DateTimeFormat(o,h[t]||h.short).format(a)}catch{return String(e)}},currency:(e,i,t="USD",o="en-US")=>{if(e===void 0||e===null)return"";try{let a=Number(e);if(Number.isNaN(a))return String(e);return new Intl.NumberFormat(o,{style:"currency",currency:t}).format(a)}catch{return String(e)}},pluralize:(e,i,t,o)=>{let a=Number(e);if(Number.isNaN(a))return t;let h=o||`${t}s`;return a===1?t:h},first:(e,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[0];return String(e).charAt(0)},last:(e,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[e.length-1];let t=String(e);return t.charAt(t.length-1)},length:(e,i)=>{if(e===void 0||e===null)return 0;if(Array.isArray(e)||typeof e==="string")return e.length;if(e instanceof Map||e instanceof Set)return e.size;if(typeof e==="object")return Object.keys(e).length;return 0},json:(e,i,t=!1)=>{if(e===void 0)return"undefined";if(e===null)return"null";try{return t?JSON.stringify(e,null,2):JSON.stringify(e)}catch{return String(e)}},default:(e,i,t="")=>e===void 0||e===null||e===""?t:e,reverse:(e,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return[...e].reverse();return String(e).split("").reverse().join("")},slice:(e,i,t=0,o)=>{if(e===void 0||e===null)return"";if(Array.isArray(e)||typeof e==="string")return e.slice(t,o);return e},replace:(e,i,t,o="")=>{if(e===void 0||e===null)return"";let a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).replace(new RegExp(a,"g"),()=>o)},stripTags:(e,i)=>{if(e===void 0||e===null)return"";return String(e).replace(/<[^>]*>/g,"")},urlencode:(e,i)=>{if(e===void 0||e===null)return"";return encodeURIComponent(String(e))},abs:(e,i)=>{let t=Number(e);return Number.isNaN(t)?0:Math.abs(t)},round:(e,i,t=0)=>{let o=Number(e);if(Number.isNaN(o))return 0;let a=10**t;return Math.round(o*a)/a}};function iu(e,i){if(e in vs)console.warn(`Filter "${e}" already exists as a built-in filter. Custom filter will take precedence.`);qt[e]=i}function Op(e){for(let[i,t]of Object.entries(e))iu(i,t)}function au(){return{...vs,...qt}}function Np(){for(let e of Object.keys(qt))delete qt[e]}function Ot(e,i,t=2){let o="{".repeat(t);if(!e.includes(o))return e;let a="",h=0;for(;;){let c=e.indexOf(o,h);if(c===-1)break;let v=be(e,c,t);if(v===-1)break;a+=e.slice(h,c)+i(e.slice(c,v+t),e.slice(c+t,v),c),h=v+t}return h===0?e:a+e.slice(h)}function d(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function H(e){return Ur(d(e))}function nc(e){return e.replace(/ /g,"&#32;").replace(/\t/g,"&#9;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;").replace(/\f/g,"&#12;").replace(/=/g,"&#61;").replace(/`/g,"&#96;")}function sc(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\([\dA-Fa-f]{1,6})\s?/g,(i,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\([^\r\n])/g,"$1").replace(/[\u0000-\u0020]+/g,"").toLowerCase()}function rc(e,i){let t=sc(e);if(/@import|expression\(|behavior:|-moz-binding|(?:image-set|cross-fade)\(/.test(t))throw new oe(i,"network-capable or executable CSS is not allowed in an escaped interpolation");let o=/url\(([^)]*)\)/g,a;while((a=o.exec(t))!==null){let h=a[1].replace(/^["']|["']$/g,""),c=h.startsWith("/")&&!h.startsWith("//")||h.startsWith("./")||h.startsWith("../")||h.startsWith("#"),v=/^data:image\/(?:avif|bmp|gif|jpeg|jpg|png|webp);base64,[a-z\d+/=]+$/i.test(h);if(!c&&!v)throw new oe(i,"CSS URLs must be local paths or base64 raster images")}}function J(e,i,t,o=!1,a=0){try{return ic(e,i,t,o,a)}catch(h){if(h instanceof oe)h.locate(e,i);throw h}}function ic(e,i,t,o,a){let h=ds(e,i,o),c=H(t);if(!h)return c;if(h.kind==="tag-name"){if(!/^[A-Za-z][A-Za-z0-9:-]*$/.test(t))throw new oe("tag name","dynamic tag names may contain only letters, digits, colons, and hyphens");return t}if(h.kind==="tag"){let R=e.slice(i+a).trimStart(),C=t.trim();if(!R.startsWith("=")&&(C===""||/^(?!on)[A-Za-z_:][\w:.-]*(?:\s+(?!on)[A-Za-z_:][\w:.-]*)*$/.test(C)))return C;throw new oe("tag structure","only standalone boolean attributes may be interpolated into tag structure")}let v=h.name.toLowerCase();if(/^on[a-z]/.test(v))throw new oe(h.name,"native event-handler attributes execute JavaScript; use an @event binding instead");if(v==="srcdoc")c=H(c);if(v==="style")rc(t,h.name);if(h.quote===null)c=nc(c);let E=ks(v);if(E&&h.valuePrefix.trim()===""&&Dn(t,E))return Hr+c;return Zr(Kr(e,i),t,c)}function mn(e,i){let t=` ${e}="`;return J(t,t.length,i,!0)}function oi(e){return e.flatMap((i)=>{let t=i.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);return!t||/\bserver\b|\bsrc\s*=/.test(t[1])?[]:[t[2]]})}function we(e,i){let{scripts:t}=K(e);for(let o of oi(t)){if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(o))return!0;if(xr(o,i))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(e))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(e))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(e))return!0;return!1}function cu(e){let i=[],t=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let o=t.exec(e);o;o=t.exec(e)){let a=o[1].toLowerCase(),h=new Set(G(o[3]));if(h.size===0)continue;let c=o.index+o[0].length;if(o[0].endsWith("/>")){i.push({start:o.index,end:c,names:h});continue}let v=new RegExp(`<(/?)${a}\\b[^>]*?(/?)>`,"gi");v.lastIndex=c;let E=1,R=e.length;for(let C=v.exec(e);C;C=v.exec(e)){if(C[2]==="/")continue;if(E+=C[1]==="/"?-1:1,E===0){R=C.index+C[0].length;break}}i.push({start:o.index,end:R,names:h})}return i}function ti(e,i,t){let o=r(t);for(let a of e){if(i<a.start||i>=a.end)continue;for(let h of a.names)if(new RegExp(`(?<![.#\\w$])${h.replace(/\$/g,"\\$")}(?![\\w$])`).test(o))return!0}return!1}function ni(e,i){let t=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],o=e.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),a="",h=!1,c=0;for(let R=0;R<o.length;R++){let C=o[R];if(!h&&C==="`"){h=!0,c=0;continue}if(h){if(C==="`"&&c===0){h=!1;continue}if(C==="$"&&o[R+1]==="{"){c++,R++,a+=" ";continue}if(C==="}"&&c>0){c--;continue}if(c>0){a+=C;continue}continue}a+=C}o=a;let v=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,E;while((E=v.exec(o))!==null){let R=E[1];if(!o.substring(0,E.index).trimEnd().endsWith(".")){if(!t.includes(R)&&!(R in i))return!1}}return!0}function oc(e,i){let t=r(e);for(let o of t.matchAll(/(?<![.\w$])([A-Z_$][\w$]*)\s*\(/gi))if(typeof i[o[1]]==="function")return!0;return!1}function ac(e,i){let t=i.__stx_serverDeclared;if(!t||t.size===0)return!1;let o=r(e);for(let a of t)if(new RegExp(`(?<![.#\\w$])${a}(?![\\w$])`).test(o))return!0;return!1}var si=new Set;function ri(e){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(e.trim())}function ii(e,i){let t=`${i??"<unknown>"}\x00${e}`;if(process.env.STX_DEBUG||!si.has(t))si.add(t),console.warn(`[stx] {{ ${e} }} in a <script> in ${i??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function Fo(e,i,t){let o=e;return o=o.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>{try{let c=_(h,i);if(c===void 0)return ri(h)?ii(h.trim(),t):a;return c===null?"":String(c)}catch{return a}}),o=Ot(o,(a,h,c)=>{let v=h.trim();if(/^__[A-Z_]+__$/.test(v))return a;try{let E=_(h,i);if(E===void 0)return ri(v)?ii(v,t):a;return JSON.stringify(E).replace(/</g,"\\u003c").replace(/@/g,"\\u0040").replace(/\{{2,}/g,(R)=>"\\u007b".repeat(R.length)).replace(/\{(?=!)/g,"\\u007b")}catch{return a}}),o}function lu(e,i){if(!e.includes("{"))return e;let t=e;return t=t.replace(/\{!!([\s\S]*?)!!\}/g,(o,a)=>{try{let h=_(a,i);if(h===void 0)return o;return h===null?"":String(h)}catch{return o}}),t=Ot(t,(o,a,h)=>{let c=a.trim();if(/^__[A-Z_]+__$/.test(c))return o;try{let v=_(a,i);if(v===void 0)return o;if(v===null)return"";let E=String(v);return J(t,h,E,!0,o.length)}catch(v){if(v instanceof oe)throw v;return o}}),t}function Dp(e,i,t={}){let{output:o,scripts:a}=K(e),h=a.map((c)=>{let v=c.match(/^<script\b((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/i),E=c.search(/<\/script\s*>$/i);if(!v||E===-1)return c;let R=v[1],C=c.slice(v[0].length,E);if(/\bdata-raw\b/.test(R))return c;if(t.skipServer&&/\bserver\b/.test(R))return c;let M=`<script${lu(R,i)}>`;if(/\bsrc\s*=/.test(R)||/\btype\s*=\s*["']application\/json["']/.test(R))return M+C+c.slice(E);return M+Fo(C,i)+c.slice(E)});return cr(o,h)}function k(e,i,t){let o=e,a=(I,P)=>{let q=cn(I,P);if(q===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(I.slice(P,q))?-1:q},h=(I,P,q,Z)=>{let W=q.length,{output:Y,tokens:ee}=de(I,P,(te,ae)=>Z(W+ae));return q.push(...ee),Y},c=[];o=h(o,a,c,(I)=>`<!--__STX_STYLE_${I}__-->`);let v=[];o=h(o,F,v,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`);let E=i?.__stx_signals_gate===!0||we(e),R=new Set([...Array.isArray(i?.__stx_client_signal_names)?i.__stx_client_signal_names:[],...jo(oi(v))]),C=new Set(Array.isArray(i?.__stx_preserved_client_expressions)?i.__stx_preserved_client_expressions:[]);o=Ot(o,(I,P,q)=>{try{let Z=_(P,i,!1,(W)=>Ps(W,I,t,e));return Z!==void 0&&Z!==null?String(Z):""}catch(Z){let W=Z instanceof Error?Z.message:String(Z);return m("Expression",`Error evaluating: {{{ ${P.trim()}}}}: ${W}`,t,e,q,I)}},3),o=o.replace(/\{!!([\s\S]*?)!!\}/g,(I,P,q)=>{try{let Z=_(P,i,!1,(W)=>Ps(W,I,t,e));if(Z===void 0&&i.__stx_buildMode==="compile")return Pn("raw",P.trim());return Z!==void 0&&Z!==null?String(Z):""}catch(Z){if(i.__stx_buildMode==="compile")return Pn("raw",P.trim());let W=Z instanceof Error?Z.message:String(Z);return m("Expression",`Error evaluating: {!! ${P.trim()} !!}: ${W}`,t,e,q,I)}}),o=h(o,F,v,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`),o=h(o,a,c,(I)=>`<!--__STX_STYLE_${I}__-->`);let O=E?cu(o):[],M=zn(o).map((I)=>({...I,names:new Set(G(`${I.binding} in __slot`))})),N=new Set(et(i));if(o=Ot(o,(I,P,q)=>{let Z=P.trim();if(ti(M,q,Z))return I;if(z(Z,N))return I;if(O.length>0&&ti(O,q,Z))return I;if(C.has(Z))return I;let W=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],Y=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,te=Z.match(Y)?.[1],ae=te&&((te in i)||W.includes(te)),me=Boolean(te&&R.has(te)),ke=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,Re=Z.match(ke),Ve=Re&&!W.includes(Re[1])&&!(Re[1]in i);if(/^__[A-Z_]+__$/.test(Z))return"";if(me)return I;if(i.__stx_native_screen===!0&&oc(Z,i))return I;let Te;try{let Ze=_(P,i,!1,(mt)=>{Te=mt});if(E&&!ni(Z,i))return I;if(Te)Ps(Te,I,t,e);if(i.__stx_buildMode==="compile"&&!E&&(Ze===void 0||ac(Z,i)))return Pn("expr",Z);if(Ze===void 0||Ze===null)return"";let Ye=String(Ze);return J(o,q,Ye,!1,I.length)}catch(Ze){if(Ze instanceof oe)throw Ze;if(E&&!ni(Z,i))return I;if(Ve)return I;let Ye=Ze instanceof Error?Ze.message:String(Ze);return m("Expression",`Error evaluating: {{ ${Z} }}: ${Ye}`,t,e,q,I)}}),v.length>0)o=o.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(I,P)=>v[Number(P)]??I);if(c.length>0)o=o.replace(/<!--__STX_STYLE_(\d+)__-->/g,(I,P)=>c[Number(P)]??I);return o}function uu(e,i,t){if(!i.trim())return e;let o=e,a=i.trim();while(a.length>0){let h=a.match(/^(\w+)/);if(!h)break;let c=h[1];a=a.substring(c.length).trim();let v=qt[c]||vs[c];if(!v)throw Error(`Filter not found: ${c}. Available filters: ${Object.keys(au()).join(", ")}`);let E=[];if(a.startsWith(":")){let R=a.match(/^:([^|\s]+)/);if(R){let C=R[1].trim();try{let O=Number(C);E=[Number.isNaN(O)?C:O]}catch{E=[C]}a=a.substring(R[0].length).trim()}}else if(a.startsWith("(")){let R=1,C=1;while(R>0&&C<a.length){if(a[C]==="(")R++;if(a[C]===")")R--;C++}if(R===0){let O=a.substring(1,C-1).trim();if(O)try{if(O.startsWith("{")&&O.endsWith("}"))E=[_(`(${O})`,t,!0)];else{let M=[],N="",I=null,P=0,q=0,Z=0,W=!1;for(let Y=0;Y<O.length;Y++){let ee=O[Y];if(W){N+=ee,W=!1;continue}if(ee==="\\"){N+=ee,W=!0;continue}if(I){if(N+=ee,ee===I)I=null;continue}if(ee==='"'||ee==="'"||ee==="`"){I=ee,N+=ee;continue}if(ee==="(")P++;else if(ee===")")P--;else if(ee==="[")q++;else if(ee==="]")q--;else if(ee==="{")Z++;else if(ee==="}")Z--;if(ee===","&&P===0&&q===0&&Z===0){M.push(N),N="";continue}N+=ee}if(N)M.push(N);E=M.map((Y)=>{let ee=Y.trim();return _(ee,t,!0)})}}catch{E=[O]}a=a.substring(C).trim()}}try{o=v(o,t,...E)}catch(R){let C=R instanceof Error?R.message:String(R);throw Error(`Error applying filter '${c}': ${C}`)}if(a.startsWith("|"))a=a.substring(1).trim();else break}return o}function cc(e){let i=!1,t="",o=0,a=0,h=0,c=!1;for(let v=0;v<e.length;v++){let E=e[v],R=e[v+1];if(i&&c){c=!1;continue}if(i&&E==="\\"){c=!0;continue}if(c=!1,(E==='"'||E==="'"||E==="`")&&!c){if(!i)i=!0,t=E;else if(E===t)i=!1,t="";continue}if(i&&t==="`"&&E==="$"&&R==="{"){let C=1;v+=2;while(v<e.length&&C>0){if(e[v]==="{")C++;else if(e[v]==="}")C--;if(C>0)v++}continue}if(i)continue;if(E==="(")o++;else if(E===")")o--;else if(E==="[")a++;else if(E==="]")a--;else if(E==="{")h++;else if(E==="}")h--;if(E==="|"&&o===0&&a===0&&h===0){if(R==="|"){v++;continue}if(R==="="){v++;continue}return v}}return-1}var Zt=new Set,fc=1000;function Mp(){Zt.clear()}function Ps(e,i,t,o){if(!U())return;let a=`${t}\x00${e.expression}`;if(Zt.has(a))return;if(Zt.size>=fc)Zt.clear();Zt.add(a);let h=t,c=o;try{if(t&&Qr.existsSync(t))c=Qr.readFileSync(t,"utf8")}catch{}let v=c.indexOf(i);if(v>=0)h=`${t}:${c.slice(0,v).split(`
228
- `).length}`;console.warn(`${h}: stx warning: ${i} rendered as an empty string. The safe evaluator rejected \`${e.expression}\` (${e.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function _(e,i,t=!1,o){try{let a=e.trim(),h=cc(a);if(h>0){let v=a.substring(0,h).trim(),E=a.substring(h+1).trim(),R=_(v,i,!0,o);return uu(R,E,i)}let c=xs(a);if(c!==null){o?.({expression:a,rule:c});return}try{let v=Object.keys(i),E=Object.values(i);return u(a,v)(...E)}catch{return l(a,i)}}catch(a){if(a instanceof ReferenceError){let h=/(\b\w+)\s+is not defined/.exec(a.message);if(h){let c=h[1],v=pc(c,Object.keys(i));if(v&&v!==c)a.message=`${a.message} \u2014 did you mean '${v}'?`}}if(!t)console.error(`Error evaluating expression: ${e}`,a);throw a}}function pc(e,i){let t=null;for(let a of i){if(a===e)continue;let h=dc(e,a);if(t===null||h<t.dist)t={key:a,dist:h}}if(!t)return null;let o=Math.max(e.length,t.key.length);if(t.dist<=2||t.dist/o<=0.35)return t.key;return null}function dc(e,i){if(e===i)return 0;if(e.length===0)return i.length;if(i.length===0)return e.length;let[t,o]=e.length<i.length?[e,i]:[i,e],a=Array(t.length+1),h=Array(t.length+1);for(let c=0;c<=t.length;c++)a[c]=c;for(let c=1;c<=o.length;c++){h[0]=c;for(let v=1;v<=t.length;v++){let E=t[v-1]===o[c-1]?0:1;h[v]=Math.min(h[v-1]+1,a[v]+1,a[v-1]+E)}for(let v=0;v<=t.length;v++)a[v]=h[v]}return a[t.length]}function Lp(e){if(!e)return"";return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import gc from"process";function S(e="STX_PUBLIC_"){let i={},t={};for(let[o,a]of Object.entries(gc.env)){if(!o.startsWith(e)||a===void 0)continue;i[`import.meta.env.${o}`]=JSON.stringify(a),t[o]=a}return i["import.meta.env"]=JSON.stringify(t),i}function ai(e,i=""){let t=`${e}${i}`,o=0;for(let a=0;a<t.length;a++){let h=t.charCodeAt(a);o=(o<<5)-o+h,o=o&o}return`stx-${Math.abs(o).toString(36)}`}function ci(e,i,t={}){let{prefix:o="",preserveHost:a=!0,scopeKeyframes:h=!0,scopeCustomProperties:c=!1}=t;if(!e.trim())return"";let v=Ms(e),E=[],R=new Map;if(h)for(let C of v){let O=C.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(O){let M=O[1],N=`${i}_${M}`;R.set(M,N)}}for(let C of v){let O=li(C,i,o,a,R,c);E.push(O)}return E.join(`
226
+ </script>`,E,R=/<(?:template\b|script\b(?=[^>]*\bdata-stx-scoped\b))/iy;return z(e,(C,O)=>{if(E===void 0){if(R.lastIndex=O,R.test(C))E=O}return-1}),a.push({start:E??0,end:E??0,replacement:`${v}
227
+ `}),Fr(e,a)}function Fr(e,i){if(i.length===0)return e;i.sort((h,c)=>h.start-c.start||h.end-c.end);let t=Array(i.length*2+1),o=0,a=0;for(let h of i)t[a++]=e.slice(o,h.start),t[a++]=h.replacement,o=h.end;return t[a]=e.slice(o),t.join("")}function Vr(e){let i=Mn(e),t=new Map;if(i)for(let[o,a]of i)t.set(o,a.instances);return t}function Ur(e,i){let t=Mn(e);if(!t)return[];let o=[];for(let[a,h]of t){let c=h.instances-(i.get(a)??0);if(c>0)o.push({body:h.body,count:c})}return o}function Hr(e,i){for(let{body:t,count:o}of i)for(let a=0;a<o;a++)As(e,t)}function be(e,i,t=2){let o=0,a=null;for(let h=i+t;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="{"){o++;continue}if(c==="}"){if(o>0){o--;continue}let v=0;while(e[h+v]==="}")v++;if(v>=t)return h}}return-1}import Qr from"fs";var Kr=0,Is=new Map;function Qa(){Kr=0,Is.clear()}function Dn(e,i){let t=Kr++,o=`<!--__STX_${e.toUpperCase()}_${t}__-->`;return Is.set(o,{type:e,expression:i}),o}function ec(){let e={};for(let[i,t]of Is)e[i]={type:t.type,expression:t.expression};return e}function tc(e,i){let t=e;for(let[o,a]of i)t=t.split(o).join(a);return t}function zo(e){return e.includes("<!--__STX_")}var ba=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function ya(e){return Array.from({length:e},()=>"&#123;").join("&#8288;")}function Zr(e){return e.replace(/\{{2,}/g,(i)=>ya(i.length)).replace(/\{(?=!)/g,"&#123;&#8288;").replace(ba,"&#64;")}function ps(e,i,t=!1){let{openTag:o,tail:a}=t?_a(e,i):wa(e).at(i);return $a(a,o,t)}function _a(e,i){let t="",o=0;for(let c=0;c<i;c++){if(!e.startsWith("{{",c))continue;let v=be(e,c);if(v<0||v+2>i)break;t+=e.slice(o,c)+"x",c=v+1,o=v+2}t+=e.slice(o,i);let a=-1,h=null;for(let c=0;c<t.length;c++){let v=t[c];if(h){if(v===h)h=null;continue}if(v==='"'||v==="'"){h=v;continue}if(v===">"){a=-1;continue}if(v==="<")a=c}return{openTag:a,tail:a>=0?t.slice(a+1):t}}var jn=null;function wa(e){if(jn&&jn.source===e)return jn.scanner;let i=Sa(e);return jn={source:e,scanner:i},i}function Sa(e){let i=0,t=-1,o=null,a=-1,h=(v,E)=>{let R=e[v];if(E.quote){if(R===E.quote)E.quote=null;return}if(E.openTag>=0){if(R==='"'||R==="'"){E.quote=R;return}if(R===">"){E.openTag=-1;return}}if(R==="<")E.openTag=v},c=(v,E)=>{if(E.openTag>=0||!e.startsWith("<!--",v))return-1;let R=e.indexOf("-->",v+4);return R<0?e.length:R+3};return{at(v){if(v<i)i=0,t=-1,o=null,a=-1;let E={openTag:t,quote:o},R=!1;while(i<v){if(a<0&&e.startsWith("{{",i)){let P=be(e,i);if(P<0)a=i;else if(P+2<=v){i=P+2;continue}else break}let I=c(i,E);if(I>=0){if(I>v){R=!0;break}i=I;continue}h(i,E),i++}if(t=E.openTag,o=E.quote,R)return{openTag:-1,tail:""};let C=a>=0?a:i,O={openTag:t,quote:o};for(let I=i;I<v;I++){let P=c(I,O);if(P>=0){if(P>v)return{openTag:-1,tail:""};I=P-1;continue}h(I,O)}if(O.openTag<0)return{openTag:-1,tail:""};let M="",N=O.openTag+1;for(let I=N;I<Math.min(v,C);I++){if(!e.startsWith("{{",I))continue;let P=be(e,I);M+=e.slice(N,I)+"x",I=P+1,N=P+2}return M+=e.slice(N,v),{openTag:O.openTag,tail:M}}}}function $a(e,i,t){if(i<0&&!t)return null;if(i>=0&&/^\s*[!/?]/.test(e))return/^\s*\/?\s*$/.test(e)?{kind:"tag-name"}:null;if(i>=0&&/^\s*$/.test(e))return{kind:"tag-name"};let o=0;if(i>=0)while(o<e.length&&!/\s/.test(e[o]))o++;while(o<e.length){while(/\s/.test(e[o]??"")&&o<e.length)o++;let a=o;while(o<e.length&&!/[\s=/>]/.test(e[o]))o++;let h=e.slice(a,o);if(!h)break;while(o<e.length&&/\s/.test(e[o]))o++;if(e[o]!=="=")continue;o++;while(o<e.length&&/\s/.test(e[o]))o++;let c=e[o];if(c==='"'||c==="'"){let v=++o,E=e.indexOf(c,o);if(E===-1)return{kind:"attribute",name:h,quote:c,valuePrefix:e.slice(v)};o=E+1}else{let v=o;while(o<e.length&&!/\s/.test(e[o]))o++;if(o===e.length)return{kind:"attribute",name:h,quote:null,valuePrefix:e.slice(v)}}}return{kind:"tag"}}class oe extends Error{attribute;near;constructor(e,i){super(`Unsafe interpolation in ${e}: ${i}`);this.name="UnsafeInterpolationContextError",this.attribute=e}locate(e,i){if(this.near===void 0)this.near=e.slice(Math.max(0,i-160),i).replace(/\s+/g," ").trim(),this.message+=` (after: ${JSON.stringify(this.near)})`;return this}}var qr="unsafe:";var va=/^(?:javascript|vbscript|livescript|mocha|view-source):/,Ea=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,ka=/^data:(?:text\/html|application\/xhtml\+xml)/,Ra=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function Ca(e){return e.replace(Ra,"").toLowerCase()}function Os(e){let i=e.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(i))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(i))return"fetched";return null}function Nn(e,i="navigable"){let t=Ca(e);if(va.test(t))return!0;return i==="navigable"?Ea.test(t):ka.test(t)}function ar(e,i="navigable"){return Nn(e,i)?"unsafe:"+e:e}function Ta(e){let i=e.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!i)return null;if(i[3].trim()!=="")return null;return Os(i[1])}function Xr(e,i,t=256){if(i<=t)return e.slice(0,i);let o=e.slice(i-t,i),a=o.search(/[\s"'`/]/);return a===-1?"":o.slice(a)}function Jr(e,i,t=i){let o=Ta(e);return o&&Nn(i,o)?"unsafe:"+t:t}function $t(e){let i=e.indexOf(" as ");if(i!==-1){let h=e.slice(0,i).trim(),c=e.slice(i+4).trim();return h&&c?{arrayExpr:h,itemVar:c}:null}let t=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!t)return null;let o=t[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),a=t[2].trim();return o&&a?{arrayExpr:a,itemVar:o}:null}function Ln(e){let i=[],t=0,o="",a=0;for(let h=0;h<e.length;h++){let c=e[h];if(o){if(c==="\\")h++;else if(c===o)o="";continue}if(c==="'"||c==='"'||c==="`")o=c;else if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)i.push(e.slice(a,h)),a=h+1}return i.push(e.slice(a)),i}function Gr(e,i){let t=0;for(let o=0;o<e.length;o++){let a=e[o];if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;else if(a===i&&t===0)return o}return-1}function Yr(e){let i=0;for(let t=0;t<e.length;t++){let o=e[t];if(o==="("||o==="["||o==="{")i++;else if((o===")"||o==="]"||o==="}")&&--i===0)return t}return-1}function ht(e,i){let t=e.trim().replace(/^\.\.\./,"").trim(),o=Gr(t,"=");if(o!==-1&&t[o+1]!==">")t=t.slice(0,o).trim();if(!t)return;if(t.startsWith("{")&&t.endsWith("}")){for(let a of Ln(t.slice(1,-1))){let h=a.trim();if(!h)continue;if(h.startsWith("...")){ht(h,i);continue}let c=Gr(h,":");ht(c===-1?h:h.slice(c+1),i)}return}if(t.startsWith("[")&&t.endsWith("]")){for(let a of Ln(t.slice(1,-1)))ht(a,i);return}if(/^[A-Z_$][\w$]*$/i.test(t))i.push(t)}function X(e){let i=e.trim(),t=[],o=0;for(let h=0;h<i.length;h++){let c=i[h];if(c==="("||c==="["||c==="{")o++;else if(c===")"||c==="]"||c==="}")o--;else if(o===0&&/\s/.test(c)){if(!/^\s+(?:in|of)\s/.exec(i.slice(h)))continue;let E=i.slice(0,h).trim();if(E.startsWith("(")&&Yr(E)===E.length-1)E=E.slice(1,-1);for(let R of Ln(E))ht(R,t);if(t.length>0)return t;break}}let a=/^[\s\S]+?\s+as\s+([\s\S]+)$/.exec(i);if(a){let h=a[1].trim();if(h.startsWith("(")&&Yr(h)===h.length-1)h=h.slice(1,-1);let c=/^([\w$]+)\s*=>\s*([\s\S]+)$/.exec(h);if(c)ht(c[2],t),ht(c[1],t);else for(let v of Ln(h))ht(v,t)}return t}function H(e,i){let t=i instanceof Set?i:new Set(i);if(t.size===0)return!1;let c=e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g," ").replace(/`(?:[^`\\$]|\\.|\$(?!\{))*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:(?!:))/g,"$1$2");for(let v of c.match(/[a-zA-Z_$][\w$]*/g)||[])if(t.has(v))return!0;return!1}var Bn="__stx_client_loop_names";function et(e){let i=e?.[Bn];return Array.isArray(i)?i:[]}function zn(e){if(!e.includes("#")&&!e.includes("v-slot:")&&!e.includes("data-stx-slot-binding"))return[];let i=[],t=[],o=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let a of e.matchAll(o)){let h=a[0];if(/^<\/template\s*>$/i.test(h)){let c=t.pop();if(c)c.end=a.index}else if(/^<template\b/i.test(h)&&!/\/\s*>$/.test(h)){let v=[...h.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((C)=>/^(?:#[\w-]+|v-slot:[\w-]+|data-stx-slot-binding)$/i.test(C[1])),E=(v?.[2]??v?.[3])?.trim();if(E&&v?.[1]==="data-stx-slot-binding")try{E=decodeURIComponent(E)}catch{E=void 0}let R=E?{start:a.index+h.length,end:e.length,binding:E}:void 0;if(t.push(R),R)i.push(R)}}return i}var Zt={},ei=new Map;function nc(e){let i=ei.get(e);if(!i){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=new RegExp(`:${t}(?!\\w)`,"g"),ei.set(e,i)}return i.lastIndex=0,i}var ws={uppercase:(e,i)=>e!==void 0&&e!==null?String(e).toUpperCase():"",lowercase:(e,i)=>e!==void 0&&e!==null?String(e).toLowerCase():"",capitalize:(e,i)=>{if(e===void 0||e===null)return"";let t=String(e);return t.charAt(0).toUpperCase()+t.slice(1)},number:(e,i,t=0)=>{if(e===void 0||e===null)return"";try{let o=Number(e);return Number.isNaN(o)?"":o.toFixed(Number.parseInt(String(t),10))}catch{return""}},fmt:(e,i,t="en-US")=>{if(e===void 0||e===null)return"";try{let o=Number(e);if(Number.isNaN(o))return String(e);return o.toLocaleString(t)}catch{return String(e)}},join:(e,i,t=",")=>{if(!Array.isArray(e))return"";return e.join(String(t))},escape:(e,i)=>{if(e===void 0||e===null)return"";return V(String(e))},translate:(e,i,t={})=>{if(!i||!i.__translations)return e;let o=i.__translations,a=i.__i18nConfig?.fallbackToKey??!0,h=String(e).split("."),c=o;for(let E of h){if(c===void 0||c===null)break;c=c[E]}if(c===void 0||c===null)return a?e:"";let v=String(c);return Object.entries(t).forEach(([E,R])=>{v=v.replace(nc(E),()=>String(R))}),v},t:(e,i,t={})=>ws.translate(e,i,t),truncate:(e,i,t=50,o="...")=>{if(e===void 0||e===null)return"";let a=String(e);if(a.length<=t)return a;if(t<=o.length)return o.substring(0,t);return a.substring(0,t-o.length)+o},date:(e,i,t="short",o="en-US")=>{if(e===void 0||e===null)return"";try{let a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return String(e);let h={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(t==="iso")return a.toISOString();return new Intl.DateTimeFormat(o,h[t]||h.short).format(a)}catch{return String(e)}},currency:(e,i,t="USD",o="en-US")=>{if(e===void 0||e===null)return"";try{let a=Number(e);if(Number.isNaN(a))return String(e);return new Intl.NumberFormat(o,{style:"currency",currency:t}).format(a)}catch{return String(e)}},pluralize:(e,i,t,o)=>{let a=Number(e);if(Number.isNaN(a))return t;let h=o||`${t}s`;return a===1?t:h},first:(e,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[0];return String(e).charAt(0)},last:(e,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[e.length-1];let t=String(e);return t.charAt(t.length-1)},length:(e,i)=>{if(e===void 0||e===null)return 0;if(Array.isArray(e)||typeof e==="string")return e.length;if(e instanceof Map||e instanceof Set)return e.size;if(typeof e==="object")return Object.keys(e).length;return 0},json:(e,i,t=!1)=>{if(e===void 0)return"undefined";if(e===null)return"null";try{return t?JSON.stringify(e,null,2):JSON.stringify(e)}catch{return String(e)}},default:(e,i,t="")=>e===void 0||e===null||e===""?t:e,reverse:(e,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return[...e].reverse();return String(e).split("").reverse().join("")},slice:(e,i,t=0,o)=>{if(e===void 0||e===null)return"";if(Array.isArray(e)||typeof e==="string")return e.slice(t,o);return e},replace:(e,i,t,o="")=>{if(e===void 0||e===null)return"";let a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).replace(new RegExp(a,"g"),()=>o)},stripTags:(e,i)=>{if(e===void 0||e===null)return"";return String(e).replace(/<[^>]*>/g,"")},urlencode:(e,i)=>{if(e===void 0||e===null)return"";return encodeURIComponent(String(e))},abs:(e,i)=>{let t=Number(e);return Number.isNaN(t)?0:Math.abs(t)},round:(e,i,t=0)=>{let o=Number(e);if(Number.isNaN(o))return 0;let a=10**t;return Math.round(o*a)/a}};function cu(e,i){if(e in ws)console.warn(`Filter "${e}" already exists as a built-in filter. Custom filter will take precedence.`);Zt[e]=i}function Dp(e){for(let[i,t]of Object.entries(e))cu(i,t)}function lu(){return{...ws,...Zt}}function Mp(){for(let e of Object.keys(Zt))delete Zt[e]}function Ot(e,i,t=2){let o="{".repeat(t);if(!e.includes(o))return e;let a="",h=0;for(;;){let c=e.indexOf(o,h);if(c===-1)break;let v=be(e,c,t);if(v===-1)break;a+=e.slice(h,c)+i(e.slice(c,v+t),e.slice(c+t,v),c),h=v+t}return h===0?e:a+e.slice(h)}function d(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function V(e){return Zr(d(e))}function sc(e){return e.replace(/ /g,"&#32;").replace(/\t/g,"&#9;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;").replace(/\f/g,"&#12;").replace(/=/g,"&#61;").replace(/`/g,"&#96;")}function rc(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\([\dA-Fa-f]{1,6})\s?/g,(i,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\([^\r\n])/g,"$1").replace(/[\u0000-\u0020]+/g,"").toLowerCase()}function ic(e,i){let t=rc(e);if(/@import|expression\(|behavior:|-moz-binding|(?:image-set|cross-fade)\(/.test(t))throw new oe(i,"network-capable or executable CSS is not allowed in an escaped interpolation");let o=/url\(([^)]*)\)/g,a;while((a=o.exec(t))!==null){let h=a[1].replace(/^["']|["']$/g,""),c=h.startsWith("/")&&!h.startsWith("//")||h.startsWith("./")||h.startsWith("../")||h.startsWith("#"),v=/^data:image\/(?:avif|bmp|gif|jpeg|jpg|png|webp);base64,[a-z\d+/=]+$/i.test(h);if(!c&&!v)throw new oe(i,"CSS URLs must be local paths or base64 raster images")}}function Y(e,i,t,o=!1,a=0){try{return oc(e,i,t,o,a)}catch(h){if(h instanceof oe)h.locate(e,i);throw h}}function oc(e,i,t,o,a){let h=ps(e,i,o),c=V(t);if(!h)return c;if(h.kind==="tag-name"){if(!/^[A-Za-z][A-Za-z0-9:-]*$/.test(t))throw new oe("tag name","dynamic tag names may contain only letters, digits, colons, and hyphens");return t}if(h.kind==="tag"){let R=e.slice(i+a).trimStart(),C=t.trim();if(!R.startsWith("=")&&(C===""||/^(?!on)[A-Za-z_:][\w:.-]*(?:\s+(?!on)[A-Za-z_:][\w:.-]*)*$/.test(C)))return C;throw new oe("tag structure","only standalone boolean attributes may be interpolated into tag structure")}let v=h.name.toLowerCase();if(/^on[a-z]/.test(v))throw new oe(h.name,"native event-handler attributes execute JavaScript; use an @event binding instead");if(v==="srcdoc")c=V(c);if(v==="style")ic(t,h.name);if(h.quote===null)c=sc(c);let E=Os(v);if(E&&h.valuePrefix.trim()===""&&Nn(t,E))return qr+c;return Jr(Xr(e,i),t,c)}function mn(e,i){let t=` ${e}="`;return Y(t,t.length,i,!0)}function oi(e){return e.flatMap((i)=>{let t=i.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);return!t||/\bserver\b|\bsrc\s*=/.test(t[1])?[]:[t[2]]})}function we(e,i){let{scripts:t}=K(e);for(let o of oi(t)){if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(o))return!0;if(xr(o,i))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(e))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(e))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(e))return!0;return!1}function uu(e){let i=[],t=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let o=t.exec(e);o;o=t.exec(e)){let a=o[1].toLowerCase(),h=new Set(X(o[3]));if(h.size===0)continue;let c=o.index+o[0].length;if(o[0].endsWith("/>")){i.push({start:o.index,end:c,names:h});continue}let v=new RegExp(`<(/?)${a}\\b[^>]*?(/?)>`,"gi");v.lastIndex=c;let E=1,R=e.length;for(let C=v.exec(e);C;C=v.exec(e)){if(C[2]==="/")continue;if(E+=C[1]==="/"?-1:1,E===0){R=C.index+C[0].length;break}}i.push({start:o.index,end:R,names:h})}return i}function ti(e,i,t){let o=r(t);for(let a of e){if(i<a.start||i>=a.end)continue;for(let h of a.names)if(new RegExp(`(?<![.#\\w$])${h.replace(/\$/g,"\\$")}(?![\\w$])`).test(o))return!0}return!1}function ni(e,i){let t=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],o=e.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),a="",h=!1,c=0;for(let R=0;R<o.length;R++){let C=o[R];if(!h&&C==="`"){h=!0,c=0;continue}if(h){if(C==="`"&&c===0){h=!1;continue}if(C==="$"&&o[R+1]==="{"){c++,R++,a+=" ";continue}if(C==="}"&&c>0){c--;continue}if(c>0){a+=C;continue}continue}a+=C}o=a;let v=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,E;while((E=v.exec(o))!==null){let R=E[1];if(!o.substring(0,E.index).trimEnd().endsWith(".")){if(!t.includes(R)&&!(R in i))return!1}}return!0}function ac(e,i){let t=r(e);for(let o of t.matchAll(/(?<![.\w$])([A-Z_$][\w$]*)\s*\(/gi))if(typeof i[o[1]]==="function")return!0;return!1}function cc(e,i){let t=i.__stx_serverDeclared;if(!t||t.size===0)return!1;let o=r(e);for(let a of t)if(new RegExp(`(?<![.#\\w$])${a}(?![\\w$])`).test(o))return!0;return!1}var si=new Set;function ri(e){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(e.trim())}function ii(e,i){let t=`${i??"<unknown>"}\x00${e}`;if(process.env.STX_DEBUG||!si.has(t))si.add(t),console.warn(`[stx] {{ ${e} }} in a <script> in ${i??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function Ho(e,i,t){let o=e;return o=o.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>{try{let c=_(h,i);if(c===void 0)return ri(h)?ii(h.trim(),t):a;return c===null?"":String(c)}catch{return a}}),o=Ot(o,(a,h,c)=>{let v=h.trim();if(/^__[A-Z_]+__$/.test(v))return a;try{let E=_(h,i);if(E===void 0)return ri(v)?ii(v,t):a;return JSON.stringify(E).replace(/</g,"\\u003c").replace(/@/g,"\\u0040").replace(/\{{2,}/g,(R)=>"\\u007b".repeat(R.length)).replace(/\{(?=!)/g,"\\u007b")}catch{return a}}),o}function du(e,i){if(!e.includes("{"))return e;let t=e;return t=t.replace(/\{!!([\s\S]*?)!!\}/g,(o,a)=>{try{let h=_(a,i);if(h===void 0)return o;return h===null?"":String(h)}catch{return o}}),t=Ot(t,(o,a,h)=>{let c=a.trim();if(/^__[A-Z_]+__$/.test(c))return o;try{let v=_(a,i);if(v===void 0)return o;if(v===null)return"";let E=String(v);return Y(t,h,E,!0,o.length)}catch(v){if(v instanceof oe)throw v;return o}}),t}function Lp(e,i,t={}){let{output:o,scripts:a}=K(e),h=a.map((c)=>{let v=c.match(/^<script\b((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/i),E=c.search(/<\/script\s*>$/i);if(!v||E===-1)return c;let R=v[1],C=c.slice(v[0].length,E);if(/\bdata-raw\b/.test(R))return c;if(t.skipServer&&/\bserver\b/.test(R))return c;let M=`<script${du(R,i)}>`;if(/\bsrc\s*=/.test(R)||/\btype\s*=\s*["']application\/json["']/.test(R))return M+C+c.slice(E);return M+Ho(C,i)+c.slice(E)});return cr(o,h)}function x(e,i,t){let o=e,a=(I,P)=>{let G=cn(I,P);if(G===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(I.slice(P,G))?-1:G},h=(I,P,G,q)=>{let Z=G.length,{output:Q,tokens:te}=de(I,P,(ne,ae)=>q(Z+ae));return G.push(...te),Q},c=[];o=h(o,a,c,(I)=>`<!--__STX_STYLE_${I}__-->`);let v=[];o=h(o,F,v,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`);let E=i?.__stx_signals_gate===!0||we(e),R=new Set([...Array.isArray(i?.__stx_client_signal_names)?i.__stx_client_signal_names:[],...Fo(oi(v))]),C=new Set(Array.isArray(i?.__stx_preserved_client_expressions)?i.__stx_preserved_client_expressions:[]);o=Ot(o,(I,P,G)=>{try{let q=_(P,i,!1,(Z)=>Ps(Z,I,t,e));return q!==void 0&&q!==null?String(q):""}catch(q){let Z=q instanceof Error?q.message:String(q);return m("Expression",`Error evaluating: {{{ ${P.trim()}}}}: ${Z}`,t,e,G,I)}},3),o=o.replace(/\{!!([\s\S]*?)!!\}/g,(I,P,G)=>{try{let q=_(P,i,!1,(Z)=>Ps(Z,I,t,e));if(q===void 0&&i.__stx_buildMode==="compile")return Dn("raw",P.trim());return q!==void 0&&q!==null?String(q):""}catch(q){if(i.__stx_buildMode==="compile")return Dn("raw",P.trim());let Z=q instanceof Error?q.message:String(q);return m("Expression",`Error evaluating: {!! ${P.trim()} !!}: ${Z}`,t,e,G,I)}}),o=h(o,F,v,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`),o=h(o,a,c,(I)=>`<!--__STX_STYLE_${I}__-->`);let O=E?uu(o):[],M=zn(o).map((I)=>({...I,names:new Set(X(`${I.binding} in __slot`))})),N=new Set(et(i));if(o=Ot(o,(I,P,G)=>{let q=P.trim();if(ti(M,G,q))return I;if(H(q,N))return I;if(O.length>0&&ti(O,G,q))return I;if(C.has(q))return I;let Z=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],Q=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,ne=q.match(Q)?.[1],ae=ne&&((ne in i)||Z.includes(ne)),me=Boolean(ne&&R.has(ne)),ke=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,Re=q.match(ke),Ue=Re&&!Z.includes(Re[1])&&!(Re[1]in i);if(/^__[A-Z_]+__$/.test(q))return"";if(me)return I;if(i.__stx_native_screen===!0&&ac(q,i))return I;let We;try{let Ze=_(P,i,!1,(xt)=>{We=xt});if(E&&!ni(q,i))return I;if(We)Ps(We,I,t,e);if(i.__stx_buildMode==="compile"&&!E&&(Ze===void 0||cc(q,i)))return Dn("expr",q);if(Ze===void 0||Ze===null)return"";let Ye=String(Ze);return Y(o,G,Ye,!1,I.length)}catch(Ze){if(Ze instanceof oe)throw Ze;if(E&&!ni(q,i))return I;if(Ue)return I;let Ye=Ze instanceof Error?Ze.message:String(Ze);return m("Expression",`Error evaluating: {{ ${q} }}: ${Ye}`,t,e,G,I)}}),v.length>0)o=o.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(I,P)=>v[Number(P)]??I);if(c.length>0)o=o.replace(/<!--__STX_STYLE_(\d+)__-->/g,(I,P)=>c[Number(P)]??I);return o}function pu(e,i,t){if(!i.trim())return e;let o=e,a=i.trim();while(a.length>0){let h=a.match(/^(\w+)/);if(!h)break;let c=h[1];a=a.substring(c.length).trim();let v=Zt[c]||ws[c];if(!v)throw Error(`Filter not found: ${c}. Available filters: ${Object.keys(lu()).join(", ")}`);let E=[];if(a.startsWith(":")){let R=a.match(/^:([^|\s]+)/);if(R){let C=R[1].trim();try{let O=Number(C);E=[Number.isNaN(O)?C:O]}catch{E=[C]}a=a.substring(R[0].length).trim()}}else if(a.startsWith("(")){let R=1,C=1;while(R>0&&C<a.length){if(a[C]==="(")R++;if(a[C]===")")R--;C++}if(R===0){let O=a.substring(1,C-1).trim();if(O)try{if(O.startsWith("{")&&O.endsWith("}"))E=[_(`(${O})`,t,!0)];else{let M=[],N="",I=null,P=0,G=0,q=0,Z=!1;for(let Q=0;Q<O.length;Q++){let te=O[Q];if(Z){N+=te,Z=!1;continue}if(te==="\\"){N+=te,Z=!0;continue}if(I){if(N+=te,te===I)I=null;continue}if(te==='"'||te==="'"||te==="`"){I=te,N+=te;continue}if(te==="(")P++;else if(te===")")P--;else if(te==="[")G++;else if(te==="]")G--;else if(te==="{")q++;else if(te==="}")q--;if(te===","&&P===0&&G===0&&q===0){M.push(N),N="";continue}N+=te}if(N)M.push(N);E=M.map((Q)=>{let te=Q.trim();return _(te,t,!0)})}}catch{E=[O]}a=a.substring(C).trim()}}try{o=v(o,t,...E)}catch(R){let C=R instanceof Error?R.message:String(R);throw Error(`Error applying filter '${c}': ${C}`)}if(a.startsWith("|"))a=a.substring(1).trim();else break}return o}function lc(e){let i=!1,t="",o=0,a=0,h=0,c=!1;for(let v=0;v<e.length;v++){let E=e[v],R=e[v+1];if(i&&c){c=!1;continue}if(i&&E==="\\"){c=!0;continue}if(c=!1,(E==='"'||E==="'"||E==="`")&&!c){if(!i)i=!0,t=E;else if(E===t)i=!1,t="";continue}if(i&&t==="`"&&E==="$"&&R==="{"){let C=1;v+=2;while(v<e.length&&C>0){if(e[v]==="{")C++;else if(e[v]==="}")C--;if(C>0)v++}continue}if(i)continue;if(E==="(")o++;else if(E===")")o--;else if(E==="[")a++;else if(E==="]")a--;else if(E==="{")h++;else if(E==="}")h--;if(E==="|"&&o===0&&a===0&&h===0){if(R==="|"){v++;continue}if(R==="="){v++;continue}return v}}return-1}var Kt=new Set,uc=1000;function jp(){Kt.clear()}function Ps(e,i,t,o){if(!W())return;let a=`${t}\x00${e.expression}`;if(Kt.has(a))return;if(Kt.size>=uc)Kt.clear();Kt.add(a);let h=t,c=o;try{if(t&&Qr.existsSync(t))c=Qr.readFileSync(t,"utf8")}catch{}let v=c.indexOf(i);if(v>=0)h=`${t}:${c.slice(0,v).split(`
228
+ `).length}`;console.warn(`${h}: stx warning: ${i} rendered as an empty string. The safe evaluator rejected \`${e.expression}\` (${e.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function _(e,i,t=!1,o){try{let a=e.trim(),h=lc(a);if(h>0){let v=a.substring(0,h).trim(),E=a.substring(h+1).trim(),R=_(v,i,!0,o);return pu(R,E,i)}let c=Ss(a);if(c!==null){o?.({expression:a,rule:c});return}try{let v=Object.keys(i),E=Object.values(i);return u(a,v)(...E)}catch{return l(a,i)}}catch(a){if(a instanceof ReferenceError){let h=/(\b\w+)\s+is not defined/.exec(a.message);if(h){let c=h[1],v=fc(c,Object.keys(i));if(v&&v!==c)a.message=`${a.message} \u2014 did you mean '${v}'?`}}if(!t)console.error(`Error evaluating expression: ${e}`,a);throw a}}function fc(e,i){let t=null;for(let a of i){if(a===e)continue;let h=gc(e,a);if(t===null||h<t.dist)t={key:a,dist:h}}if(!t)return null;let o=Math.max(e.length,t.key.length);if(t.dist<=2||t.dist/o<=0.35)return t.key;return null}function gc(e,i){if(e===i)return 0;if(e.length===0)return i.length;if(i.length===0)return e.length;let[t,o]=e.length<i.length?[e,i]:[i,e],a=Array(t.length+1),h=Array(t.length+1);for(let c=0;c<=t.length;c++)a[c]=c;for(let c=1;c<=o.length;c++){h[0]=c;for(let v=1;v<=t.length;v++){let E=t[v-1]===o[c-1]?0:1;h[v]=Math.min(h[v-1]+1,a[v]+1,a[v-1]+E)}for(let v=0;v<=t.length;v++)a[v]=h[v]}return a[t.length]}function Bp(e){if(!e)return"";return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import mc from"process";function k(e="STX_PUBLIC_"){let i={},t={};for(let[o,a]of Object.entries(mc.env)){if(!o.startsWith(e)||a===void 0)continue;i[`import.meta.env.${o}`]=JSON.stringify(a),t[o]=a}return i["import.meta.env"]=JSON.stringify(t),i}function ai(e,i=""){let t=`${e}${i}`,o=0;for(let a=0;a<t.length;a++){let h=t.charCodeAt(a);o=(o<<5)-o+h,o=o&o}return`stx-${Math.abs(o).toString(36)}`}function ci(e,i,t={}){let{prefix:o="",preserveHost:a=!0,scopeKeyframes:h=!0,scopeCustomProperties:c=!1}=t;if(!e.trim())return"";let v=Ms(e),E=[],R=new Map;if(h)for(let C of v){let O=C.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(O){let M=O[1],N=`${i}_${M}`;R.set(M,N)}}for(let C of v){let O=li(C,i,o,a,R,c);E.push(O)}return E.join(`
229
229
 
230
230
  `)}function Ms(e){let i=[],t=e.replace(/\/\*[\s\S]*?\*\//g,""),o=0,a="",h=!1,c="";for(let v=0;v<t.length;v++){let E=t[v];if(E==="@"&&o===0)h=!0;if(E==="{")o++;else if(E==="}"){if(o--,o===0){if(h){c+=E;let R=c.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(R){let[,C,O,M]=R;if(C==="keyframes")i.push({selector:`@keyframes ${O.trim()}`,declarations:M.trim()});else if(C==="media"||C==="supports"||C==="container"){let N=Ms(M);i.push({selector:`@${C} ${O.trim()}`,declarations:N.map((I)=>`${I.selector} { ${I.declarations} }`).join(`
231
231
  `)})}else i.push({selector:`@${C} ${O.trim()}`,declarations:M.trim()})}c="",h=!1}else if(a.trim()){a+=E;let R=a.match(/([^{]+)\{([^}]*)\}/);if(R)i.push({selector:R[1].trim(),declarations:R[2].trim()});a=""}continue}}if(h)c+=E;else a+=E}return i}function li(e,i,t,o,a,h){let{selector:c,declarations:v}=e;if(c.startsWith("@")){if(c.startsWith("@keyframes")){let C=c.replace("@keyframes ","").trim();return`@keyframes ${a.get(C)||C} { ${v} }`}if(c.startsWith("@media")||c.startsWith("@supports")||c.startsWith("@container")){let O=Ms(`x { ${v} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((M)=>li(M,i,t,o,a,h)).join(`
232
232
  `);return`${c} {
233
233
  ${O}
234
- }`}return`${c} { ${v} }`}let E=mc(c,i,t,o),R=v;for(let[C,O]of a)R=R.replace(new RegExp(`\\b${C}\\b`,"g"),O);if(h)R=R.replace(/--([a-z-]+)/gi,`--${i}-$1`);return`${E} { ${R} }`}function mc(e,i,t,o){let a=e.split(",").map((c)=>c.trim()),h=[];for(let c of a){if(c.startsWith(":host")){if(o)h.push(c);else{let R=c.replace(/:host(\([^)]*\))?/,`.${i}$1`);h.push(R)}continue}if(c.includes("::slotted")){h.push(c);continue}if(c===":root"){h.push(`:root .${i}`);continue}let v=t?`${t} .${i}`:`.${i}`;h.push(`${v} ${c}`);let E=hc(c,i);if(E)h.push(t?`${t} ${E}`:E)}return h.join(", ")}function hc(e,i){let t=0,o=e.length;for(let E=0;E<e.length;E++){let R=e[E];if(R==="["||R==="(")t++;else if(R==="]"||R===")")t--;else if(t===0&&(R===" "||R===">"||R==="+"||R==="~")){o=E;break}}let a=e.slice(0,o),h=e.slice(o);if(!a)return"";let c=a.length,v=0;for(let E=0;E<a.length;E++){let R=a[E];if(R==="["||R==="(")v++;else if(R==="]"||R===")")v--;else if(t===0&&v===0&&R===":"){c=E;break}}return`${a.slice(0,c)}.${i}${a.slice(c)}${h}`}var pi=String.raw`(?<![\w-])scoped(?![\w-])`,Ds=/<style\s+([^>]*)>/gi,ui=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,di=new RegExp(pi,"i"),xc=new RegExp(pi,"gi"),js=/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi;function bc(e){Ds.lastIndex=0;let i=Ds.exec(e);while(i!==null){if(di.test(i[1]))return!0;i=Ds.exec(e)}return!1}function Io(e){let i=new Set,t=[];js.lastIndex=0;let o=js.exec(e);while(o!==null){let a=o[0].trim();if(i.has(a))t.push({start:o.index,end:o.index+o[0].length});else i.add(a);o=js.exec(e)}return t}function ln(e){let i=Io(e);if(i.length===0)return e;let t=Array(i.length+1),o=0;for(let a=0;a<i.length;a++){let h=i[a];t[a]=e.slice(o,h.start),o=h.end}return t[i.length]=e.slice(o),t.join("")}function gs(e,i){if(!bc(e))return{html:e,hasScoped:!1};let t=ai(i),o=`data-v-${t}`,a=e,h=!1;if(ui.lastIndex=0,a=a.replace(ui,(c,v,E)=>{if(!di.test(v))return c;h=!0;let R=yc(E,o),C=v.replace(xc,"").trim(),O=C?` ${C}`:"";return`<style data-stx-scoped="${t}"${O}>${R}</style>`}),!h)return{html:e,hasScoped:!1};return a=wc(a,o),{html:a,hasScoped:!0}}function yc(e,i){return ci(e,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${i}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${i}]`)}var _c=(e)=>`\x00stx-scope-mask-${e}\x00`,fi=/\u0000stx-scope-mask-(\d+)\u0000/g;function wc(e,i){let t=de(e,(a,h)=>{let c=F(a,h);return c>h?c:cn(a,h)},(a,h)=>_c(h)),o=Sc(t.output,i);return fi.lastIndex=0,o.replace(fi,(a,h)=>t.tokens[Number(h)])}function Sc(e,i){let t=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return e.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(o,a,h)=>{if(t.has(a.toLowerCase()))return o;if(o.includes(i))return o;if(a.toLowerCase()==="style"||a.toLowerCase()==="script")return o;if(h)return o.replace(`<${a}${h}`,`<${a} ${i}${h}`);if(o.endsWith("/>"))return`<${a} ${i} />`;return`<${a} ${i}>`})}var Xt=/<\/?template\b[^>]*>/gi,$c=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function vc(e){let i=e.replace(/^<template\b/i,"").replace(/>$/,"");return $c.test(i)}function ue(e){Xt.lastIndex=0;let i;while((i=Xt.exec(e))!==null){if(i[0].startsWith("</")||vc(i[0]))continue;let t=i.index,o=Xt.lastIndex,a=1,h;while((h=Xt.exec(e))!==null)if(h[0].startsWith("</")){if(a--,a===0){let c=h.index;return{start:t,openEnd:o,closeStart:c,end:Xt.lastIndex,content:e.slice(o,c)}}}else a++;return null}return null}function hs(e,i){let t=e,o=/@json\s*\(/g,a;while((a=o.exec(t))!==null){let h=a.index,c=h+a[0].length-1,v=1,E=c+1,R=null,C=!1;while(E<t.length&&v>0){let Y=t[E];if(C){C=!1,E++;continue}if(Y==="\\"&&R){C=!0,E++;continue}if(R){if(Y===R)R=null;E++;continue}if(Y==='"'||Y==="'"||Y==="`"){R=Y,E++;continue}if(Y==="(")v++;else if(Y===")"){if(v--,v===0)break}E++}if(v!==0)break;let O=t.substring(c+1,E).trim(),M=t.substring(h,E+1),N=-1,I=0,P=null,q=!1;for(let Y=0;Y<O.length;Y++){let ee=O[Y];if(q){q=!1;continue}if(ee==="\\"&&P){q=!0;continue}if(P){if(ee===P)P=null;continue}if(ee==='"'||ee==="'"||ee==="`"){P=ee;continue}if(ee==="("||ee==="["||ee==="{")I++;else if(ee===")"||ee==="]"||ee==="}")I--;if(ee===","&&I===0){N=Y;break}}let Z=N>=0?O.substring(0,N).trim():O,W=N>=0?O.substring(N+1).trim():void 0;try{let Y=Z.trim(),ee;if(p(Y))ee=u(Y,Object.keys(i))(...Object.values(i));else ee=void 0;let te;if(W==="true")te=JSON.stringify(ee,null,2);else te=JSON.stringify(ee);let ae=te.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");t=t.substring(0,h)+ae+t.substring(E+1),o.lastIndex=h+ae.length}catch(Y){D.log(Y instanceof Error?Y:Error(String(Y)),{directive:"@json"},"error"),o.lastIndex=h+M.length}}return t}function ys(e){return e.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Fa(e){let i=e,t=/@memo\s*\(/g,o,a=[];while((o=t.exec(i))!==null){let h=o.index,c=h+o[0].length,v=1,E=c;while(E<i.length&&v>0){if(i[E]==="(")v++;else if(i[E]===")")v--;E++}if(v!==0)continue;let R=i.slice(c,E-1).trim(),C=E,O=i.slice(C),M=O.indexOf("@endmemo");if(M===-1)continue;let N=O.slice(0,M),I=C+M+8,P=N.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),q=P?P[0].length:0,Z=N.slice(q),W=N.match(/(\s*)$/),Y=W?W[0].length:0,ee=Z.slice(0,Z.length-Y),te=ee.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),ae;if(te){let[me,ke,Re="",Ve]=te,Te=`<${ke}${Re} data-stx-memo="${R}"${Ve}>`;ae=N.slice(0,q)+Te+ee.slice(me.length)+N.slice(q+ee.length)}else ae=`${N.slice(0,q)}<div data-stx-memo="${R}">${ee}</div>${N.slice(q+ee.length)}`;a.push({start:h,end:I,replacement:ae}),t.lastIndex=I}for(let h=a.length-1;h>=0;h--){let c=a[h];i=i.slice(0,c.start)+c.replacement+i.slice(c.end)}return i.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function Oo(e){let i=e.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return i=i.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),i}function xi(e,i){if(!/\bref\s*=/.test(e))return e;let t=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,o=se(e,(E,R)=>{t.lastIndex=R;let C=t.exec(E);if(!C||/^(?:script|style)$/i.test(C[1]))return-1;return t.lastIndex}),a=[],h=0,c=0,v=[];for(let{start:E,end:R,token:C}of o){let O=/^<\/?([\w-]+)/.exec(C)[1].toLowerCase();if(C.startsWith("</")){let N;while(N=a.pop()){if(N.scoped)h--;if(N.name===O)break}continue}let M=/\sdata-stx-scope\s*=/.test(C);if(!h&&!M&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(C)&&!/\sdata-stx-ref-caller\s*=/.test(C))v.push(e.slice(c,E),C.replace(/\s*\/?>$/,(N)=>` data-stx-ref-caller="${i}"${N}`)),c=R;if(!bi.has(O)&&!/\/>$/.test(C)){if(a.push({name:O,scoped:M}),M)h++}}return v.push(e.slice(c)),v.join("")}var bi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),yi=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,gi=/<\/?\s*([a-z][\w-]*)/iy,Ec=/\s/;function kc(e,i){let t=i-1;while(t>=0&&Ec.test(e[t]))t--;return t>=0&&e[t]==="/"}function Rc(e,i){let t=!1,o=!1;for(let a=i;a<e.length;a++){let h=e[a];if(t){if(h==="'")t=!1}else if(o){if(h==='"')o=!1}else if(h==="'")t=!0;else if(h==='"')o=!0;else if(h===">")return a}return-1}function Cc(e,i){if(e.indexOf("{",i)===-1||e.indexOf("}",i)===-1)return!1;let t=0,o=i,a=!1,h=!1,c=!1;while(o<e.length){let v=e.indexOf("<",o),E=v===-1?e.length:v;if(E>o){if(t===0)while(o<E){let O=e.indexOf(h?"}":"{",o);if(O===-1||O>=E){if(h)c=!1;else a=!1;break}if(O>o)if(h)c=!1;else a=!1;if(h){if(c)return!0;c=!0}else if(a)h=!0,c=!1;else a=!0;o=O+1}o=E;continue}if(e.startsWith("<!--",o)){let O=e.indexOf("-->",o);o=O===-1?e.length:O+3;continue}let R=Rc(e,o);if(R===-1)break;gi.lastIndex=o;let C=gi.exec(e)?.[1]?.toLowerCase()??"";if(e[o+1]==="/"){if(t===0)break;t--}else if(!kc(e,R)&&!bi.has(C))t++;o=R+1}return!1}var mi=b(256);function za(e){if(e.length<1024)return hi(e);let i=w(e),t=mi.get(i);if(t!==void 0)return t;let o=hi(e);return mi.set(i,o),o}function hi(e){if(e.length>=32768&&!Jr(e))return e;let t=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),o="",a=0,h;while((h=t.exec(e))!==null){let c=h.index,v=c+h[0].length,E=!1,R=!1,C=-1;while(v<e.length){let M=e[v];if(E){if(M==="'")E=!1}else if(R){if(M==='"')R=!1}else if(M==="'")E=!0;else if(M==='"')R=!0;else if(M===">"){C=v;break}v++}if(C===-1)continue;let O=e.slice(c,C+1);if(yi.test(O))continue;if(O.includes("x-cloak"))continue;if(Cc(e,C+1))o+=e.slice(a,C)+" x-cloak>",a=C+1}return o+=e.slice(a),o}var Tc=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,Ac=/<\/script>/gi,Ic=/<\/style>/gi;function Ha(e){let i=/<[a-z][\w-]*/gi,t="",o=0,a;while((a=i.exec(e))!==null){let h=a.index,c=a[0].slice(1).toLowerCase();if(c==="script"||c==="style"){let I=c==="script"?Ac:Ic;I.lastIndex=h;let P=I.exec(e);if(P!==null)i.lastIndex=P.index+P[0].length;continue}let v=h+a[0].length,E=!1,R=!1,C=-1;while(v<e.length){let I=e[v];if(E){if(I==="'")E=!1}else if(R){if(I==='"')R=!1}else if(I==="'")E=!0;else if(I==='"')R=!0;else if(I===">"){C=v;break}v++}if(C===-1)continue;let O=e.slice(h+a[0].length,C);if(yi.test(O))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(O))continue;if(!Tc.test(O))continue;let M=e[C-1]==="/",N=M?C-1:C;t+=`${e.slice(o,N)} x-cloak${M?" ":""}`,o=N}return t+=e.slice(o),t}import Oi from"path";import Ls from"fs";import Jt from"path";function _i(e,i,t,o){let a=0;for(let h=i;h<e.length;h++)if(e[h]===t)a++;else if(e[h]===o&&!(o===">"&&e[h-1]==="=")){if(--a===0)return h}return-1}function Oc(e){let i=r(e),t=0,o=0,a=[];for(let h=0;h<i.length;h++)if("([{".includes(i[h]))t++;else if(")]}".includes(i[h]))t--;else if(i[h]===","&&t===0)a.push(e.slice(o,h).trim()),o=h+1;return a.push(e.slice(o).trim()),a}function Ns(e,i){let t=r(e),o=new RegExp(`\\b(?:${i.map((a)=>a.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let a of t.matchAll(o)){let h=a.index+a[0].length,c="";if(t[h]==="<"){let E=_i(t,h,"<",">");if(E<0)continue;c=e.slice(h+1,E),h=E+1;while(/\s/.test(t[h]||"")&&h<t.length)h++}if(t[h]!=="(")continue;let v=_i(t,h,"(",")");if(v>=0)return{type:c,args:Oc(e.slice(h+1,v))}}return null}var wi=`
234
+ }`}return`${c} { ${v} }`}let E=hc(c,i,t,o),R=v;for(let[C,O]of a)R=R.replace(new RegExp(`\\b${C}\\b`,"g"),O);if(h)R=R.replace(/--([a-z-]+)/gi,`--${i}-$1`);return`${E} { ${R} }`}function hc(e,i,t,o){let a=e.split(",").map((c)=>c.trim()),h=[];for(let c of a){if(c.startsWith(":host")){if(o)h.push(c);else{let R=c.replace(/:host(\([^)]*\))?/,`.${i}$1`);h.push(R)}continue}if(c.includes("::slotted")){h.push(c);continue}if(c===":root"){h.push(`:root .${i}`);continue}let v=t?`${t} .${i}`:`.${i}`;h.push(`${v} ${c}`);let E=xc(c,i);if(E)h.push(t?`${t} ${E}`:E)}return h.join(", ")}function xc(e,i){let t=0,o=e.length;for(let E=0;E<e.length;E++){let R=e[E];if(R==="["||R==="(")t++;else if(R==="]"||R===")")t--;else if(t===0&&(R===" "||R===">"||R==="+"||R==="~")){o=E;break}}let a=e.slice(0,o),h=e.slice(o);if(!a)return"";let c=a.length,v=0;for(let E=0;E<a.length;E++){let R=a[E];if(R==="["||R==="(")v++;else if(R==="]"||R===")")v--;else if(t===0&&v===0&&R===":"){c=E;break}}return`${a.slice(0,c)}.${i}${a.slice(c)}${h}`}var pi=String.raw`(?<![\w-])scoped(?![\w-])`,Ds=/<style\s+([^>]*)>/gi,ui=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,di=new RegExp(pi,"i"),bc=new RegExp(pi,"gi"),js=/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi;function yc(e){Ds.lastIndex=0;let i=Ds.exec(e);while(i!==null){if(di.test(i[1]))return!0;i=Ds.exec(e)}return!1}function No(e){let i=new Set,t=[];js.lastIndex=0;let o=js.exec(e);while(o!==null){let a=o[0].trim();if(i.has(a))t.push({start:o.index,end:o.index+o[0].length});else i.add(a);o=js.exec(e)}return t}function ln(e){let i=No(e);if(i.length===0)return e;let t=Array(i.length+1),o=0;for(let a=0;a<i.length;a++){let h=i[a];t[a]=e.slice(o,h.start),o=h.end}return t[i.length]=e.slice(o),t.join("")}function ms(e,i){if(!yc(e))return{html:e,hasScoped:!1};let t=ai(i),o=`data-v-${t}`,a=e,h=!1;if(ui.lastIndex=0,a=a.replace(ui,(c,v,E)=>{if(!di.test(v))return c;h=!0;let R=_c(E,o),C=v.replace(bc,"").trim(),O=C?` ${C}`:"";return`<style data-stx-scoped="${t}"${O}>${R}</style>`}),!h)return{html:e,hasScoped:!1};return a=Sc(a,o),{html:a,hasScoped:!0}}function _c(e,i){return ci(e,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${i}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${i}]`)}var wc=(e)=>`\x00stx-scope-mask-${e}\x00`,fi=/\u0000stx-scope-mask-(\d+)\u0000/g;function Sc(e,i){let t=de(e,(a,h)=>{let c=F(a,h);return c>h?c:cn(a,h)},(a,h)=>wc(h)),o=$c(t.output,i);return fi.lastIndex=0,o.replace(fi,(a,h)=>t.tokens[Number(h)])}function $c(e,i){let t=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return e.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(o,a,h)=>{if(t.has(a.toLowerCase()))return o;if(o.includes(i))return o;if(a.toLowerCase()==="style"||a.toLowerCase()==="script")return o;if(h)return o.replace(`<${a}${h}`,`<${a} ${i}${h}`);if(o.endsWith("/>"))return`<${a} ${i} />`;return`<${a} ${i}>`})}var qt=/<\/?template\b[^>]*>/gi,vc=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function Ec(e){let i=e.replace(/^<template\b/i,"").replace(/>$/,"");return vc.test(i)}function ue(e){qt.lastIndex=0;let i;while((i=qt.exec(e))!==null){if(i[0].startsWith("</")||Ec(i[0]))continue;let t=i.index,o=qt.lastIndex,a=1,h;while((h=qt.exec(e))!==null)if(h[0].startsWith("</")){if(a--,a===0){let c=h.index;return{start:t,openEnd:o,closeStart:c,end:qt.lastIndex,content:e.slice(o,c)}}}else a++;return null}return null}function ys(e,i){let t=e,o=/@json\s*\(/g,a;while((a=o.exec(t))!==null){let h=a.index,c=h+a[0].length-1,v=1,E=c+1,R=null,C=!1;while(E<t.length&&v>0){let Q=t[E];if(C){C=!1,E++;continue}if(Q==="\\"&&R){C=!0,E++;continue}if(R){if(Q===R)R=null;E++;continue}if(Q==='"'||Q==="'"||Q==="`"){R=Q,E++;continue}if(Q==="(")v++;else if(Q===")"){if(v--,v===0)break}E++}if(v!==0)break;let O=t.substring(c+1,E).trim(),M=t.substring(h,E+1),N=-1,I=0,P=null,G=!1;for(let Q=0;Q<O.length;Q++){let te=O[Q];if(G){G=!1;continue}if(te==="\\"&&P){G=!0;continue}if(P){if(te===P)P=null;continue}if(te==='"'||te==="'"||te==="`"){P=te;continue}if(te==="("||te==="["||te==="{")I++;else if(te===")"||te==="]"||te==="}")I--;if(te===","&&I===0){N=Q;break}}let q=N>=0?O.substring(0,N).trim():O,Z=N>=0?O.substring(N+1).trim():void 0;try{let Q=q.trim(),te;if(p(Q))te=u(Q,Object.keys(i))(...Object.values(i));else te=void 0;let ne;if(Z==="true")ne=JSON.stringify(te,null,2);else ne=JSON.stringify(te);let ae=ne.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");t=t.substring(0,h)+ae+t.substring(E+1),o.lastIndex=h+ae.length}catch(Q){D.log(Q instanceof Error?Q:Error(String(Q)),{directive:"@json"},"error"),o.lastIndex=h+M.length}}return t}function bs(e){return e.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Ha(e){let i=e,t=/@memo\s*\(/g,o,a=[];while((o=t.exec(i))!==null){let h=o.index,c=h+o[0].length,v=1,E=c;while(E<i.length&&v>0){if(i[E]==="(")v++;else if(i[E]===")")v--;E++}if(v!==0)continue;let R=i.slice(c,E-1).trim(),C=E,O=i.slice(C),M=O.indexOf("@endmemo");if(M===-1)continue;let N=O.slice(0,M),I=C+M+8,P=N.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),G=P?P[0].length:0,q=N.slice(G),Z=N.match(/(\s*)$/),Q=Z?Z[0].length:0,te=q.slice(0,q.length-Q),ne=te.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),ae;if(ne){let[me,ke,Re="",Ue]=ne,We=`<${ke}${Re} data-stx-memo="${R}"${Ue}>`;ae=N.slice(0,G)+We+te.slice(me.length)+N.slice(G+te.length)}else ae=`${N.slice(0,G)}<div data-stx-memo="${R}">${te}</div>${N.slice(G+te.length)}`;a.push({start:h,end:I,replacement:ae}),t.lastIndex=I}for(let h=a.length-1;h>=0;h--){let c=a[h];i=i.slice(0,c.start)+c.replacement+i.slice(c.end)}return i.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function Do(e){let i=e.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return i=i.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),i}function xi(e,i){if(!/\bref\s*=/.test(e))return e;let t=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,o=z(e,(E,R)=>{t.lastIndex=R;let C=t.exec(E);if(!C||/^(?:script|style)$/i.test(C[1]))return-1;return t.lastIndex}),a=[],h=0,c=0,v=[];for(let{start:E,end:R,token:C}of o){let O=/^<\/?([\w-]+)/.exec(C)[1].toLowerCase();if(C.startsWith("</")){let N;while(N=a.pop()){if(N.scoped)h--;if(N.name===O)break}continue}let M=/\sdata-stx-scope\s*=/.test(C);if(!h&&!M&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(C)&&!/\sdata-stx-ref-caller\s*=/.test(C))v.push(e.slice(c,E),C.replace(/\s*\/?>$/,(N)=>` data-stx-ref-caller="${i}"${N}`)),c=R;if(!bi.has(O)&&!/\/>$/.test(C)){if(a.push({name:O,scoped:M}),M)h++}}return v.push(e.slice(c)),v.join("")}var bi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),yi=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,gi=/<\/?\s*([a-z][\w-]*)/iy,kc=/\s/;function Rc(e,i){let t=i-1;while(t>=0&&kc.test(e[t]))t--;return t>=0&&e[t]==="/"}function Cc(e,i){let t=!1,o=!1;for(let a=i;a<e.length;a++){let h=e[a];if(t){if(h==="'")t=!1}else if(o){if(h==='"')o=!1}else if(h==="'")t=!0;else if(h==='"')o=!0;else if(h===">")return a}return-1}function Tc(e,i){if(e.indexOf("{",i)===-1||e.indexOf("}",i)===-1)return!1;let t=0,o=i,a=!1,h=!1,c=!1;while(o<e.length){let v=e.indexOf("<",o),E=v===-1?e.length:v;if(E>o){if(t===0)while(o<E){let O=e.indexOf(h?"}":"{",o);if(O===-1||O>=E){if(h)c=!1;else a=!1;break}if(O>o)if(h)c=!1;else a=!1;if(h){if(c)return!0;c=!0}else if(a)h=!0,c=!1;else a=!0;o=O+1}o=E;continue}if(e.startsWith("<!--",o)){let O=e.indexOf("-->",o);o=O===-1?e.length:O+3;continue}let R=Cc(e,o);if(R===-1)break;gi.lastIndex=o;let C=gi.exec(e)?.[1]?.toLowerCase()??"";if(e[o+1]==="/"){if(t===0)break;t--}else if(!Rc(e,R)&&!bi.has(C))t++;o=R+1}return!1}var mi=b(256);function Va(e){if(e.length<1024)return hi(e);let i=w(e),t=mi.get(i);if(t!==void 0)return t;let o=hi(e);return mi.set(i,o),o}function hi(e){if(e.length>=32768&&!Wr(e))return e;let t=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),o="",a=0,h;while((h=t.exec(e))!==null){let c=h.index,v=c+h[0].length,E=!1,R=!1,C=-1;while(v<e.length){let M=e[v];if(E){if(M==="'")E=!1}else if(R){if(M==='"')R=!1}else if(M==="'")E=!0;else if(M==='"')R=!0;else if(M===">"){C=v;break}v++}if(C===-1)continue;let O=e.slice(c,C+1);if(yi.test(O))continue;if(O.includes("x-cloak"))continue;if(Tc(e,C+1))o+=e.slice(a,C)+" x-cloak>",a=C+1}return o+=e.slice(a),o}var Ac=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,Ic=/<\/script>/gi,Oc=/<\/style>/gi;function Ua(e){let i=/<[a-z][\w-]*/gi,t="",o=0,a;while((a=i.exec(e))!==null){let h=a.index,c=a[0].slice(1).toLowerCase();if(c==="script"||c==="style"){let I=c==="script"?Ic:Oc;I.lastIndex=h;let P=I.exec(e);if(P!==null)i.lastIndex=P.index+P[0].length;continue}let v=h+a[0].length,E=!1,R=!1,C=-1;while(v<e.length){let I=e[v];if(E){if(I==="'")E=!1}else if(R){if(I==='"')R=!1}else if(I==="'")E=!0;else if(I==='"')R=!0;else if(I===">"){C=v;break}v++}if(C===-1)continue;let O=e.slice(h+a[0].length,C);if(yi.test(O))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(O))continue;if(!Ac.test(O))continue;let M=e[C-1]==="/",N=M?C-1:C;t+=`${e.slice(o,N)} x-cloak${M?" ":""}`,o=N}return t+=e.slice(o),t}import Oi from"path";import Ls from"fs";import Xt from"path";function _i(e,i,t,o){let a=0;for(let h=i;h<e.length;h++)if(e[h]===t)a++;else if(e[h]===o&&!(o===">"&&e[h-1]==="=")){if(--a===0)return h}return-1}function Pc(e){let i=r(e),t=0,o=0,a=[];for(let h=0;h<i.length;h++)if("([{".includes(i[h]))t++;else if(")]}".includes(i[h]))t--;else if(i[h]===","&&t===0)a.push(e.slice(o,h).trim()),o=h+1;return a.push(e.slice(o).trim()),a}function Ns(e,i){let t=r(e),o=new RegExp(`\\b(?:${i.map((a)=>a.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let a of t.matchAll(o)){let h=a.index+a[0].length,c="";if(t[h]==="<"){let E=_i(t,h,"<",">");if(E<0)continue;c=e.slice(h+1,E),h=E+1;while(/\s/.test(t[h]||"")&&h<t.length)h++}if(t[h]!=="(")continue;let v=_i(t,h,"(",")");if(v>=0)return{type:c,args:Pc(e.slice(h+1,v))}}return null}var wi=`
235
235
  type __StxCtor<T> = T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? unknown[] : T extends ObjectConstructor ? object : T extends readonly unknown[] ? __StxCtor<T[number]> : T extends abstract new (...args: any[]) => infer V ? V : unknown;
236
236
  type __StxWiden<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
237
237
  type __StxOption<T> = T extends { type: infer C } ? __StxCtor<C> : T extends { default: infer D } ? D extends (...args: any[]) => infer V ? V : __StxWiden<D> : __StxCtor<T>;
@@ -239,68 +239,68 @@ type __StxRequired<O> = { [K in keyof O]-?: O[K] extends { required: true } ? K
239
239
  type __StxDefaulted<O> = { [K in keyof O]-?: O[K] extends { default: unknown } ? K : never }[keyof O];
240
240
  type __StxOptions<O> = { [K in Exclude<__StxRequired<O>, __StxDefaulted<O>>]: __StxOption<O[K]> } & { [K in Exclude<keyof O, Exclude<__StxRequired<O>, __StxDefaulted<O>>>]?: __StxOption<O[K]> };
241
241
  type __StxDefaults<P, K> = Omit<P, Extract<keyof P, K>> & Partial<Pick<P, Extract<keyof P, K>>>;
242
- `;function Si(e,i){let t=[],o={defineProps:["defineProps"],defineEmits:["defineEmits"],withDefaults:["withDefaults"]},a=r(e),h=e.replace(/\bimport\s+(?:type\s+)?(\{[^}]*\}|\*\s+as\s+[\w$]+|[\w$]+)\s+from\s*(['"])([^'"]+)\2\s*;?/g,(M,N,I,P,q)=>{if(a.slice(q,q+6)!=="import")return M;if(P.endsWith(".stx"))return"";let Z=`${i}Import${t.length}`;if(t.push(`import * as ${Z} from ${JSON.stringify(P)};`),N.startsWith("*"))return`import ${N.replace(/^\*\s+as\s+/,"")} = ${Z};`;if(!N.startsWith("{"))return`import ${N} = ${Z}.default;`;return N.slice(1,-1).split(",").map((W)=>{let[Y,ee=Y]=W.trim().replace(/^type\s+/,"").split(/\s+as\s+/);if(!Y)return"";if(/^(?:stx|@stacksjs\/stx)(?:\/|$)/.test(P)&&Y in o)o[Y].push(ee);return`import ${ee} = ${Z}.${Y};`}).join(`
242
+ `;function Si(e,i){let t=[],o={defineProps:["defineProps"],defineEmits:["defineEmits"],withDefaults:["withDefaults"]},a=r(e),h=e.replace(/\bimport\s+(?:type\s+)?(\{[^}]*\}|\*\s+as\s+[\w$]+|[\w$]+)\s+from\s*(['"])([^'"]+)\2\s*;?/g,(M,N,I,P,G)=>{if(a.slice(G,G+6)!=="import")return M;if(P.endsWith(".stx"))return"";let q=`${i}Import${t.length}`;if(t.push(`import * as ${q} from ${JSON.stringify(P)};`),N.startsWith("*"))return`import ${N.replace(/^\*\s+as\s+/,"")} = ${q};`;if(!N.startsWith("{"))return`import ${N} = ${q}.default;`;return N.slice(1,-1).split(",").map((Z)=>{let[Q,te=Q]=Z.trim().replace(/^type\s+/,"").split(/\s+as\s+/);if(!Q)return"";if(/^(?:stx|@stacksjs\/stx)(?:\/|$)/.test(P)&&Q in o)o[Q].push(te);return`import ${te} = ${q}.${Q};`}).join(`
243
243
  `)}),c=Ns(e,o.defineProps),v=Ns(e,o.defineEmits),E=Ns(e,o.withDefaults);if(!c&&!v)return{declarations:"",props:null,events:null};let R=[],C=null,O=null;if(c){R.push(`const __options = (${c.args[0]||"{}"}) as const;`),R.push(`const __defaults = (${E?.args[1]||"{}"});`);let M=c.type||"__StxOptions<typeof __options>";R.push(`export type __StxProps = __StxDefaults<${M}, keyof typeof __defaults | __StxDefaulted<typeof __options>>;`),C=`${i}.__StxProps`}if(v)R.push(`const __events = (${v.args[0]||"[]"}) as const;`),R.push(`export type __StxEvents = ${v.type||"Record<(typeof __events)[number], any[]>"};`),O=`${i}.__StxEvents`;return{declarations:`${t.join(`
244
244
  `)}
245
245
  namespace ${i} {
246
246
  ${h}
247
247
  ${R.join(`
248
248
  `)}
249
- }`,props:C,events:O}}var lr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function ur(e){if(e.includes("-")||e==="component")return!1;if(/^[A-Z]/.test(e))return!/[a-z]/.test(e)&&[...lr].some((i)=>i.toLowerCase()===e.toLowerCase());return lr.has(e)||/[A-Z]/.test(e)}function*Pc(e){let i=/<([A-Za-z][\w.-]*)(?=[\s/>])/g,t;while(t=i.exec(e)){let o=i.lastIndex,a=[];while(o<e.length){while(/\s/.test(e[o]||""))o++;if(e[o]===">"||e.slice(o,o+2)==="/>"){o+=e[o]===">"?1:2;break}let h=/^[^\s=/>]+/.exec(e.slice(o))?.[0];if(!h){o++;continue}let c=o;o+=h.length;while(/\s/.test(e[o]||""))o++;if(e[o]!=="="){a.push({name:h,value:!0,offset:c,braced:!1});continue}o++;while(/\s/.test(e[o]||""))o++;let v=e[o],E=v==="{",R=v==='"'||v==="'";if(R||E)o++;let C=o;if(E){let O=r(e.slice(o)),M=1,N=0;for(;N<O.length;N++){if(O[N]==="{")M++;if(O[N]==="}"&&--M===0)break}o+=N}else if(R)while(o<e.length&&e[o]!==v)o++;else while(o<e.length&&!/[\s/>]/.test(e[o]))o++;if(a.push({name:h,value:e.slice(C,o),offset:C,braced:E}),R||E)o++}i.lastIndex=o,yield{name:t[1],offset:t.index,attributes:a}}}function $i(e,i,t){let o=[],a=[wi,"type __StxAssignedValue<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? T extends () => infer V ? V : T : T;","type __StxProp<P, K> = K extends keyof P ? P[K] : unknown;",'type __StxEvent<E, K> = K extends keyof E ? E[K] extends readonly unknown[] ? Exclude<E[K]["length"], 0 | 1> extends never ? E[K][0] : E[K] : E[K] : any;'],h=new Map,c=new Map,v=new Map,E=t.scriptCode(e,t.filePath),R=r(E);for(let I of E.matchAll(/\bimport\s+(\{[^}]+\}|[\w$]+)\s+from\s*['"]([^'"]+)['"]/g)){if(R.slice(I.index,I.index+6)!=="import")continue;let P=I[2],q=Jt.isAbsolute(P)||P.startsWith(".")?Jt.resolve(Jt.dirname(t.filePath),P):cs(P,Jt.dirname(t.filePath));if(!q)continue;let Z=q.endsWith(".stx")?q:Ls.existsSync(`${q}.stx`)?`${q}.stx`:void 0,W=Z?null:as(q,!1),Y=I[1].startsWith("{")?I[1].slice(1,-1).split(","):[I[1]];for(let ee of Y){let[te,ae=te]=ee.trim().split(/\s+as\s+/),me=Z||W?.get(te)||W?.get(te.toLowerCase());if(me)v.set(ae,me),v.set(ae.toLowerCase(),me),v.set(ae.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),me)}}for(let I of i.matchAll(/@import\s*\(([^)]+)\)/g))for(let P of I[1].matchAll(/['"]([^'"]+)['"]/g)){let q=ls(P[1],t.filePath,t).find((Z)=>Ls.statSync(Z,{throwIfNoEntry:!1})?.isFile());if(q)v.set(Jt.basename(P[1]).replace(/\.stx$/,""),q)}let C={__importedComponents:v},O=new Map,M=(I,P,q)=>{let Z=e.slice(0,I);return{code:P,offset:I,attribute:q,anchor:!0,kind:"directive",line:Z.split(`
250
- `).length,column:I-Z.lastIndexOf(`
251
- `)}},N=(I,P,q)=>o.push({expression:I,statement:{text:P+I.code+q,prefixLength:P.length}});for(let I of Pc(i)){if(ur(I.name)||I.name==="component")continue;let P=br(I.name,t.filePath,t,C);if(!P)continue;let q=O.get(P);if(!q){let W;try{W=t.readComponent?t.readComponent(P):Ls.readFileSync(P,"utf8")}catch{continue}if(W===void 0)continue;c.set(P,W),q=Si(t.scriptCode(W,P),`__StxComponent${O.size}`),O.set(P,q),a.push(q.declarations)}let Z=[];for(let W of I.attributes){let{name:Y,offset:ee}=W,te=W.value===!0?"true":W.value;if(Y.startsWith("@")||Y.startsWith("v-on:")){if(q.events&&W.value!==!0)h.set(ee,`__StxEvent<${q.events}, ${JSON.stringify(Y.replace(/^@|^v-on:/,"").split(".")[0])}>`);continue}let ae=/^v-model(?::([\w-]+))?(?:\.[\w-]+)*$/.exec(Y);if(Y.startsWith("v-")&&!Y.startsWith("v-bind:")&&!ae)continue;if(/^(?:x-|:)(?:if|for|show|key|else)(?:$|[.:-])/.test(Y))continue;let me=(ae?ae[1]||"modelValue":Y.replace(/^:|^v-bind:/,"")).replace(/-([a-z])/g,(Ve,Te)=>Te.toUpperCase());if(Z.push(me),!q.props)continue;let Re=Y.startsWith(":")||Y.startsWith("v-bind:")||!!ae||W.braced?te:W.value!==!0?JSON.stringify(te):"true";N(M(ee,Re,Y),";void ((",`) satisfies __StxProp<${q.props}, ${JSON.stringify(me)}>);`)}if(q.props){let W=[...new Set(Z)].map((ee)=>`${JSON.stringify(ee)}: undefined as any`).join(", "),Y=M(I.offset,`<${I.name}>`);o.push({expression:Y,statement:{text:`;void ({ ${W} } satisfies ${q.props} & Record<string, unknown>);`,prefixLength:0}})}}return{declarations:O.size?a.join(`
252
- `):"",checks:o,events:h,dependencies:c}}var vi=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function Mc(e){let i=(t)=>t.replace(/[^\n]/g," ");return e.replace(/<!--[\s\S]*?-->/g,i).replace(/\{\{--[\s\S]*?--\}\}/g,i)}function Rt(e){let i=[],t=Mc(e);vi.lastIndex=0;let o;while((o=vi.exec(t))!==null){let a=(o[1]||"").trim(),h=(o[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,c=(o[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,v=o.index+h,E=o.index+o[0].length-c,R=e.slice(v,E);if(/\bsrc\s*=/.test(a))continue;let C=a.match(/\btype\s*=\s*["']([^"']+)["']/i);if(C&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(C[1]))continue;let O=/\bserver\b/.test(a)?"server":/\bclient\b/.test(a)?"client":"plain",M=Gt(e,v);i.push({kind:O,code:R,startLine:M,startColumn:Yt(e,v),offset:v,attrs:a})}return i}function Gt(e,i){let t=1;for(let o=0;o<i&&o<e.length;o++)if(e.charCodeAt(o)===10)t++;return t}function Yt(e,i){let t=e.lastIndexOf(`
249
+ }`,props:C,events:O}}var lr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function ur(e){if(e.includes("-")||e==="component")return!1;if(/^[A-Z]/.test(e))return!/[a-z]/.test(e)&&[...lr].some((i)=>i.toLowerCase()===e.toLowerCase());return lr.has(e)||/[A-Z]/.test(e)}function*Mc(e){let i=/<([A-Za-z][\w.-]*)(?=[\s/>])/g,t;while(t=i.exec(e)){let o=i.lastIndex,a=[];while(o<e.length){while(/\s/.test(e[o]||""))o++;if(e[o]===">"||e.slice(o,o+2)==="/>"){o+=e[o]===">"?1:2;break}let h=/^[^\s=/>]+/.exec(e.slice(o))?.[0];if(!h){o++;continue}let c=o;o+=h.length;while(/\s/.test(e[o]||""))o++;if(e[o]!=="="){a.push({name:h,value:!0,offset:c,braced:!1});continue}o++;while(/\s/.test(e[o]||""))o++;let v=e[o],E=v==="{",R=v==='"'||v==="'";if(R||E)o++;let C=o;if(E){let O=r(e.slice(o)),M=1,N=0;for(;N<O.length;N++){if(O[N]==="{")M++;if(O[N]==="}"&&--M===0)break}o+=N}else if(R)while(o<e.length&&e[o]!==v)o++;else while(o<e.length&&!/[\s/>]/.test(e[o]))o++;if(a.push({name:h,value:e.slice(C,o),offset:C,braced:E}),R||E)o++}i.lastIndex=o,yield{name:t[1],offset:t.index,attributes:a}}}function $i(e,i,t){let o=[],a=[wi,"type __StxAssignedValue<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? T extends () => infer V ? V : T : T;","type __StxProp<P, K> = K extends keyof P ? P[K] : unknown;",'type __StxEvent<E, K> = K extends keyof E ? E[K] extends readonly unknown[] ? Exclude<E[K]["length"], 0 | 1> extends never ? E[K][0] : E[K] : E[K] : any;'],h=new Map,c=new Map,v=new Map,E=t.scriptCode(e,t.filePath),R=r(E);for(let I of E.matchAll(/\bimport\s+(\{[^}]+\}|[\w$]+)\s+from\s*['"]([^'"]+)['"]/g)){if(R.slice(I.index,I.index+6)!=="import")continue;let P=I[2],G=Xt.isAbsolute(P)||P.startsWith(".")?Xt.resolve(Xt.dirname(t.filePath),P):ls(P,Xt.dirname(t.filePath));if(!G)continue;let q=G.endsWith(".stx")?G:Ls.existsSync(`${G}.stx`)?`${G}.stx`:void 0,Z=q?null:cs(G,!1),Q=I[1].startsWith("{")?I[1].slice(1,-1).split(","):[I[1]];for(let te of Q){let[ne,ae=ne]=te.trim().split(/\s+as\s+/),me=q||Z?.get(ne)||Z?.get(ne.toLowerCase());if(me)v.set(ae,me),v.set(ae.toLowerCase(),me),v.set(ae.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),me)}}for(let I of i.matchAll(/@import\s*\(([^)]+)\)/g))for(let P of I[1].matchAll(/['"]([^'"]+)['"]/g)){let G=us(P[1],t.filePath,t).find((q)=>Ls.statSync(q,{throwIfNoEntry:!1})?.isFile());if(G)v.set(Xt.basename(P[1]).replace(/\.stx$/,""),G)}let C={__importedComponents:v},O=new Map,M=(I,P,G)=>{let q=e.slice(0,I);return{code:P,offset:I,attribute:G,anchor:!0,kind:"directive",line:q.split(`
250
+ `).length,column:I-q.lastIndexOf(`
251
+ `)}},N=(I,P,G)=>o.push({expression:I,statement:{text:P+I.code+G,prefixLength:P.length}});for(let I of Mc(i)){if(ur(I.name)||I.name==="component")continue;let P=br(I.name,t.filePath,t,C);if(!P)continue;let G=O.get(P);if(!G){let Z;try{Z=t.readComponent?t.readComponent(P):Ls.readFileSync(P,"utf8")}catch{continue}if(Z===void 0)continue;c.set(P,Z),G=Si(t.scriptCode(Z,P),`__StxComponent${O.size}`),O.set(P,G),a.push(G.declarations)}let q=[];for(let Z of I.attributes){let{name:Q,offset:te}=Z,ne=Z.value===!0?"true":Z.value;if(Q.startsWith("@")||Q.startsWith("v-on:")){if(G.events&&Z.value!==!0)h.set(te,`__StxEvent<${G.events}, ${JSON.stringify(Q.replace(/^@|^v-on:/,"").split(".")[0])}>`);continue}let ae=/^v-model(?::([\w-]+))?(?:\.[\w-]+)*$/.exec(Q);if(Q.startsWith("v-")&&!Q.startsWith("v-bind:")&&!ae)continue;if(/^(?:x-|:)(?:if|for|show|key|else)(?:$|[.:-])/.test(Q))continue;let me=(ae?ae[1]||"modelValue":Q.replace(/^:|^v-bind:/,"")).replace(/-([a-z])/g,(Ue,We)=>We.toUpperCase());if(q.push(me),!G.props)continue;let Re=Q.startsWith(":")||Q.startsWith("v-bind:")||!!ae||Z.braced?ne:Z.value!==!0?JSON.stringify(ne):"true";N(M(te,Re,Q),";void ((",`) satisfies __StxProp<${G.props}, ${JSON.stringify(me)}>);`)}if(G.props){let Z=[...new Set(q)].map((te)=>`${JSON.stringify(te)}: undefined as any`).join(", "),Q=M(I.offset,`<${I.name}>`);o.push({expression:Q,statement:{text:`;void ({ ${Z} } satisfies ${G.props} & Record<string, unknown>);`,prefixLength:0}})}}return{declarations:O.size?a.join(`
252
+ `):"",checks:o,events:h,dependencies:c}}var vi=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function Dc(e){let i=(t)=>t.replace(/[^\n]/g," ");return e.replace(/<!--[\s\S]*?-->/g,i).replace(/\{\{--[\s\S]*?--\}\}/g,i)}function Rt(e){let i=[],t=Dc(e);vi.lastIndex=0;let o;while((o=vi.exec(t))!==null){let a=(o[1]||"").trim(),h=(o[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,c=(o[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,v=o.index+h,E=o.index+o[0].length-c,R=e.slice(v,E);if(/\bsrc\s*=/.test(a))continue;let C=a.match(/\btype\s*=\s*["']([^"']+)["']/i);if(C&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(C[1]))continue;let O=/\bserver\b/.test(a)?"server":/\bclient\b/.test(a)?"client":"plain",M=Jt(e,v);i.push({kind:O,code:R,startLine:M,startColumn:Gt(e,v),offset:v,attrs:a})}return i}function Jt(e,i){let t=1;for(let o=0;o<i&&o<e.length;o++)if(e.charCodeAt(o)===10)t++;return t}function Gt(e,i){let t=e.lastIndexOf(`
253
253
  `,i-1)+1;return i-t+1}function Wn(e){let i=e.split(""),t=(a,h)=>{for(let c=a;c<h&&c<i.length;c++)if(i[c]!==`
254
- `)i[c]=" "},o=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let a of o){a.lastIndex=0;let h;while((h=a.exec(e))!==null)t(h.index,h.index+h[0].length)}return i.join("")}function Dc(e){let i=0,t="";for(let o=0;o<e.length;o++){let a=e[o];if(t){if(a==="\\"){o++;continue}if(a===t)t="";continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{"){i++;continue}if(a===")"||a==="]"||a==="}"){i--;continue}if(a==="|"&&i===0){if(e[o+1]==="|"){o++;continue}if(e[o-1]==="|")continue;return e.slice(0,o)}}return e}var Pi=new Set([":for","x-for","v-for"]),Fn=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,Bs="__stx_interpolated",Ei="__StxElement",Mi="__StxTemplateValue",jc=`type ${Mi}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function ki(e){return e.replace(/\{\{[\s\S]*?\}\}/g,Bs).replace(/\{!![\s\S]*?!!\}/g,Bs)}function $o(e){return e.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(i)=>{let t=i.split(`
254
+ `)i[c]=" "},o=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let a of o){a.lastIndex=0;let h;while((h=a.exec(e))!==null)t(h.index,h.index+h[0].length)}return i.join("")}function jc(e){let i=0,t="";for(let o=0;o<e.length;o++){let a=e[o];if(t){if(a==="\\"){o++;continue}if(a===t)t="";continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{"){i++;continue}if(a===")"||a==="]"||a==="}"){i--;continue}if(a==="|"&&i===0){if(e[o+1]==="|"){o++;continue}if(e[o-1]==="|")continue;return e.slice(0,o)}}return e}var Pi=new Set([":for","x-for","v-for"]),Fn=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,Bs="__stx_interpolated",Ei="__StxElement",Mi="__StxTemplateValue",Nc=`type ${Mi}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function ki(e){return e.replace(/\{\{[\s\S]*?\}\}/g,Bs).replace(/\{!![\s\S]*?!!\}/g,Bs)}function Ao(e){return e.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(i)=>{let t=i.split(`
255
255
  `).length-1,o=i.length-t;return`0${" ".repeat(Math.max(0,o-1))}${`
256
- `.repeat(t)}`})}var Nc=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],Lc=new RegExp(String.raw`^[ \t]*@(?:${Nc.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function Ro(e){return e.replace(Lc,(i)=>i.replace(/[^\n]/g," "))}var Ri=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function Vl(e){let i=Wn(e),t=[],o=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,a;while((a=o.exec(i))!==null){if(a[1]||a[3])continue;let v=a[2]??a[4]??"",E=a[2]!==void 0?2:3,R=Dc(v);if(!R.trim())continue;let C=a.index+E+(R.length-R.trimStart().length);t.push({code:R.trim(),line:Gt(i,C),column:Yt(i,C),offset:C,kind:"interpolation"})}let h=/@(if|elseif|else\s+if|unless)\b\s*\(/g;while((a=h.exec(i))!==null){let c=a.index+a[0].length-1,v=0,E=c;for(;E<i.length;E++){let M=i[E];if(M==="(")v++;else if(M===")"){if(v--,v===0)break}}if(v!==0)continue;let R=i.slice(c+1,E),C=R.trim();if(h.lastIndex=E+1,!C)continue;let O=c+1+(R.length-R.trimStart().length);t.push({code:C,line:Gt(i,O),column:Yt(i,O),offset:a.index,kind:"condition"})}Fn.lastIndex=0;while((a=Fn.exec(i))!==null){let c=a[1],v=a[3]??"",E=c.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(Ri.has(E)||Ri.has(c))continue;if(!v.trim())continue;let R=a.index+a[0].indexOf(a[2],a[0].indexOf(c)+c.length)+1;if(Pi.has(E)){let O=v.match(/\s+(?:in|of)\s+/);if(!O||O.index===void 0)continue;let M=v.slice(O.index+O[0].length),N=O.index+O[0].length+(M.length-M.trimStart().length);t.push({code:ki(M.trim()),line:Gt(i,R+N),column:Yt(i,R+N),offset:R+N,kind:"directive",attribute:E});continue}let C=v.length-v.trimStart().length;t.push({code:ki(v.trim()),line:Gt(i,R+C),column:Yt(i,R+C),offset:R+C,kind:"directive",attribute:E})}return t.sort((c,v)=>c.line-v.line||c.column-v.column),t}var Bc=2000;function zc(e,i){let t=0,o=Math.min(e.length,i+Bc);for(let a=i;a<o;a++){let h=e[a];if(h==="(")t++;else if(h===")"){if(t--,t===0)return e.slice(i+1,a)}}return null}function Wc(e){let i=new Map,t=(v,E)=>{let R=v.split(/[,[\]{}()\s]+/).filter(Boolean);for(let C of R){let O=C.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(O))continue;let M=R.length===1?E:void 0,N=i.get(O);if(!N)i.set(O,{name:O,iterable:M});else if(N.iterable!==M)N.iterable=void 0}},o=/^\$?[A-Z_$][\w$]*$/i,a=(v)=>{let E=v.trim();return o.test(E)?E:void 0};for(let v of e.matchAll(/@for(?:each|else)\s*\(/g)){let E=zc(e,v.index+v[0].length-1);if(E===null)continue;let R=$t(E);if(!R)continue;t(R.itemVar.replace(/=>/g," "),a(R.arrayExpr))}for(let v of e.matchAll(/@for\s*\(\s*(?:(?:let|const|var)\s+)?([\w$]+|\[[^\]]*\]|\{[^}]*\})\s+(of|in)\s+([^)]*)/g))t(v[1],v[2]==="of"?a(v[3]):void 0);for(let v of e.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)\s*[=;]/g))t(v[1]);let h=Wn(e);Fn.lastIndex=0;let c;while((c=Fn.exec(h))!==null){let v=c[1].replace(/\..*$/,"");if(!Pi.has(v))continue;let E=c[3].match(/\s+(?:in|of)\s+/);if(!E||E.index===void 0)continue;t(c[3].slice(0,E.index),a(c[3].slice(E.index+E[0].length)))}for(let v of e.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let E of v[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))t(E[1]);return[...i.values()].sort((v,E)=>v.name.localeCompare(E.name))}function Oe(e){let i=new Set;for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))i.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))i.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))i.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let o of t[1].split(",")){let a=o.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(a))i.add(a)}return[...i].sort()}var zs=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"],Fc={$bool:"declare function $bool(value: unknown, fallback?: boolean): boolean",$num:"declare function $num(value: unknown, fallback?: number): number",$uid:"declare var $uid: string",$native:"declare var $native: boolean"};function Pa(e=new Set){return[...zs.filter((i)=>!e.has(i)).map((i)=>`declare var ${i}: any`),...Object.entries(Fc).filter(([i])=>!e.has(i)).map(([,i])=>i)].join(`
257
- `)}function Ia(e){return new Set([...e.matchAll(/^declare (?:function|const|let|var)\s+([A-Za-z_$][\w$]*)/gm)].map((i)=>i[1]))}function Di(e){let i=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,t,o=!1,a=new Set,h=r(e);while((t=i.exec(h))!==null){o=!0;for(let c of Vc(t[1])){let v=c.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(v))a.add(v)}}return o?[...a]:null}function Vc(e){let i=[],t=0,o="";for(let a of e){if(a===","&&t===0){i.push(o),o="";continue}if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;o+=a}return i.push(o),i.filter((a)=>a.trim().length>0)}function Uc(e){let i=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,t=[],o=e.replace(i,(a)=>(t.push(a.trim()),a.split(`
256
+ `.repeat(t)}`})}var Lc=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],Bc=new RegExp(String.raw`^[ \t]*@(?:${Lc.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function Po(e){return e.replace(Bc,(i)=>i.replace(/[^\n]/g," "))}var Ri=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function Wl(e){let i=Wn(e),t=[],o=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,a;while((a=o.exec(i))!==null){if(a[1]||a[3])continue;let v=a[2]??a[4]??"",E=a[2]!==void 0?2:3,R=jc(v);if(!R.trim())continue;let C=a.index+E+(R.length-R.trimStart().length);t.push({code:R.trim(),line:Jt(i,C),column:Gt(i,C),offset:C,kind:"interpolation"})}let h=/@(if|elseif|else\s+if|unless)\b\s*\(/g;while((a=h.exec(i))!==null){let c=a.index+a[0].length-1,v=0,E=c;for(;E<i.length;E++){let M=i[E];if(M==="(")v++;else if(M===")"){if(v--,v===0)break}}if(v!==0)continue;let R=i.slice(c+1,E),C=R.trim();if(h.lastIndex=E+1,!C)continue;let O=c+1+(R.length-R.trimStart().length);t.push({code:C,line:Jt(i,O),column:Gt(i,O),offset:a.index,kind:"condition"})}Fn.lastIndex=0;while((a=Fn.exec(i))!==null){let c=a[1],v=a[3]??"",E=c.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(Ri.has(E)||Ri.has(c))continue;if(!v.trim())continue;let R=a.index+a[0].indexOf(a[2],a[0].indexOf(c)+c.length)+1;if(Pi.has(E)){let O=v.match(/\s+(?:in|of)\s+/);if(!O||O.index===void 0)continue;let M=v.slice(O.index+O[0].length),N=O.index+O[0].length+(M.length-M.trimStart().length);t.push({code:ki(M.trim()),line:Jt(i,R+N),column:Gt(i,R+N),offset:R+N,kind:"directive",attribute:E});continue}let C=v.length-v.trimStart().length;t.push({code:ki(v.trim()),line:Jt(i,R+C),column:Gt(i,R+C),offset:R+C,kind:"directive",attribute:E})}return t.sort((c,v)=>c.line-v.line||c.column-v.column),t}var zc=2000;function Wc(e,i){let t=0,o=Math.min(e.length,i+zc);for(let a=i;a<o;a++){let h=e[a];if(h==="(")t++;else if(h===")"){if(t--,t===0)return e.slice(i+1,a)}}return null}function Fc(e){let i=new Map,t=(v,E)=>{let R=v.split(/[,[\]{}()\s]+/).filter(Boolean);for(let C of R){let O=C.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(O))continue;let M=R.length===1?E:void 0,N=i.get(O);if(!N)i.set(O,{name:O,iterable:M});else if(N.iterable!==M)N.iterable=void 0}},o=/^\$?[A-Z_$][\w$]*$/i,a=(v)=>{let E=v.trim();return o.test(E)?E:void 0};for(let v of e.matchAll(/@for(?:each|else)\s*\(/g)){let E=Wc(e,v.index+v[0].length-1);if(E===null)continue;let R=$t(E);if(!R)continue;t(R.itemVar.replace(/=>/g," "),a(R.arrayExpr))}for(let v of e.matchAll(/@for\s*\(\s*(?:(?:let|const|var)\s+)?([\w$]+|\[[^\]]*\]|\{[^}]*\})\s+(of|in)\s+([^)]*)/g))t(v[1],v[2]==="of"?a(v[3]):void 0);for(let v of e.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)\s*[=;]/g))t(v[1]);let h=Wn(e);Fn.lastIndex=0;let c;while((c=Fn.exec(h))!==null){let v=c[1].replace(/\..*$/,"");if(!Pi.has(v))continue;let E=c[3].match(/\s+(?:in|of)\s+/);if(!E||E.index===void 0)continue;t(c[3].slice(0,E.index),a(c[3].slice(E.index+E[0].length)))}for(let v of e.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let E of v[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))t(E[1]);return[...i.values()].sort((v,E)=>v.name.localeCompare(E.name))}function Oe(e){let i=new Set;for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))i.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))i.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))i.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let o of t[1].split(",")){let a=o.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(a))i.add(a)}return[...i].sort()}var zs=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"],Vc={$bool:"declare function $bool(value: unknown, fallback?: boolean): boolean",$num:"declare function $num(value: unknown, fallback?: number): number",$uid:"declare var $uid: string",$native:"declare var $native: boolean"};function Oa(e=new Set){return[...zs.filter((i)=>!e.has(i)).map((i)=>`declare var ${i}: any`),...Object.entries(Vc).filter(([i])=>!e.has(i)).map(([,i])=>i)].join(`
257
+ `)}function Na(e){return new Set([...e.matchAll(/^declare (?:function|const|let|var)\s+([A-Za-z_$][\w$]*)/gm)].map((i)=>i[1]))}function Di(e){let i=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,t,o=!1,a=new Set,h=r(e);while((t=i.exec(h))!==null){o=!0;for(let c of Uc(t[1])){let v=c.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(v))a.add(v)}}return o?[...a]:null}function Uc(e){let i=[],t=0,o="";for(let a of e){if(a===","&&t===0){i.push(o),o="";continue}if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;o+=a}return i.push(o),i.filter((a)=>a.trim().length>0)}function Hc(e){let i=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,t=[],o=e.replace(i,(a)=>(t.push(a.trim()),a.split(`
258
258
  `).map(()=>"").join(`
259
259
  `)));return{imports:t.join(`
260
260
  `),body:o}}function ji(e){let i=r(e),t=Array(i.length),o=0;for(let v=0;v<i.length;v++){let E=i[v];if(E==="}"||E===")"||E==="]")o=Math.max(0,o-1);if(t[v]=o,E==="{"||E==="("||E==="[")o++}let a=[],h=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,c;while((c=h.exec(i))!==null){if(t[c.index]!==0)continue;let v=c[1],E=c[2],R;if(v==="interface"){let C=i.indexOf("{",c.index);if(C===-1)continue;let O=0;R=-1;for(let M=C;M<i.length;M++)if(i[M]==="{")O++;else if(i[M]==="}"&&--O===0){R=M+1;break}if(R===-1)continue}else{let C=0;R=i.length;for(let O=i.indexOf("=",c.index)+1;O<i.length;O++){let M=i[O];if(M==="{"||M==="["||M==="("||M==="<")C++;else if(M==="}"||M==="]"||M===")"||M===">")C--;else if(C<=0&&(M===";"||M===`
261
- `&&!/[=|&,<([{]\s*$/.test(i.slice(Math.max(0,O-40),O)))){R=M===";"?O+1:O;break}}}a.push({name:E,text:e.slice(c.index,R).replace(/^[ \t]*export[ \t]+/,"")}),h.lastIndex=R}return a}function Hc(e){return new Set(ji(e).map((i)=>i.name))}function Oa(e,i=""){let t=Di(e),o=Hc(i),a=ji(e).filter((R)=>!o.has(R.name)).map((R)=>R.text);if(!t){let R=Oe(e).filter((C)=>!Et(i,C));if(R.length===0&&a.length===0)return"";return["",`// ${Kc}`,...a,...R.map((C)=>`declare var ${C}: any`)].join(`
261
+ `&&!/[=|&,<([{]\s*$/.test(i.slice(Math.max(0,O-40),O)))){R=M===";"?O+1:O;break}}}a.push({name:E,text:e.slice(c.index,R).replace(/^[ \t]*export[ \t]+/,"")}),h.lastIndex=R}return a}function Kc(e){return new Set(ji(e).map((i)=>i.name))}function Da(e,i=""){let t=Di(e),o=Kc(i),a=ji(e).filter((R)=>!o.has(R.name)).map((R)=>R.text);if(!t){let R=Oe(e).filter((C)=>!Et(i,C));if(R.length===0&&a.length===0)return"";return["",`// ${Zc}`,...a,...R.map((C)=>`declare var ${C}: any`)].join(`
262
262
  `)}if(t.length===0)return a.length>0?["",`// ${Ci}`,...a].join(`
263
- `):"";let{imports:h,body:c}=Uc(e),v=c.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),E=["",`// ${Ci}`];if(h)E.push(h);return E.push(...a),E.push(`async function ${Ti}() {`,v,` return { ${t.join(", ")} }`,"}",`type ${Ai} = Awaited<ReturnType<typeof ${Ti}>>`,...t.map((R)=>`declare var ${R}: ${Ai}[${JSON.stringify(R)}]`)),E.join(`
264
- `)}function Ao(e){let t=r(e).split(""),o=0;for(let a=0;a<t.length;a++){let h=t[a];if(h==="{"||h==="("||h==="["){o++;continue}if(h==="}"||h===")"||h==="]"){o=Math.max(0,o-1);continue}if(o>0&&h!==`
265
- `)t[a]=" "}return Oe(t.join(""))}function Na(e,i){if(Di(e)!==null)return[];let t=Ao(e),o=on(i,new Set(t)),a=new Set(x);return t.filter((h)=>{if(a.has(h))return!1;if(Et(i,h))return!1;return o.has(h)})}var Ci="stx: types for the declared client payload (#1868)",Kc="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",Ti="__stxServerScope",Ai="__StxClientPayload";var Ii=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","$native","props","slot"];var Zc=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function qc(e){let i=new Map,t=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let o of e){let a=r(o),{depths:h,balanced:c}=fe(a);if(!c)continue;let v=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let E of a.matchAll(v)){let R=E.index??0;if(h[R+E[1].length]!==0)continue;let C=E[2],O=R+E[0].length-E[3].length,M=o.slice(O,R+E[0].length).trim().replace(/;$/,"").trim(),N=E[3],I=t.test(N)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(N)&&!/[,+\-*/%&|?:=]$/.test(M)&&fe(N).balanced;i.set(C,i.has(C)||!I?null:M)}}return new Map([...i].filter((o)=>o[1]!==null))}function Ni(e,i,t=0,o=new Set){if(i.size===0||t>=5)return e;let a=r(e),h="",c=0;for(let v of a.matchAll(/[A-Za-z_$][\w$]*/g)){let E=v.index??0,R=v[0],C=i.get(R);if(!C||o.has(R))continue;let O=a.slice(0,E).trimEnd(),M=a.slice(E+R.length).trimStart();if(O.endsWith(".")||/^:(?!:)/.test(M)&&/[{,]$/.test(O))continue;if(E>0&&/[\w$]/.test(a[E-1]))continue;h+=`${e.slice(c,E)}(${Ni(C,i,t+1,new Set([...o,R]))})`,c=E+R.length}return h+e.slice(c)}function Xc(e,i){let t=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,o=[],a;while((a=t.exec(e))!==null){if(a.index>i)break;let h=a[1];if(a.index===i){if(h==="elseif"){let v=o[o.length-1];if(v?.current)v.seen.push(v.current);if(v)v.current=null}break}if(h==="endif"||h==="endunless"){o.pop();continue}let c="";if(a[2]==="("){let v=0,E=a.index+a[0].length-1,R=E+1;for(;E<e.length;E++){let C=e[E];if(C==="(")v++;else if(C===")"){if(v--,v===0)break}}c=e.slice(R,E).trim(),t.lastIndex=E+1}if(h==="if")o.push({seen:[],current:c});else if(h==="unless")o.push({seen:[],current:`!(${c})`});else if(h==="elseif"||h==="else"){let v=o[o.length-1];if(!v)continue;if(v.current)v.seen.push(v.current);v.current=h==="elseif"?c:null}}return o.flatMap((h)=>[...h.seen.map((c)=>`!(${c})`),...h.current?[h.current]:[]]).filter(Boolean)}function Jc(e){let i=e.code.trim();if(!i)return null;if(e.attribute?.startsWith("@")){if(Zc.test(i))return null;let o=";(($event: any): void => { ";return{text:`${o}${i} });`,prefixLength:o.length}}let t=";void ((";return{text:`${t}${i}));`,prefixLength:t.length}}var Gc=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function ps(e,i){if(!i)return e;return e.replace(Gc,(t,o,a,h)=>{let c=Oi.resolve(i,h).replace(/\\/g,"/");return`${o}${a}${c}${a}`})}function Po(e){return" ".repeat(Math.max(0,(e.startColumn??1)-1))}function Yc(e){let i=new Set,t=r(e);for(let o of t.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let a=o[1],h=/\{([^}]*)\}/.exec(a);for(let R of h?.[1].split(",")??[]){let C=R.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(C&&/^[A-Z_$][\w$]*$/i.test(C))i.add(C)}let c=a.replace(/\{[^}]*\}/,""),v=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(c);if(v)i.add(v[1]);let E=/^\s*([A-Z_$][\w$]*)/i.exec(c);if(E&&E[1]!=="type")i.add(E[1])}return[...i].sort()}function Da(e,i={}){let t=Rt(e),o=e.split(`
266
- `),a=Array.from({length:o.length},()=>""),h=new Map,c=i.filePath&&i.templateExpressions!==!1?$i(e,Wn(e),{filePath:i.filePath,componentsDir:i.componentsDir,projectRoot:i.projectRoot,readComponent:i.readComponent,scriptCode:(O,M)=>Rt(O).map((N)=>ps(N.code,Oi.dirname(M))).join(`
267
- `)}):void 0,v=new Set,E=[];for(let O of t){let M=Ro($o(O.code)),N=ps(M,i.originDir??"").split(`
268
- `);N.forEach((I,P)=>{let q=O.startLine-1+P;if(q<a.length)a[q]=P===0?Po(O)+I:I,v.add(q)}),E.push(O.startLine-1+N.length-1)}for(let O of E){let M=a[O]?.trim()===""?O:O+1;if(M<a.length&&a[M].trim()===""&&(M===O||!v.has(M)))a[M]=";"}let R=(O,M)=>{for(let[N,I]of O.split(`
269
- `).entries())if(a.push(I),M)h.set(a.length,N===0?M:{...M,line:M.line+N,column:1,prefixLength:0})};if(i.globals!==!1){R("");let O=new Set([...t.flatMap((P)=>Oe(P.code)),...t.flatMap((P)=>Yc(P.code))]),M=(P)=>{if(!O.has(P))R(`declare var ${P}: any`)};if(i.runtimeGlobals!==!1){if(!O.has("window"))R("declare var window: any");for(let P of x)M(P)}let N=[...new Set([...zs,...ve,...Ii])].filter((P)=>i.runtimeGlobals!==!1||!x.includes(P));if(i.contextScope==="global"){R("declare global {");for(let P of N)R(` var ${P}: any`);R("}")}else{for(let P of zs)M(P);for(let P of ve)M(P);for(let P of Ii)M(P)}R(`declare var ${Bs}: any`);let I=new Set(t.flatMap((P)=>Oe(P.code)));R(`type ${Ei}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let P of Wc(e)){if(I.has(P.name))continue;let q=P.iterable&&I.has(P.iterable)?`${Ei}<typeof ${P.iterable}>`:"any";R(`declare var ${P.name}: ${q}`)}}if(i.templateExpressions!==!1){if(c?.declarations)for(let M of c.declarations.split(`
270
- `))R(M);let O=Vl(e).map((M)=>{let N=c?.events.get(M.offset??-1);if(N){M.anchor=!0;let I=M.code.trim(),P=/^([\w$]+)\s*=\s*([^=][\s\S]*)$/.exec(I),q=P?`void ((${P[2]}) satisfies __StxAssignedValue<typeof ${P[1]}>)`:/^[\w$]+(?:\.[\w$]+)*$/.test(I)?`${I} satisfies (($event: ${N}) => unknown)`:I,Z=`;(($event: ${N}): void => { `;return{expression:M,statement:{text:`${Z}${q} });`,prefixLength:Z.length}}}return{expression:M,statement:Jc(M)}}).filter((M)=>M.statement!==null);if(O.push(...c?.checks||[]),O.length>0){let M=Wn(e),N=zn(M),I=qc(t.map((W)=>W.code)),q=[...new Set(t.flatMap((W)=>Oe(W.code)))].filter((W)=>/^[A-Z_$][\w$]*$/i.test(W)),Z=0;if(q.length>0){R(jc);for(let W of q)R(`function __StxRead_${W}() { return ${W} }`),R(`type __StxT_${W} = ${Mi}<ReturnType<typeof __StxRead_${W}>>`);R(`;((${q.map((W)=>`${W}: __StxT_${W}`).join(", ")}) => {`),Z=1}for(let{expression:W,statement:Y}of O){let ee=" ".repeat(Z),te=W.offset===void 0?[]:N.filter((Te)=>W.offset>=Te.start&&W.offset<Te.end),ae=te.map((Te)=>`;((${Te.binding.replace(/[\r\n]/g," ")}: any) => { `).join(""),me=" });".repeat(te.length),ke=W.offset===void 0?[]:Xc(M,W.offset),Re=ke.length>0?`${ke.map((Te)=>`if (${Ni(Te,I)}) `).join("")}{ `:"",Ve=ke.length>0?" }":"";R(ee+ae+Re+Y.text+Ve+me,{line:W.line,column:W.column,expression:W,prefixLength:Y.prefixLength+ee.length+ae.length+Re.length,guardPrefixLength:ee.length+ae.length+Re.length})}if(Z>0)R("});")}}let C=!1;if(i.reference&&a[0]!==void 0&&a[0].trim()==="")a[0]=`/// <reference path=${JSON.stringify(i.reference.replace(/\\/g,"/"))} />`,C=!0;return R("export {}"),{text:a.join(`
271
- `),lineMap:h,sourceLineCount:o.length,componentDependencies:c?.dependencies,referenced:C}}function Ma(e,i){if(!e.expression)return!1;return e.inGuard===!0||i===2774}function La(e,i,t){let o=e.lineMap.get(i);if(!o)return i<=e.sourceLineCount?{line:i,column:t}:null;let a=o.expression?.anchor?0:Math.max(0,t-1-(o.prefixLength??0));return{line:o.line,column:o.column+a,expression:o.expression,inGuard:t<=(o.guardPrefixLength??0)}}var Ws=b(256),Qc=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or, where this must run before first paint and the runtime does not exist yet, the colorMode config for a light/dark theme, or @appearanceBootstrap when there is a second appearance axis"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}],Li=/(?:\/\/|\/\*|\{\{--)\s*stx-strict-ignore(-next-line)?([^\n*}]*)/g;function el(e){let i=Array.from(e,(a)=>a===`
263
+ `):"";let{imports:h,body:c}=Hc(e),v=c.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),E=["",`// ${Ci}`];if(h)E.push(h);return E.push(...a),E.push(`async function ${Ti}() {`,v,` return { ${t.join(", ")} }`,"}",`type ${Ai} = Awaited<ReturnType<typeof ${Ti}>>`,...t.map((R)=>`declare var ${R}: ${Ai}[${JSON.stringify(R)}]`)),E.join(`
264
+ `)}function Io(e){let t=r(e).split(""),o=0;for(let a=0;a<t.length;a++){let h=t[a];if(h==="{"||h==="("||h==="["){o++;continue}if(h==="}"||h===")"||h==="]"){o=Math.max(0,o-1);continue}if(o>0&&h!==`
265
+ `)t[a]=" "}return Oe(t.join(""))}function Ma(e,i){if(Di(e)!==null)return[];let t=Io(e),o=on(i,new Set(t)),a=new Set(S);return t.filter((h)=>{if(a.has(h))return!1;if(Et(i,h))return!1;return o.has(h)})}var Ci="stx: types for the declared client payload (#1868)",Zc="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",Ti="__stxServerScope",Ai="__StxClientPayload";var Ii=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","$native","props","slot"];var qc=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function Xc(e){let i=new Map,t=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let o of e){let a=r(o),{depths:h,balanced:c}=fe(a);if(!c)continue;let v=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let E of a.matchAll(v)){let R=E.index??0;if(h[R+E[1].length]!==0)continue;let C=E[2],O=R+E[0].length-E[3].length,M=o.slice(O,R+E[0].length).trim().replace(/;$/,"").trim(),N=E[3],I=t.test(N)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(N)&&!/[,+\-*/%&|?:=]$/.test(M)&&fe(N).balanced;i.set(C,i.has(C)||!I?null:M)}}return new Map([...i].filter((o)=>o[1]!==null))}function Ni(e,i,t=0,o=new Set){if(i.size===0||t>=5)return e;let a=r(e),h="",c=0;for(let v of a.matchAll(/[A-Za-z_$][\w$]*/g)){let E=v.index??0,R=v[0],C=i.get(R);if(!C||o.has(R))continue;let O=a.slice(0,E).trimEnd(),M=a.slice(E+R.length).trimStart();if(O.endsWith(".")||/^:(?!:)/.test(M)&&/[{,]$/.test(O))continue;if(E>0&&/[\w$]/.test(a[E-1]))continue;h+=`${e.slice(c,E)}(${Ni(C,i,t+1,new Set([...o,R]))})`,c=E+R.length}return h+e.slice(c)}function Jc(e,i){let t=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,o=[],a;while((a=t.exec(e))!==null){if(a.index>i)break;let h=a[1];if(a.index===i){if(h==="elseif"){let v=o[o.length-1];if(v?.current)v.seen.push(v.current);if(v)v.current=null}break}if(h==="endif"||h==="endunless"){o.pop();continue}let c="";if(a[2]==="("){let v=0,E=a.index+a[0].length-1,R=E+1;for(;E<e.length;E++){let C=e[E];if(C==="(")v++;else if(C===")"){if(v--,v===0)break}}c=e.slice(R,E).trim(),t.lastIndex=E+1}if(h==="if")o.push({seen:[],current:c});else if(h==="unless")o.push({seen:[],current:`!(${c})`});else if(h==="elseif"||h==="else"){let v=o[o.length-1];if(!v)continue;if(v.current)v.seen.push(v.current);v.current=h==="elseif"?c:null}}return o.flatMap((h)=>[...h.seen.map((c)=>`!(${c})`),...h.current?[h.current]:[]]).filter(Boolean)}function Gc(e){let i=e.code.trim();if(!i)return null;if(e.attribute?.startsWith("@")){if(qc.test(i))return null;let o=";(($event: any): void => { ";return{text:`${o}${i} });`,prefixLength:o.length}}let t=";void ((";return{text:`${t}${i}));`,prefixLength:t.length}}var Yc=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function gs(e,i){if(!i)return e;return e.replace(Yc,(t,o,a,h)=>{let c=Oi.resolve(i,h).replace(/\\/g,"/");return`${o}${a}${c}${a}`})}function Oo(e){return" ".repeat(Math.max(0,(e.startColumn??1)-1))}function Qc(e){let i=new Set,t=r(e);for(let o of t.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let a=o[1],h=/\{([^}]*)\}/.exec(a);for(let R of h?.[1].split(",")??[]){let C=R.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(C&&/^[A-Z_$][\w$]*$/i.test(C))i.add(C)}let c=a.replace(/\{[^}]*\}/,""),v=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(c);if(v)i.add(v[1]);let E=/^\s*([A-Z_$][\w$]*)/i.exec(c);if(E&&E[1]!=="type")i.add(E[1])}return[...i].sort()}function La(e,i={}){let t=Rt(e),o=e.split(`
266
+ `),a=Array.from({length:o.length},()=>""),h=new Map,c=i.filePath&&i.templateExpressions!==!1?$i(e,Wn(e),{filePath:i.filePath,componentsDir:i.componentsDir,projectRoot:i.projectRoot,readComponent:i.readComponent,scriptCode:(O,M)=>Rt(O).map((N)=>gs(N.code,Oi.dirname(M))).join(`
267
+ `)}):void 0,v=new Set,E=[];for(let O of t){let M=Po(Ao(O.code)),N=gs(M,i.originDir??"").split(`
268
+ `);N.forEach((I,P)=>{let G=O.startLine-1+P;if(G<a.length)a[G]=P===0?Oo(O)+I:I,v.add(G)}),E.push(O.startLine-1+N.length-1)}for(let O of E){let M=a[O]?.trim()===""?O:O+1;if(M<a.length&&a[M].trim()===""&&(M===O||!v.has(M)))a[M]=";"}let R=(O,M)=>{for(let[N,I]of O.split(`
269
+ `).entries())if(a.push(I),M)h.set(a.length,N===0?M:{...M,line:M.line+N,column:1,prefixLength:0})};if(i.globals!==!1){R("");let O=new Set([...t.flatMap((P)=>Oe(P.code)),...t.flatMap((P)=>Qc(P.code))]),M=(P)=>{if(!O.has(P))R(`declare var ${P}: any`)};if(i.runtimeGlobals!==!1){if(!O.has("window"))R("declare var window: any");for(let P of S)M(P)}let N=[...new Set([...zs,...ve,...Ii])].filter((P)=>i.runtimeGlobals!==!1||!S.includes(P));if(i.contextScope==="global"){R("declare global {");for(let P of N)R(` var ${P}: any`);R("}")}else{for(let P of zs)M(P);for(let P of ve)M(P);for(let P of Ii)M(P)}R(`declare var ${Bs}: any`);let I=new Set(t.flatMap((P)=>Oe(P.code)));R(`type ${Ei}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let P of Fc(e)){if(I.has(P.name))continue;let G=P.iterable&&I.has(P.iterable)?`${Ei}<typeof ${P.iterable}>`:"any";R(`declare var ${P.name}: ${G}`)}}if(i.templateExpressions!==!1){if(c?.declarations)for(let M of c.declarations.split(`
270
+ `))R(M);let O=Wl(e).map((M)=>{let N=c?.events.get(M.offset??-1);if(N){M.anchor=!0;let I=M.code.trim(),P=/^([\w$]+)\s*=\s*([^=][\s\S]*)$/.exec(I),G=P?`void ((${P[2]}) satisfies __StxAssignedValue<typeof ${P[1]}>)`:/^[\w$]+(?:\.[\w$]+)*$/.test(I)?`${I} satisfies (($event: ${N}) => unknown)`:I,q=`;(($event: ${N}): void => { `;return{expression:M,statement:{text:`${q}${G} });`,prefixLength:q.length}}}return{expression:M,statement:Gc(M)}}).filter((M)=>M.statement!==null);if(O.push(...c?.checks||[]),O.length>0){let M=Wn(e),N=zn(M),I=Xc(t.map((Z)=>Z.code)),G=[...new Set(t.flatMap((Z)=>Oe(Z.code)))].filter((Z)=>/^[A-Z_$][\w$]*$/i.test(Z)),q=0;if(G.length>0){R(Nc);for(let Z of G)R(`function __StxRead_${Z}() { return ${Z} }`),R(`type __StxT_${Z} = ${Mi}<ReturnType<typeof __StxRead_${Z}>>`);R(`;((${G.map((Z)=>`${Z}: __StxT_${Z}`).join(", ")}) => {`),q=1}for(let{expression:Z,statement:Q}of O){let te=" ".repeat(q),ne=Z.offset===void 0?[]:N.filter((We)=>Z.offset>=We.start&&Z.offset<We.end),ae=ne.map((We)=>`;((${We.binding.replace(/[\r\n]/g," ")}: any) => { `).join(""),me=" });".repeat(ne.length),ke=Z.offset===void 0?[]:Jc(M,Z.offset),Re=ke.length>0?`${ke.map((We)=>`if (${Ni(We,I)}) `).join("")}{ `:"",Ue=ke.length>0?" }":"";R(te+ae+Re+Q.text+Ue+me,{line:Z.line,column:Z.column,expression:Z,prefixLength:Q.prefixLength+te.length+ae.length+Re.length,guardPrefixLength:te.length+ae.length+Re.length})}if(q>0)R("});")}}let C=!1;if(i.reference&&a[0]!==void 0&&a[0].trim()==="")a[0]=`/// <reference path=${JSON.stringify(i.reference.replace(/\\/g,"/"))} />`,C=!0;return R("export {}"),{text:a.join(`
271
+ `),lineMap:h,sourceLineCount:o.length,componentDependencies:c?.dependencies,referenced:C}}function ja(e,i){if(!e.expression)return!1;return e.inGuard===!0||i===2774}function Ba(e,i,t){let o=e.lineMap.get(i);if(!o)return i<=e.sourceLineCount?{line:i,column:t}:null;let a=o.expression?.anchor?0:Math.max(0,t-1-(o.prefixLength??0));return{line:o.line,column:o.column+a,expression:o.expression,inGuard:t<=(o.guardPrefixLength??0)}}var Ws=b(256),el=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or, where this must run before first paint and the runtime does not exist yet, the colorMode config for a light/dark theme, or @appearanceBootstrap when there is a second appearance axis"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}],Li=/(?:\/\/|\/\*|\{\{--)\s*stx-strict-ignore(-next-line)?([^\n*}]*)/g;function tl(e){let i=Array.from(e,(a)=>a===`
272
272
  `?`
273
273
  `:" "),t=0,o="";while(t<e.length){let a=e[t],h=e[t+1];if(o){if(a==="\\"){t+=2;continue}if(a===o)o="";t++;continue}if(a==='"'||a==="'"||a==="`"){o=a,t++;continue}if(a==="/"&&h==="/"){while(t<e.length&&e[t]!==`
274
- `)i[t]=e[t],t++;continue}if(a==="/"&&h==="*"){let c=e.indexOf("*/",t+2),v=c===-1?e.length:c+2;for(;t<v;t++)i[t]=e[t];continue}if(a==="{"&&h==="{"&&e.slice(t,t+4)==="{{--"){let c=e.indexOf("--}}",t+4),v=c===-1?e.length:c+4;for(;t<v;t++)i[t]=e[t];continue}t++}return i.join("")}function tl(e){let i=new Map,t=el(e).split(`
274
+ `)i[t]=e[t],t++;continue}if(a==="/"&&h==="*"){let c=e.indexOf("*/",t+2),v=c===-1?e.length:c+2;for(;t<v;t++)i[t]=e[t];continue}if(a==="{"&&h==="{"&&e.slice(t,t+4)==="{{--"){let c=e.indexOf("--}}",t+4),v=c===-1?e.length:c+4;for(;t<v;t++)i[t]=e[t];continue}t++}return i.join("")}function nl(e){let i=new Map,t=tl(e).split(`
275
275
  `),o=e.split(`
276
- `);return t.forEach((a,h)=>{Li.lastIndex=0;for(let c of a.matchAll(Li)){let v=c[1]==="-next-line",E=(o[h]??"").slice(0,c.index).trim(),R=v||E===""?h+2:h+1,O=(c[2]??"").split("--")[0].split(/[\s,]+/).filter(Boolean),M=O.filter((I)=>/\w/.test(I));if(O.length>0&&M.length===0)continue;let N=i.get(R);if(N&&N.size===0)continue;if(M.length===0){i.set(R,new Set);continue}if(N)M.forEach((I)=>N.add(I));else i.set(R,new Set(M))}}),i}function nl(e,i,t){let o=e.get(i);if(!o)return!1;if(o.size===0)return!0;return[...o].some((a)=>t.includes(a))}function Pe(e,i,t,o){let a=typeof t==="boolean"?{enabled:t,failOnViolation:t}:t??{enabled:!1};if(!a.enabled)return;let h=w(e,i,o,JSON.stringify(a)),c=Ws.get(h);if(c!==void 0){if(c&&a.failOnViolation)throw new V(c,o??i);return}let v=a.allowPatterns??[],E=tl(e),R=[],C=r(e.replace(/\{\{--[\s\S]*?--\}\}/g,(I)=>I.replace(/[^\n]/g," ")));for(let{pattern:I,message:P,suggestion:q}of Qc){if(v.some((W)=>/\w/.test(W)&&P.includes(W)))continue;I.lastIndex=0;let Z=C.match(I);if(Z&&Z.length>0){let W=C.split(`
277
- `),Y=e.split(`
278
- `),ee=[];if(W.forEach((ke,Re)=>{if(I.lastIndex=0,I.test(ke)&&!nl(E,Re+1,P))ee.push(Re+1)}),ee.length===0&&W.some((ke)=>(I.lastIndex=0,I.test(ke))))continue;let te=ee.length>0?` (script line${ee.length>1?"s":""} ${ee.join(", ")})`:"",ae=ee.slice(0,3).map((ke)=>` ${ke} | ${(Y[ke-1]??"").trim().slice(0,100)}`).join(`
276
+ `);return t.forEach((a,h)=>{Li.lastIndex=0;for(let c of a.matchAll(Li)){let v=c[1]==="-next-line",E=(o[h]??"").slice(0,c.index).trim(),R=v||E===""?h+2:h+1,O=(c[2]??"").split("--")[0].split(/[\s,]+/).filter(Boolean),M=O.filter((I)=>/\w/.test(I));if(O.length>0&&M.length===0)continue;let N=i.get(R);if(N&&N.size===0)continue;if(M.length===0){i.set(R,new Set);continue}if(N)M.forEach((I)=>N.add(I));else i.set(R,new Set(M))}}),i}function sl(e,i,t){let o=e.get(i);if(!o)return!1;if(o.size===0)return!0;return[...o].some((a)=>t.includes(a))}function Pe(e,i,t,o){let a=typeof t==="boolean"?{enabled:t,failOnViolation:t}:t??{enabled:!1};if(!a.enabled)return;let h=w(e,i,o,JSON.stringify(a)),c=Ws.get(h);if(c!==void 0){if(c&&a.failOnViolation)throw new U(c,o??i);return}let v=a.allowPatterns??[],E=nl(e),R=[],C=r(e.replace(/\{\{--[\s\S]*?--\}\}/g,(I)=>I.replace(/[^\n]/g," ")));for(let{pattern:I,message:P,suggestion:G}of el){if(v.some((Z)=>/\w/.test(Z)&&P.includes(Z)))continue;I.lastIndex=0;let q=C.match(I);if(q&&q.length>0){let Z=C.split(`
277
+ `),Q=e.split(`
278
+ `),te=[];if(Z.forEach((ke,Re)=>{if(I.lastIndex=0,I.test(ke)&&!sl(E,Re+1,P))te.push(Re+1)}),te.length===0&&Z.some((ke)=>(I.lastIndex=0,I.test(ke))))continue;let ne=te.length>0?` (script line${te.length>1?"s":""} ${te.join(", ")})`:"",ae=te.slice(0,3).map((ke)=>` ${ke} | ${(Q[ke-1]??"").trim().slice(0,100)}`).join(`
279
279
  `),me=ae?`
280
- ${ae}`:"";R.push(` \u2717 ${P}${te}
281
- \u2192 ${q}${me}`)}}if(R.length===0){Ws.set(h,"");return}let O=(I)=>{let P=`${process.cwd()}/`;return I.startsWith(P)?I.slice(P.length):I},N=`[STX] DOM API violation in ${o&&o!==i?`${O(o)} (composed into ${O(i)})`:O(i)}:
280
+ ${ae}`:"";R.push(` \u2717 ${P}${ne}
281
+ \u2192 ${G}${me}`)}}if(R.length===0){Ws.set(h,"");return}let O=(I)=>{let P=`${process.cwd()}/`;return I.startsWith(P)?I.slice(P.length):I},N=`[STX] DOM API violation in ${o&&o!==i?`${O(o)} (composed into ${O(i)})`:O(i)}:
282
282
  ${R.join(`
283
283
  `)}
284
- Tip: prefer useRef(), navigate(), and composables for component code`;if(Ws.set(h,N),console.warn(N),a.failOnViolation)throw new V(N,o??i)}var sl=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],rl=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],il=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function Zl(e){let i=[],t=[];return ol(e,i),al(e,i,t),cl(e,t),ll(e,i),{valid:i.length===0,errors:i,warnings:t}}function ol(e,i){let t=(e.match(/\{\{/g)||[]).length,o=(e.match(/\}\}/g)||[]).length;if(t!==o)i.push({type:"expression",message:`Unclosed expression brackets: found ${t} opening '{{' and ${o} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function al(e,i,t){for(let o of sl){let a=new RegExp(`${o.open}(?:\\s|\\()`,"g"),h=new RegExp(o.close,"g"),c=(e.match(a)||[]).length,v=(e.match(h)||[]).length;if(o.altClose){let E=new RegExp(o.altClose,"g");v+=(e.match(E)||[]).length}if(c>v)i.push({type:"directive",message:`Unclosed @${o.name} directive: found ${c} opening and ${v} closing`,suggestion:`Add ${c-v} missing ${o.close} tag(s)`});else if(v>c)t.push({type:"directive",message:`Extra ${o.close} found: ${v-c} more closing than opening`,suggestion:`Check for orphaned ${o.close} tags`})}}function cl(e,i){for(let t of rl)if(t.pattern.test(e))i.push({type:"syntax",message:t.message,suggestion:t.suggestion})}function ll(e,i){for(let t of il)if(t.pattern.test(e))i.push({type:"expression",message:`Security warning: ${t.message}`,suggestion:"Remove dangerous code from template expressions"})}function Ql(e,i){let t=e.slice(0,i).split(`
285
- `);return{line:t.length,column:t[t.length-1].length+1}}function eu(e,i,t){let o=[];switch(e){case"if":case"elseif":case"unless":if(t.length===0)o.push({type:"syntax",message:`@${e} requires a condition`,suggestion:`Use @${e}(condition)`});break;case"foreach":if(t.length===0||!t[0].includes(" as "))o.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(t.length===0)o.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(t.length===0)o.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(t.length===0)o.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(t.length===0)o.push({type:"syntax",message:`@${e} requires a path`,suggestion:`Use @${e}('path/to/template')`});break}return o}function tu(e){return/@[a-z]+/i.test(e)||/\{\{/.test(e)}function nu(e){let i=e.matchAll(/@([a-z]+)/gi),t=new Set;for(let o of i){let a=o[1].toLowerCase();if(!a.startsWith("end"))t.add(a)}return Array.from(t)}var Qt=new B(500),Un=new B(1000),Us=new B(2000),Hs=new B(500),Hi=33554432,Ks=Hi;function ul(e){let i=e.componentRenderCacheBytes;if(typeof i!=="number"||i<0||i===Ks)return;Ks=i,Hn.setMaxBytes(i)}var Hn=new B(2000,{maxBytes:Hi,sizeOf:(e)=>e.output.length});function fl(e){let i=new WeakSet;try{let t=(o)=>{if(o===void 0)return{__stxType:"undefined"};if(typeof o==="bigint")return{__stxType:"bigint",value:o.toString()};if(typeof o==="function"||typeof o==="symbol")throw TypeError("Non-serializable component input");if(o===null||typeof o!=="object")return o;if(i.has(o))throw TypeError("Circular component input");i.add(o);try{if(o instanceof Date)return{__stxType:"date",value:o.toISOString()};if(Array.isArray(o))return o.map(t);let a=Object.getPrototypeOf(o);if(a!==Object.prototype&&a!==null)throw TypeError("Non-plain component input");let h={};for(let c of Object.keys(o).sort())h[c]=t(o[c]);return h}finally{i.delete(o)}};return JSON.stringify(t(e))}catch{return null}}function pl(e){let i={};for(let[t,o]of Object.entries(e))if(!t.startsWith("__")||t==="__stxServeContext")i[t]=o;return i}function Fs(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bs(e){let i=process.cwd(),t=`${i}\x00${e}`,o=Bi.get(t);if(o===void 0)o=Bun.hash(Ki(e,i).split(le.sep).join("/")).toString(36).slice(0,6),Bi.set(t,o);return o}var Bi=new Map;function Ki(e,i){if(!le.isAbsolute(e))return e;let t=(o)=>{try{return qs.realpathSync(o)}catch{return o}};return le.relative(t(i),t(e))}function ru(e){return/\bjs\b/.test(e)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test(e)}function Me(e){return!ru(e)}var Vn=new Map;function X(e){let i;try{i=JSON.stringify(e)}catch{return new Bun.Transpiler(e)}let t=Vn.get(i);if(t)return t;if(Vn.size>=16)Vn.clear();let o=new Bun.Transpiler(e);return Vn.set(i,o),o}var zi=new WeakMap,dl=256;function Le(e){try{let i=X({loader:"ts",target:"browser",define:S()}),t=zi.get(i);if(!t)t=new Map,zi.set(i,t);let o=t.get(e);if(o!==void 0)return o;let a=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");a=a.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let h=[];a=a.replace(/\{!![\s\S]*?!!\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`}),a=a.replace(/\{\{\{[\s\S]*?\}\}\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`}),a=a.replace(/\{\{[\s\S]*?\}\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`});let c=i.transformSync(a);for(let v=0;v<h.length;v++)c=c.replace(`"__STX_EXPR_${v}__"`,h[v]),c=c.replace(`'__STX_EXPR_${v}__'`,h[v]);if(t.size>=dl){let v=t.keys().next();if(!v.done)t.delete(v.value)}return t.set(e,c),c}catch(i){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",i);return e}}function gl(e){let i=[],t=new Set,o=0,a=0,h=e.length,c=(C)=>{a++;while(a<h){if(e[a]==="\\"){a+=2;continue}if(e[a]===C){a++;return}a++}},v=()=>{a++;while(a<h){if(e[a]==="\\"){a+=2;continue}if(e[a]==="`"){a++;return}if(e[a]==="$"&&e[a+1]==="{"){a+=2;let C=1;while(a<h&&C>0)if(e[a]==="{")C++,a++;else if(e[a]==="}")C--,a++;else if(e[a]==="'"||e[a]==='"')c(e[a]);else if(e[a]==="`")v();else a++;continue}a++}},E=()=>{if(e[a]==="/"&&e[a+1]==="/"){while(a<h&&e[a]!==`
286
- `)a++;return!0}if(e[a]==="/"&&e[a+1]==="*"){a+=2;while(a<h-1&&!(e[a]==="*"&&e[a+1]==="/"))a++;return a+=2,!0}return!1},R=()=>{if(o!==0)return;let C=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(C){let I=C[2].split(",").map((P)=>{let q=P.trim().split(":");return q[q.length-1].trim()});for(let P of I)if(P&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(P)&&!t.has(P))i.push(P),t.add(P);return}let O=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(O){let I=O[2];if(!t.has(I))i.push(I),t.add(I);return}let M=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!t.has(I))i.push(I),t.add(I);return}let N=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!t.has(I))i.push(I),t.add(I)}};while(a<h){if(E())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){v();continue}if(e[a]==="{"){o++,a++;continue}if(e[a]==="}"){o--,a++;continue}if(o===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))R();a++}return i}function ml(e){let i=[],t=0,o=0,a=null;for(let h=0;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)i.push(e.slice(o,h)),o=h+1}if(o<e.length)i.push(e.slice(o));return i}function hl(e){let i=0,t=null;for(let o=0;o<e.length;o++){let a=e[o];if(t){if(a==="\\"){o++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")i++;else if(a===")"||a==="]"||a==="}")i--;else if(a==="="&&i===0){let h=e[o-1],c=e[o+1];if(h==="!"||h==="<"||h===">"||h==="=")continue;if(c==="="||c===">")continue;return o}}return-1}function xl(e,i){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let o=t.index-1;while(o>=0&&/\s/.test(e[o]))o--;if(e[o]!=="}")return;let a=o,h=0,c=-1;for(;o>=0;o--){let E=e[o];if(E==="}")h++;else if(E==="{"){if(h--,h===0){c=o;break}}}if(c===-1)return;let v=e.slice(c+1,a);for(let E of ml(v)){let R=E.trim();if(!R||R.startsWith("..."))continue;let C=hl(R);if(C===-1)continue;let O=R.slice(0,C).trim();if(!/^[A-Z_$][\w$]*$/i.test(O))continue;if(i[O]!==void 0)continue;let M=R.slice(C+1).trim();if(!M)continue;try{let N=Object.keys(i).filter(Dt),I=Function(...N,`"use strict"; return (${M});`);i[O]=I(...N.map((P)=>i[P]))}catch{}}}catch{}}var bl=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function su(e,i){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let o=t[2].toLowerCase();if(!bl.has(o))return null;let a=new RegExp(`<\\/?${o}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),h=se(e,(R,C)=>(a.lastIndex=C,a.exec(R)?.index===C?a.lastIndex:-1));if(o==="span"&&/\sdata-stx-scope\s*=/.test(h[0]?.token||""))return null;let c=0,v=!1;for(let R of h){if(c+=R.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(R.end).trim())return null;v=!0;break}}if(!v)return null;let E=t[0].length;return e.slice(0,E)+i+e.slice(E)}async function pr(e,i,t,o,a){let h=e.endsWith(".stx")?e.slice(0,-4):e,c=(te)=>te.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),v=t.__importedComponents;if(v){for(let te of[h,h.toLowerCase(),c(h),j(h)])if(v.has(te))return!0}let E=[...new Set([`${h}.stx`,`${c(h)}.stx`,`${j(h)}.stx`])],R=typeof a.root==="string"?le.resolve(a.root):void 0,C=R??le.dirname(o),O=[],M=(te)=>{if(te&&!O.includes(te))O.push(te)},N=t.__originalFilePath;if(N)M(le.join(le.dirname(N),"components"));M(i),M(a._rootComponentsDir),M(le.join(le.dirname(o),"components")),M(a.componentsDir);let I=a._targetComponentFallbackNames?.some((te)=>te.toLowerCase()===h.toLowerCase());if(!I)for(let te of a._targetComponentDirs??[])M(te);if(R)M(le.resolve(R,"resources/views/components")),M(le.resolve(R,"resources/components")),M(le.resolve(R,"src/components")),M(le.resolve(R,"components"));for(let te of a._layerComponentDirs??[])M(te);let P=a._pluginComponentDirs;if(Array.isArray(P))for(let te of P)M(typeof te==="string"?te:null);if(M(a.fallbackComponentsDir),I)for(let te of a._targetComponentDirs??[])M(te);if(h.startsWith("./")||h.startsWith("../"))return n(le.resolve(le.dirname(o),`${h}.stx`));let q=Wi(le.resolve(import.meta.dir,"components")),Z=O.map((te)=>le.isAbsolute(te)?te:le.resolve(C,te)),W=`${E.join("\x00")}\x00\x00${Z.join("\x00")}`,Y=Us.get(W);if(Y!==void 0)return Y;let ee=!1;e:for(let te of Z){if(Wi(te)===q)continue;for(let ae of E)if(await n(le.join(te,ae))){ee=!0;break e}}return Us.set(W,ee),ee}function Wi(e){let i=Hs.get(e);if(i!==void 0)return i;let t=e;try{t=qs.realpathSync(e)}catch{}return Hs.set(e,t),t}function ou(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Xa(e){if(!e)return!1;let i=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(i)}function yl(e,i,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let o=(a,h)=>{let c;try{c=_(a,i)}catch{return h}if(c===void 0||c===null)return"";let v=String(c);if(/<\/style/i.test(v))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return v};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>o(h,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,h)=>o(h,a))}var Fi=new Set;function Vi(e,i,t,o){let a=`${e}\x00${i}\x00${o??""}`;if(!process.env.STX_DEBUG&&Fi.has(a))return;Fi.add(a);let h=i?` used in ${i}`:"",c=o?` Cause: ${o}.`:"",v=t.length>0?`
284
+ Tip: prefer useRef(), navigate(), and composables for component code`;if(Ws.set(h,N),console.warn(N),a.failOnViolation)throw new U(N,o??i)}var rl=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],il=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],ol=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function eu(e){let i=[],t=[];return al(e,i),cl(e,i,t),ll(e,t),ul(e,i),{valid:i.length===0,errors:i,warnings:t}}function al(e,i){let t=(e.match(/\{\{/g)||[]).length,o=(e.match(/\}\}/g)||[]).length;if(t!==o)i.push({type:"expression",message:`Unclosed expression brackets: found ${t} opening '{{' and ${o} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function cl(e,i,t){for(let o of rl){let a=new RegExp(`${o.open}(?:\\s|\\()`,"g"),h=new RegExp(o.close,"g"),c=(e.match(a)||[]).length,v=(e.match(h)||[]).length;if(o.altClose){let E=new RegExp(o.altClose,"g");v+=(e.match(E)||[]).length}if(c>v)i.push({type:"directive",message:`Unclosed @${o.name} directive: found ${c} opening and ${v} closing`,suggestion:`Add ${c-v} missing ${o.close} tag(s)`});else if(v>c)t.push({type:"directive",message:`Extra ${o.close} found: ${v-c} more closing than opening`,suggestion:`Check for orphaned ${o.close} tags`})}}function ll(e,i){for(let t of il)if(t.pattern.test(e))i.push({type:"syntax",message:t.message,suggestion:t.suggestion})}function ul(e,i){for(let t of ol)if(t.pattern.test(e))i.push({type:"expression",message:`Security warning: ${t.message}`,suggestion:"Remove dangerous code from template expressions"})}function tu(e,i){let t=e.slice(0,i).split(`
285
+ `);return{line:t.length,column:t[t.length-1].length+1}}function nu(e,i,t){let o=[];switch(e){case"if":case"elseif":case"unless":if(t.length===0)o.push({type:"syntax",message:`@${e} requires a condition`,suggestion:`Use @${e}(condition)`});break;case"foreach":if(t.length===0||!t[0].includes(" as "))o.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(t.length===0)o.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(t.length===0)o.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(t.length===0)o.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(t.length===0)o.push({type:"syntax",message:`@${e} requires a path`,suggestion:`Use @${e}('path/to/template')`});break}return o}function ru(e){return/@[a-z]+/i.test(e)||/\{\{/.test(e)}function su(e){let i=e.matchAll(/@([a-z]+)/gi),t=new Set;for(let o of i){let a=o[1].toLowerCase();if(!a.startsWith("end"))t.add(a)}return Array.from(t)}function Bi(e,i,t){let o=/^<script\b([^>]*)>/i.exec(e);if(!o||!/(?:^|\s)src\s*=/i.test(o[1]??""))return null;return x(o[0],i,t)+e.slice(o[0].length)}var Yt=new B(500),Un=new B(1000),Us=new B(2000),Hs=new B(500),Ki=33554432,Ks=Ki;function fl(e){let i=e.componentRenderCacheBytes;if(typeof i!=="number"||i<0||i===Ks)return;Ks=i,Hn.setMaxBytes(i)}var Hn=new B(2000,{maxBytes:Ki,sizeOf:(e)=>e.output.length});function pl(e){let i=new WeakSet;try{let t=(o)=>{if(o===void 0)return{__stxType:"undefined"};if(typeof o==="bigint")return{__stxType:"bigint",value:o.toString()};if(typeof o==="function"||typeof o==="symbol")throw TypeError("Non-serializable component input");if(o===null||typeof o!=="object")return o;if(i.has(o))throw TypeError("Circular component input");i.add(o);try{if(o instanceof Date)return{__stxType:"date",value:o.toISOString()};if(Array.isArray(o))return o.map(t);let a=Object.getPrototypeOf(o);if(a!==Object.prototype&&a!==null)throw TypeError("Non-plain component input");let h={};for(let c of Object.keys(o).sort())h[c]=t(o[c]);return h}finally{i.delete(o)}};return JSON.stringify(t(e))}catch{return null}}function dl(e){let i={};for(let[t,o]of Object.entries(e))if(!t.startsWith("__")||t==="__stxServeContext")i[t]=o;return i}function Fs(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vs(e){let i=process.cwd(),t=`${i}\x00${e}`,o=zi.get(t);if(o===void 0)o=Bun.hash(Zi(e,i).split(le.sep).join("/")).toString(36).slice(0,6),zi.set(t,o);return o}var zi=new Map;function Zi(e,i){if(!le.isAbsolute(e))return e;let t=(o)=>{try{return qs.realpathSync(o)}catch{return o}};return le.relative(t(i),t(e))}function ou(e){return/\bjs\b/.test(e)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test(e)}function Me(e){return!ou(e)}var Vn=new Map;function J(e){let i;try{i=JSON.stringify(e)}catch{return new Bun.Transpiler(e)}let t=Vn.get(i);if(t)return t;if(Vn.size>=16)Vn.clear();let o=new Bun.Transpiler(e);return Vn.set(i,o),o}var Wi=new WeakMap,gl=256;function Le(e){try{let i=J({loader:"ts",target:"browser",define:k()}),t=Wi.get(i);if(!t)t=new Map,Wi.set(i,t);let o=t.get(e);if(o!==void 0)return o;let a=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");a=a.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let h=[];a=a.replace(/\{!![\s\S]*?!!\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`}),a=a.replace(/\{\{\{[\s\S]*?\}\}\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`}),a=a.replace(/\{\{[\s\S]*?\}\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`});let c=i.transformSync(a);for(let v=0;v<h.length;v++)c=c.replace(`"__STX_EXPR_${v}__"`,h[v]),c=c.replace(`'__STX_EXPR_${v}__'`,h[v]);if(t.size>=gl){let v=t.keys().next();if(!v.done)t.delete(v.value)}return t.set(e,c),c}catch(i){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",i);return e}}function ml(e){let i=[],t=new Set,o=0,a=0,h=e.length,c=(C)=>{a++;while(a<h){if(e[a]==="\\"){a+=2;continue}if(e[a]===C){a++;return}a++}},v=()=>{a++;while(a<h){if(e[a]==="\\"){a+=2;continue}if(e[a]==="`"){a++;return}if(e[a]==="$"&&e[a+1]==="{"){a+=2;let C=1;while(a<h&&C>0)if(e[a]==="{")C++,a++;else if(e[a]==="}")C--,a++;else if(e[a]==="'"||e[a]==='"')c(e[a]);else if(e[a]==="`")v();else a++;continue}a++}},E=()=>{if(e[a]==="/"&&e[a+1]==="/"){while(a<h&&e[a]!==`
286
+ `)a++;return!0}if(e[a]==="/"&&e[a+1]==="*"){a+=2;while(a<h-1&&!(e[a]==="*"&&e[a+1]==="/"))a++;return a+=2,!0}return!1},R=()=>{if(o!==0)return;let C=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(C){let I=C[2].split(",").map((P)=>{let G=P.trim().split(":");return G[G.length-1].trim()});for(let P of I)if(P&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(P)&&!t.has(P))i.push(P),t.add(P);return}let O=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(O){let I=O[2];if(!t.has(I))i.push(I),t.add(I);return}let M=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!t.has(I))i.push(I),t.add(I);return}let N=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!t.has(I))i.push(I),t.add(I)}};while(a<h){if(E())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){v();continue}if(e[a]==="{"){o++,a++;continue}if(e[a]==="}"){o--,a++;continue}if(o===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))R();a++}return i}function hl(e){let i=[],t=0,o=0,a=null;for(let h=0;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)i.push(e.slice(o,h)),o=h+1}if(o<e.length)i.push(e.slice(o));return i}function xl(e){let i=0,t=null;for(let o=0;o<e.length;o++){let a=e[o];if(t){if(a==="\\"){o++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")i++;else if(a===")"||a==="]"||a==="}")i--;else if(a==="="&&i===0){let h=e[o-1],c=e[o+1];if(h==="!"||h==="<"||h===">"||h==="=")continue;if(c==="="||c===">")continue;return o}}return-1}function bl(e,i){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let o=t.index-1;while(o>=0&&/\s/.test(e[o]))o--;if(e[o]!=="}")return;let a=o,h=0,c=-1;for(;o>=0;o--){let E=e[o];if(E==="}")h++;else if(E==="{"){if(h--,h===0){c=o;break}}}if(c===-1)return;let v=e.slice(c+1,a);for(let E of hl(v)){let R=E.trim();if(!R||R.startsWith("..."))continue;let C=xl(R);if(C===-1)continue;let O=R.slice(0,C).trim();if(!/^[A-Z_$][\w$]*$/i.test(O))continue;if(i[O]!==void 0)continue;let M=R.slice(C+1).trim();if(!M)continue;try{let N=Object.keys(i).filter(Dt),I=Function(...N,`"use strict"; return (${M});`);i[O]=I(...N.map((P)=>i[P]))}catch{}}}catch{}}var yl=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function iu(e,i){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let o=t[2].toLowerCase();if(!yl.has(o))return null;let a=new RegExp(`<\\/?${o}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),h=z(e,(R,C)=>(a.lastIndex=C,a.exec(R)?.index===C?a.lastIndex:-1));if(o==="span"&&/\sdata-stx-scope\s*=/.test(h[0]?.token||""))return null;let c=0,v=!1;for(let R of h){if(c+=R.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(R.end).trim())return null;v=!0;break}}if(!v)return null;let E=t[0].length;return e.slice(0,E)+i+e.slice(E)}async function pr(e,i,t,o,a){let h=e.endsWith(".stx")?e.slice(0,-4):e,c=(ne)=>ne.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),v=t.__importedComponents;if(v){for(let ne of[h,h.toLowerCase(),c(h),j(h)])if(v.has(ne))return!0}let E=[...new Set([`${h}.stx`,`${c(h)}.stx`,`${j(h)}.stx`])],R=typeof a.root==="string"?le.resolve(a.root):void 0,C=R??le.dirname(o),O=[],M=(ne)=>{if(ne&&!O.includes(ne))O.push(ne)},N=t.__originalFilePath;if(N)M(le.join(le.dirname(N),"components"));M(i),M(a._rootComponentsDir),M(le.join(le.dirname(o),"components")),M(a.componentsDir);let I=a._targetComponentFallbackNames?.some((ne)=>ne.toLowerCase()===h.toLowerCase());if(!I)for(let ne of a._targetComponentDirs??[])M(ne);if(R)M(le.resolve(R,"resources/views/components")),M(le.resolve(R,"resources/components")),M(le.resolve(R,"src/components")),M(le.resolve(R,"components"));for(let ne of a._layerComponentDirs??[])M(ne);let P=a._pluginComponentDirs;if(Array.isArray(P))for(let ne of P)M(typeof ne==="string"?ne:null);if(M(a.fallbackComponentsDir),I)for(let ne of a._targetComponentDirs??[])M(ne);if(h.startsWith("./")||h.startsWith("../"))return n(le.resolve(le.dirname(o),`${h}.stx`));let G=Fi(le.resolve(import.meta.dir,"components")),q=O.map((ne)=>le.isAbsolute(ne)?ne:le.resolve(C,ne)),Z=`${E.join("\x00")}\x00\x00${q.join("\x00")}`,Q=Us.get(Z);if(Q!==void 0)return Q;let te=!1;e:for(let ne of q){if(Fi(ne)===G)continue;for(let ae of E)if(await n(le.join(ne,ae))){te=!0;break e}}return Us.set(Z,te),te}function Fi(e){let i=Hs.get(e);if(i!==void 0)return i;let t=e;try{t=qs.realpathSync(e)}catch{}return Hs.set(e,t),t}function au(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Ya(e){if(!e)return!1;let i=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(i)}function _l(e,i,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let o=(a,h)=>{let c;try{c=_(a,i)}catch{return h}if(c===void 0||c===null)return"";let v=String(c);if(/<\/style/i.test(v))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return v};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>o(h,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,h)=>o(h,a))}var Vi=new Set;function Ui(e,i,t,o){let a=`${e}\x00${i}\x00${o??""}`;if(!process.env.STX_DEBUG&&Vi.has(a))return;Vi.add(a);let h=i?` used in ${i}`:"",c=o?` Cause: ${o}.`:"",v=t.length>0?`
287
287
  searched:
288
288
  ${t.map((E)=>` - ${E}`).join(`
289
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${h}, so it rendered as nothing.${c}${v}`)}function Ui(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function jo(e){let i=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let o of e){let a;while((a=t.exec(o))!==null)i.add(a[1]);t.lastIndex=0}return[...i]}async function je(e,i,t,o,a,h,c,v=new Set,E,R=et(a),C,O=e){let{extractVariables:M}=await s("stx/variable-extractor",()=>import("./chunk-5fmxn52y.js")),N=v??new Set;if(N.has(e))return`[Circular component reference: ${e}]`;let I=new Set(N);I.add(e);let P=typeof i.client==="string"?i.client.trim():"";if("client"in i)delete i.client;let q=P&&P!=="load"&&ou(P)?P:"";try{let Z=(ce)=>ce.split("-").map((ie)=>ie.charAt(0).toUpperCase()+ie.slice(1)).join(""),W=O.endsWith(".stx")?O.slice(0,-4):O,Y=null,ee=a.__importedComponents;if(ee){let ce=[W,W.toLowerCase(),Z(W),j(W)];for(let ie of ce)if(ee.has(ie)){Y=ee.get(ie);break}}let te=[];if(!Y){let ce=[`${W}.stx`,`${Z(W)}.stx`,`${j(W)}.stx`],ie=[...new Set(ce)],he=a.__originalFilePath,xe=[];if(xe.push(...c._layerComponentDirs??[]),he){let _e=le.join(le.dirname(he),"components");xe.push(_e)}if(o)xe.push(o);let Ke=c._rootComponentsDir;if(typeof Ke==="string"&&!xe.includes(Ke))xe.push(Ke);let We=le.join(le.dirname(h),"components");if(!xe.includes(We))xe.push(We);if(c.componentsDir&&c.componentsDir!==o&&!xe.includes(c.componentsDir))xe.push(c.componentsDir);let it=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(W),ot=(C?.events??[]).map((_e)=>_e.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),at=Object.hasOwn(i,"checked")||Boolean(C?.reactiveProps?.includes("checked")),bt=Object.hasOwn(i,"value")||Boolean(C?.reactiveProps?.includes("value")),_n=!ot.includes("valuechange")&&(at||ot.includes("change")&&!bt),Gn=c._nativeHostAttrs&&/^textinput$/i.test(W),yt=ot.includes("update:value")&&!ot.includes("input"),Ut=c._nativeHostAttrs&&/^video$/i.test(W),wn=Object.hasOwn(i,"src")||Boolean(C?.reactiveProps?.includes("src")),Sn=Object.hasOwn(i,"source")||Boolean(C?.reactiveProps?.includes("source")),$n=Ut&&wn&&!Sn&&(C?.events??[]).every((_e)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(_e.replace(/^@/,"").split(".")[0])),Ht=c._targetComponentFallbackNames?.some((_e)=>_e.toLowerCase()===W.toLowerCase())&&(!it||_n)&&(!Gn||yt)&&(!Ut||$n);for(let _e of Ht?[]:c._targetComponentDirs??[])if(_e&&!xe.includes(_e))xe.push(_e);let _t=typeof c.root==="string"?le.resolve(c.root):void 0,oo=_t??le.dirname(h),wt=[];if(_t)wt.push(le.resolve(_t,"resources/views/components")),wt.push(le.resolve(_t,"resources/components")),wt.push(le.resolve(_t,"src/components")),wt.push(le.resolve(_t,"components"));wt.push(le.resolve(import.meta.dir,"components"));for(let _e of wt)if(!xe.includes(_e))xe.push(_e);let tr=c._pluginComponentDirs;if(Array.isArray(tr)){for(let _e of tr)if(typeof _e==="string"&&!xe.includes(_e))xe.push(_e)}if(c.fallbackComponentsDir&&!xe.includes(c.fallbackComponentsDir))xe.push(c.fallbackComponentsDir);if(Ht){for(let _e of c._targetComponentDirs??[])if(_e&&!xe.includes(_e))xe.push(_e)}let nr=[...new Set(xe.map((_e)=>{if(!_e)return _e;return le.isAbsolute(_e)?_e:le.resolve(oo,_e)}))];xe.length=0,xe.push(...nr);let Yn=`${W}\x00${h}\x00${nr.join("\x00")}`,Qn=Un.get(Yn);if(Qn)if(await n(Qn))Y=Qn;else Un.delete(Yn);if(!Y&&(W.startsWith("./")||W.startsWith("../")))Y=le.resolve(le.dirname(h),`${W}.stx`),te.push(Y);else if(!Y)for(let _e of xe){if(!_e)continue;for(let vn of ie){let En=le.join(_e,vn);if(te.push(En),await n(En)){Y=En;break}}if(Y)break;if(!Y)try{let vn=await import("fs");if(!vn.statSync(_e,{throwIfNoEntry:!1})?.isDirectory())continue;let ao=8,es=[{path:_e,depth:0}];while(es.length>0&&!Y){let kn=es.pop();if(kn.depth>=ao)continue;let sr;try{sr=vn.readdirSync(kn.path,{withFileTypes:!0})}catch{continue}for(let Rn of sr){if(!Rn.isDirectory())continue;if(Rn.name==="node_modules"||Rn.name.startsWith("."))continue;let rr=le.join(kn.path,Rn.name);for(let co of ie){let ts=le.join(rr,co);if(te.push(ts),await n(ts)){Y=ts;break}}if(Y)break;es.push({path:rr,depth:kn.depth+1})}}}catch{}if(Y)break}if(Y)Un.set(Yn,Y)}if(!Y||!await n(Y))return Vi(e,h,te),Ui(e);E.add(Y);let ae;if(Qt.has(Y))ae=Qt.get(Y);else try{ae=await Bun.file(Y).text(),Qt.set(Y,ae)}catch(ce){let ie=ce instanceof Error?ce.message:String(ce);return Vi(e,h,[Y],ie),Ui(e)}if(C)for(let ce of new Set([...Object.keys(i),...C.reactiveProps??[]])){let ie=ce.toLowerCase();if(ie.startsWith("aria-")||ie.startsWith("data-"))continue;let he=ce.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${he}\\b`).test(ae))C.declaredProps.add(ce);if(new RegExp(`\\$props\\s*(?:\\.\\s*${he}\\b|\\[\\s*['"]${he}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${he}['"]`).test(ae))C.consumedProps?.add(ce)}let me=new Set(["__originalFilePath","__importedComponents",In,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),ke={};for(let[ce,ie]of Object.entries(a))if(!ce.startsWith("__")||me.has(ce))ke[ce]=ie;let Re=R.length>0?{[Bn]:[...R]}:{},Ve=t;if(t.includes("@include")){let{processIncludes:ce}=await s("stx/includes",()=>import("./chunk-kejrhccx.js"));Ve=await ce(t,a,h,c,E)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ve)){let{processComponents:ce}=await s("stx/component-renderer",()=>import("./chunk-pz3mg7hr.js"));Ve=await ce(Ve,{...a,__processedComponents:N,...Re},h,c,E)}let Te=[];if(Xa(Ve)){let{processExpressions:ce}=await s("stx/expressions",()=>import("./chunk-0v35wpm7.js")),ie=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Re}:R.length>0?{...a,...Re}:a;Ve=ce(Ve,ie,h);for(let he of Ve.matchAll(/\{\{([\s\S]*?)\}\}/g))Te.push(he[1].trim())}let Ze=K(Ve),Ye=[],mt=Ze.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ce,ie)=>{let he=Ze.scripts[Number(ie)]||"",xe=he.match(/^<script\b([^>]*)>/i)?.[1]||"",Ke=xe.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),We=!Ke||["module","text/javascript","application/javascript"].includes(Ke),it=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${xe}`);if(!/\bserver\b/i.test(xe)&&We&&!it)return Ye.push(he),"";return he}),{extractSlotContent:Zn}=await s("stx/slots",()=>import("./chunk-cwmazy7y.js")),lt=Zn(mt),ut={};if(lt.defaultSlot?.trim())ut.default=lt.defaultSlot;for(let[ce,ie]of lt.namedSlots)ut[ce]=ie.content;let ft=a.__stx_scope_seq??={n:0,key:bs(String(a.__filename??h))},Mt=Ki(e,process.cwd()),nt=`stx_${(Mt.endsWith(".stx")?Mt.slice(0,-4):Mt).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,Ue={...ke,$uid:nt,$native:c._nativeHostAttrs===!0,...i,props:i,slot:mt,$slots:ut,__processedComponents:I,__sections:{},__stx_signals_gate:we(ae)||Xa(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Te]};xl(ae,Ue);let jt=ae,tn=ue(jt);if(tn)jt=tn.content.trim();let qn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Nt=[...ae.matchAll(qn)];for(let[,ce,ie]of Nt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ce))Pe(ie,Y,c.strict);let Je=[],Lt=null,Xn=Nt.some((ce)=>/\bserver\b/.test(ce[1]||"")&&/\bcache\b/.test(ce[1]||"")),ht=null,Qe=null,Bt=null,nn=0,zt=null;if(ul(c),Xn&&Ks>0){let ce=fl({props:i,slot:Ve,slotContext:t.trim()?pl(ke):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((ie)=>ie.configFile),uid:nt});if(ce!==null){ht=`${Y}\x00${w(ae)}\x00${ce}`;let ie=Hn.get(ht);if(ie){for(let he of ie.dependencies)E.add(he);if(Fr(a,ie.clientFactories),ft.n+=ie.uidsConsumed,ie.preservedClientExpressions.length>0){let he=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let xe of ie.preservedClientExpressions)he.add(xe);a.__stx_preserved_client_expressions=[...he]}return ie.output}Qe=new Set(E),Bt=zr(a),nn=ft.n,zt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Wt=new Set;for(let ce of Nt){let ie=ce[1]||"",he=ce[2]||"",xe=ie.includes("server");if(Me(ie)&&he.trim())he=Le(he);if(xe&&he){for(let We of Oe(he))Wt.add(We);try{await M(he,Ue,Y,{onFailure:(We)=>{if(We.kind!=="unknown")Lt=We.kind}})}catch(We){}}if(!xe){let We=he.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),it=We.includes("{{")&&We.includes("}}"),ot=We.includes("{!!")&&We.includes("!!}");if(it||ot)We=Fo(We,Ue,Y);let at=ie.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${at}>${We}</script>`)}}let qe=K(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=qe?qe[1]:"",Jn=qe?qe[2]:"",tt="",Q=Ft&&/\bscoped\b/i.test(Ft);if(qe)tt=`<style${Ft}>${yl(Jn,Ue,Y)}</style>`;let ne=jt;if(ne=ne.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),qe)ne=ne.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ce=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ie=[];if(ne=ne.replace(ce,(he,xe)=>{let Ke=xe.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ke)ie.push(`<style${Ke[1]}>${Ke[2]}</style>`);return""}),ne=ne.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ie.length>0)tt=`${tt}${ie.join(`
290
- `)}`}if(t&&ne.includes("{{ text || slot }}"))ne=ne.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:ge}=await s("stx/slots",()=>import("./chunk-cwmazy7y.js")),{defaultSlot:ye,namedSlots:Ee}=lt,Fe=c._nativeHostAttrs===!0&&Je.length>0||Je.some((ce)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ce)),pt=(ce)=>Fe?xi(ce,nt):ce,er=new Map([...Ee].map(([ce,ie])=>[ce,{...ie,content:pt(ie.content)}]));ne=await ge(ne,pt(ye),er,Ue,Fe?nt:"");let sn=jo(Je),rn=(Array.isArray(Ue.__stx_client_signal_names)?Ue.__stx_client_signal_names:[]).filter((ce)=>!Wt.has(ce));if(sn.length>0||rn.length>0)Ue.__stx_client_signal_names=[...new Set([...rn,...sn])];else delete Ue.__stx_client_signal_names;let Vt=R.filter((ce)=>!Wt.has(ce)&&!(ce in i));if(Vt.length>0)Ue[Bn]=Vt;let xn={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:le.dirname(Y),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||Fe||Je.length===0,defaultLayout:void 0};Ue.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:bn}=await s("stx/process",()=>import("./chunk-52x079ax.js")),rt=await bn(ne,Ue,Y,xn,E),xt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ce of rt.matchAll(/\{\{([\s\S]*?)\}\}/g))xt.add(ce[1].trim());if(xt.size>0)a.__stx_preserved_client_expressions=[...xt];let Xe=nt,He=rt;if(Fe){let ce="";if(Object.keys(i).length>0)try{ce=` data-stx-props="${Fs(JSON.stringify(i))}"`}catch{}let ie=q?` stx-hydrate="${Fs(q)}"`:"",he=Object.fromEntries(Object.entries(ut).map(([at,bt])=>[at,Boolean(bt)])),xe=Object.keys(he).length>0?` data-stx-slots="${Fs(JSON.stringify(he))}"`:"",Ke=` data-stx-scope="${Xe}"${ce}${xe}${ie}`,We=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(rt),it=We?"span":"div";He=su(rt,Ke)??`<${it}${Ke} data-stx-component-wrapper${We?' style="display:contents"':""}>${rt}</${it}>`;let ot=await Promise.all(Je.map(async(at)=>{let bt=at.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!bt)return at;let[,_n,Gn]=bt,yt=await Sl(Gn,Y,c.buildMode==="compile"),Ut=fn(yt.clientCode,Ne(Ue)),{vendorStyleTags:wn}=yt,Sn=Ut?`function(__scopeId) {
291
- ${Ut}
292
- return (${yt.factoryBody})(__scopeId);
293
- }`:yt.factoryBody,$n=q?null:Ss(a,Sn),Ht=$n?`window.__stxComponentFactories[${JSON.stringify($n)}](${JSON.stringify(Xe)});`:`(${Sn})(${JSON.stringify(Xe)});`;if(q)return`${wn}<script type="stx/island" data-stx-island="${Xe}" data-stx-scoped data-stx-owner="${Xe}"${_n}>${Ht}</script>`;return`${wn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${Xe}"${_n}>${Ht}</script>`}));if(He=He+`
294
- `+ot.join(`
289
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${h}, so it rendered as nothing.${c}${v}`)}function Hi(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Fo(e){let i=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let o of e){let a;while((a=t.exec(o))!==null)i.add(a[1]);t.lastIndex=0}return[...i]}async function je(e,i,t,o,a,h,c,v=new Set,E,R=et(a),C,O=e){let{extractVariables:M}=await s("stx/variable-extractor",()=>import("./chunk-8nk56cs2.js")),N=v??new Set;if(N.has(e))return`[Circular component reference: ${e}]`;let I=new Set(N);I.add(e);let P=typeof i.client==="string"?i.client.trim():"";if("client"in i)delete i.client;let G=P&&P!=="load"&&au(P)?P:"";try{let q=(ce)=>ce.split("-").map((ie)=>ie.charAt(0).toUpperCase()+ie.slice(1)).join(""),Z=O.endsWith(".stx")?O.slice(0,-4):O,Q=null,te=a.__importedComponents;if(te){let ce=[Z,Z.toLowerCase(),q(Z),j(Z)];for(let ie of ce)if(te.has(ie)){Q=te.get(ie);break}}let ne=[];if(!Q){let ce=[`${Z}.stx`,`${q(Z)}.stx`,`${j(Z)}.stx`],ie=[...new Set(ce)],he=a.__originalFilePath,xe=[];if(xe.push(...c._layerComponentDirs??[]),he){let _e=le.join(le.dirname(he),"components");xe.push(_e)}if(o)xe.push(o);let Ke=c._rootComponentsDir;if(typeof Ke==="string"&&!xe.includes(Ke))xe.push(Ke);let Ce=le.join(le.dirname(h),"components");if(!xe.includes(Ce))xe.push(Ce);if(c.componentsDir&&c.componentsDir!==o&&!xe.includes(c.componentsDir))xe.push(c.componentsDir);let at=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(Z),ct=(C?.events??[]).map((_e)=>_e.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),nt=Object.hasOwn(i,"checked")||Boolean(C?.reactiveProps?.includes("checked")),_t=Object.hasOwn(i,"value")||Boolean(C?.reactiveProps?.includes("value")),bn=!ct.includes("valuechange")&&(nt||ct.includes("change")&&!_t),Gn=c._nativeHostAttrs&&/^textinput$/i.test(Z),_n=ct.includes("update:value")&&!ct.includes("input"),gt=c._nativeHostAttrs&&/^video$/i.test(Z),wn=Object.hasOwn(i,"src")||Boolean(C?.reactiveProps?.includes("src")),Sn=Object.hasOwn(i,"source")||Boolean(C?.reactiveProps?.includes("source")),$n=gt&&wn&&!Sn&&(C?.events??[]).every((_e)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(_e.replace(/^@/,"").split(".")[0])),Ut=c._targetComponentFallbackNames?.some((_e)=>_e.toLowerCase()===Z.toLowerCase())&&(!at||bn)&&(!Gn||_n)&&(!gt||$n);for(let _e of Ut?[]:c._targetComponentDirs??[])if(_e&&!xe.includes(_e))xe.push(_e);let rt=typeof c.root==="string"?le.resolve(c.root):void 0,ao=rt??le.dirname(h),wt=[];if(rt)wt.push(le.resolve(rt,"resources/views/components")),wt.push(le.resolve(rt,"resources/components")),wt.push(le.resolve(rt,"src/components")),wt.push(le.resolve(rt,"components"));wt.push(le.resolve(import.meta.dir,"components"));for(let _e of wt)if(!xe.includes(_e))xe.push(_e);let tr=c._pluginComponentDirs;if(Array.isArray(tr)){for(let _e of tr)if(typeof _e==="string"&&!xe.includes(_e))xe.push(_e)}if(c.fallbackComponentsDir&&!xe.includes(c.fallbackComponentsDir))xe.push(c.fallbackComponentsDir);if(Ut){for(let _e of c._targetComponentDirs??[])if(_e&&!xe.includes(_e))xe.push(_e)}let nr=[...new Set(xe.map((_e)=>{if(!_e)return _e;return le.isAbsolute(_e)?_e:le.resolve(ao,_e)}))];xe.length=0,xe.push(...nr);let Yn=`${Z}\x00${h}\x00${nr.join("\x00")}`,Qn=Un.get(Yn);if(Qn)if(await n(Qn))Q=Qn;else Un.delete(Yn);if(!Q&&(Z.startsWith("./")||Z.startsWith("../")))Q=le.resolve(le.dirname(h),`${Z}.stx`),ne.push(Q);else if(!Q)for(let _e of xe){if(!_e)continue;for(let vn of ie){let En=le.join(_e,vn);if(ne.push(En),await n(En)){Q=En;break}}if(Q)break;if(!Q)try{let vn=await import("fs");if(!vn.statSync(_e,{throwIfNoEntry:!1})?.isDirectory())continue;let co=8,es=[{path:_e,depth:0}];while(es.length>0&&!Q){let kn=es.pop();if(kn.depth>=co)continue;let sr;try{sr=vn.readdirSync(kn.path,{withFileTypes:!0})}catch{continue}for(let Rn of sr){if(!Rn.isDirectory())continue;if(Rn.name==="node_modules"||Rn.name.startsWith("."))continue;let rr=le.join(kn.path,Rn.name);for(let lo of ie){let ts=le.join(rr,lo);if(ne.push(ts),await n(ts)){Q=ts;break}}if(Q)break;es.push({path:rr,depth:kn.depth+1})}}}catch{}if(Q)break}if(Q)Un.set(Yn,Q)}if(!Q||!await n(Q))return Ui(e,h,ne),Hi(e);E.add(Q);let ae;if(Yt.has(Q))ae=Yt.get(Q);else try{ae=await Bun.file(Q).text(),Yt.set(Q,ae)}catch(ce){let ie=ce instanceof Error?ce.message:String(ce);return Ui(e,h,[Q],ie),Hi(e)}if(C)for(let ce of new Set([...Object.keys(i),...C.reactiveProps??[]])){let ie=ce.toLowerCase();if(ie.startsWith("aria-")||ie.startsWith("data-"))continue;let he=ce.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${he}\\b`).test(ae))C.declaredProps.add(ce);if(new RegExp(`\\$props\\s*(?:\\.\\s*${he}\\b|\\[\\s*['"]${he}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${he}['"]`).test(ae))C.consumedProps?.add(ce)}let me=new Set(["__originalFilePath","__importedComponents",Pn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),ke={};for(let[ce,ie]of Object.entries(a))if(!ce.startsWith("__")||me.has(ce))ke[ce]=ie;let Re=R.length>0?{[Bn]:[...R]}:{},Ue=t;if(t.includes("@include")){let{processIncludes:ce}=await s("stx/includes",()=>import("./chunk-bv43s0gx.js"));Ue=await ce(t,a,h,c,E)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ue)){let{processComponents:ce}=await s("stx/component-renderer",()=>import("./chunk-rk8kmshp.js"));Ue=await ce(Ue,{...a,__processedComponents:N,...Re},h,c,E)}let We=[];if(Ya(Ue)){let{processExpressions:ce}=await s("stx/expressions",()=>import("./chunk-4m5g3f2b.js")),ie=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Re}:R.length>0?{...a,...Re}:a;Ue=ce(Ue,ie,h);for(let he of Ue.matchAll(/\{\{([\s\S]*?)\}\}/g))We.push(he[1].trim())}let Ze=K(Ue),Ye=[],xt=Ze.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ce,ie)=>{let he=Ze.scripts[Number(ie)]||"",xe=he.match(/^<script\b([^>]*)>/i)?.[1]||"",Ke=xe.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ce=!Ke||["module","text/javascript","application/javascript"].includes(Ke),at=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${xe}`);if(!/\bserver\b/i.test(xe)&&Ce&&!at)return Ye.push(he),"";return he}),{extractSlotContent:Zn}=await s("stx/slots",()=>import("./chunk-3tkag58v.js")),ut=Zn(xt),ft={};if(ut.defaultSlot?.trim())ft.default=ut.defaultSlot;for(let[ce,ie]of ut.namedSlots)ft[ce]=ie.content;let pt=a.__stx_scope_seq??={n:0,key:vs(String(a.__filename??h))},Mt=Zi(e,process.cwd()),it=`stx_${(Mt.endsWith(".stx")?Mt.slice(0,-4):Mt).replace(/[^a-zA-Z0-9]/g,"_")}_${++pt.n}_${pt.key}`,Fe={...ke,$uid:it,$native:c._nativeHostAttrs===!0,...i,props:i,slot:xt,$slots:ft,__processedComponents:I,__sections:{},__stx_signals_gate:we(ae)||Ya(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...We]};bl(ae,Fe);let jt=ae,en=ue(jt);if(en)jt=en.content.trim();let qn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Nt=[...ae.matchAll(qn)];for(let[,ce,ie]of Nt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ce))Pe(ie,Q,c.strict);let Je=[],Lt=null,Xn=Nt.some((ce)=>/\bserver\b/.test(ce[1]||"")&&/\bcache\b/.test(ce[1]||"")),bt=null,Qe=null,Bt=null,tn=0,zt=null;if(fl(c),Xn&&Ks>0){let ce=pl({props:i,slot:Ue,slotContext:t.trim()?dl(ke):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((ie)=>ie.configFile),uid:it});if(ce!==null){bt=`${Q}\x00${w(ae)}\x00${ce}`;let ie=Hn.get(bt);if(ie){for(let he of ie.dependencies)E.add(he);if(Hr(a,ie.clientFactories),pt.n+=ie.uidsConsumed,ie.preservedClientExpressions.length>0){let he=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let xe of ie.preservedClientExpressions)he.add(xe);a.__stx_preserved_client_expressions=[...he]}return ie.output}Qe=new Set(E),Bt=Vr(a),tn=pt.n,zt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Wt=new Set;for(let ce of Nt){let ie=ce[1]||"",he=ce[2]||"",xe=ie.includes("server");if(Me(ie)&&he.trim())he=Le(he);if(xe&&he){for(let Ce of Oe(he))Wt.add(Ce);try{await M(he,Fe,Q,{onFailure:(Ce)=>{if(Ce.kind!=="unknown")Lt=Ce.kind}})}catch(Ce){}}if(!xe){let Ce=he.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),at=Ce.includes("{{")&&Ce.includes("}}"),ct=Ce.includes("{!!")&&Ce.includes("!!}");if(at||ct)Ce=Ho(Ce,Fe,Q);let nt=ie.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${nt}>${Ce}</script>`)}}let qe=K(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=qe?qe[1]:"",Jn=qe?qe[2]:"",tt="",ee=Ft&&/\bscoped\b/i.test(Ft);if(qe)tt=`<style${Ft}>${_l(Jn,Fe,Q)}</style>`;let re=jt;if(re=re.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),qe)re=re.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ce=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ie=[];if(re=re.replace(ce,(he,xe)=>{let Ke=xe.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ke)ie.push(`<style${Ke[1]}>${Ke[2]}</style>`);return""}),re=re.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ie.length>0)tt=`${tt}${ie.join(`
290
+ `)}`}if(t&&re.includes("{{ text || slot }}"))re=re.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:ge}=await s("stx/slots",()=>import("./chunk-3tkag58v.js")),{defaultSlot:ye,namedSlots:Ee}=ut,Ve=c._nativeHostAttrs===!0&&Je.length>0||Je.some((ce)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ce)),dt=(ce)=>Ve?xi(ce,it):ce,er=new Map([...Ee].map(([ce,ie])=>[ce,{...ie,content:dt(ie.content)}]));re=await ge(re,dt(ye),er,Fe,Ve?it:"");let nn=Fo(Je),sn=(Array.isArray(Fe.__stx_client_signal_names)?Fe.__stx_client_signal_names:[]).filter((ce)=>!Wt.has(ce));if(nn.length>0||sn.length>0)Fe.__stx_client_signal_names=[...new Set([...sn,...nn])];else delete Fe.__stx_client_signal_names;let Vt=R.filter((ce)=>!Wt.has(ce)&&!(ce in i));if(Vt.length>0)Fe[Bn]=Vt;let rn={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:le.dirname(Q),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||Ve||Je.length===0,defaultLayout:void 0};Fe.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:xn}=await s("stx/process",()=>import("./chunk-jecmxby7.js")),ot=await xn(re,Fe,Q,rn,E),yt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ce of ot.matchAll(/\{\{([\s\S]*?)\}\}/g))yt.add(ce[1].trim());if(yt.size>0)a.__stx_preserved_client_expressions=[...yt];let Xe=it,He=ot;if(Ve){let ce="";if(Object.keys(i).length>0)try{ce=` data-stx-props="${Fs(JSON.stringify(i))}"`}catch{}let ie=G?` stx-hydrate="${Fs(G)}"`:"",he=Object.fromEntries(Object.entries(ft).map(([nt,_t])=>[nt,Boolean(_t)])),xe=Object.keys(he).length>0?` data-stx-slots="${Fs(JSON.stringify(he))}"`:"",Ke=` data-stx-scope="${Xe}"${ce}${xe}${ie}`,Ce=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(ot),at=Ce?"span":"div";He=iu(ot,Ke)??`<${at}${Ke} data-stx-component-wrapper${Ce?' style="display:contents"':""}>${ot}</${at}>`;let ct=await Promise.all(Je.map(async(nt)=>{let _t=nt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return nt;let[,bn,Gn]=_t,_n=Bi(nt,Fe,Q);if(_n!==null)return _n;let gt=await $l(Gn,Q,c.buildMode==="compile"),wn=fn(gt.clientCode,Ne(Fe)),{vendorStyleTags:Sn}=gt,$n=wn?`function(__scopeId) {
291
+ ${wn}
292
+ return (${gt.factoryBody})(__scopeId);
293
+ }`:gt.factoryBody,Ut=G?null:As(a,$n),rt=Ut?`window.__stxComponentFactories[${JSON.stringify(Ut)}](${JSON.stringify(Xe)});`:`(${$n})(${JSON.stringify(Xe)});`;if(G)return`${Sn}<script type="stx/island" data-stx-island="${Xe}" data-stx-scoped data-stx-owner="${Xe}"${bn}>${rt}</script>`;return`${Sn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${Xe}"${bn}>${rt}</script>`}));if(He=He+`
294
+ `+ct.join(`
295
295
  `),tt)He+=`
296
296
  `+tt}else{if(tt)He+=`
297
- `+tt;if(Je.length>0){let ce=Ue.__stx_event_bindings||[],ie=Ne(Ue),he=await Promise.all(Je.map(async(xe)=>{let Ke=xe.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!Ke)return xe;return await De(Ke[1],{eventBindings:ce,templateContent:He,filePath:Y,projectRoot:process.cwd(),serverData:ie,instanceId:nt})}));He+=`
297
+ `+tt;if(Je.length>0){let ce=Fe.__stx_event_bindings||[],ie=Ne(Fe),he=await Promise.all(Je.map(async(xe)=>{let Ke=Bi(xe,Fe,Q);if(Ke!==null)return Ke;let Ce=xe.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!Ce)return xe;return await De(Ce[1],{eventBindings:ce,templateContent:He,filePath:Q,projectRoot:process.cwd(),serverData:ie,instanceId:it})}));He+=`
298
298
  `+he.join(`
299
- `),Ue.__stx_event_bindings=[]}}if(Q){let ce=gs(He,Y);if(ce.hasScoped)He=ce.html}if(ht&&Qe){let ce=Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[];Hn.set(ht,{output:He,dependencies:[...E].filter((ie)=>!Qe.has(ie)),clientFactories:Bt?Wr(a,Bt):[],uidsConsumed:ft.n-nn,preservedClientExpressions:zt?ce.filter((ie)=>!zt.has(ie)):[]})}if(Lt)He=`<!--stx-render-failed:${Lt}-->${He}`;return Ye.length>0?`${He}
299
+ `),Fe.__stx_event_bindings=[]}}if(ee){let ce=ms(He,Q);if(ce.hasScoped)He=ce.html}if(bt&&Qe){let ce=Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[];Hn.set(bt,{output:He,dependencies:[...E].filter((ie)=>!Qe.has(ie)),clientFactories:Bt?Ur(a,Bt):[],uidsConsumed:pt.n-tn,preservedClientExpressions:zt?ce.filter((ie)=>!zt.has(ie)):[]})}if(Lt)He=`<!--stx-render-failed:${Lt}-->${He}`;return Ye.length>0?`${He}
300
300
  ${Ye.join(`
301
- `)}`:He}catch(Z){if(Z instanceof V)throw Z;return`[Error processing component: ${Z instanceof Error?Z.message:String(Z)}]`}finally{N.delete(e)}}async function n(e){return Bun.file(e).exists()}function Zs(e,i){let t=le.resolve(i),o=le.resolve(e),a=t.endsWith(le.sep)?t:t+le.sep;if(o===t||o.startsWith(a))return o;return null}async function _l(e,i,t,o){let a=i.startsWith("layouts/")?i.slice(8):i,h=le.join(e,a);for(let c of h.endsWith(".stx")?[h]:[h,`${h}.stx`])if(await n(c)){if(o)console.log(`Found layout in ${e}: ${c}`);return t?.add(c),c}return null}async function gn(e,i,t,o){let a=await wl(e,i,t,o);if(a===null)return null;let h=Zs(a,process.cwd());if(h)return h;let c=[t.root,t.layoutsDir,t.fallbackLayoutsDir,t.componentsDir,t.partialsDir,t.pagesDir,...t._layerLayoutDirs??[]].filter((v)=>typeof v==="string"&&v.length>0);for(let v of c){let E=le.isAbsolute(v)?v:le.resolve(process.cwd(),v);if(Zs(a,E))return le.resolve(a)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${a} (template: ${e}, from: ${i})`),null}async function wl(e,i,t,o){if(t.debug)console.log(`Resolving template path: ${e} from ${i}`);let a=le.dirname(i),h=process.cwd();if(e.startsWith("/")){let M=le.join(h,e),N=Zs(M,h);if(!N)return console.warn(`[stx] rejected template path that escapes project root: ${e} (from ${i})`),null;if(t.debug)console.log(`Checking absolute path: ${N}`);if(await n(N)&&o)o.add(N);return N}let c=le.join(a,e);if(await n(c)){if(t.debug)console.log(`Found direct path: ${c}`);if(o)o.add(c);return c}if(!e.endsWith(".stx")&&!e.endsWith(".jsx")&&!e.endsWith(".tsx"))for(let M of[".stx",".tsx",".jsx"]){let N=`${c}${M}`;if(await n(N)){if(t.debug)console.log(`Found direct path with extension: ${N}`);if(o)o.add(N);return N}}let v=[];if(v.push(...t._layerLayoutDirs??[]),t.layoutsDir)v.push(le.isAbsolute(t.layoutsDir)?t.layoutsDir:le.resolve(process.cwd(),t.layoutsDir));let E=le.resolve(a),R=process.cwd();for(let M=0;M<10;M++){let N=le.join(E,"layouts"),I=!1;try{I=qs.statSync(N,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(I){v.push(N);break}let P=le.dirname(E);if(P===E||P.length<R.length)break;E=P}for(let M of v){let N=await _l(M,e,o,t.debug);if(N)return N}if(t.fallbackLayoutsDir){let M=le.isAbsolute(t.fallbackLayoutsDir)?t.fallbackLayoutsDir:le.resolve(process.cwd(),t.fallbackLayoutsDir),N=e.startsWith("layouts/")?e.slice(8):e,I=[le.join(M,N)];if(!e.endsWith(".stx"))I.push(`${I[0]}.stx`);for(let P of I)if(await n(P)){if(t.debug)console.log(`Found in options.fallbackLayoutsDir: ${P}`);if(o)o.add(P);return P}}if(e.startsWith("layouts/")||e.includes("/layouts/")){let M=e.split("layouts/"),N=le.join(t.partialsDir||a,"layouts",M[1]);if(await n(N)){if(t.debug)console.log(`Found in layouts path: ${N}`);if(o)o.add(N);return N}if(!N.endsWith(".stx")){let I=`${N}.stx`;if(await n(I)){if(t.debug)console.log(`Found in layouts path with extension: ${I}`);if(o)o.add(I);return I}}}if(t.partialsDir){let M=le.join(t.partialsDir,"layouts");if(await n(M)){let N=le.join(M,e);if(await n(N)){if(t.debug)console.log(`Found in partials layouts dir: ${N}`);if(o)o.add(N);return N}if(!e.endsWith(".stx")){let I=`${N}.stx`;if(await n(I)){if(t.debug)console.log(`Found in partials layouts dir with extension: ${I}`);if(o)o.add(I);return I}}}}let C=t.partialsDir||le.join(process.cwd(),"views"),O=le.join(C,e);if(await n(O)){if(t.debug)console.log(`Found in views path: ${O}`);if(o)o.add(O);return O}if(!e.endsWith(".stx")){let M=`${O}.stx`;if(await n(M)){if(t.debug)console.log(`Found in views path with extension: ${M}`);if(o)o.add(M);return M}}if(a.includes("temp")){let M=le.join(le.dirname(a),"layouts",e);if(await n(M)){if(t.debug)console.log(`Found in temp layouts dir: ${M}`);if(o)o.add(M);return M}if(!e.endsWith(".stx")){let N=`${M}.stx`;if(await n(N)){if(t.debug)console.log(`Found in temp layouts dir with extension: ${N}`);if(o)o.add(N);return N}}}if(t.debug)console.warn(`Template not found after trying all paths: ${e} (referenced from ${i})`);else console.warn(`Template not found: ${e} (referenced from ${i})`);return null}function Ja(e,i,t){let o=0,a="",h="";try{if(typeof i==="number"&&i>=0){let c=e.split(`
301
+ `)}`:He}catch(q){if(q instanceof U)throw q;return`[Error processing component: ${q instanceof Error?q.message:String(q)}]`}finally{N.delete(e)}}async function n(e){return Bun.file(e).exists()}function Zs(e,i){let t=le.resolve(i),o=le.resolve(e),a=t.endsWith(le.sep)?t:t+le.sep;if(o===t||o.startsWith(a))return o;return null}async function wl(e,i,t,o){let a=i.startsWith("layouts/")?i.slice(8):i,h=le.join(e,a);for(let c of h.endsWith(".stx")?[h]:[h,`${h}.stx`])if(await n(c)){if(o)console.log(`Found layout in ${e}: ${c}`);return t?.add(c),c}return null}async function gn(e,i,t,o){let a=await Sl(e,i,t,o);if(a===null)return null;let h=Zs(a,process.cwd());if(h)return h;let c=[t.root,t.layoutsDir,t.fallbackLayoutsDir,t.componentsDir,t.partialsDir,t.pagesDir,...t._layerLayoutDirs??[]].filter((v)=>typeof v==="string"&&v.length>0);for(let v of c){let E=le.isAbsolute(v)?v:le.resolve(process.cwd(),v);if(Zs(a,E))return le.resolve(a)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${a} (template: ${e}, from: ${i})`),null}async function Sl(e,i,t,o){if(t.debug)console.log(`Resolving template path: ${e} from ${i}`);let a=le.dirname(i),h=process.cwd();if(e.startsWith("/")){let M=le.join(h,e),N=Zs(M,h);if(!N)return console.warn(`[stx] rejected template path that escapes project root: ${e} (from ${i})`),null;if(t.debug)console.log(`Checking absolute path: ${N}`);if(await n(N)&&o)o.add(N);return N}let c=le.join(a,e);if(await n(c)){if(t.debug)console.log(`Found direct path: ${c}`);if(o)o.add(c);return c}if(!e.endsWith(".stx")&&!e.endsWith(".jsx")&&!e.endsWith(".tsx"))for(let M of[".stx",".tsx",".jsx"]){let N=`${c}${M}`;if(await n(N)){if(t.debug)console.log(`Found direct path with extension: ${N}`);if(o)o.add(N);return N}}let v=[];if(v.push(...t._layerLayoutDirs??[]),t.layoutsDir)v.push(le.isAbsolute(t.layoutsDir)?t.layoutsDir:le.resolve(process.cwd(),t.layoutsDir));let E=le.resolve(a),R=process.cwd();for(let M=0;M<10;M++){let N=le.join(E,"layouts"),I=!1;try{I=qs.statSync(N,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(I){v.push(N);break}let P=le.dirname(E);if(P===E||P.length<R.length)break;E=P}for(let M of v){let N=await wl(M,e,o,t.debug);if(N)return N}if(t.fallbackLayoutsDir){let M=le.isAbsolute(t.fallbackLayoutsDir)?t.fallbackLayoutsDir:le.resolve(process.cwd(),t.fallbackLayoutsDir),N=e.startsWith("layouts/")?e.slice(8):e,I=[le.join(M,N)];if(!e.endsWith(".stx"))I.push(`${I[0]}.stx`);for(let P of I)if(await n(P)){if(t.debug)console.log(`Found in options.fallbackLayoutsDir: ${P}`);if(o)o.add(P);return P}}if(e.startsWith("layouts/")||e.includes("/layouts/")){let M=e.split("layouts/"),N=le.join(t.partialsDir||a,"layouts",M[1]);if(await n(N)){if(t.debug)console.log(`Found in layouts path: ${N}`);if(o)o.add(N);return N}if(!N.endsWith(".stx")){let I=`${N}.stx`;if(await n(I)){if(t.debug)console.log(`Found in layouts path with extension: ${I}`);if(o)o.add(I);return I}}}if(t.partialsDir){let M=le.join(t.partialsDir,"layouts");if(await n(M)){let N=le.join(M,e);if(await n(N)){if(t.debug)console.log(`Found in partials layouts dir: ${N}`);if(o)o.add(N);return N}if(!e.endsWith(".stx")){let I=`${N}.stx`;if(await n(I)){if(t.debug)console.log(`Found in partials layouts dir with extension: ${I}`);if(o)o.add(I);return I}}}}let C=t.partialsDir||le.join(process.cwd(),"views"),O=le.join(C,e);if(await n(O)){if(t.debug)console.log(`Found in views path: ${O}`);if(o)o.add(O);return O}if(!e.endsWith(".stx")){let M=`${O}.stx`;if(await n(M)){if(t.debug)console.log(`Found in views path with extension: ${M}`);if(o)o.add(M);return M}}if(a.includes("temp")){let M=le.join(le.dirname(a),"layouts",e);if(await n(M)){if(t.debug)console.log(`Found in temp layouts dir: ${M}`);if(o)o.add(M);return M}if(!e.endsWith(".stx")){let N=`${M}.stx`;if(await n(N)){if(t.debug)console.log(`Found in temp layouts dir with extension: ${N}`);if(o)o.add(N);return N}}}if(t.debug)console.warn(`Template not found after trying all paths: ${e} (referenced from ${i})`);else console.warn(`Template not found: ${e} (referenced from ${i})`);return null}function Za(e,i,t){let o=0,a="",h="";try{if(typeof i==="number"&&i>=0){let c=e.split(`
302
302
  `),v=0;for(let E=0;E<c.length;E++)if(v+=c[E].length+1,v>=i){o=E+1,a=c[E].trim();let R=Math.max(0,E-2),C=Math.min(c.length,E+3);h=c.slice(R,C).map((O,M)=>{let N=R+M+1;return`${N===o?"> ":" "}${N}: ${O}`}).join(`
303
- `);break}}else if(t){let c=e.indexOf(t);if(c>=0)return Ja(e,c)}}catch{}return{lineNumber:o,lineContent:a,context:h}}var $e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function m(e,i,t,o,a,h){let{lineNumber:c,context:v}=Ja(o,a,h),E=t.split("/").pop(),R=0;if(typeof a==="number"&&a>=0&&o){let O=o.lastIndexOf(`
303
+ `);break}}else if(t){let c=e.indexOf(t);if(c>=0)return Za(e,c)}}catch{}return{lineNumber:o,lineContent:a,context:h}}var $e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function m(e,i,t,o,a,h){let{lineNumber:c,context:v}=Za(o,a,h),E=t.split("/").pop(),R=0;if(typeof a==="number"&&a>=0&&o){let O=o.lastIndexOf(`
304
304
  `,Math.max(0,a-1));R=a-(O+1)+1}let C="";if(c>0)C+=`
305
305
  ${t}:${c}${R>0?`:${R}`:""}: ${e.toLowerCase()} error: ${i}
306
306
  `;if(C+=`
@@ -313,8 +313,8 @@ ${$e.yellow}${$e.bold}Message:${$e.reset} ${i}
313
313
  `,v)C+=`
314
314
  ${$e.blue}${$e.bold}Context:${$e.reset}
315
315
  ${$e.dim}${v}${$e.reset}
316
- `;return C}function pe(){Qt.clear(),Un.clear(),Us.clear(),Hs.clear(),Hn.clear()}function Ip(){return{size:Qt.size,maxSize:500}}var Vs=b(128);async function Sl(e,i,t){let o=w(e,i,t),a=Vs.get(o);if(a){if(us(a.deps))return a;Vs.delete(o)}let h=Do(e,{filePath:i,projectRoot:process.cwd()}),c=h.code,v=Mo(h.styles);c=It(c).code;let{hasUserImports:E,bundleClientScript:R}=await s("stx/client-script-bundler",()=>import("./chunk-t3gmm1ja.js")),C=[],O=!1;if(E(c)){let W=c;c=await R(W,i,{projectRoot:process.cwd(),minify:t,collectInputs:C}),O=c===W}let{stripStxRuntimeImports:M}=await s("stx/signal-processing",()=>import("./chunk-tsrf4zzy.js"));c=M(c);let N=T(c),I=gl(N),P=new Set(L(N,!0).split(",").map((W)=>W.trim())),q=`function(__scopeId) {
317
- ${st("const",[...lc,...I],N)}
316
+ `;return C}function pe(){Yt.clear(),Un.clear(),Us.clear(),Hs.clear(),Hn.clear()}function Np(){return{size:Yt.size,maxSize:500}}var Vs=b(128);async function $l(e,i,t){let o=w(e,i,t),a=Vs.get(o);if(a){if(ds(a.deps))return a;Vs.delete(o)}let h=Lo(e,{filePath:i,projectRoot:process.cwd()}),c=h.code,v=jo(h.styles);c=It(c).code;let{hasUserImports:E,bundleClientScript:R}=await s("stx/client-script-bundler",()=>import("./chunk-1t6dg4s8.js")),C=[],O=!1;if(E(c)){let Z=c;c=await R(Z,i,{projectRoot:process.cwd(),minify:t,collectInputs:C}),O=c===Z}let{stripStxRuntimeImports:M}=await s("stx/signal-processing",()=>import("./chunk-ev1tnd36.js"));c=M(c);let N=T(c),I=ml(N),P=new Set(L(N,!0).split(",").map((Z)=>Z.trim())),G=`function(__scopeId) {
317
+ ${st("const",[...dc,...I],N)}
318
318
  const __scope = window.stx._scopes = window.stx._scopes || {};
319
319
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
320
320
  __scopeVars.$refs = __scopeVars.$refs || {};
@@ -379,7 +379,7 @@ ${N}
379
379
  // Register all defined signals and functions in this scope
380
380
  const __localVars = {};
381
381
  try {
382
- ${I.map((W)=>P.has(W)?`Object.defineProperty(__localVars, '${W}', ${os(W)});`:`if (typeof ${W} !== 'undefined') __localVars['${W}'] = ${W};`).join(`
382
+ ${I.map((Z)=>P.has(Z)?`Object.defineProperty(__localVars, '${Z}', ${is(Z)});`:`if (typeof ${Z} !== 'undefined') __localVars['${Z}'] = ${Z};`).join(`
383
383
  `)}
384
384
  }
385
385
  catch (e) {}
@@ -398,24 +398,24 @@ finally {
398
398
  window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
399
399
  window.__STX_CURRENT_PROPS__ = __previousCurrentProps;
400
400
  }
401
- }`,Z={vendorStyleTags:v,factoryBody:q,clientCode:N,deps:ir([...C,...h.styles.map((W)=>W.resolvedPath)])};if(!O&&h.unresolved.length===0)Vs.set(o,Z);return Z}var pn=["module","exports","require","props","$props","$bool","$num","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"];var $l=100,vl=599,Js="__stxResponseStatus",en="__stxResponseHeaders";function Kn(e){return typeof e==="number"&&Number.isInteger(e)&&e>=$l&&e<=vl}function un(e){for(let i of e.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let t=i[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!t)continue;let o=Number(t[1]);if(Kn(o))return o}return}function Xs(e,i){if(!e||typeof e!=="object")return!1;let t=typeof i==="string"&&/^\d+$/.test(i.trim())?Number(i.trim()):i;if(!Kn(t))return!1;return e[Js]=t,!0}function El(e,i,t){if(!e||typeof e!=="object")return;let o=String(i??"").trim();if(!o)return;e[en]={...e[en],[o]:String(t)}}function At(e){let i=e?.[Js];return Kn(i)?i:void 0}function Pt(e){let i=e?.[en];if(!i||typeof i!=="object")return;let t=Object.entries(i).map(([o,a])=>[o,String(a)]);return t.length>0?Object.fromEntries(t):void 0}function ja(e,i){if(!e||!i||e===i||typeof i!=="object")return;let t=At(e);if(t!==void 0)i[Js]=t;let o=Pt(e);if(o)i[en]={...i[en],...o}}function ms(e){return{setResponseStatus:(i)=>{Xs(e,i)},notFound:(i=404)=>{let t=Kn(i)&&i>=400?i:404;Xs(e,t)},setResponseHeader:(i,t)=>{El(e,i,t)}}}function Ba(e,i,t={}){if(!e.includes("@status"))return e;let{filePath:o,buildMode:a}=t,h=a==="compile",c="",v=0,E=/@status\s*\(/g,R;while((R=E.exec(e))!==null){let C=kl(e,R.index+R[0].length-1);if(C<0)break;let O=e.slice(R.index+R[0].length,C).trim(),M=/^\d+$/.test(O)?Number(O):l(O,i),N=o?` in ${o}`:"";if(h)console.warn(`[stx] @status(${O})${N} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${O}) from <script server> instead \u2014 that runs per request.`);else if(!Xs(i,M))console.warn(`[stx] @status(${O})${N} is not an HTTP status (100-599) \u2014 ignoring it.`);c+=e.slice(v,R.index),v=C+1+(e.slice(C+1).match(/^[^\S\n]*\n?/)?.[0].length??0),E.lastIndex=v}return v===0?e:c+e.slice(v)}function kl(e,i){let t=1,o=null,a=!1;for(let h=i+1;h<e.length;h++){let c=e[h];if(a){a=!1;continue}if(o){if(c==="\\")a=!0;else if(c===o)o=null;continue}if(c==='"'||c==="'"||c==="`"){o=c;continue}if(c==="(")t++;else if(c===")"&&--t===0)return h}return-1}var Zi=new Set(pn),Rl=new Set(["props","$props","defineProps"]),Cl=new Set(["stx","@stacksjs/stx"]),qi=b(128),Xi=b(64);function Tl(e){let i=[],t=0,o=e.split(`
402
- `);for(let a of o){let h=t,c=null,v=!1;for(let E=0;E<a.length;E++){let R=a[E];if(v){v=!1;continue}if(R==="\\"){v=!0;continue}if(c){if(R===c)c=null;continue}if(R==="'"||R==='"'||R==="`"){c=R;continue}if(R==="/"&&E+1<a.length&&a[E+1]==="/")break;if(R==="{")t++;else if(R==="}")t--}if(h===0){let E=a.match(/(?:const|let|var)\s+(\w+)\s*=/);if(E)i.push(E[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(a)){let R=a.match(/(?:const|let|var)\s+(\w+)/);if(R)i.push(R[1])}else{let R=a.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(R){let O=R[1].slice(1,-1).split(",").map((M)=>{let N=M.split(":");return(N.length>1?N[1]:N[0]).trim()}).filter((M)=>/^\w+$/.test(M));i.push(...O)}}}}return[...new Set(i)]}function Ul(e){let i=e;i=i.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),i=i.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),i=i.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),i=i.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),i=i.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function t(o){if(!o.includes(":"))return o;let a=[],h="",c=0,v=0,E=null;for(let R=0;R<o.length;R++){let C=o[R];if(E){if(h+=C,C===E)E=null;continue}if(C==='"'||C==="'"||C==="`"){E=C,h+=C;continue}if(C==="<")c++;else if(C===">"&&c>0)c--;else if(C==="(")v++;else if(C===")")v--;if(C===","&&c===0&&v===0){a.push(h),h="";continue}h+=C}if(h)a.push(h);return a.map((R)=>{let C=R.trim(),O=C.startsWith("..."),M=O?C.slice(3):C,N=-1,I=0;for(let te=0;te<M.length;te++)if(M[te]==="<")I++;else if(M[te]===">")I--;else if(M[te]===":"&&I===0){N=te;break}if(N===-1)return R;let q=M.substring(0,N).trim().replace(/\?$/,""),Z=M.substring(N+1),W=-1,Y=0;for(let te=0;te<Z.length;te++)if(Z[te]==="<")Y++;else if(Z[te]===">")Y--;else if(Z[te]==="="&&Y===0){W=te;break}let ee=O?"...":"";if(W!==-1)return`${ee}${q} = ${Z.substring(W+1).trim()}`;return`${ee}${q}`}).join(", ")}i=i.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(o,a,h)=>{if(!h.includes(":"))return o;return`${a}(${t(h)})`});{let o=/\b(function\s+\w*\s*)\(/g,a,h=[];while((a=o.exec(i))!==null){let c=a.index+a[0].length-1,v=1,E=c+1,R=0,C=null;while(E<i.length&&v>0){let N=i[E];if(C){if(N===C)C=null;E++;continue}if(N==='"'||N==="'"||N==="`"){C=N,E++;continue}if(N==="<")R++;else if(N===">"&&R>0)R--;else if(R===0){if(N==="(")v++;else if(N===")")v--}if(v>0)E++}if(v!==0)continue;let O=i.substring(c+1,E);if(!O.includes(":"))continue;let M=t(O);h.push({start:c+1,end:E,replacement:M})}for(let c=h.length-1;c>=0;c--){let{start:v,end:E,replacement:R}=h[c];i=i.substring(0,v)+R+i.substring(E)}}return i=i.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(o,a)=>{if(!a.includes(":"))return o;if(a.includes("{")||a.includes("}"))return o;return`(${a.split(",").map((c)=>{let[v,...E]=c.split("="),R=v.split(":")[0].trim();if(E.length>0)return`${R} = ${E.join("=").trim()}`;return R}).join(", ")}) =>`}),i=i.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),i=i.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),i=i.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),i=i.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),i=i.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),i=i.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),i=i.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),i=i.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),i=i.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),i=i.replace(/\n\s*\n\s*\n/g,`
401
+ }`,q={vendorStyleTags:v,factoryBody:G,clientCode:N,deps:ir([...C,...h.styles.map((Z)=>Z.resolvedPath)])};if(!O&&h.unresolved.length===0)Vs.set(o,q);return q}var pn=["module","exports","require","props","$props","$bool","$num","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"];var vl=100,El=599,Js="__stxResponseStatus",Qt="__stxResponseHeaders";function Kn(e){return typeof e==="number"&&Number.isInteger(e)&&e>=vl&&e<=El}function un(e){for(let i of e.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let t=i[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!t)continue;let o=Number(t[1]);if(Kn(o))return o}return}function Xs(e,i){if(!e||typeof e!=="object")return!1;let t=typeof i==="string"&&/^\d+$/.test(i.trim())?Number(i.trim()):i;if(!Kn(t))return!1;return e[Js]=t,!0}function kl(e,i,t){if(!e||typeof e!=="object")return;let o=String(i??"").trim();if(!o)return;e[Qt]={...e[Qt],[o]:String(t)}}function At(e){let i=e?.[Js];return Kn(i)?i:void 0}function Pt(e){let i=e?.[Qt];if(!i||typeof i!=="object")return;let t=Object.entries(i).map(([o,a])=>[o,String(a)]);return t.length>0?Object.fromEntries(t):void 0}function Fa(e,i){if(!e||!i||e===i||typeof i!=="object")return;let t=At(e);if(t!==void 0)i[Js]=t;let o=Pt(e);if(o)i[Qt]={...i[Qt],...o}}function hs(e){return{setResponseStatus:(i)=>{Xs(e,i)},notFound:(i=404)=>{let t=Kn(i)&&i>=400?i:404;Xs(e,t)},setResponseHeader:(i,t)=>{kl(e,i,t)}}}function za(e,i,t={}){if(!e.includes("@status"))return e;let{filePath:o,buildMode:a}=t,h=a==="compile",c="",v=0,E=/@status\s*\(/g,R;while((R=E.exec(e))!==null){let C=Rl(e,R.index+R[0].length-1);if(C<0)break;let O=e.slice(R.index+R[0].length,C).trim(),M=/^\d+$/.test(O)?Number(O):l(O,i),N=o?` in ${o}`:"";if(h)console.warn(`[stx] @status(${O})${N} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${O}) from <script server> instead \u2014 that runs per request.`);else if(!Xs(i,M))console.warn(`[stx] @status(${O})${N} is not an HTTP status (100-599) \u2014 ignoring it.`);c+=e.slice(v,R.index),v=C+1+(e.slice(C+1).match(/^[^\S\n]*\n?/)?.[0].length??0),E.lastIndex=v}return v===0?e:c+e.slice(v)}function Rl(e,i){let t=1,o=null,a=!1;for(let h=i+1;h<e.length;h++){let c=e[h];if(a){a=!1;continue}if(o){if(c==="\\")a=!0;else if(c===o)o=null;continue}if(c==='"'||c==="'"||c==="`"){o=c;continue}if(c==="(")t++;else if(c===")"&&--t===0)return h}return-1}var qi=new Set(pn),Cl=new Set(["props","$props","defineProps"]),Tl=new Set(["stx","@stacksjs/stx"]),Xi=b(128),Ji=b(64);function Al(e){let i=[],t=0,o=e.split(`
402
+ `);for(let a of o){let h=t,c=null,v=!1;for(let E=0;E<a.length;E++){let R=a[E];if(v){v=!1;continue}if(R==="\\"){v=!0;continue}if(c){if(R===c)c=null;continue}if(R==="'"||R==='"'||R==="`"){c=R;continue}if(R==="/"&&E+1<a.length&&a[E+1]==="/")break;if(R==="{")t++;else if(R==="}")t--}if(h===0){let E=a.match(/(?:const|let|var)\s+(\w+)\s*=/);if(E)i.push(E[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(a)){let R=a.match(/(?:const|let|var)\s+(\w+)/);if(R)i.push(R[1])}else{let R=a.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(R){let O=R[1].slice(1,-1).split(",").map((M)=>{let N=M.split(":");return(N.length>1?N[1]:N[0]).trim()}).filter((M)=>/^\w+$/.test(M));i.push(...O)}}}}return[...new Set(i)]}function ql(e){let i=e;i=i.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),i=i.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),i=i.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),i=i.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),i=i.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function t(o){if(!o.includes(":"))return o;let a=[],h="",c=0,v=0,E=null;for(let R=0;R<o.length;R++){let C=o[R];if(E){if(h+=C,C===E)E=null;continue}if(C==='"'||C==="'"||C==="`"){E=C,h+=C;continue}if(C==="<")c++;else if(C===">"&&c>0)c--;else if(C==="(")v++;else if(C===")")v--;if(C===","&&c===0&&v===0){a.push(h),h="";continue}h+=C}if(h)a.push(h);return a.map((R)=>{let C=R.trim(),O=C.startsWith("..."),M=O?C.slice(3):C,N=-1,I=0;for(let ne=0;ne<M.length;ne++)if(M[ne]==="<")I++;else if(M[ne]===">")I--;else if(M[ne]===":"&&I===0){N=ne;break}if(N===-1)return R;let G=M.substring(0,N).trim().replace(/\?$/,""),q=M.substring(N+1),Z=-1,Q=0;for(let ne=0;ne<q.length;ne++)if(q[ne]==="<")Q++;else if(q[ne]===">")Q--;else if(q[ne]==="="&&Q===0){Z=ne;break}let te=O?"...":"";if(Z!==-1)return`${te}${G} = ${q.substring(Z+1).trim()}`;return`${te}${G}`}).join(", ")}i=i.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(o,a,h)=>{if(!h.includes(":"))return o;return`${a}(${t(h)})`});{let o=/\b(function\s+\w*\s*)\(/g,a,h=[];while((a=o.exec(i))!==null){let c=a.index+a[0].length-1,v=1,E=c+1,R=0,C=null;while(E<i.length&&v>0){let N=i[E];if(C){if(N===C)C=null;E++;continue}if(N==='"'||N==="'"||N==="`"){C=N,E++;continue}if(N==="<")R++;else if(N===">"&&R>0)R--;else if(R===0){if(N==="(")v++;else if(N===")")v--}if(v>0)E++}if(v!==0)continue;let O=i.substring(c+1,E);if(!O.includes(":"))continue;let M=t(O);h.push({start:c+1,end:E,replacement:M})}for(let c=h.length-1;c>=0;c--){let{start:v,end:E,replacement:R}=h[c];i=i.substring(0,v)+R+i.substring(E)}}return i=i.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(o,a)=>{if(!a.includes(":"))return o;if(a.includes("{")||a.includes("}"))return o;return`(${a.split(",").map((c)=>{let[v,...E]=c.split("="),R=v.split(":")[0].trim();if(E.length>0)return`${R} = ${E.join("=").trim()}`;return R}).join(", ")}) =>`}),i=i.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),i=i.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),i=i.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),i=i.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),i=i.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),i=i.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),i=i.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),i=i.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),i=i.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),i=i.replace(/\n\s*\n\s*\n/g,`
403
403
 
404
- `),i}function Wl(e){return e.replace(/\s*(?:imported from|from)\s+(?:(['"])([^'"\r\n]+)\1|(\S+))/g,(i,...t)=>{let[,o,a]=t,h=o??a;return/(?:[/\\]packages[/\\]stx[/\\]|@stacksjs[/\\]stx[/\\])/.test(h)?"":i})}function ql(e){return/cannot find module|cannot find package|could not resolve|module not found|failed to resolve/i.test(e)}function Kl(e){if(e instanceof SyntaxError)return!0;let i=e instanceof Error?e.message:String(e);return/SyntaxError|Unexpected (token|identifier|string|number|keyword|end of)|Unterminated|Expected .+ but found/i.test(i)}function Gl(e){if(!/is not defined|can't find variable/i.test(e))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test(e)}var Ji=new Set;async function g(e,i,t,o={}){if(!e.trim())return;let a=S(),h=w(e,JSON.stringify(a)),c=qi.get(h);if(c===void 0){try{let Q=X({loader:"ts",target:"browser",define:a}),ne=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");ne=ne.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),c=Q.transformSync(ne)}catch{c=Ul(e)}qi.set(h,c)}let v={exports:{}},E=v.exports,R=Ct.cwd(),C={},O=[...c.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((Q)=>Q[1]).filter((Q)=>!Q.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(Q)),M=new Map;for(let Q of O)try{if(Q.startsWith(".")){C[Q]=await import(Ge.resolve(Ge.dirname(t),Q));continue}let ne=Ge.resolve(R,"node_modules",Q),ge=Ge.join(ne,"package.json"),ye=JSON.parse(f("fs").readFileSync(ge,"utf8")),Ee=ye.main||"index.js";if(ye.exports){let Fe=typeof ye.exports==="string"?ye.exports:ye.exports["."];if(typeof Fe==="string")Ee=Fe;else if(Fe?.bun)Ee=Fe.bun;else if(Fe?.import)Ee=Fe.import;else if(Fe?.default)Ee=Fe.default}C[Q]=await import(Ge.resolve(ne,Ee))}catch(ne){if(Q.startsWith("."))M.set(Q,ne instanceof Error?ne.message:String(ne))}let N=(Q)=>{if(C[Q])return C[Q];let ne=M.get(Q);if(ne!==void 0)throw Error(`Cannot require '${Q}' from ${t}: ${ne}`);return f(Q)},I=i.props||{},P=(Q)=>{if(!Q)return I;let ne={};for(let[ge,ye]of Object.entries(Q)){let Ee=I[ge];if(Ee!==void 0)ne[ge]=Ee;else if(typeof ye==="function")ne[ge]=ye();else ne[ge]=ye}return ne};for(let[Q,ne]of Object.entries(I))Object.defineProperty(P,Q,{value:ne,enumerable:!0,configurable:!0,writable:!0});let q=(Q,ne=!1)=>{if(Q===void 0||Q===null)return ne;if(typeof Q==="string"){let ge=Q.trim().toLowerCase();if(ge===""||ge==="true"||ge==="1"||ge==="on"||ge==="yes")return!0;if(ge==="false"||ge==="0"||ge==="off"||ge==="no")return!1;return!0}return Boolean(Q)},Z=(Q,ne=0)=>{if(Q===void 0||Q===null)return ne;if(typeof Q==="string"){let ye=Q.trim();if(ye==="")return ne;let Ee=Number(ye);return Number.isFinite(Ee)?Ee:ne}let ge=Number(Q);return Number.isFinite(ge)?ge:ne};for(let Q of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(I,Q))continue;try{Object.defineProperty(P,Q,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let W=(Q)=>{if(!Q)return I;let ne={...I};for(let[ge,ye]of Object.entries(Q)){let Ee=ye&&typeof ye==="object"&&!Array.isArray(ye)?ye:{type:ye};if(ne[ge]===void 0&&Ee.default!==void 0)ne[ge]=typeof Ee.default==="function"?Ee.default():Ee.default}return ne},Y=()=>i.slots||{},ee=(Q,ne)=>{let ge={...Q};for(let[ye,Ee]of Object.entries(ne))if(ge[ye]===void 0)if(typeof Ee==="function")ge[ye]=Ee();else ge[ye]=Ee;return ge},te=(Q)=>{let ne=()=>Q;return ne.set=(ge)=>{},ne.update=(ge)=>{},ne},ae=(Q)=>{let ne,ge=!1;return()=>{if(!ge)try{ne=Q(),ge=!0}catch{ne=void 0}return ne}},me=(Q)=>{},ke=(Q)=>Q(),Re=(Q)=>{},Ve=(Q)=>{},Te=ms(i);function Ze(Q){let ne=Q||{};if(ne.title!==void 0||ne.description!==void 0)ut({title:ne.title,description:ne.description})}function Ye(Q){if(!Q||typeof Q!=="object")return;let ne=i.__stxClientPayload??{};Object.assign(ne,Q),i.__stxClientPayload=ne}let mt=()=>{let Q=i.__stxServeContext,ne=i.__stxServeSearch??Q?.search??"",ge=Q?.path??"",ye=Object.fromEntries(new URLSearchParams(ne)),Ee=i.query,Fe=Object.keys(ye).length>0?ye:Ee??{},pt=ne||(Object.keys(Fe).length>0?`?${new URLSearchParams(Fe).toString()}`:"");return{params:i.params??{},query:Fe,path:ge,name:"",fullPath:ge+pt,hash:"",matched:[]}},Zn=()=>({push:(Q)=>{},replace:(Q)=>{},back:()=>{},forward:()=>{},go:(Q)=>{}}),lt=(Q)=>{let ne=i.__stx_runtime_head||{};i.__stx_runtime_head=ze(ne,Se(Q||{},{known:Cs,source:"useHead()"}))},ut=(Q)=>{lt(Es(Q||{}))},ft=(Q)=>({value:Q}),Mt=(Q)=>Q,Ys=(Q)=>({value:typeof Q==="function"?Q():Q}),nt=(Q,ne)=>{},Ue=(Q)=>{},jt=(Q)=>{},tn=(Q)=>Q?Q():Promise.resolve(),qn=(Q)=>(ne,...ge)=>{},Nt=(Q)=>{},Je=(Q,ne)=>{},Lt=(Q,ne)=>ne,Xn=()=>({value:"light"}),ht=()=>te(!1),Qe=(Q)=>te(!1),Bt=()=>te(!1),nn=()=>Qe("(prefers-color-scheme: dark)"),zt=()=>Qe("(prefers-color-scheme: light)"),Wt=()=>Qe("(prefers-reduced-motion: reduce)"),Qs=()=>Qe("(prefers-contrast: more)"),qe={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},Ft=new Proxy(qe,{get(Q,ne){if(ne in Q)return Q[ne];return},set(Q,ne,ge){return Q[ne]=ge,!0}}),Jn={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},tt=console;try{let Q=No(c,t),ne=new Set(Object.keys(I)),ge=Object.keys(i).filter((ie)=>!ne.has(ie)&&!Rl.has(ie)&&Dt(ie)),ye=ge.map((ie)=>i[ie]);if(!ge.includes("__stxServeContext"))ge.push("__stxServeContext"),ye.push(void 0);if(!ne.has("cookies")){let ie=i.cookies??i.__stxServeContext?.cookies??{},he=ge.indexOf("cookies");if(he<0)ge.push("cookies"),ye.push(ie);else ye[he]=ie}let Ee=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),Fe=[],pt=[];for(let[ie,he]of Object.entries(I)){if(!Dt(ie))continue;if(Ee.has(ie))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${ie}\\b`).test(Q))continue;Fe.push(ie),pt.push(he)}let sn=Tl(Q).map((ie)=>`module.exports.${ie} = typeof ${ie} !== 'undefined' ? ${ie} : module.exports.${ie};`).join(`
405
- `),rn=i.params??{},Vt=[],xn=[];for(let ie=0;ie<ge.length;ie++){if(ge[ie]==="params")continue;Vt.push(ge[ie]),xn.push(ye[ie])}let bn=[...pn,...Fe,...Vt],rt=`return (async () => {
406
- ${Q}
407
- ${sn}
404
+ `),i}function Gl(e){return e.replace(/\s*(?:imported from|from)\s+(?:(['"])([^'"\r\n]+)\1|(\S+))/g,(i,...t)=>{let[,o,a]=t,h=o??a;return/(?:[/\\]packages[/\\]stx[/\\]|@stacksjs[/\\]stx[/\\])/.test(h)?"":i})}function Kl(e){return/cannot find module|cannot find package|could not resolve|module not found|failed to resolve/i.test(e)}function Xl(e){if(e instanceof SyntaxError)return!0;let i=e instanceof Error?e.message:String(e);return/SyntaxError|Unexpected (token|identifier|string|number|keyword|end of)|Unterminated|Expected .+ but found/i.test(i)}function Jl(e){if(!/is not defined|can't find variable/i.test(e))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test(e)}var Gi=new Set;async function g(e,i,t,o={}){if(!e.trim())return;let a=k(),h=w(e,JSON.stringify(a)),c=Xi.get(h);if(c===void 0){try{let ee=J({loader:"ts",target:"browser",define:a}),re=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");re=re.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),c=ee.transformSync(re)}catch{c=ql(e)}Xi.set(h,c)}let v={exports:{}},E=v.exports,R=Ct.cwd(),C={},O=[...c.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((ee)=>ee[1]).filter((ee)=>!ee.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(ee)),M=new Map;for(let ee of O)try{if(ee.startsWith(".")){C[ee]=await import(Ge.resolve(Ge.dirname(t),ee));continue}let re=Ge.resolve(R,"node_modules",ee),ge=Ge.join(re,"package.json"),ye=JSON.parse(f("fs").readFileSync(ge,"utf8")),Ee=ye.main||"index.js";if(ye.exports){let Ve=typeof ye.exports==="string"?ye.exports:ye.exports["."];if(typeof Ve==="string")Ee=Ve;else if(Ve?.bun)Ee=Ve.bun;else if(Ve?.import)Ee=Ve.import;else if(Ve?.default)Ee=Ve.default}C[ee]=await import(Ge.resolve(re,Ee))}catch(re){if(ee.startsWith("."))M.set(ee,re instanceof Error?re.message:String(re))}let N=(ee)=>{if(C[ee])return C[ee];let re=M.get(ee);if(re!==void 0)throw Error(`Cannot require '${ee}' from ${t}: ${re}`);return f(ee)},I=i.props||{},P=(ee)=>{if(!ee)return I;let re={};for(let[ge,ye]of Object.entries(ee)){let Ee=I[ge];if(Ee!==void 0)re[ge]=Ee;else if(typeof ye==="function")re[ge]=ye();else re[ge]=ye}return re};for(let[ee,re]of Object.entries(I))Object.defineProperty(P,ee,{value:re,enumerable:!0,configurable:!0,writable:!0});let G=(ee,re=!1)=>{if(ee===void 0||ee===null)return re;if(typeof ee==="string"){let ge=ee.trim().toLowerCase();if(ge===""||ge==="true"||ge==="1"||ge==="on"||ge==="yes")return!0;if(ge==="false"||ge==="0"||ge==="off"||ge==="no")return!1;return!0}return Boolean(ee)},q=(ee,re=0)=>{if(ee===void 0||ee===null)return re;if(typeof ee==="string"){let ye=ee.trim();if(ye==="")return re;let Ee=Number(ye);return Number.isFinite(Ee)?Ee:re}let ge=Number(ee);return Number.isFinite(ge)?ge:re};for(let ee of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(I,ee))continue;try{Object.defineProperty(P,ee,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let Z=(ee)=>{if(!ee)return I;let re={...I};for(let[ge,ye]of Object.entries(ee)){let Ee=ye&&typeof ye==="object"&&!Array.isArray(ye)?ye:{type:ye};if(re[ge]===void 0&&Ee.default!==void 0)re[ge]=typeof Ee.default==="function"?Ee.default():Ee.default}return re},Q=()=>i.slots||{},te=(ee,re)=>{let ge={...ee};for(let[ye,Ee]of Object.entries(re))if(ge[ye]===void 0)if(typeof Ee==="function")ge[ye]=Ee();else ge[ye]=Ee;return ge},ne=(ee)=>{let re=()=>ee;return re.set=(ge)=>{},re.update=(ge)=>{},re},ae=(ee)=>{let re,ge=!1;return()=>{if(!ge)try{re=ee(),ge=!0}catch{re=void 0}return re}},me=(ee)=>{},ke=(ee)=>ee(),Re=(ee)=>{},Ue=(ee)=>{},We=hs(i);function Ze(ee){let re=ee||{};if(re.title!==void 0||re.description!==void 0)ft({title:re.title,description:re.description})}function Ye(ee){if(!ee||typeof ee!=="object")return;let re=i.__stxClientPayload??{};Object.assign(re,ee),i.__stxClientPayload=re}let xt=()=>{let ee=i.__stxServeContext,re=i.__stxServeSearch??ee?.search??"",ge=ee?.path??"",ye=Object.fromEntries(new URLSearchParams(re)),Ee=i.query,Ve=Object.keys(ye).length>0?ye:Ee??{},dt=re||(Object.keys(Ve).length>0?`?${new URLSearchParams(Ve).toString()}`:"");return{params:i.params??{},query:Ve,path:ge,name:"",fullPath:ge+dt,hash:"",matched:[]}},Zn=()=>({push:(ee)=>{},replace:(ee)=>{},back:()=>{},forward:()=>{},go:(ee)=>{}}),ut=(ee)=>{let re=i.__stx_runtime_head||{};i.__stx_runtime_head=ze(re,Se(ee||{},{known:Es,source:"useHead()"}))},ft=(ee)=>{ut(Ts(ee||{}))},pt=(ee)=>({value:ee}),Mt=(ee)=>ee,Ys=(ee)=>({value:typeof ee==="function"?ee():ee}),it=(ee,re)=>{},Fe=(ee)=>{},jt=(ee)=>{},en=(ee)=>ee?ee():Promise.resolve(),qn=(ee)=>(re,...ge)=>{},Nt=(ee)=>{},Je=(ee,re)=>{},Lt=(ee,re)=>re,Xn=()=>({value:"light"}),bt=()=>ne(!1),Qe=(ee)=>ne(!1),Bt=()=>ne(!1),tn=()=>Qe("(prefers-color-scheme: dark)"),zt=()=>Qe("(prefers-color-scheme: light)"),Wt=()=>Qe("(prefers-reduced-motion: reduce)"),Qs=()=>Qe("(prefers-contrast: more)"),qe={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},Ft=new Proxy(qe,{get(ee,re){if(re in ee)return ee[re];return},set(ee,re,ge){return ee[re]=ge,!0}}),Jn={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},tt=console;try{let ee=Mo(c,t),re=new Set(Object.keys(I)),ge=Object.keys(i).filter((ie)=>!re.has(ie)&&!Cl.has(ie)&&Dt(ie)),ye=ge.map((ie)=>i[ie]);if(!ge.includes("__stxServeContext"))ge.push("__stxServeContext"),ye.push(void 0);if(!re.has("cookies")){let ie=i.cookies??i.__stxServeContext?.cookies??{},he=ge.indexOf("cookies");if(he<0)ge.push("cookies"),ye.push(ie);else ye[he]=ie}let Ee=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),Ve=[],dt=[];for(let[ie,he]of Object.entries(I)){if(!Dt(ie))continue;if(Ee.has(ie))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${ie}\\b`).test(ee))continue;Ve.push(ie),dt.push(he)}let nn=Al(ee).map((ie)=>`module.exports.${ie} = typeof ${ie} !== 'undefined' ? ${ie} : module.exports.${ie};`).join(`
405
+ `),sn=i.params??{},Vt=[],rn=[];for(let ie=0;ie<ge.length;ie++){if(ge[ie]==="params")continue;Vt.push(ge[ie]),rn.push(ye[ie])}let xn=[...pn,...Ve,...Vt],ot=`return (async () => {
406
+ ${ee}
407
+ ${nn}
408
408
  return module.exports
409
- })()`,xt=w(rt,bn.join("\x00")),Xe=Xi.get(xt);if(!Xe)Xe=Function(...bn,rt),Xi.set(xt,Xe);let He=i.__stx_options?.runtimeConfig;if(He||/\buse(?:Server)?RuntimeConfig\b/.test(c))await hn(i,t,He);let ce=await Be(i.__stx_runtime_config??yn()??A(),()=>fr(i,()=>Xe(v,E,N,I,P,q,Z,W,ee,Ye,gr,Ho,ws,te,ae,me,ke,Re,Ve,Ze,mt,Zn,lt,ut,Te.setResponseStatus,Te.setResponseHeader,Te.notFound,ft,Mt,Ys,nt,Ue,jt,tn,qn,Nt,Y,Je,Lt,Xn,ht,Qe,Bt,nn,zt,Wt,Qs,Ft,Jn,tt,qe.confirm,qe.alert,qe.fetch,rn,...pt,...xn)));if(o.preserveExisting){for(let[ie,he]of Object.entries(ce))if(!(ie in i)||i[ie]===void 0)i[ie]=he}else Object.assign(i,ce);for(let[ie,he]of Object.entries(I))if(!(ie in i))i[ie]=he}catch(Q){if(i.__stx_strict_hydration)throw Q;let ne=Wl(Q instanceof Error?Q.message:String(Q));if(ql(ne))console.warn(`[stx] server <script> in ${t??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${ne}`),o.onFailure?.({kind:"module-resolution",message:ne,error:Q});else if(Kl(Q))console.warn(`[stx] server <script> in ${t??"<unknown>"} does not parse, so every variable in that script is undefined. Cause: ${ne}`),o.onFailure?.({kind:"syntax",message:ne,error:Q});else if(Gl(ne))console.warn(`[stx] server <script> in ${t??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${ne}`),o.onFailure?.({kind:"missing-binding",message:ne,error:Q});else{let ge=`${t??"<unknown>"}\x00${ne}`;if(Ct.env.STX_DEBUG||!Ji.has(ge))Ji.add(ge),console.warn(`[stx] server <script> in ${t??"<unknown>"} threw, so every variable in that script is undefined and anything that reads one renders empty. Cause: ${ne}`);o.onFailure?.({kind:"unknown",message:ne,error:Q})}try{await Dl(c,i,t)}catch(ge){if(Ct.env.STX_DEBUG){let ye=ge instanceof Error?ge.message:String(ge);console.warn(`[stx] fallback extraction also failed in ${t??"<unknown>"}: ${ye}`)}}}}function Xl(e){let i=0,t=null,o=!1,a=!1;for(let h=0;h<e.length;h++){let c=e[h];if(t){if(c===t){if(t=null,o||i===0)a=!0}continue}if(c==="'"||c==='"'||c==="`"){t=c;continue}if(c==="{")i++;else if(c==="}")i--;else if(e.startsWith("from",h)&&i===0)o=!0}return t===null&&i===0&&a}var Al=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function No(e,i){let t=i?Ge.dirname(i):Ct.cwd(),o=Ct.cwd(),a=e.split(`
410
- `),h=[],c=0;while(c<a.length){let v=a[c].trim();if(v.startsWith("interface ")||v.startsWith("export interface ")||v.startsWith("type ")||v.startsWith("export type ")){if(v.includes("{")&&!v.includes("}")){let E=0;for(;c<a.length;c++){for(let R of a[c])if(R==="{")E++;else if(R==="}")E--;if(E<=0)break}}c++;continue}if(v.startsWith("definePageMeta(")){let E=0,R=!1,C=c;for(let N=c;N<a.length&&!R;N++){let I=null,P=!1,q=a[N];for(let Z=0;Z<q.length;Z++){let W=q[Z];if(P){P=!1;continue}if(W==="\\"){P=!0;continue}if(I){if(W===I)I=null;continue}if(W==='"'||W==="'"||W==="`"){I=W;continue}if(W==="(")E++;else if(W===")"){if(E--,E===0){c=N+1,R=!0;break}}}}if(!R)c=a.length;let O=a.slice(C,c).join(`
411
- `),M=[];for(let N of["title","description"]){let I=new RegExp(`\\b${N}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(O);if(I)M.push(`${N}: ${JSON.stringify(I[2])}`)}if(M.length>0)h.push(`useSeoMeta({ ${M.join(", ")} });`);continue}if(v.startsWith("import ")||v==="import"||v.startsWith("import{")||/^import['"]/.test(v)){let E=v,R=0;while(!Xl(E)&&c+R+1<a.length)R++,E=`${E} ${a[c+R].trim()}`;c+=R;let C=E.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),O=E.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),M=E.match(/^import\s*['"](.+?)['"]/),N=E,I=(P)=>{if(P.startsWith("."))return Ge.resolve(t,P);if(P.startsWith("~/")||P.startsWith("@/"))return Ge.resolve(o,P.slice(2));try{return Bun.resolveSync(P,t)}catch{return P}};if(C){let[,P,q]=C,Z=I(q);h.push(`const ${P} = (await import('${Z}')).default`),h.push(`module.exports.${P} = ${P};`)}else if(O){let[,P,q]=O,Z=I(q),W=[],Y=[],ee=Cl.has(q);for(let te of P.split(",")){let ae=te.trim();if(!ae)continue;let me=ae.split(/\s+as\s+/);if(me.length===2){let[ke,Re]=[me[0].trim(),me[1].trim()];if(ee&&Zi.has(ke)){h.push(`const ${Re} = ${ke};`);continue}W.push(`${ke}: ${Re}`),Y.push(Re)}else{if(ee&&Zi.has(ae))continue;W.push(ae),Y.push(ae)}}if(W.length>0)h.push(`const { ${W.join(", ")} } = await import('${Z}')`);for(let te of Y)h.push(`module.exports.${te} = ${te};`)}else if(M){let P=I(M[1]);h.push(`await import('${P}')`)}else h.push(N);c++;continue}if(Al.test(v))h.push(a[c]),c++;else if(v.startsWith("export const ")||v.startsWith("export let ")||v.startsWith("export var ")){let E=Yi(a,c),{type:R,name:C,value:O}=E;h.push(`${R} ${C} = ${O};`),h.push(`module.exports.${C} = ${C};`),c=E.nextIndex}else if(v.startsWith("export function ")||v.startsWith("export async function ")){let E=Gs(a,c);h.push(E.functionCode),h.push(`module.exports.${E.name} = ${E.name};`),c=E.nextIndex}else if(v.startsWith("const ")||v.startsWith("let ")||v.startsWith("var ")){let E=Yi(a,c),{type:R,name:C,value:O}=E;h.push(`${R} ${C} = ${O};`),h.push(`module.exports.${C} = ${C};`),c=E.nextIndex}else if(v.startsWith("function ")||v.startsWith("async function ")){let E=Gs(a,c);h.push(E.functionCode),h.push(`module.exports.${E.name} = ${E.name};`),c=E.nextIndex}else if(v.startsWith("export default function ")||v.startsWith("export default async function ")){let E=a[c].replace(/^(\s*)export\s+default\s+/,"$1"),R=[...a];R[c]=E;let C=Gs(R,c);if(h.push(C.functionCode),C.name)h.push(`module.exports.default = ${C.name};`);c=C.nextIndex}else if(v.startsWith("export default ")){let E=v.replace(/^export\s+default\s+/,"").replace(/;$/,"");h.push(`module.exports.default = ${E};`),c++}else if(v.startsWith("class ")||v.startsWith("export class ")){let E=v.match(/(?:export\s+)?class\s+(\w+)/);if(E){let R=E[1],C=a[c].replace(/^export\s+/,""),O=0,M=c;for(;M<a.length;M++){let N=a[M];for(let I of N)if(I==="{")O++;else if(I==="}")O--;if(M>c)C+=`
412
- `+N;if(O<=0&&M>=c)break}h.push(C),h.push(`module.exports.${R} = ${R};`),c=M+1}else h.push(v),c++}else if(v.includes("module.exports"))h.push(v),c++;else if(v.trim()&&!v.startsWith("//"))h.push(v),c++;else c++}return Il(h.join(`
413
- `),t,o)}function Il(e,i,t){let o=e.length,a="",h=0,c=null,v=!1,E=!1,R=0;while(h<o){let C=e[h],O=e[h+1];if(v){if(a+=C,C===`
414
- `)v=!1;h++;continue}if(E){if(a+=C,C==="*"&&O==="/"){a+=O,h+=2,E=!1;continue}h++;continue}if(!c&&C==="/"&&O==="/"){v=!0,a+=C,h++;continue}if(!c&&C==="/"&&O==="*"){E=!0,a+=C,h++;continue}if(c){if(a+=C,C==="\\"){a+=O,h+=2;continue}if(C===c&&c!=="`"){c=null,h++;continue}if(c==="`"){if(C==="$"&&O==="{"){R++,a+=O,h+=2;continue}if(C==="`"){c=null,h++;continue}}h++;continue}if(R>0){if(C==="{")R++;else if(C==="}")R--}if(C==='"'||C==="'"||C==="`"){c=C,a+=C,h++;continue}if(C==="a"&&e.startsWith("await",h)){let M=Ol(e,h);if(M){let{quote:N,path:I,end:P}=M;if(I.startsWith(".")||I.startsWith("~/")||I.startsWith("@/")){let q=I.startsWith(".")?Ge.resolve(i,I):Ge.resolve(t,I.slice(2));a+=`await import(${N}${q}${N})`,h=P;continue}}}a+=C,h++}return a}function Ol(e,i){let t=i+5;if(t>=e.length)return null;if(!/\s/.test(e[t]))return null;while(t<e.length&&/\s/.test(e[t]))t++;if(!e.startsWith("import",t))return null;t+=6;while(t<e.length&&/\s/.test(e[t]))t++;if(e[t]!=="(")return null;t++;while(t<e.length&&/\s/.test(e[t]))t++;let o=e[t];if(o!=="'"&&o!=='"')return null;t++;let a=t;while(t<e.length&&e[t]!==o)if(e[t]==="\\")t+=2;else t++;if(t>=e.length)return null;let h=e.slice(a,t);t++;while(t<e.length&&/\s/.test(e[t]))t++;if(e[t]!==")")return null;return{quote:o,path:h,end:t+1}}function no(e,i){let t=e[i];if(t!=="{"&&t!=="[")return null;let a=y(e,t,t==="{"?"}":"]",i);if(a===-1)return null;return{pattern:e.slice(i,a+1),endPos:a+1}}function so(e){let i=[],t=e.slice(1,-1).trim();if(!t)return i;let o=0,a=0,h="";while(o<t.length){let c=t[o];if(c==="{"||c==="["){let v=a===0?no(t,o):null;if(v){i.push(...so(v.pattern)),o=v.endPos,h="";continue}a++}else if(c==="}"||c==="]")a--;if(a>0){o++;continue}if(c===","){if(h.trim())i.push(h.trim());h="",o++;continue}if(c===":"){h="",o++;continue}if(c==="="){if(h.trim())i.push(h.trim());h="",o++;while(o<t.length&&t[o]!==","&&a===0){if(t[o]==="{"||t[o]==="[")a++;else if(t[o]==="}"||t[o]==="]")a--;o++}continue}if(/[\w$]/.test(c))h+=c;o++}if(h.trim())i.push(h.trim());return i}function Jl(e){let i=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec(e);if(!i)return null;let t=i[0].length,o=(a)=>a===" "||a==="\t";while(t<e.length&&o(e[t]))t++;if(e[t]===":"){let a=0,h=null;t++;for(;t<e.length;t++){let c=e[t];if(h){if(c==="\\"){t++;continue}if(c===h)h=null;continue}if(c==="'"||c==='"'||c==="`"){h=c;continue}if(c==="("||c==="["||c==="{"||c==="<"){a++;continue}if(c===")"||c==="]"||c==="}"||c===">"){a--;continue}if(c==="="&&a<=0){let v=e[t+1],E=e[t-1];if(v!=="="&&v!==">"&&E!=="="&&E!=="!"&&E!=="<"&&E!==">")break}}if(e[t]!=="=")return null}while(t<e.length&&o(e[t]))t++;if(e[t]!=="=")return null;return{type:i[1],name:i[2],value:e.slice(t+1).trim()}}function Gi(e,i,t,o){let a=null,h=!1;for(let c of e){if(h){h=!1;continue}if(c==="\\"){h=!0;continue}if(a){if(c===a)a=null;continue}if(c==="'"||c==='"'||c==="`"){a=c;continue}if(c===i)o++;else if(c===t)o--}return o}function Yi(e,i){let t=e[i].trim(),o=Jl(t),a=o?[t,o.type,o.name,o.value]:null;if(!a){let C=t.match(/^(?:export\s+)?(const|let|var)\s+/);if(C){let O=t.slice(C[0].length),M=i;if(O.startsWith("{")||O.startsWith("[")){let I=O[0],P=I==="{"?"}":"]",q=Gi(O,I,P,0),Z=O;for(let W=i+1;W<e.length&&q>0;W++)Z+=` ${e[W].trim()}`,M=W,q=Gi(e[W],I,P,q);if(q>0)Z=O,M=i;O=Z}let N=no(O,0);if(N){let I=C[1],P=N.pattern,q=O.slice(N.endPos).trim();if(q.startsWith("=")){let Z=q.slice(1).trim(),W=Z,Y=Math.max(M,i);if(Qi(Z)){let me=eo(e,Y,Z);W=me.value,Y=me.nextIndex}else Y=Y+1;W=W.trim().replace(/;$/,"");let ee=so(P),te=`__stx_src_${i}`,ae=ee.map((me)=>`module.exports.${me} = ${me};`).join(`
415
- `);return{type:I,name:te,value:`${W}; ${I} ${P} = ${te};
416
- ${ae}`,nextIndex:Y}}}}throw Error(`Failed to parse variable declaration: ${t}`)}let[,h,c,v]=a,E=v,R=i;if(Qi(v)){let C=eo(e,i,v);E=C.value,R=C.nextIndex}else R=i+1;while(R<e.length){let C=e[R].trim();if(C.startsWith(".")||C.startsWith("?."))E+=`
417
- ${e[R]}`,R++;else break}return E=E.trim().replace(/;$/,""),{type:h,name:c,value:E,nextIndex:R}}function Gs(e,i){let t=e[i].trim(),o=t.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!o)throw Error(`Failed to parse function declaration: ${t}`);let[,a]=o,h=t.replace(/^export\s+/,""),c=i;if(Pl(t)){let v=Ml(e,i,h);h=v.functionCode,c=v.nextIndex}else c=i+1;return{name:a,functionCode:h,nextIndex:c}}function Qi(e){let i=e.trim();if(i.startsWith("{"))return y(i,"{","}",0)===-1;if(i.startsWith("["))return y(i,"[","]",0)===-1;return!ro(i)}function ro(e){let i={paren:0,bracket:0,brace:0},t=null,o=0;for(let a=0;a<e.length;a++){let h=e[a];if((a>0?e[a-1]:"")==="\\"&&t)continue;if((h==='"'||h==="'")&&!t){t=h;continue}if(h===t&&t!=="`"){t=null;continue}if(h==="`"&&!t){t="`";continue}if(h==="`"&&t==="`"&&o===0){t=null;continue}if(t==="`"&&h==="$"&&e[a+1]==="{"){o++,a++;continue}if(o>0&&h==="{"){o++;continue}if(o>0&&h==="}"){o--;continue}if(t)continue;if(h==="(")i.paren++;else if(h===")")i.paren--;else if(h==="[")i.bracket++;else if(h==="]")i.bracket--;else if(h==="{")i.brace++;else if(h==="}")i.brace--}return i.paren===0&&i.bracket===0&&i.brace===0&&t===null}function io(e){let i=e.indexOf("(");if(i===-1)return e.indexOf("{");let t=y(e,"(",")",i);if(t===-1)return-1;return e.indexOf("{",t)}function Pl(e){let i=io(e);if(i===-1)return!0;return y(e,"{","}",i)===-1}function eo(e,i,t){let o=t,a=i+1;while(a<e.length&&!ro(o)){let h=e[a];o+=`
409
+ })()`,yt=w(ot,xn.join("\x00")),Xe=Ji.get(yt);if(!Xe)Xe=Function(...xn,ot),Ji.set(yt,Xe);let He=i.__stx_options?.runtimeConfig;if(He||/\buse(?:Server)?RuntimeConfig\b/.test(c))await hn(i,t,He);let ce=await Be(i.__stx_runtime_config??yn()??A(),()=>fr(i,()=>Xe(v,E,N,I,P,G,q,Z,te,Ye,gr,Uo,xs,ne,ae,me,ke,Re,Ue,Ze,xt,Zn,ut,ft,We.setResponseStatus,We.setResponseHeader,We.notFound,pt,Mt,Ys,it,Fe,jt,en,qn,Nt,Q,Je,Lt,Xn,bt,Qe,Bt,tn,zt,Wt,Qs,Ft,Jn,tt,qe.confirm,qe.alert,qe.fetch,sn,...dt,...rn)));if(o.preserveExisting){for(let[ie,he]of Object.entries(ce))if(!(ie in i)||i[ie]===void 0)i[ie]=he}else Object.assign(i,ce);for(let[ie,he]of Object.entries(I))if(!(ie in i))i[ie]=he}catch(ee){if(i.__stx_strict_hydration)throw ee;let re=Gl(ee instanceof Error?ee.message:String(ee));if(Kl(re))console.warn(`[stx] server <script> in ${t??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${re}`),o.onFailure?.({kind:"module-resolution",message:re,error:ee});else if(Xl(ee))console.warn(`[stx] server <script> in ${t??"<unknown>"} does not parse, so every variable in that script is undefined. Cause: ${re}`),o.onFailure?.({kind:"syntax",message:re,error:ee});else if(Jl(re))console.warn(`[stx] server <script> in ${t??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${re}`),o.onFailure?.({kind:"missing-binding",message:re,error:ee});else{let ge=`${t??"<unknown>"}\x00${re}`;if(Ct.env.STX_DEBUG||!Gi.has(ge))Gi.add(ge),console.warn(`[stx] server <script> in ${t??"<unknown>"} threw, so every variable in that script is undefined and anything that reads one renders empty. Cause: ${re}`);o.onFailure?.({kind:"unknown",message:re,error:ee})}try{await jl(c,i,t)}catch(ge){if(Ct.env.STX_DEBUG){let ye=ge instanceof Error?ge.message:String(ge);console.warn(`[stx] fallback extraction also failed in ${t??"<unknown>"}: ${ye}`)}}}}function Yl(e){let i=0,t=null,o=!1,a=!1;for(let h=0;h<e.length;h++){let c=e[h];if(t){if(c===t){if(t=null,o||i===0)a=!0}continue}if(c==="'"||c==='"'||c==="`"){t=c;continue}if(c==="{")i++;else if(c==="}")i--;else if(e.startsWith("from",h)&&i===0)o=!0}return t===null&&i===0&&a}var Il=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function Mo(e,i){let t=i?Ge.dirname(i):Ct.cwd(),o=Ct.cwd(),a=e.split(`
410
+ `),h=[],c=0;while(c<a.length){let v=a[c].trim();if(v.startsWith("interface ")||v.startsWith("export interface ")||v.startsWith("type ")||v.startsWith("export type ")){if(v.includes("{")&&!v.includes("}")){let E=0;for(;c<a.length;c++){for(let R of a[c])if(R==="{")E++;else if(R==="}")E--;if(E<=0)break}}c++;continue}if(v.startsWith("definePageMeta(")){let E=0,R=!1,C=c;for(let N=c;N<a.length&&!R;N++){let I=null,P=!1,G=a[N];for(let q=0;q<G.length;q++){let Z=G[q];if(P){P=!1;continue}if(Z==="\\"){P=!0;continue}if(I){if(Z===I)I=null;continue}if(Z==='"'||Z==="'"||Z==="`"){I=Z;continue}if(Z==="(")E++;else if(Z===")"){if(E--,E===0){c=N+1,R=!0;break}}}}if(!R)c=a.length;let O=a.slice(C,c).join(`
411
+ `),M=[];for(let N of["title","description"]){let I=new RegExp(`\\b${N}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(O);if(I)M.push(`${N}: ${JSON.stringify(I[2])}`)}if(M.length>0)h.push(`useSeoMeta({ ${M.join(", ")} });`);continue}if(v.startsWith("import ")||v==="import"||v.startsWith("import{")||/^import['"]/.test(v)){let E=v,R=0;while(!Yl(E)&&c+R+1<a.length)R++,E=`${E} ${a[c+R].trim()}`;c+=R;let C=E.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),O=E.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),M=E.match(/^import\s*['"](.+?)['"]/),N=E,I=(P)=>{if(P.startsWith("."))return Ge.resolve(t,P);if(P.startsWith("~/")||P.startsWith("@/"))return Ge.resolve(o,P.slice(2));try{return Bun.resolveSync(P,t)}catch{return P}};if(C){let[,P,G]=C,q=I(G);h.push(`const ${P} = (await import('${q}')).default`),h.push(`module.exports.${P} = ${P};`)}else if(O){let[,P,G]=O,q=I(G),Z=[],Q=[],te=Tl.has(G);for(let ne of P.split(",")){let ae=ne.trim();if(!ae)continue;let me=ae.split(/\s+as\s+/);if(me.length===2){let[ke,Re]=[me[0].trim(),me[1].trim()];if(te&&qi.has(ke)){h.push(`const ${Re} = ${ke};`);continue}Z.push(`${ke}: ${Re}`),Q.push(Re)}else{if(te&&qi.has(ae))continue;Z.push(ae),Q.push(ae)}}if(Z.length>0)h.push(`const { ${Z.join(", ")} } = await import('${q}')`);for(let ne of Q)h.push(`module.exports.${ne} = ${ne};`)}else if(M){let P=I(M[1]);h.push(`await import('${P}')`)}else h.push(N);c++;continue}if(Il.test(v))h.push(a[c]),c++;else if(v.startsWith("export const ")||v.startsWith("export let ")||v.startsWith("export var ")){let E=Qi(a,c),{type:R,name:C,value:O}=E;h.push(`${R} ${C} = ${O};`),h.push(`module.exports.${C} = ${C};`),c=E.nextIndex}else if(v.startsWith("export function ")||v.startsWith("export async function ")){let E=Gs(a,c);h.push(E.functionCode),h.push(`module.exports.${E.name} = ${E.name};`),c=E.nextIndex}else if(v.startsWith("const ")||v.startsWith("let ")||v.startsWith("var ")){let E=Qi(a,c),{type:R,name:C,value:O}=E;h.push(`${R} ${C} = ${O};`),h.push(`module.exports.${C} = ${C};`),c=E.nextIndex}else if(v.startsWith("function ")||v.startsWith("async function ")){let E=Gs(a,c);h.push(E.functionCode),h.push(`module.exports.${E.name} = ${E.name};`),c=E.nextIndex}else if(v.startsWith("export default function ")||v.startsWith("export default async function ")){let E=a[c].replace(/^(\s*)export\s+default\s+/,"$1"),R=[...a];R[c]=E;let C=Gs(R,c);if(h.push(C.functionCode),C.name)h.push(`module.exports.default = ${C.name};`);c=C.nextIndex}else if(v.startsWith("export default ")){let E=v.replace(/^export\s+default\s+/,"").replace(/;$/,"");h.push(`module.exports.default = ${E};`),c++}else if(v.startsWith("class ")||v.startsWith("export class ")){let E=v.match(/(?:export\s+)?class\s+(\w+)/);if(E){let R=E[1],C=a[c].replace(/^export\s+/,""),O=0,M=c;for(;M<a.length;M++){let N=a[M];for(let I of N)if(I==="{")O++;else if(I==="}")O--;if(M>c)C+=`
412
+ `+N;if(O<=0&&M>=c)break}h.push(C),h.push(`module.exports.${R} = ${R};`),c=M+1}else h.push(v),c++}else if(v.includes("module.exports"))h.push(v),c++;else if(v.trim()&&!v.startsWith("//"))h.push(v),c++;else c++}return Ol(h.join(`
413
+ `),t,o)}function Ol(e,i,t){let o=e.length,a="",h=0,c=null,v=!1,E=!1,R=0;while(h<o){let C=e[h],O=e[h+1];if(v){if(a+=C,C===`
414
+ `)v=!1;h++;continue}if(E){if(a+=C,C==="*"&&O==="/"){a+=O,h+=2,E=!1;continue}h++;continue}if(!c&&C==="/"&&O==="/"){v=!0,a+=C,h++;continue}if(!c&&C==="/"&&O==="*"){E=!0,a+=C,h++;continue}if(c){if(a+=C,C==="\\"){a+=O,h+=2;continue}if(C===c&&c!=="`"){c=null,h++;continue}if(c==="`"){if(C==="$"&&O==="{"){R++,a+=O,h+=2;continue}if(C==="`"){c=null,h++;continue}}h++;continue}if(R>0){if(C==="{")R++;else if(C==="}")R--}if(C==='"'||C==="'"||C==="`"){c=C,a+=C,h++;continue}if(C==="a"&&e.startsWith("await",h)){let M=Pl(e,h);if(M){let{quote:N,path:I,end:P}=M;if(I.startsWith(".")||I.startsWith("~/")||I.startsWith("@/")){let G=I.startsWith(".")?Ge.resolve(i,I):Ge.resolve(t,I.slice(2));a+=`await import(${N}${G}${N})`,h=P;continue}}}a+=C,h++}return a}function Pl(e,i){let t=i+5;if(t>=e.length)return null;if(!/\s/.test(e[t]))return null;while(t<e.length&&/\s/.test(e[t]))t++;if(!e.startsWith("import",t))return null;t+=6;while(t<e.length&&/\s/.test(e[t]))t++;if(e[t]!=="(")return null;t++;while(t<e.length&&/\s/.test(e[t]))t++;let o=e[t];if(o!=="'"&&o!=='"')return null;t++;let a=t;while(t<e.length&&e[t]!==o)if(e[t]==="\\")t+=2;else t++;if(t>=e.length)return null;let h=e.slice(a,t);t++;while(t<e.length&&/\s/.test(e[t]))t++;if(e[t]!==")")return null;return{quote:o,path:h,end:t+1}}function so(e,i){let t=e[i];if(t!=="{"&&t!=="[")return null;let a=y(e,t,t==="{"?"}":"]",i);if(a===-1)return null;return{pattern:e.slice(i,a+1),endPos:a+1}}function ro(e){let i=[],t=e.slice(1,-1).trim();if(!t)return i;let o=0,a=0,h="";while(o<t.length){let c=t[o];if(c==="{"||c==="["){let v=a===0?so(t,o):null;if(v){i.push(...ro(v.pattern)),o=v.endPos,h="";continue}a++}else if(c==="}"||c==="]")a--;if(a>0){o++;continue}if(c===","){if(h.trim())i.push(h.trim());h="",o++;continue}if(c===":"){h="",o++;continue}if(c==="="){if(h.trim())i.push(h.trim());h="",o++;while(o<t.length&&t[o]!==","&&a===0){if(t[o]==="{"||t[o]==="[")a++;else if(t[o]==="}"||t[o]==="]")a--;o++}continue}if(/[\w$]/.test(c))h+=c;o++}if(h.trim())i.push(h.trim());return i}function Zl(e){let i=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec(e);if(!i)return null;let t=i[0].length,o=(a)=>a===" "||a==="\t";while(t<e.length&&o(e[t]))t++;if(e[t]===":"){let a=0,h=null;t++;for(;t<e.length;t++){let c=e[t];if(h){if(c==="\\"){t++;continue}if(c===h)h=null;continue}if(c==="'"||c==='"'||c==="`"){h=c;continue}if(c==="("||c==="["||c==="{"||c==="<"){a++;continue}if(c===")"||c==="]"||c==="}"||c===">"){a--;continue}if(c==="="&&a<=0){let v=e[t+1],E=e[t-1];if(v!=="="&&v!==">"&&E!=="="&&E!=="!"&&E!=="<"&&E!==">")break}}if(e[t]!=="=")return null}while(t<e.length&&o(e[t]))t++;if(e[t]!=="=")return null;return{type:i[1],name:i[2],value:e.slice(t+1).trim()}}function Yi(e,i,t,o){let a=null,h=!1;for(let c of e){if(h){h=!1;continue}if(c==="\\"){h=!0;continue}if(a){if(c===a)a=null;continue}if(c==="'"||c==='"'||c==="`"){a=c;continue}if(c===i)o++;else if(c===t)o--}return o}function Qi(e,i){let t=e[i].trim(),o=Zl(t),a=o?[t,o.type,o.name,o.value]:null;if(!a){let C=t.match(/^(?:export\s+)?(const|let|var)\s+/);if(C){let O=t.slice(C[0].length),M=i;if(O.startsWith("{")||O.startsWith("[")){let I=O[0],P=I==="{"?"}":"]",G=Yi(O,I,P,0),q=O;for(let Z=i+1;Z<e.length&&G>0;Z++)q+=` ${e[Z].trim()}`,M=Z,G=Yi(e[Z],I,P,G);if(G>0)q=O,M=i;O=q}let N=so(O,0);if(N){let I=C[1],P=N.pattern,G=O.slice(N.endPos).trim();if(G.startsWith("=")){let q=G.slice(1).trim(),Z=q,Q=Math.max(M,i);if(eo(q)){let me=to(e,Q,q);Z=me.value,Q=me.nextIndex}else Q=Q+1;Z=Z.trim().replace(/;$/,"");let te=ro(P),ne=`__stx_src_${i}`,ae=te.map((me)=>`module.exports.${me} = ${me};`).join(`
415
+ `);return{type:I,name:ne,value:`${Z}; ${I} ${P} = ${ne};
416
+ ${ae}`,nextIndex:Q}}}}throw Error(`Failed to parse variable declaration: ${t}`)}let[,h,c,v]=a,E=v,R=i;if(eo(v)){let C=to(e,i,v);E=C.value,R=C.nextIndex}else R=i+1;while(R<e.length){let C=e[R].trim();if(C.startsWith(".")||C.startsWith("?."))E+=`
417
+ ${e[R]}`,R++;else break}return E=E.trim().replace(/;$/,""),{type:h,name:c,value:E,nextIndex:R}}function Gs(e,i){let t=e[i].trim(),o=t.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!o)throw Error(`Failed to parse function declaration: ${t}`);let[,a]=o,h=t.replace(/^export\s+/,""),c=i;if(Ml(t)){let v=Dl(e,i,h);h=v.functionCode,c=v.nextIndex}else c=i+1;return{name:a,functionCode:h,nextIndex:c}}function eo(e){let i=e.trim();if(i.startsWith("{"))return y(i,"{","}",0)===-1;if(i.startsWith("["))return y(i,"[","]",0)===-1;return!io(i)}function io(e){let i={paren:0,bracket:0,brace:0},t=null,o=0;for(let a=0;a<e.length;a++){let h=e[a];if((a>0?e[a-1]:"")==="\\"&&t)continue;if((h==='"'||h==="'")&&!t){t=h;continue}if(h===t&&t!=="`"){t=null;continue}if(h==="`"&&!t){t="`";continue}if(h==="`"&&t==="`"&&o===0){t=null;continue}if(t==="`"&&h==="$"&&e[a+1]==="{"){o++,a++;continue}if(o>0&&h==="{"){o++;continue}if(o>0&&h==="}"){o--;continue}if(t)continue;if(h==="(")i.paren++;else if(h===")")i.paren--;else if(h==="[")i.bracket++;else if(h==="]")i.bracket--;else if(h==="{")i.brace++;else if(h==="}")i.brace--}return i.paren===0&&i.bracket===0&&i.brace===0&&t===null}function oo(e){let i=e.indexOf("(");if(i===-1)return e.indexOf("{");let t=y(e,"(",")",i);if(t===-1)return-1;return e.indexOf("{",t)}function Ml(e){let i=oo(e);if(i===-1)return!0;return y(e,"{","}",i)===-1}function to(e,i,t){let o=t,a=i+1;while(a<e.length&&!io(o)){let h=e[a];o+=`
418
418
  ${h}`,a++}while(a<e.length){let h=e[a].trim();if(h.startsWith(".")||h.startsWith("?."))o+=`
419
- ${e[a]}`,a++;else break}return{value:o,nextIndex:a}}function Ml(e,i,t){let o=t,a=i+1;while(a<e.length){let h=io(o);if(h!==-1){if(y(o,"{","}",h)!==-1)break}let c=e[a];o+=`
420
- ${c}`,a++}return{functionCode:o,nextIndex:a}}function to(e,i){let t=l(e,i)??l(`(${e})`,i);if(t!==void 0)return t;if(!/\bprocess\b/.test(e))return;let o={...i,process:Object.freeze({env:{...Ct.env}})},a=Object.keys(o).filter(Dt),h=a.map((c)=>o[c]);try{return Function(...a,`'use strict'; return (${e});`)(...h)}catch{try{return Function(...a,`'use strict'; return ${e};`)(...h)}catch{return}}}async function Dl(e,i,t){let o=e.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let h of o){let[,,c,v]=h;try{let E=v.trim().replace(/;$/,""),R=to(E,i);if(R!==void 0)i[c]=R}catch(E){console.warn(`Failed to parse export ${c} in fallback:`,E)}}let a=e.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let h of a){let[,,c,v]=h;if(!(c in i))try{let E=v.trim().replace(/;$/,""),R=to(E,i);if(R!==void 0)i[c]=R}catch{}}}function Wa(e){let i=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),t=i?i[1]:"",o=i?e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):e;return{scriptContent:t,templateWithoutScript:o}}function qa(e){let i=e.trim();if(!i)return!1;return/(?:const|let|var|function)\s+\w+/.test(i)}
421
- export{Ae,be,L,os,is,j,as,cs,ls,Co,Eo,To,$a,Et,on,s,an,B,Tt,re,b,Ra,w,ir,us,ve,S,Pe,ue,ar,F,cn,Ie,se,Aa,de,K,cr,ds,oe,$t,G,z,et,lr,ur,Rt,$o,Ro,Vl,Oe,Pa,Ia,Oa,Ao,Na,ps,Po,Da,Ma,La,Io,ln,gs,un,At,Pt,ja,ms,Ba,dn,dr,hs,ys,Fa,Oo,za,Ha,Va,Ua,pn,Ul,Wl,ql,Kl,Gl,g,Xl,No,Jl,Wa,qa,Do,Mo,Yl,It,Ka,Lo,Ga,Pp,Ne,fn,De,Zl,Ql,eu,tu,nu,bs,ru,Me,X,Le,su,pr,ou,Xa,jo,je,n,gn,Ja,m,pe,Ip,Ya,Za,Qa,Bo,vs,iu,Op,au,Np,Ot,d,H,J,mn,we,cu,Fo,lu,Dp,k,uu,Mp,_,Lp};
419
+ ${e[a]}`,a++;else break}return{value:o,nextIndex:a}}function Dl(e,i,t){let o=t,a=i+1;while(a<e.length){let h=oo(o);if(h!==-1){if(y(o,"{","}",h)!==-1)break}let c=e[a];o+=`
420
+ ${c}`,a++}return{functionCode:o,nextIndex:a}}function no(e,i){let t=l(e,i)??l(`(${e})`,i);if(t!==void 0)return t;if(!/\bprocess\b/.test(e))return;let o={...i,process:Object.freeze({env:{...Ct.env}})},a=Object.keys(o).filter(Dt),h=a.map((c)=>o[c]);try{return Function(...a,`'use strict'; return (${e});`)(...h)}catch{try{return Function(...a,`'use strict'; return ${e};`)(...h)}catch{return}}}async function jl(e,i,t){let o=e.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let h of o){let[,,c,v]=h;try{let E=v.trim().replace(/;$/,""),R=no(E,i);if(R!==void 0)i[c]=R}catch(E){console.warn(`Failed to parse export ${c} in fallback:`,E)}}let a=e.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let h of a){let[,,c,v]=h;if(!(c in i))try{let E=v.trim().replace(/;$/,""),R=no(E,i);if(R!==void 0)i[c]=R}catch{}}}function Ga(e){let i=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),t=i?i[1]:"",o=i?e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):e;return{scriptContent:t,templateWithoutScript:o}}function Ka(e){let i=e.trim();if(!i)return!1;return/(?:const|let|var|function)\s+\w+/.test(i)}
421
+ export{Ae,be,L,is,as,j,cs,ls,us,To,$o,Ro,Aa,Et,on,s,an,B,Tt,se,b,Pa,w,ir,ds,ve,k,Pe,ue,ar,F,cn,Ie,z,Ia,de,K,cr,ps,oe,$t,X,H,et,lr,ur,Rt,Ao,Po,Wl,Oe,Oa,Na,Da,Io,Ma,gs,Oo,La,ja,Ba,No,ln,ms,un,At,Pt,Fa,hs,za,dn,dr,ys,bs,Ha,Do,Va,Ua,Wa,qa,pn,ql,Gl,Kl,Xl,Jl,g,Yl,Mo,Zl,Ga,Ka,Lo,jo,Ql,It,Xa,Bo,Ja,Op,Ne,fn,De,eu,tu,nu,ru,su,vs,ou,Me,J,Le,iu,pr,au,Ya,Fo,je,n,gn,Za,m,pe,Np,Qa,ec,tc,zo,ws,cu,Dp,lu,Mp,Ot,d,V,Y,mn,we,uu,Ho,du,Lp,x,pu,jp,_,Bp};