@stacksjs/stx 0.2.855 → 0.2.857

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 (154) hide show
  1. package/dist/{chunk-6w3gv9d6.js → chunk-03t7tk2k.js} +1 -1
  2. package/dist/{chunk-jn6mdfrs.js → chunk-08a7j82a.js} +1 -1
  3. package/dist/{chunk-5ppe8d51.js → chunk-08vwk3x7.js} +1 -1
  4. package/dist/{chunk-0dmpc70r.js → chunk-0d3z8hwz.js} +14 -14
  5. package/dist/{chunk-k0arm18k.js → chunk-0hrkpb2h.js} +1 -1
  6. package/dist/{chunk-yzvp90yk.js → chunk-0veh8bcn.js} +2 -2
  7. package/dist/{chunk-4cd94cd5.js → chunk-1277d5we.js} +4 -4
  8. package/dist/{chunk-279n7sde.js → chunk-16p1vkn6.js} +3 -3
  9. package/dist/{chunk-zqb294v2.js → chunk-1772ax8e.js} +1 -1
  10. package/dist/chunk-1ffkbwdz.js +2 -0
  11. package/dist/{chunk-xfb7fdeq.js → chunk-1kmzj10y.js} +10 -10
  12. package/dist/{chunk-w032x0zm.js → chunk-1nankvf6.js} +2 -2
  13. package/dist/chunk-1qbagang.js +2 -0
  14. package/dist/{chunk-7tteg9bn.js → chunk-1qvtme01.js} +1 -1
  15. package/dist/{chunk-gn1dmfdv.js → chunk-1xx55d2p.js} +1 -1
  16. package/dist/{chunk-q0ycypnt.js → chunk-1ywqsmy2.js} +1 -1
  17. package/dist/{chunk-9n3584wt.js → chunk-23mccy5y.js} +1 -1
  18. package/dist/{chunk-2j2qzv8g.js → chunk-27zp4q77.js} +2 -2
  19. package/dist/chunk-2a471sw1.js +3 -0
  20. package/dist/{chunk-33ph9zb2.js → chunk-2cy33z00.js} +2 -2
  21. package/dist/chunk-2jrf9m4w.js +2 -0
  22. package/dist/chunk-3jgrrjvx.js +2 -0
  23. package/dist/{chunk-q0jmc3m4.js → chunk-3wabhzf4.js} +8 -8
  24. package/dist/{chunk-68pvvd7v.js → chunk-3zjyhhg4.js} +3 -3
  25. package/dist/{chunk-gxqtbbz0.js → chunk-41md2f3q.js} +3 -3
  26. package/dist/{chunk-ngnvyqk3.js → chunk-432c35hs.js} +2 -2
  27. package/dist/{chunk-a2fngjfx.js → chunk-4h9kkkh7.js} +1 -1
  28. package/dist/{chunk-h1f3dpvq.js → chunk-4tzsze9z.js} +2 -2
  29. package/dist/chunk-655m8g98.js +2 -0
  30. package/dist/chunk-68kspmq4.js +2 -0
  31. package/dist/{chunk-e8zpzt9s.js → chunk-6tpcm12w.js} +1 -1
  32. package/dist/chunk-6x0jm4bv.js +2 -0
  33. package/dist/{chunk-w835crjw.js → chunk-6zj9wsy3.js} +1 -1
  34. package/dist/{chunk-0vg0j7xa.js → chunk-827rt3ew.js} +1 -1
  35. package/dist/{chunk-fzkyk5j4.js → chunk-8hymdzv2.js} +4 -4
  36. package/dist/chunk-8j8fth4b.js +2 -0
  37. package/dist/{chunk-enxnw50k.js → chunk-8ta5b0eb.js} +1 -1
  38. package/dist/{chunk-pwem4sed.js → chunk-914wcp1a.js} +3 -3
  39. package/dist/{chunk-f858fazq.js → chunk-93cgpqva.js} +1 -1
  40. package/dist/{chunk-car6nhfe.js → chunk-9n8t7v78.js} +2 -2
  41. package/dist/chunk-9wf5fx4s.js +2 -0
  42. package/dist/chunk-a4v8z93r.js +2 -0
  43. package/dist/{chunk-463zkecq.js → chunk-a53jtd74.js} +1 -1
  44. package/dist/{chunk-krtkxnz6.js → chunk-admnvsmx.js} +2 -2
  45. package/dist/chunk-b16g785w.js +2 -0
  46. package/dist/{chunk-ctb1bj28.js → chunk-bg574nvy.js} +3 -3
  47. package/dist/{chunk-fbpqkrvb.js → chunk-bq6jy4yk.js} +3 -3
  48. package/dist/{chunk-hgy98n76.js → chunk-cama7kaq.js} +3 -3
  49. package/dist/chunk-ccdp6g5z.js +2 -0
  50. package/dist/chunk-chr56bhk.js +2 -0
  51. package/dist/{chunk-v8p8t3t4.js → chunk-cskmp5p1.js} +1 -1
  52. package/dist/{chunk-77kanny8.js → chunk-cvrkr3re.js} +9 -9
  53. package/dist/{chunk-9r999ees.js → chunk-dhpd4mx7.js} +2 -2
  54. package/dist/{chunk-9hvfmqs1.js → chunk-dnrgcjds.js} +8 -8
  55. package/dist/chunk-dtxg2a6m.js +2 -0
  56. package/dist/{chunk-wzv7k91a.js → chunk-e8we717q.js} +2 -2
  57. package/dist/{chunk-zswtgwxg.js → chunk-eefdz43s.js} +1 -1
  58. package/dist/chunk-ent64fyq.js +2 -0
  59. package/dist/chunk-erfspa7v.js +2 -0
  60. package/dist/chunk-f0kveh4g.js +2 -0
  61. package/dist/{chunk-anva219c.js → chunk-f1vvhbmw.js} +2 -2
  62. package/dist/chunk-f1z6y2ts.js +2 -0
  63. package/dist/chunk-f3msj6jf.js +2 -0
  64. package/dist/chunk-fk7wk568.js +2 -0
  65. package/dist/{chunk-mv48q1p4.js → chunk-fp24ecp8.js} +65 -65
  66. package/dist/{chunk-9z7fnv33.js → chunk-fyp1v087.js} +1 -1
  67. package/dist/{chunk-1qybwj8k.js → chunk-g0h1gxew.js} +11 -11
  68. package/dist/{chunk-kez50h8a.js → chunk-gggethdc.js} +1 -1
  69. package/dist/{chunk-7kc9xwht.js → chunk-gqrypyk7.js} +2 -2
  70. package/dist/chunk-gr19kv83.js +2 -0
  71. package/dist/{chunk-ynd2nfvs.js → chunk-hfng042r.js} +26 -26
  72. package/dist/chunk-hj1yn8w5.js +2 -0
  73. package/dist/{chunk-7hp50cpd.js → chunk-htwn1f36.js} +6 -6
  74. package/dist/chunk-hzrcnxzg.js +2 -0
  75. package/dist/{chunk-vw73gsxx.js → chunk-j2s8j7ff.js} +3 -3
  76. package/dist/chunk-jed9n2hz.js +2 -0
  77. package/dist/{chunk-xn2gyhes.js → chunk-jefafv6s.js} +4 -4
  78. package/dist/chunk-jhm1228j.js +4 -0
  79. package/dist/chunk-js7nmw8v.js +2 -0
  80. package/dist/chunk-k0ert6e7.js +3 -0
  81. package/dist/{chunk-2rxr5cj6.js → chunk-mfwfaggj.js} +9 -9
  82. package/dist/{chunk-hpwtjb4a.js → chunk-mzes9ds7.js} +2 -2
  83. package/dist/chunk-n68sanmz.js +2 -0
  84. package/dist/{chunk-cy60hmv2.js → chunk-npzzbdn1.js} +1 -1
  85. package/dist/chunk-nstcwcpj.js +2 -0
  86. package/dist/{chunk-ybq56wam.js → chunk-pb09xy77.js} +2 -2
  87. package/dist/chunk-q87hkwfg.js +3 -0
  88. package/dist/chunk-qe6631me.js +2 -0
  89. package/dist/{chunk-ma4ftg5p.js → chunk-qvydfw8g.js} +4 -4
  90. package/dist/{chunk-pesgcwrj.js → chunk-qw0ctwnc.js} +3 -3
  91. package/dist/chunk-rrf78ezg.js +2 -0
  92. package/dist/{chunk-4dfz7cdr.js → chunk-sb7zn84j.js} +5 -5
  93. package/dist/{chunk-f9thwm8c.js → chunk-sftyb8k4.js} +8 -8
  94. package/dist/{chunk-zme05d1n.js → chunk-sgnkbgx1.js} +1 -1
  95. package/dist/chunk-shy2hkvj.js +2 -0
  96. package/dist/{chunk-v4bqmzj9.js → chunk-sny8rqe8.js} +2 -2
  97. package/dist/{chunk-csgfws3j.js → chunk-v1eycdhj.js} +2 -2
  98. package/dist/{chunk-eegs2at0.js → chunk-vmrvkbw6.js} +1 -1
  99. package/dist/chunk-vr5h5jpw.js +2 -0
  100. package/dist/{chunk-11y3106w.js → chunk-wdh20fxz.js} +1 -1
  101. package/dist/chunk-wg7xzens.js +2 -0
  102. package/dist/{chunk-te82sjhy.js → chunk-xejhmsfw.js} +7 -7
  103. package/dist/{chunk-4wrddn8m.js → chunk-xfymp197.js} +9 -9
  104. package/dist/{chunk-qxk9grjm.js → chunk-xqr2ec9k.js} +1 -1
  105. package/dist/{chunk-fba71th7.js → chunk-xw12cd90.js} +7 -7
  106. package/dist/{chunk-gsn5vvw4.js → chunk-y5agvhgg.js} +1 -1
  107. package/dist/chunk-zd2c84ct.js +2 -0
  108. package/dist/{chunk-yscys65t.js → chunk-zrsc45wv.js} +1 -1
  109. package/dist/{chunk-mhjxx64x.js → chunk-zx5bt056.js} +24 -24
  110. package/dist/cli.js +17 -17
  111. package/dist/component-client-factories.js +6 -5
  112. package/dist/craft-entry.js +1 -1
  113. package/dist/craft.js +1 -1
  114. package/dist/pwa.js +3 -3
  115. package/dist/ssg.js +8 -8
  116. package/dist/utils.js +3 -2
  117. package/package.json +5 -5
  118. package/dist/chunk-161ksm7f.js +0 -2
  119. package/dist/chunk-1p968nww.js +0 -2
  120. package/dist/chunk-2y20dvab.js +0 -2
  121. package/dist/chunk-33yeb861.js +0 -2
  122. package/dist/chunk-3pm6d9zj.js +0 -2
  123. package/dist/chunk-3wt0nh3p.js +0 -2
  124. package/dist/chunk-5dykcrnv.js +0 -2
  125. package/dist/chunk-5xcxc9f8.js +0 -2
  126. package/dist/chunk-6bm19d4k.js +0 -2
  127. package/dist/chunk-81z64a84.js +0 -2
  128. package/dist/chunk-8gsd2n0j.js +0 -2
  129. package/dist/chunk-8kqqxqyp.js +0 -2
  130. package/dist/chunk-8qe34jb8.js +0 -3
  131. package/dist/chunk-bk0arddt.js +0 -2
  132. package/dist/chunk-c557w9e6.js +0 -2
  133. package/dist/chunk-cfmjtyzm.js +0 -2
  134. package/dist/chunk-ck9zengd.js +0 -2
  135. package/dist/chunk-cwt26rvt.js +0 -3
  136. package/dist/chunk-dbag44ta.js +0 -2
  137. package/dist/chunk-dfcnaaym.js +0 -2
  138. package/dist/chunk-ehp792dy.js +0 -3
  139. package/dist/chunk-ggthncvg.js +0 -2
  140. package/dist/chunk-hfcagm39.js +0 -2
  141. package/dist/chunk-hfe2byfx.js +0 -2
  142. package/dist/chunk-hmys6w75.js +0 -2
  143. package/dist/chunk-hqtj4ngq.js +0 -2
  144. package/dist/chunk-j3s5y2k5.js +0 -2
  145. package/dist/chunk-ns5epsng.js +0 -2
  146. package/dist/chunk-p91288ce.js +0 -2
  147. package/dist/chunk-pw6n7a9k.js +0 -2
  148. package/dist/chunk-qccpfn5x.js +0 -2
  149. package/dist/chunk-vbsr76qe.js +0 -2
  150. package/dist/chunk-vgaqznwt.js +0 -2
  151. package/dist/chunk-w165qe5q.js +0 -2
  152. package/dist/chunk-wz54wsm7.js +0 -2
  153. package/dist/chunk-x4077p94.js +0 -2
  154. package/dist/chunk-z0qfspzg.js +0 -4
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{P,t,l}from"./chunk-0dmpc70r.js";import{Q}from"./chunk-mv48q1p4.js";import{ti}from"./chunk-kvafq9gy.js";import E from"path";var S;async function W(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var T={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function J(e,s=0){if(s<=0)return!1;return Date.now()-e.loadedAt>s}async function G(e,s){if({...T,...s.i18n}.cache&&v[e]){let r=v[e],o=s.i18n?.cacheMaxAge??0;if(!J(r,o))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=C(e,s).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function C(e,s){let i={...T,...s.i18n},n=E.isAbsolute(i.translationsDir)?i.translationsDir:E.resolve(s.root||process.cwd(),i.translationsDir);try{let r=await W(),o=r?await r(e,{translationsDir:n,defaultLocale:i.defaultLocale,sources:te(i.format)}):await Y(e,i,n);if(o===void 0){let u=e!==i.defaultLocale?await C(i.defaultLocale,s):{};if(i.cache)v[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=o;if(i.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(s.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==i.defaultLocale)return C(i.defaultLocale,s);return{}}}async function Y(e,s,i){let n=E.join(i,`${e}${Z(s.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let o=await Bun.file(n).text();if(s.format==="yaml"||s.format==="yml")return X(o);if(s.format==="json")return JSON.parse(o);throw r}catch{return}}}function Z(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function X(e){let s={},i=e.split(`
2
+ import{P,t,l}from"./chunk-0d3z8hwz.js";import{Q}from"./chunk-fp24ecp8.js";import{ti}from"./chunk-kvafq9gy.js";import E from"path";var S;async function W(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var T={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function J(e,s=0){if(s<=0)return!1;return Date.now()-e.loadedAt>s}async function G(e,s){if({...T,...s.i18n}.cache&&v[e]){let r=v[e],o=s.i18n?.cacheMaxAge??0;if(!J(r,o))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=C(e,s).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function C(e,s){let i={...T,...s.i18n},n=E.isAbsolute(i.translationsDir)?i.translationsDir:E.resolve(s.root||process.cwd(),i.translationsDir);try{let r=await W(),o=r?await r(e,{translationsDir:n,defaultLocale:i.defaultLocale,sources:te(i.format)}):await Y(e,i,n);if(o===void 0){let u=e!==i.defaultLocale?await C(i.defaultLocale,s):{};if(i.cache)v[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=o;if(i.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(s.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==i.defaultLocale)return C(i.defaultLocale,s);return{}}}async function Y(e,s,i){let n=E.join(i,`${e}${Z(s.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let o=await Bun.file(n).text();if(s.format==="yaml"||s.format==="yml")return X(o);if(s.format==="json")return JSON.parse(o);throw r}catch{return}}}function Z(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function X(e){let s={},i=e.split(`
3
3
  `),n=[{obj:s,indent:-1}];for(let r of i){let o=r.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let c=o.search(/\S/);if(c===-1)continue;while(n.length>1&&n[n.length-1].indent>=c)n.pop();let u=n[n.length-1].obj,a=o.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(a){let[,,g,p]=a,f=g.trim(),m=p.trim();if(m==="")u[f]={},n.push({obj:u[f],indent:c});else u[f]=ee(m)}}return s}function ee(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let s=e.toLowerCase();if(s==="true"||s==="yes")return!0;if(s==="false"||s==="no")return!1;if(s==="null"||s==="~")return null;let i=Number(e);if(!Number.isNaN(i)&&e!=="")return i;return e}function te(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function re(e,s){return G(e,s)}function ne(e,s){for(let i of e){let n=i.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let c=Number.parseInt(r[1],10);if(s===c)return r[2];continue}let o=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(o){let c=Number.parseInt(o[1],10),u=o[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(o[2],10);if(s>=c&&s<=u)return o[3];continue}}if(e.length===2)return s===1?e[0].trim():e[1].trim();if(s<e.length)return e[s].trim();return e[e.length-1].trim()}function ie(e,s={}){return j(e,s)}function j(e,s){let i="",n=0;while(n<e.length)if(e[n]==="{"){let r=se(e,n);if(r===-1){i+=e[n],n++;continue}let o=e.slice(n+1,r);i+=ae(o,s),n=r+1}else if(e[n]==="'"&&n+1<e.length)if(e[n+1]==="'")i+="'",n+=2;else if(e[n+1]==="{"||e[n+1]==="}")i+=e[n+1],n+=2;else i+=e[n],n++;else i+=e[n],n++;return i}function se(e,s){let i=0;for(let n=s;n<e.length;n++)if(e[n]==="{")i++;else if(e[n]==="}"){if(i--,i===0)return n}return-1}function ae(e,s){let i=oe(e);if(i.length===0)return`{${e}}`;let n=i[0].trim(),r=s[n];if(i.length===1)return r!==void 0?String(r):`{${n}}`;switch(i[1].trim().toLowerCase()){case"plural":return le(r,i.slice(2).join(","),s);case"select":return ue(r,i.slice(2).join(","));case"selectordinal":return de(r,i.slice(2).join(","));case"number":return pe(r,i[2]?.trim());case"date":return fe(r,i[2]?.trim());case"time":return me(r,i[2]?.trim());default:return r!==void 0?String(r):`{${e}}`}}function oe(e){let s=[],i="",n=0;for(let r=0;r<e.length;r++){let o=e[r];if(o==="{")n++,i+=o;else if(o==="}")n--,i+=o;else if(o===","&&n===0)s.push(i),i="";else i+=o}if(i)s.push(i);return s}function le(e,s,i){let n=Number(e)||0,r=I(s),o=`=${n}`;if(r[o])return R(r[o],n,i);let c=ce(n);if(r[c])return R(r[c],n,i);if(r.other)return R(r.other,n,i);return String(n)}function R(e,s,i){let n=e.replace(/#/g,String(s));return j(n,i)}function ce(e){let s=Math.abs(e),i=Math.floor(s),n=String(e).includes(".")?String(e).split(".")[1].length:0;if(i===1&&n===0)return"one";return"other"}function ue(e,s){let i=String(e||""),n=I(s);if(n[i])return n[i];return n.other||String(e)}function de(e,s){let i=Number(e)||0,n=I(s),r=ge(i);if(n[r])return n[r].replace(/#/g,String(i));if(n.other)return n.other.replace(/#/g,String(i));return String(i)}function ge(e){let s=Math.abs(e),i=s%10,n=s%100;if(i===1&&n!==11)return"one";if(i===2&&n!==12)return"two";if(i===3&&n!==13)return"few";return"other"}function I(e){let s={},i=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,n=i.exec(e);while(n!==null)s[n[1]]=n[2],n=i.exec(e);return s}function pe(e,s){let i=Number(e);if(Number.isNaN(i))return String(e);switch(s){case"integer":return Math.floor(i).toLocaleString();case"percent":return`${(i*100).toFixed(0)}%`;case"currency":return i.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return i.toLocaleString()}}function fe(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.dateStyle="short";break;case"medium":n.dateStyle="medium";break;case"long":n.dateStyle="long";break;case"full":n.dateStyle="full";break;default:n.dateStyle="medium"}return i.toLocaleDateString(void 0,n)}function me(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.timeStyle="short";break;case"medium":n.timeStyle="medium";break;case"long":n.timeStyle="long";break;case"full":n.timeStyle="full";break;default:n.timeStyle="short"}return i.toLocaleTimeString(void 0,n)}function be(e){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(e)}function O(e,s,i=!0,n={}){let r=e.split("."),o=s;for(let u of r){if(o===void 0||o===null)break;o=o[u]}if(o===void 0||o===null)return i?e:"";let c=String(o);if(be(c))return ie(c,n);if(c.includes("|")&&"count"in n){let u=Number(n.count),a=c.split("|");c=ne(a,u)}for(let[u,a]of Object.entries(n)){let g=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`:${g}`,"g"),()=>String(a))}return c}var D=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),he=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function q(e){if(!e)return"ltr";let s=e.trim().toLowerCase().replace(/_/g,"-").split("-"),i=s[0];if(!i)return"ltr";let n=s[1]?.length===4?s[1]:void 0;if(n)return he.has(n)?"rtl":"ltr";if(s.length>1&&D.has(`${i}-${s[1]}`))return"rtl";return D.has(i)?"rtl":"ltr"}async function kc(e,s,i,n){let r=e,o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,c={...T,...n.i18n},u=await re(c.locale,n);s.__translations=u,s.__locale=c.locale,s.__i18nConfig=c,r=await F(r,o,async(p,f,m,w,h)=>{try{let b={};if(m)try{let d=[()=>JSON.parse(m),()=>{let x=`{"data":${m}}`,A=JSON.parse(x);return typeof A.data==="object"?A.data:{}},()=>P(m,s)];for(let x of d)try{if(b=x(),Object.keys(b).length>0)break}catch{}}catch(d){if(n.debug)console.error("Error parsing parameters for @translate directive:",d)}let y=O(f,u,c.fallbackToKey,b);return y?Q(r,h,y,!1,p.length):w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return l("Translate",`Error in @translate('${f}'): ${b instanceof Error?b.message:String(b)}`,t.EVALUATION_ERROR)}});let a=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(n.debug){console.warn(`Processing translations in template. Sections: ${r.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let p=[...r.matchAll(a)];console.warn(`Found ${p.length} @translate matches`),p.forEach((f,m)=>console.warn(`Match ${m}: ${f[0]}, Key: ${f[1]}, Params: ${f[2]||"none"}`))}return r=await F(r,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(p,f,m,w)=>{try{let h={};if(m)try{let b=[()=>JSON.parse(m),()=>{let y=`{"data":${m}}`,d=JSON.parse(y);return typeof d.data==="object"?d.data:{}},()=>P(m,s)];for(let y of b)try{if(h=y(),Object.keys(h).length>0)break}catch{}}catch(b){if(n.debug)console.error("Error parsing parameters for @translate directive:",b)}return Q(r,w,O(f,u,c.fallbackToKey,h),!1,p.length)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return l("Translate",`Error in @translate('${f}'): ${h instanceof Error?h.message:String(h)}`,t.EVALUATION_ERROR)}}),r}async function F(e,s,i){let n=[];return e.replace(s,(o,...c)=>{let u=i(o,...c).then((a)=>({match:o,replacement:a}));return n.push(u),o}),(await Promise.all(n)).reduce((o,{match:c,replacement:u})=>o.replace(c,()=>u),e)}function _(e,s){if(!e||q(e)!=="rtl")return!1;return!s||s.trim().toLowerCase()!=="rtl"}function V(e){if(!e)return!1;return e.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||e.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function U(e,s){let i=new RegExp(`\\b${s}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);if(!i)return null;return i[2]??i[3]??i[4]??null}function _c(e,s,i,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,u,a)=>{let p={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[u]||"Make this element accessible";return`<!-- a11y-hint: ${a||p} -->`});let o=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(o,(c,u)=>`<span class="sr-only">${u.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(c,u,a)=>`<span id="${`desc-${u}`}" class="sr-only">${a}</span>`),r}function ye(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function xe(e){let s=new Map,i=e.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(r,o,c)=>{let u=s.get(c);if(!u)u=`stx-a11y-component-${s.size}`,s.set(c,u);return`<${o}${u}`}),n=new Map([...s.entries()].map(([r,o])=>[o,r]));return{protectedSource:i,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(o,c,u)=>{let a=n.get(u);return a?`<${c}${a}`:o})}}function we(e,s){let i=[],n=/<img\s+([^>]*)>/gi,r;r=n.exec(e);while(r!==null){let d=r[1];if(!/\balt\s*=/i.test(d))i.push({type:"missing-alt",element:r[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});r=n.exec(e)}let o=/<button([^>]*)>\s*<\/button>/gi;r=o.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"missing-accessible-name",element:r[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});r=o.exec(e)}let c=/<a\s+([^>]*)>\s*<\/a>/gi;r=c.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"link-missing-text",element:r[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});r=c.exec(e)}let u=/<(input|select|textarea)\s+([^>]*)>/gi;r=u.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=u.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),A=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=A&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${A[1]}["']`,"i").test(e),M=r.index,N=e.substring(0,M),Se=e.substring(M),H=(N.match(/<label\b/gi)||[]).length,z=(N.match(/<\/label>/gi)||[]).length,K=H>z;if(!B&&!K)i.push({type:"input-missing-label",element:r[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}r=u.exec(e)}let a=/<h([1-6])[^>]*>/gi,g=[];r=a.exec(e);while(r!==null)g.push(Number.parseInt(r[1],10)),r=a.exec(e);let p=0;for(let d of g){if(p>0&&d>p+1)i.push({type:"heading-skip",element:`<h${d}>`,message:`Heading level skipped from h${p} to h${d}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});p=d}if(/<html\b/i.test(e)&&!/<html[^>]*\slang\s*=/i.test(e))i.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let f=e.match(/<html\b([^>]*)>/i);if(f&&_(U(f[1],"lang"),U(f[1],"dir")))i.push({type:"missing-dir",element:f[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let m=/<table([^>]*)>([\s\S]*?)<\/table>/gi;r=m.exec(e);while(r!==null){let d=r[2];if(!V(U(r[1],"role"))&&!/<th\b/i.test(d))i.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});r=m.exec(e)}let w=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;r=w.exec(e);while(r!==null){if(!/\bmuted\b/i.test(r[0]))i.push({type:"autoplay-audio",element:`<${r[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});r=w.exec(e)}let h=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;r=h.exec(e);while(r!==null)i.push({type:"positive-tabindex",element:`tabindex="${r[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),r=h.exec(e);let b=/<iframe\s+([^>]*)>/gi;r=b.exec(e);while(r!==null){let d=r[1];if(!/\btitle\s*=/i.test(d)&&!/\baria-label\s*=/i.test(d))i.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});r=b.exec(e)}let y=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;r=y.exec(e);while(r!==null){let d=r[1].toLowerCase(),x=r[2];if(d!=="button"&&!/\btabindex\s*=/i.test(x))i.push({type:"button-not-focusable",element:r[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});r=y.exec(e)}return i}async function Ae(e,s){let{protectedSource:i}=xe(e);if(!ye())return we(i,s);let n=[];try{let r=globalThis.document.createElement("div");r.innerHTML=i,r.querySelectorAll("img").forEach((a)=>{if(!a.hasAttribute("alt"))n.push({type:"missing-alt",element:`<${a.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),r.querySelectorAll('button, a, [role="button"]').forEach((a)=>{if(!(a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby")||a.textContent&&a.textContent.trim().length>0))n.push({type:"missing-accessible-name",element:`<${a.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),r.querySelectorAll("input, select, textarea").forEach((a)=>{let g=a.getAttribute("id"),p=g&&r.querySelector(`label[for="${g}"]`),f=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),m=a.closest("label")!==null;if(!p&&!f&&!m)n.push({type:"input-missing-label",element:`<${a.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let o=Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")),c=0;for(let a of o){let g=Number.parseInt(a.tagName.charAt(1));if(c>0&&g>c+1)n.push({type:"heading-skip",element:`<${a.outerHTML}>`,message:`Heading level skipped from h${c} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});c=g}let u=r.querySelector("html");if(i.includes("<html")&&u&&!u.hasAttribute("lang"))n.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(u&&_(u.getAttribute("lang"),u.getAttribute("dir")))n.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(r.querySelectorAll("a").forEach((a)=>{let g=a.textContent&&a.textContent.trim().length>0,p=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),f=a.hasAttribute("title"),m=a.querySelector("img[alt]");if(!g&&!p&&!f&&!m)n.push({type:"link-missing-text",element:`<${a.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),i.includes("<nav")||i.includes("<header")){if(!r.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&r.querySelectorAll("a").length>5)n.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(r.querySelectorAll("table").forEach((a)=>{if(V(a.getAttribute("role")))return;let g=a.querySelector("caption");if(!a.querySelector("th"))n.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!g&&!a.hasAttribute("aria-label")&&!a.hasAttribute("aria-labelledby"))n.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),r.querySelectorAll('[style*="color"]').forEach((a)=>{let g=a.getAttribute("style")||"";if(g.includes("color:")&&!g.includes("background"))n.push({type:"potential-contrast-issue",element:`<${a.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),r.querySelectorAll("video[autoplay], audio[autoplay]").forEach((a)=>{if(!a.hasAttribute("muted"))n.push({type:"autoplay-audio",element:`<${a.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),r.querySelectorAll("[tabindex]").forEach((a)=>{if(Number.parseInt(a.getAttribute("tabindex")||"0")>0)n.push({type:"positive-tabindex",element:`<${a.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),r.querySelectorAll('[role="button"]').forEach((a)=>{if(!a.hasAttribute("tabindex"))n.push({type:"button-not-focusable",element:`<${a.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),i.includes("<body")&&!r.querySelector('main, [role="main"]'))n.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});r.querySelectorAll("iframe").forEach((a)=>{if(!a.hasAttribute("title")&&!a.hasAttribute("aria-label"))n.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(r){console.error(`Error checking accessibility in ${s}:`,r)}return n}async function Cc(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,o=Array.isArray(e)?e:[e],c=await ti(o,{recursive:n,ignorePaths:r}),u=[];for(let a of c)try{let g=await Bun.file(a).text();if(a.endsWith("good-a11y.stx"))continue;let p=await Ae(g,a);if(u.push(a),p.length>0)i[a]=p}catch(g){console.error(`Error scanning ${a}:`,g)}return{results:i,scannedFiles:u}}var Ec={name:"a11y",handler:(e,s,i,n)=>{if(!s.length)return e;let r=s[0].replace(/['"]/g,""),o=s.length>1?s[1].replace(/['"]/g,""):"",u={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[r]||"Make this element accessible";return`<!-- a11y-hint: ${o||u} -->${e}`},hasEndTag:!1},Tc={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
4
4
  export{kc,_c,Cc,Ec,Tc};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Tn}from"./chunk-0dmpc70r.js";import{q,y,Mt,Dt,$r,g,cl,_i,W,A}from"./chunk-mv48q1p4.js";import{nn}from"./chunk-yzvp90yk.js";import{n}from"./chunk-8qe34jb8.js";import{G}from"./chunk-ym5qgw03.js";var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)s.push({start:r.index,end:r.index+r[0].length});return s}function N(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},r=s,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let o=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];r=r.slice(o[0].length);continue}let c=r.match(/^#([\w-]+)/);if(c){e.id=c[1],r=r.slice(c[0].length);continue}let a=r.match(/^\.([\w-]+)/);if(a){e.className=a[1],r=r.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Y(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=r.exec(t))!==null){if(N(o.index,i))continue;let c=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||X.has(c))continue;if(e.tag&&e.tag!==c)continue;if(!Y(a,e))continue;let l=o[0],f=o.index+l.length,u=new RegExp(`<(/?)${c}\\b([^>]*)>`,"gi");u.lastIndex=f;let d=1,h;while((h=u.exec(t))!==null){if(N(h.index,i))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=S?-1:1,d===0)return{openTag:l,openIndex:o.index,start:f,end:h.index,tagName:c}}return null}return null}var mt="private, no-store";function Jt(t){return t.replace(/&#(\d+);/g,(s,e)=>F(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>F(Number.parseInt(e,16),s)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function F(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Ee(t){return t.headers.get("X-STX-Router")==="true"}function Z(t,s){if(!t)return s;return t.split(",").some((r)=>r.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function j(t){return{Vary:Z(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function D(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return y(s,(r,i)=>(e.lastIndex=i,e.exec(r)?e.lastIndex:-1)).map(({token:r})=>r)}function L(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let r of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=r[1].toLowerCase();if(!(i in s))s[i]=r[2]??r[3]??r[4]??""}return s}function Nn(t){let s=[];for(let e of D(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let r=L(e);if(/^<meta\b/i.test(e)){let i=r.property?"property":"name",o=Jt(r[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${n(o)}" content="${E(r.content??"")}">`)}else{let i=Jt(r.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&r.hreflang)s.push(`<link rel="${i}" href="${E(r.href??"")}"${i==="alternate"?` hreflang="${E(r.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
3
- `}var Q=["media","crossorigin","integrity"];function Mn(t){let s=[];for(let e of D(t)){if(!/^<link\b/i.test(e))continue;let r=L(e);if(Jt(r.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!r.href||"data-css"in r||"disabled"in r)continue;let i=Q.filter((o)=>(o in r)).map((o)=>` ${o}="${E(r[o])}"`).join("");s.push(`<link rel="stylesheet" href="${E(r.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
4
- `:""}import T from"path";var tt="stx-page-head:",et=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function nt(){let t=G()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-6bm19d4k.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${r()}</script>`}catch{_[t]=""}return _[t]}async function ga(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let r=T.resolve(t,s);if(await Bun.file(r).exists())return r;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function wo(t,s){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let o=nn(e),c=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=l.exec(e))!==null)a.push(f[0]);let u=r;for(let p of o.server)u=u.replace(p.fullTag,"");for(let p of o.client)u=u.replace(p.fullTag,"");u=u.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(u=u.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!u.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:R,loadStxConfig:b}=await import("./chunk-j3s5y2k5.js"),k=await b(),m={__filename:t,__dirname:T.dirname(t)};for(let p of c){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await S(C[1],m,t)}let x=await h(u,m,t,{...R,...k,...s},new Set),w=x.indexOf(d);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,w),afterSlot:x.substring(w+d.length),filePath:t,shellScripts:c,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Jr(t,s,e){let r,i="",o=s.match(et);if(o){s=s.replace(o[0],"");try{let u=Buffer.from(o[1],"base64").toString("utf8"),d=u.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)r=d[1].trim();i=u.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let c=e||r||"stx App",a=nt(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{Tn}from"./chunk-0d3z8hwz.js";import{q,y,Dt,Lt,$r,g,cl,_i,W,A}from"./chunk-fp24ecp8.js";import{rn}from"./chunk-0veh8bcn.js";import{n}from"./chunk-2a471sw1.js";import{G}from"./chunk-ym5qgw03.js";var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)s.push({start:r.index,end:r.index+r[0].length});return s}function N(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},r=s,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let o=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];r=r.slice(o[0].length);continue}let c=r.match(/^#([\w-]+)/);if(c){e.id=c[1],r=r.slice(c[0].length);continue}let a=r.match(/^\.([\w-]+)/);if(a){e.className=a[1],r=r.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Y(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=r.exec(t))!==null){if(N(o.index,i))continue;let c=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||X.has(c))continue;if(e.tag&&e.tag!==c)continue;if(!Y(a,e))continue;let l=o[0],f=o.index+l.length,u=new RegExp(`<(/?)${c}\\b([^>]*)>`,"gi");u.lastIndex=f;let d=1,h;while((h=u.exec(t))!==null){if(N(h.index,i))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=S?-1:1,d===0)return{openTag:l,openIndex:o.index,start:f,end:h.index,tagName:c}}return null}return null}var ht="private, no-store";function Yt(t){return t.replace(/&#(\d+);/g,(s,e)=>F(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>F(Number.parseInt(e,16),s)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function F(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Te(t){return t.headers.get("X-STX-Router")==="true"}function Z(t,s){if(!t)return s;return t.split(",").some((r)=>r.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function j(t){return{Vary:Z(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function D(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return y(s,(r,i)=>(e.lastIndex=i,e.exec(r)?e.lastIndex:-1)).map(({token:r})=>r)}function L(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let r of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=r[1].toLowerCase();if(!(i in s))s[i]=r[2]??r[3]??r[4]??""}return s}function Nn(t){let s=[];for(let e of D(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let r=L(e);if(/^<meta\b/i.test(e)){let i=r.property?"property":"name",o=Yt(r[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${n(o)}" content="${E(r.content??"")}">`)}else{let i=Yt(r.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&r.hreflang)s.push(`<link rel="${i}" href="${E(r.href??"")}"${i==="alternate"?` hreflang="${E(r.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
3
+ `}var Q=["media","crossorigin","integrity"];function Mn(t){let s=[];for(let e of D(t)){if(!/^<link\b/i.test(e))continue;let r=L(e);if(Yt(r.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!r.href||"data-css"in r||"disabled"in r)continue;let i=Q.filter((o)=>(o in r)).map((o)=>` ${o}="${E(r[o])}"`).join("");s.push(`<link rel="stylesheet" href="${E(r.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
4
+ `:""}import T from"path";var tt="stx-page-head:",et=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function nt(){let t=G()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-8j8fth4b.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${r()}</script>`}catch{_[t]=""}return _[t]}async function ga(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let r=T.resolve(t,s);if(await Bun.file(r).exists())return r;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function wo(t,s){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let o=rn(e),c=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=l.exec(e))!==null)a.push(f[0]);let u=r;for(let p of o.server)u=u.replace(p.fullTag,"");for(let p of o.client)u=u.replace(p.fullTag,"");u=u.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(u=u.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!u.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:R,loadStxConfig:b}=await import("./chunk-dtxg2a6m.js"),k=await b(),m={__filename:t,__dirname:T.dirname(t)};for(let p of c){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await S(C[1],m,t)}let x=await h(u,m,t,{...R,...k,...s},new Set),w=x.indexOf(d);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,w),afterSlot:x.substring(w+d.length),filePath:t,shellScripts:c,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Jr(t,s,e){let r,i="",o=s.match(et);if(o){s=s.replace(o[0],"");try{let u=Buffer.from(o[1],"base64").toString("utf8"),d=u.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)r=d[1].trim();i=u.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let c=e||r||"stx App",a=nt(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
5
5
  <html lang="en">
6
6
  <head>
7
7
  <meta charset="UTF-8">
@@ -20,14 +20,14 @@ ${t.shellScripts.filter((u)=>!u.includes("server")).join(`
20
20
  ${l}
21
21
  ${a}
22
22
  </body>
23
- </html>`}function qe(t,s={}){let e=t.trim();if(!Tn(e))return t;let r=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let l=i[1],f=/<style\b[^>]*>[\s\S]*?<\/style>/gi,u;while((u=f.exec(l))!==null)r.push(u[0]);let d=l.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(d)r.push(d[0]);let h=l.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(h)r.push(h[0])}if(s.preserveHead&&i){let l=[],f=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,u;while((u=f.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(u[0]))continue;l.push(u[0])}if(l.length>0)r.unshift(`<!--${tt}${Buffer.from(l.join(`
23
+ </html>`}function Ke(t,s={}){let e=t.trim();if(!Tn(e))return t;let r=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let l=i[1],f=/<style\b[^>]*>[\s\S]*?<\/style>/gi,u;while((u=f.exec(l))!==null)r.push(u[0]);let d=l.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(d)r.push(d[0]);let h=l.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(h)r.push(h[0])}if(s.preserveHead&&i){let l=[],f=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,u;while((u=f.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(u[0]))continue;l.push(u[0])}if(l.length>0)r.unshift(`<!--${tt}${Buffer.from(l.join(`
24
24
  `),"utf8").toString("base64")}-->`)}let o=e.match(/<body\b[^>]*>/i),c=e.lastIndexOf("</body>");if(o&&c!==-1){let l=o.index+o[0].length,f=e.slice(l,c).trim();if(r.length>0)return r.join(`
25
25
  `)+`
26
26
  `+f;return f}let a=e;if(a=a.replace(/<!DOCTYPE\b[^>]*>/i,""),a=a.replace(/<html\b[^>]*>/i,""),a=a.replace(/<\/html\s*>/i,""),i)a=a.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
27
- `));return a=a.replace(/<body\b[^>]*>/i,""),a=a.replace(/<\/body\s*>/i,""),a.trim()}var H=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function V(t,s,e,r){if(!H.test(s))return!1;let i=s.slice(0,s.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!o)return!0;let c=`data-stx-scope="${o}"`;for(let a=t.indexOf(c);a!==-1;a=t.indexOf(c,a+c.length))if(a>=e&&a<r)return!1;return!0}function ma(t){return Ee(t)}function rt(t,s){let e=[],r=new Set;for(let i of y(t,q)){if(i.start>=s.start&&i.start<s.end)continue;let o=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",c=new Map;for(let f of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))c.set(f[1].toLowerCase(),f[2]??f[3]??f[4]??"");let a=c.get("src")?.trim(),l=c.get("type")?.trim().toLowerCase();if(!a||c.has("server")||l&&!["module","text/javascript","application/javascript"].includes(l))continue;if(c.has("data-stx-runtime")||c.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(a))continue;if(V(t,i.token,s.start,s.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function Ke(t,s="main"){return!!P(t.trim(),s)}function Te(t,s="main",e=!1){let r=t.trim(),i=[],o=[],c=r.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(c){let x=c[1],w=/<style\b[^>]*>[\s\S]*?<\/style>/gi,p;while((p=w.exec(x))!==null)i.push(p[0]);let C=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((p=C.exec(x))!==null){if(H.test(p[0])||p[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(p[0]))continue;o.push(p[0])}}let a=P(r,s);if(!a)return(e?Nn(t)+Mn(t):"")+qe(t);let l=rt(r,a),f=new Set(l),{tagName:u,start:d,end:h}=a,S=r.slice(d,h).trim(),R=[],b=r.match(/<body\b[^>]*>/i),k=r.lastIndexOf("</body>");if(b&&b.index!==void 0&&k!==-1){let w=[[b.index+b[0].length,a.openIndex],[h+`</${u}>`.length,k]],p=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[C,I]of w){if(C>=I)continue;let z=r.slice(C,I),v;p.lastIndex=0;while((v=p.exec(z))!==null){if(V(r,v[0],d,h))continue;R.push(v[0])}}}let m=[];if(e)m.push(Nn(t)+Mn(t));if(i.length>0)m.push(i.join(`
27
+ `));return a=a.replace(/<body\b[^>]*>/i,""),a=a.replace(/<\/body\s*>/i,""),a.trim()}var H=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function V(t,s,e,r){if(!H.test(s))return!1;let i=s.slice(0,s.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!o)return!0;let c=`data-stx-scope="${o}"`;for(let a=t.indexOf(c);a!==-1;a=t.indexOf(c,a+c.length))if(a>=e&&a<r)return!1;return!0}function ma(t){return Te(t)}function rt(t,s){let e=[],r=new Set;for(let i of y(t,q)){if(i.start>=s.start&&i.start<s.end)continue;let o=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",c=new Map;for(let f of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))c.set(f[1].toLowerCase(),f[2]??f[3]??f[4]??"");let a=c.get("src")?.trim(),l=c.get("type")?.trim().toLowerCase();if(!a||c.has("server")||l&&!["module","text/javascript","application/javascript"].includes(l))continue;if(c.has("data-stx-runtime")||c.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(a))continue;if(V(t,i.token,s.start,s.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function Ge(t,s="main"){return!!P(t.trim(),s)}function $e(t,s="main",e=!1){let r=t.trim(),i=[],o=[],c=r.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(c){let x=c[1],w=/<style\b[^>]*>[\s\S]*?<\/style>/gi,p;while((p=w.exec(x))!==null)i.push(p[0]);let C=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((p=C.exec(x))!==null){if(H.test(p[0])||p[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(p[0]))continue;o.push(p[0])}}let a=P(r,s);if(!a)return(e?Nn(t)+Mn(t):"")+Ke(t);let l=rt(r,a),f=new Set(l),{tagName:u,start:d,end:h}=a,S=r.slice(d,h).trim(),R=[],b=r.match(/<body\b[^>]*>/i),k=r.lastIndexOf("</body>");if(b&&b.index!==void 0&&k!==-1){let w=[[b.index+b[0].length,a.openIndex],[h+`</${u}>`.length,k]],p=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[C,I]of w){if(C>=I)continue;let z=r.slice(C,I),v;p.lastIndex=0;while((v=p.exec(z))!==null){if(V(r,v[0],d,h))continue;R.push(v[0])}}}let m=[];if(e)m.push(Nn(t)+Mn(t));if(i.length>0)m.push(i.join(`
28
28
  `));if(l.length>0)m.push(l.join(`
29
29
  `));if(o.length>0)m.push(o.filter((x)=>!f.has(x)).join(`
30
30
  `));if(R.length>0)m.push(R.filter((x)=>!f.has(x)).join(`
31
31
  `));return m.push(S),m.join(`
32
- `)}import O from"fs";import B from"path";function ha(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function ya(t,s){let e=B.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function ba(t){let s=B.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function st(t){let s=t.headers.get("content-type")||"",e={},r=(i,o)=>{let c=e[i];if(c===void 0)e[i]=o;else if(Array.isArray(c))c.push(o);else e[i]=[c,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,c]of i.entries())if(typeof c==="string")r(o,c);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())r(i,o);return e}return e}function vo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function U(t,s={}){let e=s.request,r=s.method??e?.method;if(!e||!vo(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await st(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let c=o,a=it(c.cookies),l=c.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:f,redirect:u,...d}=c;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function it(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){s.push(M(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function wa(t,s=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)r.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,o);return new Response(null,{status:303,headers:r})}async function Dn(t,s={}){let{html:e,context:r,redirect:i,cookies:o}=await ot(t,s),c=Mt(r),a=Dt(r);if(i)return{html:e,redirect:i,cookies:o,status:c,headers:a};let{extractStreamBoundaries:l}=await import("./chunk-ggthncvg.js"),f=l(r),u=t.streamTemplates;if(u&&Object.keys(u).length>0){let{processDirectives:d}=await import("./chunk-vgaqznwt.js"),{defaultConfig:h}=await import("./chunk-hfe2byfx.js"),S=r.streamBoundaries||{},R={...h,autoShell:!1},b=Object.keys(u).map((m)=>({id:m,render:async()=>{let x=typeof S[m]==="function"?await S[m]():void 0;return d(u[m],{...r,$boundary:x},t.sourceFile,R,new Set)}})),k=new Set(b.map((m)=>m.id));f=[...(f||[]).filter((m)=>!k.has(m.id)),...b]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:o,status:c,headers:a}}async function ot(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!_i(t.html))return{html:t.html,context:e};for(let c of t.serverScriptContent)try{await g(c,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let r=await U(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(c)=>{let a=c.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=$r(e);if(!l)return a;let f=a.indexOf("</head>");return f<0?l+a:a.slice(0,f)+l+a.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!_i(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let o=new Map;for(let[c,a]of Object.entries(t.placeholders))if(a.expression)try{let l=A(a.expression,e);if(a.type==="raw")o.set(c,l!==void 0&&l!==null?String(l):"");else o.set(c,l!==void 0&&l!==null?W(String(l)):"")}catch(l){if(s.__stx_strict_hydration)throw l;o.set(c,"")}return{html:i(cl(t.html,o)),context:e,cookies:r.cookies}}
33
- export{mt,Jt,Ee,j,Nn,Mn,ga,wo,Jr,qe,ma,Ke,Te,ha,ya,ba,vo,wa,Dn};
32
+ `)}import O from"fs";import B from"path";function ha(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function ya(t,s){let e=B.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function ba(t){let s=B.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function st(t){let s=t.headers.get("content-type")||"",e={},r=(i,o)=>{let c=e[i];if(c===void 0)e[i]=o;else if(Array.isArray(c))c.push(o);else e[i]=[c,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,c]of i.entries())if(typeof c==="string")r(o,c);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())r(i,o);return e}return e}function vo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function U(t,s={}){let e=s.request,r=s.method??e?.method;if(!e||!vo(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await st(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let c=o,a=it(c.cookies),l=c.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:f,redirect:u,...d}=c;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function it(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){s.push(M(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function wa(t,s=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)r.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,o);return new Response(null,{status:303,headers:r})}async function Dn(t,s={}){let{html:e,context:r,redirect:i,cookies:o}=await ot(t,s),c=Dt(r),a=Lt(r);if(i)return{html:e,redirect:i,cookies:o,status:c,headers:a};let{extractStreamBoundaries:l}=await import("./chunk-js7nmw8v.js"),f=l(r),u=t.streamTemplates;if(u&&Object.keys(u).length>0){let{processDirectives:d}=await import("./chunk-68kspmq4.js"),{defaultConfig:h}=await import("./chunk-655m8g98.js"),S=r.streamBoundaries||{},R={...h,autoShell:!1},b=Object.keys(u).map((m)=>({id:m,render:async()=>{let x=typeof S[m]==="function"?await S[m]():void 0;return d(u[m],{...r,$boundary:x},t.sourceFile,R,new Set)}})),k=new Set(b.map((m)=>m.id));f=[...(f||[]).filter((m)=>!k.has(m.id)),...b]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:o,status:c,headers:a}}async function ot(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!_i(t.html))return{html:t.html,context:e};for(let c of t.serverScriptContent)try{await g(c,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let r=await U(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(c)=>{let a=c.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=$r(e);if(!l)return a;let f=a.indexOf("</head>");return f<0?l+a:a.slice(0,f)+l+a.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!_i(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let o=new Map;for(let[c,a]of Object.entries(t.placeholders))if(a.expression)try{let l=A(a.expression,e);if(a.type==="raw")o.set(c,l!==void 0&&l!==null?String(l):"");else o.set(c,l!==void 0&&l!==null?W(String(l)):"")}catch(l){if(s.__stx_strict_hydration)throw l;o.set(c,"")}return{html:i(cl(t.html,o)),context:e,cookies:r.cookies}}
33
+ export{ht,Yt,Te,j,Nn,Mn,ga,wo,Jr,Ke,ma,Ge,$e,ha,ya,ba,vo,wa,Dn};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Su,$o,Yn,ku,_u,Cu,Eu,Tu,$u,Ru,Au,Pu,Iu,Ou,Nu,Mu,Du,Lu,ju,Bu,Fu,zu,Hu,Vu,Uu,Wu,qu,Ku,Gu,Xu,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,Qt,Da,gd,md,hd,La,yd,bd,wd,vd,xd,Sd,ja,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Zn,Id,Od,Nd,Md,Dd,Ld,jd,Bd,Fd,zd,Hd,Vd,Ro,Ud,Wd,qd,Kd,Gd,rs,ss,Xd,Jd,Yd,Zd,Qd,Ba,ep,tp,np,Fa,Ao,rp,sp,za,Ha,os,Va,op,en,ip,Ua,Wa,Po,ap,Io,cp,lp,up,dp,pp,fp,gp,qa,mp,hp,Ka,yp,bp,wp,vp,xp,Sp,kp,_p,Cp,Ep,Tp,$p,Rp,Ap,Pp,Ip,Op,Np,Mp,Dp,Lp,jp,Bp,Fp,Ga,zp,Hp,Vp,Up,Wp,qp,Kp,Gp,Xp,Jp,Yp,Qn,Xa,Ja,Zp,er,Qp,ef,tf,Ya,Za,is,as,nf,Oo,rf,sf,of,af,cf,lf,uf,df,pf,ff,gf,mf,hf,yf,bf,wf,vf,xf,Sf,kf,Qa,_f,Cf,ec,tc,Ef,Tf}from"./chunk-te82sjhy.js";export{pd as AVAILABLE_COMPONENTS,Ba as AutoUpdater,fd as COMPONENT_STYLES,is as DEFAULT_WATCH_INTERVAL_MS,Za as MAX_WATCH_INTERVAL_MS,Ya as MIN_WATCH_INTERVAL_MS,Sd as MODAL_STYLES,Pu as TOAST_STYLES,Rd as TRAY_MENU_STYLES,za as UPDATE_MANIFEST_ASSET,bd as alert,Lp as appInfo,lf as appleScript,Tf as applicationDataDirectory,cf as audio,Cf as backgroundDelay,Op as battery,af as biometric,Jp as bluetooth,gf as bonjour,en as bundlePathForExecutable,ap as caffeinate,ep as canReplaceBundle,tp as clearQuarantine,_p as clipboard,xd as closeAllModals,Vd as closeAllWindows,yd as confirm,Fp as contextMenu,vf as continuityCamera,wf as coreml,Zd as craftBinaryNotFoundMessage,Ro as craftWindowArguments,Qn as crashReporter,ed as createAccordion,Ku as createAutocomplete,ju as createAvatar,Lu as createBadge,Iu as createButton,Bu as createCard,ad as createChart,Nu as createCheckbox,Ju as createChip,cd as createCodeEditor,Uu as createColorPicker,id as createDataGrid,Wu as createDatePicker,ss as createDiskImage,zu as createDropdown,ud as createFileExplorer,op as createGitHubUpdateManifest,Va as createGitHubUpdater,Xu as createImageView,vp as createInterval,Gu as createLabel,rd as createListView,ld as createMediaPlayer,kd as createMenubar,nd as createModalComponent,Ef as createNativeUpdateApi,tc as createPantrySelfUpdater,pp as createPreferences,Du as createProgressBar,Vu as createRadioButton,Hu as createRating,Zu as createScrollView,Po as createSelfUpdater,Mu as createSlider,Qu as createSplitView,td as createStepper,ja as createSystemTray,sd as createTable,Fu as createTabs,Ou as createTextInput,qu as createTimePicker,wp as createTimer,Yu as createTooltip,od as createTreeView,dd as createWebView,Ud as createWindow,qd as createWindowWithHTML,Io as decaffeinate,Ip as deepLinks,xp as delay,$u as dismissAlertById,Ru as dismissAllAlerts,Ap as dragOut,np as extractBundle,uf as fileAssociations,Oo as focus,sf as focusShortcutsReady,kp as formatCompact,dp as formatDuration,up as formatRemainingTime,mp as formatShortcut,Sp as formatTime,Ep as fs,Fa as generateUpdateManifest,Au as getActiveAlertCount,vd as getActiveModalCount,_d as getActiveTrayInstances,zd as getActiveWindowIds,lp as getCaffeinateStatus,kf as getCapabilities,Qa as getCapability,Bd as getDesktopConfig,Ld as getDialogBridgeScript,bp as getRegisteredHotkeys,Td as getSimulatedTrayHTML,$d as getTrayBridgeScript,Cd as getTrayInstance,Hd as getWindow,Gd as getWindowBridgeScript,Ha as githubLatestAssetUrl,os as githubReleaseAssetUrl,$p as globalShortcuts,er as handoff,rf as hasFocusShortcuts,Zp as iap,gp as isAutoLaunchEnabled,_f as isAvailable,cp as isCaffeinated,Pp as isDragOutAvailable,Kd as isWebviewAvailable,Vp as keychain,Qp as liveActivities,of as localServer,ef as location,ff as log,Xd as macOSRuntimeExecutablePath,Bp as menu,bf as midi,qp as nativeAutoLaunch,Kp as nativeTray,Gp as nativeWindow,Np as network,Cp as notifications,Tu as notify,Wd as openDevWindow,Jd as pack,Yd as packageApp,ec as parsePantryUpdateManifest,qa as parseShortcut,pf as pdf,Up as permissions,Wp as printing,wd as prompt,Ua as quitLauncher,Ao as readBundleIdentity,Xa as redactPII,hp as registerHotkey,Wa as relaunchBundle,Su as requestNotificationPermission,Fd as resetDesktopConfig,Qd as resolveCraftBinary,rs as resolveCraftExecutablePath,ip as runningBundleTeamId,Hp as screen,tf as screenCapture,as as screenSharing,Sf as serial,xf as serviceMenu,fp as setAutoLaunch,jd as setDesktopConfig,Tp as shell,$o as showAlert,Od as showAlertDialog,Id as showColorPicker,Nd as showConfirmDialog,Md as showErrorDialog,md as showErrorModal,Eu as showErrorToast,Da as showInfoModal,ku as showInfoToast,Zn as showMessageBox,Qt as showModal,Ad as showOpenDialog,La as showQuestionModal,Pd as showSaveDialog,hd as showSuccessModal,_u as showSuccessToast,Yn as showToast,Dd as showWarningDialog,gd as showWarningModal,Cu as showWarningToast,Ga as sidebar,Ja as signPayload,Yp as speech,hf as speechRecognition,mf as spotlight,jp as standardMenus,rp as swapBundle,zp as system,df as tags,Rp as theme,Xp as touchbar,Ed as triggerTrayAction,yp as unregisterAllHotkeys,Ka as unregisterHotkey,Mp as updater,sp as verifyBundleTrust,yf as vision,nf as watchScreenSharing,Dp as windowEvents};
2
+ import{Su,$o,Yn,ku,_u,Cu,Eu,Tu,$u,Ru,Au,Pu,Iu,Ou,Nu,Mu,Du,Lu,ju,Bu,Fu,zu,Hu,Vu,Uu,Wu,qu,Ku,Gu,Xu,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,en,Da,gd,md,hd,La,yd,bd,wd,vd,xd,Sd,ja,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Zn,Id,Od,Nd,Md,Dd,Ld,jd,Bd,Fd,zd,Hd,Vd,Ro,Ud,Wd,qd,Kd,Gd,rs,ss,Xd,Jd,Yd,Zd,Qd,Ba,ep,tp,np,Fa,Ao,rp,sp,za,Ha,os,Va,op,tn,ip,Ua,Wa,Po,ap,Io,cp,lp,up,dp,pp,fp,gp,qa,mp,hp,Ka,yp,bp,wp,vp,xp,Sp,kp,_p,Cp,Ep,Tp,$p,Rp,Ap,Pp,Ip,Op,Np,Mp,Dp,Lp,jp,Bp,Fp,Ga,zp,Hp,Vp,Up,Wp,qp,Kp,Gp,Xp,Jp,Yp,Qn,Xa,Ja,Zp,er,Qp,ef,tf,Ya,Za,is,as,nf,Oo,rf,sf,of,af,cf,lf,uf,df,pf,ff,gf,mf,hf,yf,bf,wf,vf,xf,Sf,kf,Qa,_f,Cf,ec,tc,Ef,Tf}from"./chunk-xejhmsfw.js";export{pd as AVAILABLE_COMPONENTS,Ba as AutoUpdater,fd as COMPONENT_STYLES,is as DEFAULT_WATCH_INTERVAL_MS,Za as MAX_WATCH_INTERVAL_MS,Ya as MIN_WATCH_INTERVAL_MS,Sd as MODAL_STYLES,Pu as TOAST_STYLES,Rd as TRAY_MENU_STYLES,za as UPDATE_MANIFEST_ASSET,bd as alert,Lp as appInfo,lf as appleScript,Tf as applicationDataDirectory,cf as audio,Cf as backgroundDelay,Op as battery,af as biometric,Jp as bluetooth,gf as bonjour,tn as bundlePathForExecutable,ap as caffeinate,ep as canReplaceBundle,tp as clearQuarantine,_p as clipboard,xd as closeAllModals,Vd as closeAllWindows,yd as confirm,Fp as contextMenu,vf as continuityCamera,wf as coreml,Zd as craftBinaryNotFoundMessage,Ro as craftWindowArguments,Qn as crashReporter,ed as createAccordion,Ku as createAutocomplete,ju as createAvatar,Lu as createBadge,Iu as createButton,Bu as createCard,ad as createChart,Nu as createCheckbox,Ju as createChip,cd as createCodeEditor,Uu as createColorPicker,id as createDataGrid,Wu as createDatePicker,ss as createDiskImage,zu as createDropdown,ud as createFileExplorer,op as createGitHubUpdateManifest,Va as createGitHubUpdater,Xu as createImageView,vp as createInterval,Gu as createLabel,rd as createListView,ld as createMediaPlayer,kd as createMenubar,nd as createModalComponent,Ef as createNativeUpdateApi,tc as createPantrySelfUpdater,pp as createPreferences,Du as createProgressBar,Vu as createRadioButton,Hu as createRating,Zu as createScrollView,Po as createSelfUpdater,Mu as createSlider,Qu as createSplitView,td as createStepper,ja as createSystemTray,sd as createTable,Fu as createTabs,Ou as createTextInput,qu as createTimePicker,wp as createTimer,Yu as createTooltip,od as createTreeView,dd as createWebView,Ud as createWindow,qd as createWindowWithHTML,Io as decaffeinate,Ip as deepLinks,xp as delay,$u as dismissAlertById,Ru as dismissAllAlerts,Ap as dragOut,np as extractBundle,uf as fileAssociations,Oo as focus,sf as focusShortcutsReady,kp as formatCompact,dp as formatDuration,up as formatRemainingTime,mp as formatShortcut,Sp as formatTime,Ep as fs,Fa as generateUpdateManifest,Au as getActiveAlertCount,vd as getActiveModalCount,_d as getActiveTrayInstances,zd as getActiveWindowIds,lp as getCaffeinateStatus,kf as getCapabilities,Qa as getCapability,Bd as getDesktopConfig,Ld as getDialogBridgeScript,bp as getRegisteredHotkeys,Td as getSimulatedTrayHTML,$d as getTrayBridgeScript,Cd as getTrayInstance,Hd as getWindow,Gd as getWindowBridgeScript,Ha as githubLatestAssetUrl,os as githubReleaseAssetUrl,$p as globalShortcuts,er as handoff,rf as hasFocusShortcuts,Zp as iap,gp as isAutoLaunchEnabled,_f as isAvailable,cp as isCaffeinated,Pp as isDragOutAvailable,Kd as isWebviewAvailable,Vp as keychain,Qp as liveActivities,of as localServer,ef as location,ff as log,Xd as macOSRuntimeExecutablePath,Bp as menu,bf as midi,qp as nativeAutoLaunch,Kp as nativeTray,Gp as nativeWindow,Np as network,Cp as notifications,Tu as notify,Wd as openDevWindow,Jd as pack,Yd as packageApp,ec as parsePantryUpdateManifest,qa as parseShortcut,pf as pdf,Up as permissions,Wp as printing,wd as prompt,Ua as quitLauncher,Ao as readBundleIdentity,Xa as redactPII,hp as registerHotkey,Wa as relaunchBundle,Su as requestNotificationPermission,Fd as resetDesktopConfig,Qd as resolveCraftBinary,rs as resolveCraftExecutablePath,ip as runningBundleTeamId,Hp as screen,tf as screenCapture,as as screenSharing,Sf as serial,xf as serviceMenu,fp as setAutoLaunch,jd as setDesktopConfig,Tp as shell,$o as showAlert,Od as showAlertDialog,Id as showColorPicker,Nd as showConfirmDialog,Md as showErrorDialog,md as showErrorModal,Eu as showErrorToast,Da as showInfoModal,ku as showInfoToast,Zn as showMessageBox,en as showModal,Ad as showOpenDialog,La as showQuestionModal,Pd as showSaveDialog,hd as showSuccessModal,_u as showSuccessToast,Yn as showToast,Dd as showWarningDialog,gd as showWarningModal,Cu as showWarningToast,Ga as sidebar,Ja as signPayload,Yp as speech,hf as speechRecognition,mf as spotlight,jp as standardMenus,rp as swapBundle,zp as system,df as tags,Rp as theme,Xp as touchbar,Ed as triggerTrayAction,yp as unregisterAllHotkeys,Ka as unregisterHotkey,Mp as updater,sp as verifyBundleTrust,yf as vision,nf as watchScreenSharing,Dp as windowEvents};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{un,No,Mo,Do,Nh,Lo}from"./chunk-1277d5we.js";import"./chunk-tm8a2b69.js";import"./chunk-dhpd4mx7.js";import"./chunk-sny8rqe8.js";export{Mo as buildServerApi,Nh as createServerApi,un as discoverServerApi,No as generateApiTypes,Lo as isServerApiSource,Do as productionApiDispatcher};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-ngnvyqk3.js";import"./chunk-xppm4cs4.js";import"./chunk-0dmpc70r.js";import{w,S,C,Z}from"./chunk-mv48q1p4.js";import"./chunk-v4bqmzj9.js";import"./chunk-e8zpzt9s.js";import{lr}from"./chunk-14cvwsy1.js";import{existsSync as R}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],F=new Set(b);var u=new Map,h=w(64),x=new Set,k=0,P=new Set(b);function z(){u.clear(),h.clear()}function I(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function M(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function L(s){if(!s)return[];let o=S(s,k),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of P){if(x.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function _(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(R(l.join(s,`index.${o}`)))return s;let t=lr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=L(s);if(t.length===0)return null;let i=o??_();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=Z({loader:"ts",target:"browser",define:C()}),O=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=I(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
2
+ import"./chunk-432c35hs.js";import"./chunk-xppm4cs4.js";import"./chunk-0d3z8hwz.js";import{w,S,C,Z}from"./chunk-fp24ecp8.js";import"./chunk-sny8rqe8.js";import"./chunk-6tpcm12w.js";import{lr}from"./chunk-14cvwsy1.js";import{existsSync as R}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],F=new Set(b);var u=new Map,h=w(64),x=new Set,k=0,P=new Set(b);function z(){u.clear(),h.clear()}function I(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function M(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function L(s){if(!s)return[];let o=S(s,k),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of P){if(x.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function _(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(R(l.join(s,`index.${o}`)))return s;let t=lr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=L(s);if(t.length===0)return null;let i=o??_();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=Z({loader:"ts",target:"browser",define:C()}),O=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=I(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
3
3
  ${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let y=t.filter((n)=>!d.has(n)&&!M(s,n));if(y.length>0)console.warn(`[stx] could not bundle ${y.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return u.set(r,""),null;let E=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
4
4
  `),v=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
5
  ;(function(){