@stacksjs/stx 0.2.894 → 0.2.896

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 (125) hide show
  1. package/dist/{chunk-qn45rk5n.js → chunk-0k437z3q.js} +1 -1
  2. package/dist/{chunk-4s3ts344.js → chunk-142n73c3.js} +1 -1
  3. package/dist/{chunk-0waheg6m.js → chunk-18gfzvn5.js} +1 -1
  4. package/dist/{chunk-pg3yatv3.js → chunk-19v28wj2.js} +2 -2
  5. package/dist/{chunk-5zs5hrgz.js → chunk-1bft48gk.js} +2 -2
  6. package/dist/{chunk-s32gsz18.js → chunk-1y4ad3ma.js} +5 -5
  7. package/dist/{chunk-z8sv926e.js → chunk-2nqmw4dv.js} +1 -1
  8. package/dist/{chunk-gk0h2hp7.js → chunk-35j7gaj5.js} +1 -1
  9. package/dist/chunk-38gz54d6.js +182 -0
  10. package/dist/{chunk-j1mr34da.js → chunk-3jrn01rc.js} +1 -1
  11. package/dist/{chunk-tc94atxh.js → chunk-3sc1w0dz.js} +1 -1
  12. package/dist/{chunk-mj0dnha4.js → chunk-3wz8eys3.js} +1 -1
  13. package/dist/{chunk-90qwzwsm.js → chunk-4akw3bym.js} +1 -1
  14. package/dist/{chunk-vya7cck4.js → chunk-4d85str1.js} +1 -1
  15. package/dist/{chunk-hxm31y5q.js → chunk-54dk6rbc.js} +3 -3
  16. package/dist/chunk-55w7a5tt.js +3 -0
  17. package/dist/{chunk-8qgcvc9r.js → chunk-5zztnr63.js} +1 -1
  18. package/dist/{chunk-ae0qvjkz.js → chunk-66qwkxrv.js} +1 -1
  19. package/dist/{chunk-pjpf21y9.js → chunk-690518hw.js} +1 -1
  20. package/dist/{chunk-5spnw5zr.js → chunk-6s81gd2p.js} +1 -1
  21. package/dist/{chunk-ccecyvwf.js → chunk-6shfk0tt.js} +1 -1
  22. package/dist/{chunk-xdn58ea6.js → chunk-6yqeqesa.js} +4 -4
  23. package/dist/{chunk-0hfn4cek.js → chunk-7vr7nw7p.js} +1 -1
  24. package/dist/{chunk-khaem3zq.js → chunk-7xk40zsm.js} +1 -1
  25. package/dist/{chunk-xvprhdcb.js → chunk-80ky40mm.js} +1 -1
  26. package/dist/chunk-8abrg1v2.js +2 -0
  27. package/dist/{chunk-gzc16hs8.js → chunk-8ccgty8s.js} +2 -2
  28. package/dist/chunk-8e38dzxv.js +2 -0
  29. package/dist/{chunk-n64zbwzr.js → chunk-9rjgq8k4.js} +1 -1
  30. package/dist/{chunk-c5q6jdm9.js → chunk-9tngkmry.js} +4 -4
  31. package/dist/{chunk-s9a9kda4.js → chunk-9v2bpwgb.js} +2 -2
  32. package/dist/chunk-9vpcsn2f.js +2 -0
  33. package/dist/{chunk-kd7k31x3.js → chunk-aj5tsksz.js} +4 -4
  34. package/dist/{chunk-mdrdp6c4.js → chunk-avn3panj.js} +2 -2
  35. package/dist/chunk-b35t77m0.js +2 -0
  36. package/dist/chunk-c8hyr9vb.js +2 -0
  37. package/dist/{chunk-9f8fda1j.js → chunk-ch9028z3.js} +1 -1
  38. package/dist/{chunk-z012vpdz.js → chunk-cmg9x1ka.js} +3 -3
  39. package/dist/chunk-cp5x6kx1.js +2 -0
  40. package/dist/{chunk-x9036mfd.js → chunk-cphc60zw.js} +2 -2
  41. package/dist/chunk-e8szp5wa.js +2 -0
  42. package/dist/{chunk-wk36dj2m.js → chunk-er0hgd96.js} +1 -1
  43. package/dist/{chunk-p06tqhp9.js → chunk-exb4wc0c.js} +1 -1
  44. package/dist/{chunk-j5m4hy3m.js → chunk-fjpaxmvv.js} +2 -2
  45. package/dist/{chunk-yrjm6zyh.js → chunk-fnpq78k3.js} +1 -1
  46. package/dist/{chunk-e9c56r58.js → chunk-g71ppt0e.js} +4 -4
  47. package/dist/{chunk-3mdg7w2d.js → chunk-gxpcdhr3.js} +1 -1
  48. package/dist/{chunk-v6ja6a65.js → chunk-h19fp8g8.js} +2 -2
  49. package/dist/{chunk-d8ptv989.js → chunk-h91ry9p1.js} +4 -4
  50. package/dist/chunk-hn679t1s.js +2 -0
  51. package/dist/{chunk-gjqdp0zx.js → chunk-jrbkvptj.js} +1 -1
  52. package/dist/chunk-jre984qm.js +2 -0
  53. package/dist/chunk-jyd9trff.js +2 -0
  54. package/dist/{chunk-8a71xvx1.js → chunk-knhf7dkn.js} +16 -16
  55. package/dist/{chunk-t79khbtp.js → chunk-m136gh80.js} +2 -2
  56. package/dist/chunk-n2d0jzyv.js +2 -0
  57. package/dist/{chunk-y54vpvy0.js → chunk-n8mfvqqz.js} +1 -1
  58. package/dist/{chunk-cbjvabsa.js → chunk-p1wqyf10.js} +43 -43
  59. package/dist/{chunk-8n5bjars.js → chunk-q671arjn.js} +1 -1
  60. package/dist/chunk-qe3z3x39.js +2 -0
  61. package/dist/{chunk-1a8ev0eh.js → chunk-rr0wvqa3.js} +1 -1
  62. package/dist/chunk-rspsbhcv.js +2 -0
  63. package/dist/{chunk-66qt9q6e.js → chunk-rvn63nv2.js} +19 -19
  64. package/dist/{chunk-c9xg8rc2.js → chunk-s5xfmr87.js} +2 -2
  65. package/dist/chunk-snbhzrfy.js +2 -0
  66. package/dist/{chunk-na92k4va.js → chunk-srsb2zvm.js} +1 -1
  67. package/dist/{chunk-kfbw96c5.js → chunk-t0ttxayz.js} +2 -2
  68. package/dist/chunk-t31twwh0.js +2 -0
  69. package/dist/{chunk-qrk535j6.js → chunk-t3zmfh8w.js} +4 -4
  70. package/dist/{chunk-60z8rka9.js → chunk-t6sdtsf8.js} +5 -5
  71. package/dist/{chunk-gcjqxvbb.js → chunk-ta07gj66.js} +2 -2
  72. package/dist/chunk-tbh7r1wh.js +2 -0
  73. package/dist/chunk-tspz0z7d.js +2 -0
  74. package/dist/chunk-tznd1egg.js +2 -0
  75. package/dist/{chunk-hdqy5v4v.js → chunk-w5kq4k7f.js} +1 -1
  76. package/dist/{chunk-mxf6cfbg.js → chunk-whcrca58.js} +6 -6
  77. package/dist/chunk-x57p5bay.js +2 -0
  78. package/dist/{chunk-6yy54yyp.js → chunk-xbqt53jj.js} +1 -1
  79. package/dist/{chunk-ac3e6nhg.js → chunk-xmg6bmh6.js} +3 -3
  80. package/dist/{chunk-hxq5tsqa.js → chunk-xtq8swr2.js} +1 -1
  81. package/dist/chunk-xvmd0aja.js +2 -0
  82. package/dist/{chunk-2eq3aret.js → chunk-xwrjre34.js} +1 -1
  83. package/dist/{chunk-h7yme97q.js → chunk-xy8smv5e.js} +2 -2
  84. package/dist/{chunk-z3ar05m3.js → chunk-xzj4jyhy.js} +5 -5
  85. package/dist/chunk-ycge4wfk.js +2 -0
  86. package/dist/chunk-z1dym2re.js +2 -0
  87. package/dist/{chunk-1csmm3f6.js → chunk-z3kvxk73.js} +1 -1
  88. package/dist/{chunk-8y39f6z3.js → chunk-zf68afyh.js} +3 -3
  89. package/dist/{chunk-qv4qwa61.js → chunk-zkq66keq.js} +1 -1
  90. package/dist/cli.js +14 -14
  91. package/dist/craft-entry.js +2 -2
  92. package/dist/craft.js +2 -2
  93. package/dist/native/accessibility.d.ts +0 -15
  94. package/dist/native/accessibility.js +2 -6
  95. package/dist/native/compiler/html-to-ir.js +1 -27
  96. package/dist/offline/app-service-worker.d.ts +4 -1
  97. package/dist/offline/app-service-worker.js +23 -5
  98. package/dist/process.js +4 -3
  99. package/dist/pwa.js +1 -1
  100. package/dist/ssg.js +10 -10
  101. package/package.json +5 -5
  102. package/dist/chunk-0d14783x.js +0 -2
  103. package/dist/chunk-0yw075t7.js +0 -2
  104. package/dist/chunk-3ngbdap1.js +0 -2
  105. package/dist/chunk-484x27q5.js +0 -2
  106. package/dist/chunk-4eyyshsq.js +0 -2
  107. package/dist/chunk-4fcb8rmm.js +0 -2
  108. package/dist/chunk-4mmy5pfh.js +0 -2
  109. package/dist/chunk-4pq32bt3.js +0 -2
  110. package/dist/chunk-5kfe3smn.js +0 -2
  111. package/dist/chunk-b4kbj9kq.js +0 -2
  112. package/dist/chunk-b77t5zy2.js +0 -2
  113. package/dist/chunk-brmmkfnq.js +0 -2
  114. package/dist/chunk-btjhb71k.js +0 -2
  115. package/dist/chunk-dz1mkvdw.js +0 -2
  116. package/dist/chunk-dz2zehsh.js +0 -2
  117. package/dist/chunk-eenw264a.js +0 -2
  118. package/dist/chunk-erka2w6z.js +0 -2
  119. package/dist/chunk-gd5a11h2.js +0 -2
  120. package/dist/chunk-jjz64ac2.js +0 -2
  121. package/dist/chunk-jqnfvdx5.js +0 -182
  122. package/dist/chunk-nqarmx3w.js +0 -3
  123. package/dist/chunk-nxjfdtc0.js +0 -2
  124. package/dist/chunk-vm57848v.js +0 -2
  125. package/dist/chunk-xv471ek2.js +0 -2
package/dist/craft.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import"./chunk-8a71xvx1.js";import{Uo,Va,Wa}from"./chunk-z012vpdz.js";import"./chunk-mxf6cfbg.js";import"./chunk-0jdz31q1.js";import"./chunk-ac3e6nhg.js";import"./chunk-x9036mfd.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-41z7f41b.js";import"./chunk-8qgcvc9r.js";import"./chunk-q0y8gv18.js";import"./chunk-gzc16hs8.js";import"./chunk-e9c56r58.js";import"./chunk-qrk535j6.js";import"./chunk-rb2zbdqd.js";import"./chunk-hxq5tsqa.js";import"./chunk-d8ptv989.js";import"./chunk-cbjvabsa.js";import"./chunk-c9xg8rc2.js";import"./chunk-c5q6jdm9.js";import"./chunk-s9a9kda4.js";import"./chunk-mj0dnha4.js";import"./chunk-05x1rd86.js";import"./chunk-pvm48tse.js";import{Hu,qa,Xh,Jh,Ka,Vo,hs,Ga,Xa,Yh,Zh,Ja,Ya,Za,Qa}from"./chunk-s32gsz18.js";import"./chunk-pg3yatv3.js";import"./chunk-nqarmx3w.js";import"./chunk-xvprhdcb.js";import"./chunk-60z8rka9.js";import"./chunk-n64zbwzr.js";import"./chunk-n6q1d66k.js";import"./chunk-hxm31y5q.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
2
+ import"./chunk-knhf7dkn.js";import{Vo,Ua,Wa}from"./chunk-cmg9x1ka.js";import"./chunk-whcrca58.js";import"./chunk-0jdz31q1.js";import"./chunk-xmg6bmh6.js";import"./chunk-cphc60zw.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-41z7f41b.js";import"./chunk-5zztnr63.js";import"./chunk-q0y8gv18.js";import"./chunk-8ccgty8s.js";import"./chunk-g71ppt0e.js";import"./chunk-t3zmfh8w.js";import"./chunk-rb2zbdqd.js";import"./chunk-xtq8swr2.js";import"./chunk-h91ry9p1.js";import"./chunk-p1wqyf10.js";import"./chunk-s5xfmr87.js";import"./chunk-9tngkmry.js";import"./chunk-9v2bpwgb.js";import"./chunk-3wz8eys3.js";import"./chunk-05x1rd86.js";import"./chunk-pvm48tse.js";import{Hu,qa,Xh,Jh,Ka,Uo,hs,Ga,Xa,Yh,Zh,Ja,Ya,Za,Qa}from"./chunk-1y4ad3ma.js";import"./chunk-19v28wj2.js";import"./chunk-55w7a5tt.js";import"./chunk-80ky40mm.js";import"./chunk-t6sdtsf8.js";import"./chunk-9rjgq8k4.js";import"./chunk-n6q1d66k.js";import"./chunk-54dk6rbc.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
3
3
  `),scripts:t.scripts.join(`
4
4
  `),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
5
5
  `),scripts:t.scripts.join(`
6
6
  `),hydrationData:i,metadata:{renderTime:s,cacheHit:!1,totalSize:a.length,componentCount:t.metadata.componentCount}}}function V(t,e){let n=[],r=[],a=[],i=new Map,s=[];return y(t.tree,(o,c)=>{if(o.type==="component"&&o.componentName){if(T(o.componentName))n.push(o.componentName)}if(o.type==="element"&&o.tag){let p=J(o);if(p)s.push(p);if(o.props){for(let[l,f]of Object.entries(o.props))if(l.startsWith("on")&&typeof f==="string"){let g=`handler_${i.size}`;i.set(g,f)}}}if(o.isStatic&&o.type==="element")r.push(b(o));else if(!o.isStatic&&o.type!=="text")a.push(o.tag||o.componentName||"unknown")}),{nativeComponents:n,staticHTML:r,dynamicParts:a,eventHandlers:i,nativeWidgets:s}}function Y(t,e={}){let n=R(t),r=P(n,e),a=new Map,i=[];return y(n.tree,(s)=>{if(s.type==="component"&&s.componentName){if(T(s.componentName)){i.push(s.componentName);let o=`<!--craft:${s.componentName}:${s.hydrationKey||"default"}-->`;a.set(s.hydrationKey||s.componentName,o)}}}),{staticHTML:r,dynamicPlaceholders:a,craftComponents:i}}function M(t){let e={type:"fragment",children:[]},n=e,r=[e],a=t,i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(a.length>0){let s=a.match(/^<(@?[\w-]+)([^>]*)>/);if(s){let[p,l,f]=s,g=z(f),u=l.startsWith("@craft-"),C=u?l:l.toLowerCase(),S={type:u?"component":"element",tag:C,props:g,children:[],componentName:u?C.slice(1):void 0,isStatic:!v(f),hydrationKey:F()};if(n.children=n.children||[],n.children.push(S),!i.has(C)&&!f.endsWith("/"))r.push(S),n=S;a=a.slice(p.length);continue}let o=a.match(/^<\/(@?[\w-]+)>/);if(o){let[p,l]=o,g=l.startsWith("@craft-")?l:l.toLowerCase();while(r.length>1){let u=r.pop();if(n=r[r.length-1],u.tag===g)break}a=a.slice(p.length);continue}let c=a.match(/^[^<]+/);if(c){let p=c[0];if(p.trim()){let l={type:"text",text:p,isStatic:!v(p)};n.children=n.children||[],n.children.push(l)}a=a.slice(p.length);continue}a=a.slice(1)}return e}function z(t){let e={},n=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,r;while((r=n.exec(t))!==null){let[,a,i,s,o]=r,c=i??s??o??!0;e[a]=c}return e}function y(t,e,n=[]){if(e(t,n),t.children)t.children.forEach((r,a)=>{y(r,e,[...n,`${a}`])})}function h(t,e){switch(t.type){case"text":return x(t.text||"",e);case"element":case"component":{let n=t.tag||"div",r=N(t.props||{},e),a=(t.children||[]).map((i)=>h(i,e)).join("");if(!t.children||t.children.length===0){if(["input","br","hr","img","meta","link"].includes(n))return`<${n}${r} />`}return`<${n}${r}>${a}</${n}>`}case"fragment":return(t.children||[]).map((n)=>h(n,e)).join("");case"slot":return`<!--slot:${t.slotName||"default"}-->`;default:return""}}function b(t){if(t.type==="text")return t.text||"";let e=t.tag||"div",n=N(t.props||{},{});return`<${e}${n}></${e}>`}function N(t,e){let n=[];for(let[r,a]of Object.entries(t))if(a===!0)n.push(` ${r}`);else if(a!==!1&&a!==null&&a!==void 0){let i=x(String(a),e);n.push(` ${r}="${k(i)}"`)}return n.join("")}async function H(t,e){return h(t,e)}function P(t,e){let n=[];return y(t.tree,(r)=>{if(r.isStatic)n.push(h(r,e))}),n.join("")}function j(t,e,n){let r={templateId:e.id,context:n,dynamicParts:Array.from(e.dynamicParts.entries())},a=`
7
7
  <script data-craft-hydration>
8
8
  window.__CRAFT_HYDRATION__ = ${JSON.stringify(r)};
9
- </script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{Hu as CRAFT_BRIDGE_SCRIPT,Vo as CRAFT_COMPONENTS,Ga as CRAFT_COMPONENT_RUNTIME,hs as CRAFT_COMPONENT_STYLES,Uo as NATIVE_COMPONENTS,Ja as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Va as compileToNative,Wa as createHotReloadServer,Ya as findCraftBinary,qa as generateCraftBridgeScript,V as generateCraftOptimizations,Qa as getAvailableFormats,Za as getAvailableTargets,Zh as getCraftComponents,G as getSSRCacheStats,Ka as injectCraftBridge,Xh as isCraftEnvironment,Y as prerenderForCraft,Xa as processCraftComponents,Jh as processCraftDirective,Yh as registerCraftComponent,Q as renderSSR};
9
+ </script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{Hu as CRAFT_BRIDGE_SCRIPT,Uo as CRAFT_COMPONENTS,Ga as CRAFT_COMPONENT_RUNTIME,hs as CRAFT_COMPONENT_STYLES,Vo as NATIVE_COMPONENTS,Ja as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Ua as compileToNative,Wa as createHotReloadServer,Ya as findCraftBinary,qa as generateCraftBridgeScript,V as generateCraftOptimizations,Qa as getAvailableFormats,Za as getAvailableTargets,Zh as getCraftComponents,G as getSSRCacheStats,Ka as injectCraftBridge,Xh as isCraftEnvironment,Y as prerenderForCraft,Xa as processCraftComponents,Jh as processCraftDirective,Yh as registerCraftComponent,Q as renderSSR};
@@ -1,7 +1,5 @@
1
1
  /** Whether an attribute is one this module translates. */
2
2
  export declare function isAccessibilityAttribute(name: string): boolean;
3
- /** The role a host would announce for an ARIA `role`, or null where it has none. */
4
- export declare function nativeRole(value: unknown): string | null;
5
3
  /**
6
4
  * The native props an attribute write implies, given the node's current props.
7
5
  *
@@ -28,18 +26,5 @@ export declare function projectAccessibility(props: Record<string, unknown>, typ
28
26
  export declare function accessibilityChanges(props: Record<string, unknown>, before: Record<string, unknown>, changedField: string, type?: string): Record<string, unknown>;
29
27
  /** Recover authored native fields from compiler IR before reactive updates. */
30
28
  export declare function authoredAccessibilityProps(props: Record<string, unknown>, source?: Record<string, unknown>): Record<string, unknown>;
31
- /**
32
- * Marks a box that names a group of controls (set by the compiler).
33
- *
34
- * A browser reads `<div role="group" aria-label="Pages">` as a name for what
35
- * is inside. A host has no such thing for a plain box: a View with a label is
36
- * one stop for a screen reader, and whatever is inside it can no longer be
37
- * reached. The shared Pager was one stop called "Tour", its pages and its
38
- * page dots gone. So the name of such a box is not sent: the group goes
39
- * unnamed and its controls stay reachable, which is the half that matters.
40
- * Hosts' own containers (a scroll view, a tab strip, a dialog) keep theirs.
41
- * craft-native/craft#536 asks the host for a box that is both named and open.
42
- */
43
- export declare const READER_GROUP: 'data-stx-reader-group';
44
29
  /** Fields derived from web semantics at the native transport boundary. */
45
30
  export declare const ACCESSIBILITY_FIELDS: readonly ['accessibilityLabel', 'accessibilityRole', 'accessibilityState', 'accessibilityValue'];
@@ -6,9 +6,7 @@ const STATE_KEYS = {
6
6
  "aria-expanded": "expanded",
7
7
  "aria-busy": "busy",
8
8
  "aria-current": "selected"
9
- };
10
- export const READER_GROUP = "data-stx-reader-group";
11
- const ROLES = {
9
+ }, ROLES = {
12
10
  alert: "alert",
13
11
  button: "button",
14
12
  checkbox: "checkbox",
@@ -52,7 +50,7 @@ function stateValue(name, value) {
52
50
  return;
53
51
  return text === "" || text === "true";
54
52
  }
55
- export function nativeRole(value) {
53
+ function nativeRole(value) {
56
54
  if (value === void 0 || value === null)
57
55
  return null;
58
56
  for (const role of String(value).trim().toLowerCase().split(/\s+/))
@@ -88,8 +86,6 @@ export function applyStaticAccessibility(props) {
88
86
  }
89
87
  if (stateValue("aria-hidden", props["aria-hidden"]) === !0)
90
88
  derived.accessibilityRole = "none";
91
- if (props[READER_GROUP] !== void 0)
92
- delete derived.accessibilityLabel;
93
89
  for (const key of ["accessibilityLabel", "accessibilityRole", "accessibilityValue"])
94
90
  if (props[key] === void 0 && derived[key] !== void 0 && derived[key] !== null)
95
91
  props[key] = derived[key];
@@ -1,4 +1,4 @@
1
- import { ACCESSIBILITY_FIELDS, nativeRole, projectAccessibility, READER_GROUP } from "../accessibility.js";
1
+ import { ACCESSIBILITY_FIELDS, projectAccessibility } from "../accessibility.js";
2
2
  import { applyStaticTextEntry } from "../text-entry.js";
3
3
  import { NATIVE_EVENT_NAMES as EVENT_NAMES } from "../event-names.js";
4
4
  import { NATIVE_BOOLEAN_PROPS, nativePropName } from "../prop-names.js";
@@ -523,36 +523,10 @@ export async function translateHtmlToIR(html, options = {}) {
523
523
  project(child);
524
524
  };
525
525
  nameControlsFromLabels(root);
526
- markReaderGroups(root);
527
526
  project(root);
528
527
  boundScrollingViewports(root);
529
528
  return { root, diagnostics };
530
529
  }
531
- const READER_CONTROLS = new Set([
532
- "Button",
533
- "Link",
534
- "TouchableOpacity",
535
- "TouchableHighlight",
536
- "Pressable",
537
- "TextInput",
538
- "Switch",
539
- "Checkbox",
540
- "Slider",
541
- "Picker",
542
- "SegmentedControl",
543
- "DatePicker"
544
- ]);
545
- function holdsControl(node) {
546
- return node.children.some((child) => typeof child !== "string" && (READER_CONTROLS.has(child.type) || child.events.onPress !== void 0 || child.props.href !== void 0 || holdsControl(child)));
547
- }
548
- function markReaderGroups(node) {
549
- const labelled = node.props["aria-label"] !== void 0 || node.bindings?.["aria-label"] !== void 0;
550
- if (node.type === "View" && labelled && nativeRole(node.props.role) === null && node.events.onPress === void 0 && holdsControl(node))
551
- node.props[READER_GROUP] = "";
552
- for (const child of node.children)
553
- if (typeof child !== "string")
554
- markReaderGroups(child);
555
- }
556
530
  const LABELLED_CONTROLS = new Set(["TextInput", "Picker", "Switch", "Checkbox", "Slider", "DatePicker"]);
557
531
  function nameControlsFromLabels(root) {
558
532
  const byId = new Map, labels = [], visit = (node) => {
@@ -17,12 +17,14 @@ export declare function offlineRoute(path: string): OfflineRoute | null;
17
17
  * `stx:offline-update-ready`, so an app can offer "Update" and call
18
18
  * `window.stxOffline.applyUpdate()`, which takes over now and reloads.
19
19
  */
20
- export declare function registerOfflineWorker(path: string): void;
20
+ export declare function registerOfflineWorker(path: string, registerOn?: string[]): void;
21
21
  /**
22
22
  * The section a fallback screen stands in for: `scope` when given, else the
23
23
  * fallback's first path segment (`/m/today` → `/m`, `/` → `/`).
24
24
  */
25
25
  export declare function offlineFallbackScope(fallback: string | null, scope?: string): string | null;
26
+ /** Registration policy travels with the document, including SPA entry paths. */
27
+ export declare function generateOfflineRegisterScript(config: Pick<OfflineAppConfig, 'registerOn'>): string;
26
28
  /** The worker itself, for one build. */
27
29
  export declare function generateOfflineWorker(config: OfflineAppConfig, buildId: string): string;
28
30
  export declare const OFFLINE_WORKER_PATH: '/_stx/sw.js';
@@ -79,6 +81,7 @@ export declare const OFFLINE_REGISTER_SCRIPT: string;
79
81
  */
80
82
  export declare interface OfflineAppConfig {
81
83
  enabled: boolean
84
+ registerOn?: string[]
82
85
  pages?: string[]
83
86
  staticPages?: string[]
84
87
  apiPrefix?: string
@@ -16,13 +16,13 @@ export function offlineRoute(path) {
16
16
  return null;
17
17
  return { path, re: `^/${parts.join("/")}/?$`, names, sample: `/${sample.join("/")}` };
18
18
  }
19
- export function registerOfflineWorker(path) {
19
+ export function registerOfflineWorker(path, registerOn) {
20
20
  if (typeof navigator > "u" || !("serviceWorker" in navigator) || !navigator.serviceWorker)
21
21
  return;
22
22
  const sw = navigator.serviceWorker, w = window;
23
23
  if (w.stxOffline)
24
24
  return;
25
- let registration = null, reloadOnTakeOver = !1;
25
+ let registration = null, registering = !1, reloadOnTakeOver = !1;
26
26
  const waitingCallbacks = [], api = {
27
27
  updateReady: !1,
28
28
  reachable: !0,
@@ -90,6 +90,15 @@ export function registerOfflineWorker(path) {
90
90
  registration.waiting.postMessage({ type: "stx:activate-update", reason: "hidden" });
91
91
  });
92
92
  const register = () => {
93
+ if (registering)
94
+ return;
95
+ if (registerOn && !registerOn.some((prefix) => {
96
+ const scope = prefix.replace(/\/+$/, "") || "/";
97
+ return scope === "/" || location.pathname === scope || location.pathname.startsWith(`${scope}/`);
98
+ }))
99
+ return;
100
+ registering = !0;
101
+ window.removeEventListener("stx:load", afterPaint);
93
102
  sw.register(path, { scope: "/" }).then((reg) => {
94
103
  registration = reg;
95
104
  try {
@@ -108,7 +117,11 @@ export function registerOfflineWorker(path) {
108
117
  ready(reg);
109
118
  });
110
119
  });
111
- }).catch(() => {});
120
+ }).catch(() => {
121
+ registering = !1;
122
+ if (registerOn)
123
+ window.addEventListener("stx:load", afterPaint);
124
+ });
112
125
  }, afterPaint = () => {
113
126
  const later = (fn) => {
114
127
  setTimeout(fn, 0);
@@ -118,6 +131,8 @@ export function registerOfflineWorker(path) {
118
131
  else
119
132
  later(register);
120
133
  };
134
+ if (registerOn)
135
+ window.addEventListener("stx:load", afterPaint);
121
136
  if (!sw.controller)
122
137
  if (document.readyState === "complete")
123
138
  afterPaint();
@@ -128,8 +143,8 @@ export function registerOfflineWorker(path) {
128
143
  else
129
144
  afterPaint();
130
145
  }
131
- function registerScriptSource() {
132
- const source = `(${registerOfflineWorker.toString()})(${JSON.stringify(OFFLINE_WORKER_PATH)})`;
146
+ function registerScriptSource(registerOn) {
147
+ const paths = registerOn?.filter((prefix) => typeof prefix === "string" && prefix.startsWith("/") && !prefix.startsWith("//")), source = `(${registerOfflineWorker.toString()})(${JSON.stringify(OFFLINE_WORKER_PATH)}${paths ? `,${JSON.stringify(paths)}` : ""})`;
133
148
  try {
134
149
  return new Bun.Transpiler({ loader: "js", minifyWhitespace: !0 }).transformSync(source).trim().replace(/;$/, "");
135
150
  } catch {
@@ -145,6 +160,9 @@ export function offlineFallbackScope(fallback, scope) {
145
160
  return first ? `/${first}` : "/";
146
161
  }
147
162
  export const OFFLINE_REGISTER_SCRIPT = `<script data-stx-offline>${registerScriptSource()}</script>`;
163
+ export function generateOfflineRegisterScript(config) {
164
+ return config.registerOn === void 0 ? OFFLINE_REGISTER_SCRIPT : `<script data-stx-offline>${registerScriptSource(config.registerOn)}</script>`;
165
+ }
148
166
  export function generateOfflineWorker(config, buildId) {
149
167
  const precacheTimeout = Number(config.precacheTimeoutMs), settings = {
150
168
  build: String(buildId || "dev"),
package/dist/process.js CHANGED
@@ -47,7 +47,7 @@ import { processDynamicComponents } from "./dynamic-components.js";
47
47
  import { dedupeScopedStyles, processScopedStyles } from "./style-scoping.js";
48
48
  import { injectColorModeBootScript, normalizeCriticalHeadOrder } from "./color-mode-boot.js";
49
49
  import { buildIdFragment } from "./build-id.js";
50
- import { OFFLINE_REGISTER_SCRIPT } from "./offline/app-service-worker.js";
50
+ import { generateOfflineRegisterScript } from "./offline/app-service-worker.js";
51
51
  import { applyHeadInjections, createHeadInjections } from "./head-injection.js";
52
52
  import { serverDataScope, serverDataTag } from "./server-data.js";
53
53
  import { prepareRuntimeConfig } from "./runtime-config-loader.js";
@@ -457,8 +457,9 @@ export async function processDirectives(template, context, filePath, options, de
457
457
  const buildId = buildIdFragment(result);
458
458
  if (buildId !== null)
459
459
  headInjections.afterOpen.push(buildId);
460
- if (options.offline?.enabled && !result.includes("data-stx-offline"))
461
- headInjections.beforeClose.push(OFFLINE_REGISTER_SCRIPT);
460
+ const offline = options.offline;
461
+ if (offline?.enabled && !result.includes("data-stx-offline"))
462
+ headInjections.beforeClose.push(generateOfflineRegisterScript(offline));
462
463
  result = applyHeadInjections(result, headInjections);
463
464
  const colorModeConfig = options.app?.colorMode;
464
465
  if (colorModeConfig)
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  import{xo,tn,Yl,rm}from"./chunk-67j2m620.js";import{vo,ra,em,tm,nm}from"./chunk-p3hbsrk9.js";import{Gl,Xl,Jl,Zg,Qg}from"./chunk-rf0smj4c.js";import{nt,Hn,sa}from"./chunk-sh7a0g09.js";import{sm,om,im,am,So,Wy}from"./chunk-ksmn19qw.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
3
- Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-4eyyshsq.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
3
+ Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-x57p5bay.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
4
4
  <html lang="en">
5
5
  <head>
6
6
  <meta charset="UTF-8">
package/dist/ssg.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- import"./chunk-0jdz31q1.js";import"./chunk-3b3mkgpj.js";import"./chunk-115bb91s.js";import{_,Rl}from"./chunk-ac3e6nhg.js";import"./chunk-x9036mfd.js";import"./chunk-vk2jy6mn.js";import{Ut,x}from"./chunk-8a71xvx1.js";import"./chunk-41z7f41b.js";import"./chunk-8qgcvc9r.js";import"./chunk-q0y8gv18.js";import{Lt,jt,Bt,Ft,zt,Ht}from"./chunk-gzc16hs8.js";import{a}from"./chunk-e9c56r58.js";import{Us}from"./chunk-qrk535j6.js";import"./chunk-rb2zbdqd.js";import"./chunk-mdrdp6c4.js";import{Te,mn,hn}from"./chunk-4s3ts344.js";import"./chunk-hxq5tsqa.js";import{S}from"./chunk-d8ptv989.js";import{Pt,i}from"./chunk-cbjvabsa.js";import"./chunk-c9xg8rc2.js";import"./chunk-c5q6jdm9.js";import{As}from"./chunk-s9a9kda4.js";import"./chunk-mj0dnha4.js";import"./chunk-05x1rd86.js";import{Sc,kc,_c}from"./chunk-kk2p2tgv.js";import{fn,pr,fr}from"./chunk-1ph2yhfn.js";import{gn}from"./chunk-5spnw5zr.js";import"./chunk-nqarmx3w.js";import"./chunk-xvprhdcb.js";import{re,Ae}from"./chunk-60z8rka9.js";import"./chunk-n64zbwzr.js";import"./chunk-n6q1d66k.js";import"./chunk-hxm31y5q.js";import{l}from"./chunk-zxjdfgdx.js";import{tt}from"./chunk-a0aqs5a8.js";import{t,h}from"./chunk-neg6ckjg.js";import{f}from"./chunk-hxws025y.js";import R from"fs";import w from"path";import{createHash as $t}from"crypto";function kt(e){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Rt(e){return Bun.hash(e).toString(16)}function lt(e,n={}){if(!e.includes('type="stx/island"'))return{html:e,chunks:[]};let s=new Map,o=e.replace(Dt,(r,u,g,P)=>{let b=P.trim();if(!b)return r;if(/\bdata-stx-src=/.test(g))return r;if(n.minify)b=kt(b);let p=Rt(b);if(!s.has(p))s.set(p,b);let k=n.integrity?` data-stx-integrity="sha384-${$t("sha384").update(b).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${k}${g}></script>`}),c=Array.from(s,([r,u])=>({hash:r,code:u}));return{html:o,chunks:c}}var Et=new Set(["visible","idle"]);function ut(e){if(!e.includes("data-stx-src="))return e;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(e))!==null)n.set(o[1],o[2]);let c=new Set,r=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=r.exec(e))!==null)if(Et.has(n.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,P=x(e,(p,k)=>(g.lastIndex=k,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||P===-1)return e;let b=Array.from(c).filter((p)=>!e.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!b)return e;return e.slice(0,P)+b+e.slice(P)}var Ct=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function Y(e){let n=e.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function It(e){for(let n of Ct){let s=e[n];if(!s)continue;let o=Y(s);if(o)return{url:o,source:"env",via:n}}return null}function dt(e){if(!e||typeof e!=="object")return null;let n=e,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?Y(s):null}async function Tt(e){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(e,o);if(!n(c))continue;try{let r=await import(c),u=dt(r.default??r);if(u)return u}catch{}}return null}async function gt(e={}){let n=e.cwd??process.cwd(),s=e.env??process.env;if(e.explicit){let u=Y(e.explicit);if(u)return{url:u,source:"option"}}let o=dt(e.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await Tt(n);if(c)return{url:c,source:"site.config",via:"url"};let r=It(s);if(r)return r;return{url:"http://localhost",source:"fallback"}}function pt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
- `)}function V(e){return async()=>({paths:await e(),fallback:!1})}var At;function Ot(e){let n=t(e),{depths:s}=h(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(n))!==null){if(s[c.index]!==0)continue;let u=_(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),P=_(n,"{","}",g);if(u<0||g<0||P<0)break;return e.slice(c.index,P+1)}let r=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=r.exec(n))!==null){if(s[c.index]!==0)continue;let u=Rl(n,r.lastIndex).endPos;return e.slice(r.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function ft(e){let n="read";try{let s=await Bun.file(e).text();n="parse";let o=gn(s),c=[...o.server,...o.client,...o.signals].filter((r)=>/(?:^|\s)server(?:\s|=|$)/i.test(t(r.attrs))).sort((r,u)=>s.indexOf(r.fullTag)-s.indexOf(u.fullTag));for(let r of c){if(!/\bgetStaticPaths\b/.test(t(r.content)))continue;let u=(At??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(r.content);if(!/\bgetStaticPaths\b/.test(t(u)))continue;let g=Ot(u);if(/\bdefineStaticPaths\b/.test(t(g))&&Ut(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let P=Function("defineStaticPaths",`return (${g})`)(V);if(typeof P!=="function")throw TypeError("getStaticPaths must be a function");let b=await P();n="result";let p=Array.isArray(b)?{paths:b}:b;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let k of p.paths)if(!k||typeof k!=="object"||!k.params||typeof k.params!=="object"||Array.isArray(k.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class ht{cacheDir;cache=new Map;loaded=!1;salt;constructor(e,n=""){this.cacheDir=e,this.salt=n}async load(){if(this.loaded)return;let e=w.join(this.cacheDir,"build-cache.json");if(await Bun.file(e).exists())try{let n=JSON.parse(await Bun.file(e).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await R.promises.mkdir(this.cacheDir,{recursive:!0});let e=w.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(e,JSON.stringify(n))}getHash(e,n){let s=R.statSync(e),o=`${this.salt}|${e}:${s.mtimeMs}`;for(let r of n)if(R.existsSync(r)){let u=R.statSync(r);o+=`:${r}:${u.mtimeMs}`}let c=0;for(let r=0;r<o.length;r++){let u=o.charCodeAt(r);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(e,n){let s=this.cache.get(e);if(!s)return null;let o=wt(n).some((u)=>R.existsSync(u)),c=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&R.existsSync(u)&&As(R.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(e),null;let r=this.getHash(n,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(e),null;return s.html}set(e,n,s,o){let c=this.getHash(n,s);this.cache.set(e,{hash:c,html:o,generatedAt:Date.now(),dependencies:s})}}class mt{cacheDir;constructor(e){this.cacheDir=e}getFilePath(e){let n=e.replace(/[^a-zA-Z0-9]/g,"_")+".json";return w.join(this.cacheDir,"isr",n)}async get(e){let n=this.getFilePath(e);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(e,n){let s=this.getFilePath(e);await R.promises.mkdir(w.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(e){let n=this.getFilePath(e);if(await Bun.file(n).exists())await R.promises.unlink(n)}async invalidatePattern(e){let n=w.join(this.cacheDir,"isr");if(!R.existsSync(n))return;let s=await R.promises.readdir(n);for(let o of s){let c=o.replace(/_/g,"/").replace(".json","");if(e.test(c))await R.promises.unlink(w.join(n,o))}}async needsRevalidation(e){let n=await this.get(e);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function _t(e){let n=[];if(!e.isDynamic)n.push({url:e.pattern,params:{}});else{let s=await ft(e.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${e.pattern} (${e.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${e.pattern} (${e.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${e.pattern} (${e.filePath})`),n;for(let c of o.paths){let r=e.pattern;for(let[u,g]of Object.entries(c.params))r=r.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:r,params:c.params,props:c.props,revalidate:c.revalidate})}}return n}function wt(e){return[e.replace(/\.stx$/,".data.ts"),e.replace(/\.stx$/,".data.js"),e+".data.ts",e+".data.js"]}async function Mt(e){for(let n of wt(e))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...c}=s;return c}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Gt(e,n,s){let o=e.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let r=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!r)return null;return await Function("params",`
2
+ import"./chunk-0jdz31q1.js";import"./chunk-3b3mkgpj.js";import"./chunk-115bb91s.js";import{_,Rl}from"./chunk-xmg6bmh6.js";import"./chunk-cphc60zw.js";import"./chunk-vk2jy6mn.js";import{Vt,x}from"./chunk-knhf7dkn.js";import"./chunk-41z7f41b.js";import"./chunk-5zztnr63.js";import"./chunk-q0y8gv18.js";import{Lt,jt,Bt,Ft,zt,Ht}from"./chunk-8ccgty8s.js";import{a}from"./chunk-g71ppt0e.js";import{Vs}from"./chunk-t3zmfh8w.js";import"./chunk-rb2zbdqd.js";import"./chunk-avn3panj.js";import{Te,mn,hn}from"./chunk-142n73c3.js";import"./chunk-xtq8swr2.js";import{S}from"./chunk-h91ry9p1.js";import{Pt,i}from"./chunk-p1wqyf10.js";import"./chunk-s5xfmr87.js";import"./chunk-9tngkmry.js";import{As}from"./chunk-9v2bpwgb.js";import"./chunk-3wz8eys3.js";import"./chunk-05x1rd86.js";import{Sc,kc,_c}from"./chunk-kk2p2tgv.js";import{fn,pr,fr}from"./chunk-1ph2yhfn.js";import{gn}from"./chunk-6s81gd2p.js";import"./chunk-55w7a5tt.js";import"./chunk-80ky40mm.js";import{re,Ae}from"./chunk-t6sdtsf8.js";import"./chunk-9rjgq8k4.js";import"./chunk-n6q1d66k.js";import"./chunk-54dk6rbc.js";import{l}from"./chunk-zxjdfgdx.js";import{tt}from"./chunk-a0aqs5a8.js";import{t,h}from"./chunk-neg6ckjg.js";import{f}from"./chunk-hxws025y.js";import R from"fs";import w from"path";import{createHash as $t}from"crypto";function kt(e){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Rt(e){return Bun.hash(e).toString(16)}function lt(e,n={}){if(!e.includes('type="stx/island"'))return{html:e,chunks:[]};let s=new Map,o=e.replace(Dt,(r,u,g,P)=>{let b=P.trim();if(!b)return r;if(/\bdata-stx-src=/.test(g))return r;if(n.minify)b=kt(b);let p=Rt(b);if(!s.has(p))s.set(p,b);let k=n.integrity?` data-stx-integrity="sha384-${$t("sha384").update(b).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${k}${g}></script>`}),c=Array.from(s,([r,u])=>({hash:r,code:u}));return{html:o,chunks:c}}var Et=new Set(["visible","idle"]);function ut(e){if(!e.includes("data-stx-src="))return e;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(e))!==null)n.set(o[1],o[2]);let c=new Set,r=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=r.exec(e))!==null)if(Et.has(n.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,P=x(e,(p,k)=>(g.lastIndex=k,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||P===-1)return e;let b=Array.from(c).filter((p)=>!e.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!b)return e;return e.slice(0,P)+b+e.slice(P)}var Ct=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function Y(e){let n=e.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function It(e){for(let n of Ct){let s=e[n];if(!s)continue;let o=Y(s);if(o)return{url:o,source:"env",via:n}}return null}function dt(e){if(!e||typeof e!=="object")return null;let n=e,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?Y(s):null}async function Tt(e){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(e,o);if(!n(c))continue;try{let r=await import(c),u=dt(r.default??r);if(u)return u}catch{}}return null}async function gt(e={}){let n=e.cwd??process.cwd(),s=e.env??process.env;if(e.explicit){let u=Y(e.explicit);if(u)return{url:u,source:"option"}}let o=dt(e.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await Tt(n);if(c)return{url:c,source:"site.config",via:"url"};let r=It(s);if(r)return r;return{url:"http://localhost",source:"fallback"}}function pt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
+ `)}function V(e){return async()=>({paths:await e(),fallback:!1})}var At;function Ot(e){let n=t(e),{depths:s}=h(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(n))!==null){if(s[c.index]!==0)continue;let u=_(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),P=_(n,"{","}",g);if(u<0||g<0||P<0)break;return e.slice(c.index,P+1)}let r=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=r.exec(n))!==null){if(s[c.index]!==0)continue;let u=Rl(n,r.lastIndex).endPos;return e.slice(r.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function ft(e){let n="read";try{let s=await Bun.file(e).text();n="parse";let o=gn(s),c=[...o.server,...o.client,...o.signals].filter((r)=>/(?:^|\s)server(?:\s|=|$)/i.test(t(r.attrs))).sort((r,u)=>s.indexOf(r.fullTag)-s.indexOf(u.fullTag));for(let r of c){if(!/\bgetStaticPaths\b/.test(t(r.content)))continue;let u=(At??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(r.content);if(!/\bgetStaticPaths\b/.test(t(u)))continue;let g=Ot(u);if(/\bdefineStaticPaths\b/.test(t(g))&&Vt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let P=Function("defineStaticPaths",`return (${g})`)(V);if(typeof P!=="function")throw TypeError("getStaticPaths must be a function");let b=await P();n="result";let p=Array.isArray(b)?{paths:b}:b;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let k of p.paths)if(!k||typeof k!=="object"||!k.params||typeof k.params!=="object"||Array.isArray(k.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class ht{cacheDir;cache=new Map;loaded=!1;salt;constructor(e,n=""){this.cacheDir=e,this.salt=n}async load(){if(this.loaded)return;let e=w.join(this.cacheDir,"build-cache.json");if(await Bun.file(e).exists())try{let n=JSON.parse(await Bun.file(e).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await R.promises.mkdir(this.cacheDir,{recursive:!0});let e=w.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(e,JSON.stringify(n))}getHash(e,n){let s=R.statSync(e),o=`${this.salt}|${e}:${s.mtimeMs}`;for(let r of n)if(R.existsSync(r)){let u=R.statSync(r);o+=`:${r}:${u.mtimeMs}`}let c=0;for(let r=0;r<o.length;r++){let u=o.charCodeAt(r);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(e,n){let s=this.cache.get(e);if(!s)return null;let o=wt(n).some((u)=>R.existsSync(u)),c=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&R.existsSync(u)&&As(R.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(e),null;let r=this.getHash(n,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(e),null;return s.html}set(e,n,s,o){let c=this.getHash(n,s);this.cache.set(e,{hash:c,html:o,generatedAt:Date.now(),dependencies:s})}}class mt{cacheDir;constructor(e){this.cacheDir=e}getFilePath(e){let n=e.replace(/[^a-zA-Z0-9]/g,"_")+".json";return w.join(this.cacheDir,"isr",n)}async get(e){let n=this.getFilePath(e);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(e,n){let s=this.getFilePath(e);await R.promises.mkdir(w.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(e){let n=this.getFilePath(e);if(await Bun.file(n).exists())await R.promises.unlink(n)}async invalidatePattern(e){let n=w.join(this.cacheDir,"isr");if(!R.existsSync(n))return;let s=await R.promises.readdir(n);for(let o of s){let c=o.replace(/_/g,"/").replace(".json","");if(e.test(c))await R.promises.unlink(w.join(n,o))}}async needsRevalidation(e){let n=await this.get(e);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function Ut(e){let n=[];if(!e.isDynamic)n.push({url:e.pattern,params:{}});else{let s=await ft(e.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${e.pattern} (${e.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${e.pattern} (${e.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${e.pattern} (${e.filePath})`),n;for(let c of o.paths){let r=e.pattern;for(let[u,g]of Object.entries(c.params))r=r.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:r,params:c.params,props:c.props,revalidate:c.revalidate})}}return n}function wt(e){return[e.replace(/\.stx$/,".data.ts"),e.replace(/\.stx$/,".data.js"),e+".data.ts",e+".data.js"]}async function _t(e){for(let n of wt(e))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...c}=s;return c}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Mt(e,n,s){let o=e.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let r=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!r)return null;return await Function("params",`
4
4
  return (async function getStaticProps() {
5
5
  ${r[1]}
6
6
  })()
7
- `)(n)}catch(r){return console.error(`Error executing getStaticProps in ${s}:`,r),null}}function Nt(e){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(e)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(e)}async function yt(e,n,s={},o,c){let r=await Bun.file(e.filePath).text(),u=await Mt(e.filePath),g=await Gt(r,n,e.filePath),P={...u||{},...g||{},...s,params:n,$route:{path:e.pattern,params:n}},b=new Set,p=[],k=[],C={...c,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(E)=>{p.push(`${w.relative(process.cwd(),E.templatePath)}: ${E.message}
8
- resolved against partialsDir: ${E.partialsDir}`)},onServerScriptError:(E)=>{k.push(`${w.relative(process.cwd(),E.sourcePath)} (${E.kind}): ${E.message}`)}};if(Nt(r))console.warn(`Warning: ${e.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let v=await i(r,P,e.filePath,C,b);for(let E of[e.filePath,...b])for(let O of Te(E))b.add(O);if(Object.keys(n).length>0){let E=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(v.includes("</head>"))v=f(v,E);else v=`${E}
9
- ${v}`}if(v=await Ae(v,{router:o.router}),v=await S(v),o.minify!==!1)return{html:Wt(v),dependencies:Array.from(b),includeFailures:p,serverScriptFailures:k};return{html:v,dependencies:Array.from(b),includeFailures:p,serverScriptFailures:k}}function Wt(e){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=o.exec(e))!==null){let u=e.slice(s,c.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let g=c[1],P=c[2],b=c[3];P=tt(P).replace(/<\/script/gi,"<\\/script"),n.push(g+P+b),s=c.index+c[0].length}let r=e.slice(s);return n.push(r.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function qt(e){let n=0;for(let s=0;s<e.length;s++){let o=e.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return`"${Math.abs(n).toString(36)}"`}function Jt(e,n,s,o){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return o.some((c)=>{if(c instanceof RegExp)return c.test(e);return c.endsWith("/")?e===c.slice(0,-1)||e.startsWith(c):e===c})}function Vt(e,n){return`<?xml version="1.0" encoding="UTF-8"?>
7
+ `)(n)}catch(r){return console.error(`Error executing getStaticProps in ${s}:`,r),null}}function Gt(e){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(e)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(e)}async function yt(e,n,s={},o,c){let r=await Bun.file(e.filePath).text(),u=await _t(e.filePath),g=await Mt(r,n,e.filePath),P={...u||{},...g||{},...s,params:n,$route:{path:e.pattern,params:n}},b=new Set,p=[],k=[],C={...c,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(E)=>{p.push(`${w.relative(process.cwd(),E.templatePath)}: ${E.message}
8
+ resolved against partialsDir: ${E.partialsDir}`)},onServerScriptError:(E)=>{k.push(`${w.relative(process.cwd(),E.sourcePath)} (${E.kind}): ${E.message}`)}};if(Gt(r))console.warn(`Warning: ${e.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let v=await i(r,P,e.filePath,C,b);for(let E of[e.filePath,...b])for(let O of Te(E))b.add(O);if(Object.keys(n).length>0){let E=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(v.includes("</head>"))v=f(v,E);else v=`${E}
9
+ ${v}`}if(v=await Ae(v,{router:o.router}),v=await S(v),o.minify!==!1)return{html:Nt(v),dependencies:Array.from(b),includeFailures:p,serverScriptFailures:k};return{html:v,dependencies:Array.from(b),includeFailures:p,serverScriptFailures:k}}function Nt(e){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=o.exec(e))!==null){let u=e.slice(s,c.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let g=c[1],P=c[2],b=c[3];P=tt(P).replace(/<\/script/gi,"<\\/script"),n.push(g+P+b),s=c.index+c[0].length}let r=e.slice(s);return n.push(r.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function Wt(e){let n=0;for(let s=0;s<e.length;s++){let o=e.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return`"${Math.abs(n).toString(36)}"`}function qt(e,n,s,o){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return o.some((c)=>{if(c instanceof RegExp)return c.test(e);return c.endsWith("/")?e===c.slice(0,-1)||e.startsWith(c):e===c})}function Jt(e,n){return`<?xml version="1.0" encoding="UTF-8"?>
10
10
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
11
11
  ${e.map((o)=>{let c=new URL(o.loc,n).href,r=` <url>
12
12
  <loc>${T(c)}</loc>`;if(o.lastmod)r+=`
@@ -36,13 +36,13 @@ ${e.map((o)=>{let c=new URL(o.loc,n).href,r=` <url>
36
36
  ${s.join(`
37
37
  `)}
38
38
  </channel>
39
- </rss>`}async function Xt(e={}){let n=Date.now();hn();let s=await a(process.cwd()),o=s.build||{},c=await gt({explicit:e.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(e.sitemap??o.sitemap??!0))console.warn(pt());let r={router:e.router??s?.router??{},pagesDir:e.pagesDir||o.pagesDir||"pages",outputDir:e.outputDir||o.outputDir||"dist",baseUrl:e.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:e.revalidate??o.revalidate??!1,sitemap:e.sitemap??o.sitemap??!0,sitemapExclude:e.sitemapExclude||o.sitemapExclude||[],robots:e.robots??o.robots??!0,rss:e.rss??o.rss??!1,concurrency:e.concurrency||o.concurrency||10,cache:e.cache??o.cache??!0,cacheDir:e.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:e.contentLoaders||[],hooks:e.hooks||{},minify:e.minify??o.minify??!0,generate404:e.generate404??o.generate404??!0,publicDir:e.publicDir||o.publicDir||"public",trailingSlash:e.trailingSlash??o.trailingSlash??!1,cleanOutput:e.cleanOutput??o.cleanOutput??!0,cacheSalt:e.cacheSalt??"",partialsDir:e.partialsDir||s?.partialsDir||"",componentsDir:e.componentsDir||s?.componentsDir||"",failOnIncludeError:e.failOnIncludeError??!0,failOnServerScriptError:e.failOnServerScriptError??!0,chunkIslands:e.chunkIslands===!0,prefetchIslands:e.prefetchIslands===!0,integrityIslands:e.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,P=0,b={},p={};await r.hooks.onBuildStart?.();try{if(r.cleanOutput&&R.existsSync(r.outputDir))await R.promises.rm(r.outputDir,{recursive:!0});await R.promises.mkdir(r.outputDir,{recursive:!0});let C=r.cacheSalt;if(!C){let{resolveUserCssConfig:d,fingerprintConfig:y}=await import("./chunk-4fcb8rmm.js");try{C=y(await d(process.cwd()))}catch{}}let{prepareImageDelivery:v}=await import("./chunk-0waheg6m.js"),E=await v(r.publicDir,r.outputDir);if(E.count>0)console.log(`Optimized ${E.count} image(s) for responsive delivery`),C=[C,E.fingerprint].filter(Boolean).join(":");let O=new ht(r.cacheDir,C);if(r.cache)await O.load();try{let{generateCss:d}=await import("./chunk-4fcb8rmm.js");await d('<div class="bg-black"></div>')}catch{}Lt();let St=s?.routeMiddleware?.dir||"middleware";await Bt(process.cwd(),St);let K=jt();if(K.length>0)console.log(`Loaded ${K.length} middleware: ${K.join(", ")}`);let xt=s?.routeMiddleware?.global||[];_c(s?.layoutsDir,l(process.cwd()));let Q=re(".",{pagesDir:r.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Q.length} routes`);let U=[];for(let d of Q)try{let y=await _t(d);for(let D of y)U.push({route:d,url:D.url,params:D.params,props:D.props,revalidate:D.revalidate??r.revalidate})}catch(y){let D=y instanceof Error?y:Error(String(y));u.failedCount++,u.errors.push({route:d.pattern,error:D}),await r.hooks.onError?.(D,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,D)}u.totalPages=U.length+u.failedCount,console.log(`Generating ${U.length} pages...`);let M=[],et=[];for(let d=0;d<U.length;d+=r.concurrency)et.push(U.slice(d,d+r.concurrency));for(let d of et)await Promise.all(d.map(async(y)=>{let{route:D,url:m,params:G,props:bt,revalidate:it}=y;try{await r.hooks.onPageStart?.(m);let H=await Bun.file(D.filePath).text(),A=Qt(H),vt=A?.middleware?Array.isArray(A.middleware)?A.middleware:[A.middleware]:[],st=[...xt,...vt];if(st.length>0){let j=Ft(m,G,A||{}),z=zt(j,null,void 0,{isServer:!0}),F=await Ht(st,z);if(F.redirect){let I=typeof F.redirect==="string"?F.redirect:F.redirect.path||F.redirect,W=te(String(I),m),L=ee(m,r);await R.promises.mkdir(w.dirname(L),{recursive:!0}),await Bun.write(L,W),u.successCount++,u.pages.push({route:m,outputPath:L,size:Buffer.byteLength(W),cached:!1}),M.push({loc:m,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${m} \u2192 redirect to ${I}`);return}if(F.abort){let I=typeof F.abort==="string"?F.abort:F.abort?.error?.message||"aborted";console.warn(` \u21B3 ${m} \u2014 middleware aborted: ${I}`);return}}let at=A?.validate;if(typeof at==="function")try{if(!await at({params:G})){console.warn(`Validation failed for ${m}, skipping...`);return}}catch{}let B=null,ot=!1;if(r.cache){if(B=O.get(m,D.filePath),B)ot=!0,u.cachedCount++}if(!B){let j=await yt(D,G,bt,r,s);if(B=j.html,r.failOnIncludeError&&j.includeFailures.length>0)throw Error(`${j.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
39
+ </rss>`}async function Xt(e={}){let n=Date.now();hn();let s=await a(process.cwd()),o=s.build||{},c=await gt({explicit:e.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(e.sitemap??o.sitemap??!0))console.warn(pt());let r={router:e.router??s?.router??{},pagesDir:e.pagesDir||o.pagesDir||"pages",outputDir:e.outputDir||o.outputDir||"dist",baseUrl:e.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:e.revalidate??o.revalidate??!1,sitemap:e.sitemap??o.sitemap??!0,sitemapExclude:e.sitemapExclude||o.sitemapExclude||[],robots:e.robots??o.robots??!0,rss:e.rss??o.rss??!1,concurrency:e.concurrency||o.concurrency||10,cache:e.cache??o.cache??!0,cacheDir:e.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:e.contentLoaders||[],hooks:e.hooks||{},minify:e.minify??o.minify??!0,generate404:e.generate404??o.generate404??!0,publicDir:e.publicDir||o.publicDir||"public",trailingSlash:e.trailingSlash??o.trailingSlash??!1,cleanOutput:e.cleanOutput??o.cleanOutput??!0,cacheSalt:e.cacheSalt??"",partialsDir:e.partialsDir||s?.partialsDir||"",componentsDir:e.componentsDir||s?.componentsDir||"",failOnIncludeError:e.failOnIncludeError??!0,failOnServerScriptError:e.failOnServerScriptError??!0,chunkIslands:e.chunkIslands===!0,prefetchIslands:e.prefetchIslands===!0,integrityIslands:e.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,P=0,b={},p={};await r.hooks.onBuildStart?.();try{if(r.cleanOutput&&R.existsSync(r.outputDir))await R.promises.rm(r.outputDir,{recursive:!0});await R.promises.mkdir(r.outputDir,{recursive:!0});let C=r.cacheSalt;if(!C){let{resolveUserCssConfig:d,fingerprintConfig:y}=await import("./chunk-hn679t1s.js");try{C=y(await d(process.cwd()))}catch{}}let{prepareImageDelivery:v}=await import("./chunk-18gfzvn5.js"),E=await v(r.publicDir,r.outputDir);if(E.count>0)console.log(`Optimized ${E.count} image(s) for responsive delivery`),C=[C,E.fingerprint].filter(Boolean).join(":");let O=new ht(r.cacheDir,C);if(r.cache)await O.load();try{let{generateCss:d}=await import("./chunk-hn679t1s.js");await d('<div class="bg-black"></div>')}catch{}Lt();let St=s?.routeMiddleware?.dir||"middleware";await Bt(process.cwd(),St);let K=jt();if(K.length>0)console.log(`Loaded ${K.length} middleware: ${K.join(", ")}`);let xt=s?.routeMiddleware?.global||[];_c(s?.layoutsDir,l(process.cwd()));let Q=re(".",{pagesDir:r.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Q.length} routes`);let U=[];for(let d of Q)try{let y=await Ut(d);for(let D of y)U.push({route:d,url:D.url,params:D.params,props:D.props,revalidate:D.revalidate??r.revalidate})}catch(y){let D=y instanceof Error?y:Error(String(y));u.failedCount++,u.errors.push({route:d.pattern,error:D}),await r.hooks.onError?.(D,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,D)}u.totalPages=U.length+u.failedCount,console.log(`Generating ${U.length} pages...`);let M=[],et=[];for(let d=0;d<U.length;d+=r.concurrency)et.push(U.slice(d,d+r.concurrency));for(let d of et)await Promise.all(d.map(async(y)=>{let{route:D,url:m,params:G,props:bt,revalidate:it}=y;try{await r.hooks.onPageStart?.(m);let H=await Bun.file(D.filePath).text(),A=Qt(H),vt=A?.middleware?Array.isArray(A.middleware)?A.middleware:[A.middleware]:[],st=[...xt,...vt];if(st.length>0){let j=Ft(m,G,A||{}),z=zt(j,null,void 0,{isServer:!0}),F=await Ht(st,z);if(F.redirect){let I=typeof F.redirect==="string"?F.redirect:F.redirect.path||F.redirect,W=te(String(I),m),L=ee(m,r);await R.promises.mkdir(w.dirname(L),{recursive:!0}),await Bun.write(L,W),u.successCount++,u.pages.push({route:m,outputPath:L,size:Buffer.byteLength(W),cached:!1}),M.push({loc:m,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${m} \u2192 redirect to ${I}`);return}if(F.abort){let I=typeof F.abort==="string"?F.abort:F.abort?.error?.message||"aborted";console.warn(` \u21B3 ${m} \u2014 middleware aborted: ${I}`);return}}let at=A?.validate;if(typeof at==="function")try{if(!await at({params:G})){console.warn(`Validation failed for ${m}, skipping...`);return}}catch{}let B=null,ot=!1;if(r.cache){if(B=O.get(m,D.filePath),B)ot=!0,u.cachedCount++}if(!B){let j=await yt(D,G,bt,r,s);if(B=j.html,r.failOnIncludeError&&j.includeFailures.length>0)throw Error(`${j.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
40
40
  ${j.includeFailures.join(`
41
41
  `)}
42
42
  Set ssg.failOnIncludeError to false to build anyway.`);if(r.failOnServerScriptError&&j.serverScriptFailures.length>0)throw Error(`${j.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
43
43
  ${j.serverScriptFailures.join(`
44
44
  `)}
45
- Set ssg.failOnServerScriptError to false to build anyway.`);if(r.cache)O.set(m,D.filePath,j.dependencies,B)}let N;if(r.trailingSlash)N=w.join(r.outputDir,m,"index.html");else N=m==="/"?w.join(r.outputDir,"index.html"):w.join(r.outputDir,`${m}.html`);if(r.chunkIslands){let{html:j,chunks:z}=lt(B,{integrity:r.integrityIslands,minify:r.minify});if(z.length>0){let F=w.join(r.outputDir,"_stx","islands");await R.promises.mkdir(F,{recursive:!0});for(let I of z){let W=w.join(F,`${I.hash}.js`);if(!await Bun.file(W).exists())await Bun.write(W,I.code);if(!g.has(I.hash)){g.add(I.hash);let L=Buffer.byteLength(I.code,"utf8");P+=L,b[I.hash]={bytes:L,file:`/_stx/islands/${I.hash}.js`}}}if(p[m]=z.map((I)=>I.hash),B=j,r.prefetchIslands)B=ut(B)}}if(await R.promises.mkdir(w.dirname(N),{recursive:!0}),await Bun.write(N,B),!Jt(m,B,A,r.sitemapExclude))M.push({loc:m,lastmod:new Date().toISOString().split("T")[0],priority:m==="/"?1:0.8});let ct={route:m,outputPath:N,size:Buffer.byteLength(B,"utf8"),cached:ot};if(it!==!1)ct.revalidateAt=Date.now()+it*1000;u.pages.push(ct),u.successCount++,await r.hooks.onPageEnd?.(m,B)}catch(H){u.failedCount++,u.errors.push({route:m,error:H}),await r.hooks.onError?.(H,m),console.error(`Error generating ${m}:`,H)}}));let rt=mn();if(rt.length>0){let d=rt.map((y)=>`${y.filePath}: ${y.message}`).join(`
45
+ Set ssg.failOnServerScriptError to false to build anyway.`);if(r.cache)O.set(m,D.filePath,j.dependencies,B)}let N;if(r.trailingSlash)N=w.join(r.outputDir,m,"index.html");else N=m==="/"?w.join(r.outputDir,"index.html"):w.join(r.outputDir,`${m}.html`);if(r.chunkIslands){let{html:j,chunks:z}=lt(B,{integrity:r.integrityIslands,minify:r.minify});if(z.length>0){let F=w.join(r.outputDir,"_stx","islands");await R.promises.mkdir(F,{recursive:!0});for(let I of z){let W=w.join(F,`${I.hash}.js`);if(!await Bun.file(W).exists())await Bun.write(W,I.code);if(!g.has(I.hash)){g.add(I.hash);let L=Buffer.byteLength(I.code,"utf8");P+=L,b[I.hash]={bytes:L,file:`/_stx/islands/${I.hash}.js`}}}if(p[m]=z.map((I)=>I.hash),B=j,r.prefetchIslands)B=ut(B)}}if(await R.promises.mkdir(w.dirname(N),{recursive:!0}),await Bun.write(N,B),!qt(m,B,A,r.sitemapExclude))M.push({loc:m,lastmod:new Date().toISOString().split("T")[0],priority:m==="/"?1:0.8});let ct={route:m,outputPath:N,size:Buffer.byteLength(B,"utf8"),cached:ot};if(it!==!1)ct.revalidateAt=Date.now()+it*1000;u.pages.push(ct),u.successCount++,await r.hooks.onPageEnd?.(m,B)}catch(H){u.failedCount++,u.errors.push({route:m,error:H}),await r.hooks.onError?.(H,m),console.error(`Error generating ${m}:`,H)}}));let rt=mn();if(rt.length>0){let d=rt.map((y)=>`${y.filePath}: ${y.message}`).join(`
46
46
  `);throw Error(`Client script bundling failed:
47
47
  ${d}`)}if(r.cache)await O.save();if(r.generate404){let d=w.join(r.pagesDir,"404.stx");if(await Bun.file(d).exists()){let y=new Set,D={...s,minifyClient:!0,debug:!1,cache:!1},m=await i(await Bun.file(d).text(),{},d,D,y);await Bun.write(w.join(r.outputDir,"404.html"),m)}else await Bun.write(w.join(r.outputDir,"404.html"),`<!DOCTYPE html>
48
48
  <html lang="en">
@@ -65,7 +65,7 @@ ${d}`)}if(r.cache)await O.save();if(r.generate404){let d=w.join(r.pagesDir,"404.
65
65
  <a href="/">Go home</a>
66
66
  </div>
67
67
  </body>
68
- </html>`)}for(let d of[500]){let y=w.join(r.pagesDir,`${d}.stx`);if(await Bun.file(y).exists()){let D=new Set,m={...s,minifyClient:!0,debug:!1,cache:!1},G=await i(await Bun.file(y).text(),{},y,m,D);await Bun.write(w.join(r.outputDir,`${d}.html`),G)}}let X=w.join(r.pagesDir,"error.stx");if(await Bun.file(X).exists()){let d=new Set,y={...s,minifyClient:!0,debug:!1,cache:!1},D=await i(await Bun.file(X).text(),{},X,y,d);await Bun.write(w.join(r.outputDir,"error.html"),D)}if(r.sitemap&&M.length>0){let d=Vt(M,r.domain),y=w.join(r.outputDir,"sitemap.xml");await Bun.write(y,d),u.sitemapPath=y,console.log(`Generated sitemap.xml with ${M.length} URLs`)}if(r.robots!==!1){let d=typeof r.robots==="object"?r.robots:{},y=[...r.sitemapExclude.filter((m)=>typeof m==="string"),...d.disallow||[]],D=Us({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...y.length>0?{disallow:y}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",r.domain).href}:{}});await Bun.write(w.join(r.outputDir,"robots.txt"),D),console.log("Generated robots.txt")}if(r.rss){let d=typeof r.rss==="object"?r.rss:{title:"Site Feed",description:"Latest updates",link:r.domain},y=[];if(d.getItems)y=await d.getItems();let D=Kt(d,y),m=w.join(r.outputDir,"rss.xml");await Bun.write(m,D),u.rssPath=m,console.log(`Generated rss.xml with ${y.length} items`)}let q=Sc(r.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let J=kc(r.outputDir);if(J.assets>0)console.log(`Externalized ${J.assets} repeated asset(s) from ${J.pages} page(s) (${(J.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(r.publicDir&&R.existsSync(r.publicDir))await Z(r.publicDir,r.outputDir),console.log(`Copied public assets from ${r.publicDir}`);let nt=fr();if(nt)await Z(nt,w.join(r.outputDir,pr)),console.log(`Copied assets from ${fn}`)}catch(C){throw await r.hooks.onError?.(C),C}if(u.buildTime=Date.now()-n,g.size>0){u.islandChunks={count:g.size,totalBytes:P};let C={generatedChunks:g.size,totalBytes:P,chunks:b,pages:p};await Bun.write(w.join(r.outputDir,"_stx","islands-manifest.json"),JSON.stringify(C,null,2))}await r.hooks.onBuildEnd?.(u);let k=u.islandChunks?`
68
+ </html>`)}for(let d of[500]){let y=w.join(r.pagesDir,`${d}.stx`);if(await Bun.file(y).exists()){let D=new Set,m={...s,minifyClient:!0,debug:!1,cache:!1},G=await i(await Bun.file(y).text(),{},y,m,D);await Bun.write(w.join(r.outputDir,`${d}.html`),G)}}let X=w.join(r.pagesDir,"error.stx");if(await Bun.file(X).exists()){let d=new Set,y={...s,minifyClient:!0,debug:!1,cache:!1},D=await i(await Bun.file(X).text(),{},X,y,d);await Bun.write(w.join(r.outputDir,"error.html"),D)}if(r.sitemap&&M.length>0){let d=Jt(M,r.domain),y=w.join(r.outputDir,"sitemap.xml");await Bun.write(y,d),u.sitemapPath=y,console.log(`Generated sitemap.xml with ${M.length} URLs`)}if(r.robots!==!1){let d=typeof r.robots==="object"?r.robots:{},y=[...r.sitemapExclude.filter((m)=>typeof m==="string"),...d.disallow||[]],D=Vs({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...y.length>0?{disallow:y}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",r.domain).href}:{}});await Bun.write(w.join(r.outputDir,"robots.txt"),D),console.log("Generated robots.txt")}if(r.rss){let d=typeof r.rss==="object"?r.rss:{title:"Site Feed",description:"Latest updates",link:r.domain},y=[];if(d.getItems)y=await d.getItems();let D=Kt(d,y),m=w.join(r.outputDir,"rss.xml");await Bun.write(m,D),u.rssPath=m,console.log(`Generated rss.xml with ${y.length} items`)}let q=Sc(r.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let J=kc(r.outputDir);if(J.assets>0)console.log(`Externalized ${J.assets} repeated asset(s) from ${J.pages} page(s) (${(J.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(r.publicDir&&R.existsSync(r.publicDir))await Z(r.publicDir,r.outputDir),console.log(`Copied public assets from ${r.publicDir}`);let nt=fr();if(nt)await Z(nt,w.join(r.outputDir,pr)),console.log(`Copied assets from ${fn}`)}catch(C){throw await r.hooks.onError?.(C),C}if(u.buildTime=Date.now()-n,g.size>0){u.islandChunks={count:g.size,totalBytes:P};let C={generatedChunks:g.size,totalBytes:P,chunks:b,pages:p};await Bun.write(w.join(r.outputDir,"_stx","islands-manifest.json"),JSON.stringify(C,null,2))}await r.hooks.onBuildEnd?.(u);let k=u.islandChunks?`
69
69
  Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
70
70
  Build complete!
71
71
  Total: ${u.totalPages} pages
@@ -73,7 +73,7 @@ Build complete!
73
73
  Cached: ${u.cachedCount}
74
74
  Failed: ${u.failedCount}
75
75
  Time: ${u.buildTime}ms${k}
76
- `),u}async function Z(e,n){await R.promises.mkdir(n,{recursive:!0});let s=await R.promises.readdir(e,{withFileTypes:!0});for(let o of s){let c=w.join(e,o.name),r=w.join(n,o.name);if(o.isDirectory())await R.promises.mkdir(r,{recursive:!0}),await Z(c,r);else await R.promises.copyFile(c,r)}}function Yt(e={}){let n=e.cacheDir||l(process.cwd(),"ssg-cache"),s=new mt(n),o=e.revalidate||3600;return{async get(c){let r=await s.get(c);if(!r)return null;if(Date.now()>r.revalidateAfter)this.revalidate(c).catch(console.error);return{html:r.html,headers:{"Cache-Control":`public, max-age=${o}, stale-while-revalidate=${o*2}`,ETag:r.etag,"X-ISR-Generated":new Date(r.generatedAt).toISOString(),...r.headers}}},async revalidate(c){let u=re(".",{pagesDir:e.pagesDir||"pages"}).find((k)=>c.match(k.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${c}`);return}let g=c.match(u.regex),P={};if(g)u.params.forEach((k,C)=>{P[k]=g[C+1]});let b=await a(),{html:p}=await yt(u,P,{},e,b);await s.set(c,{html:p,generatedAt:Date.now(),revalidateAfter:Date.now()+o*1000,etag:qt(p)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Zt(){return{name:"markdown",extensions:[".md",".mdx"],async load(e){let n=await Bun.file(e).text(),s=n.match(/^---\n([\s\S]*?)\n---/),o={},c=n;if(s){let b=s[1];c=n.slice(s[0].length).trim();for(let p of b.split(`
76
+ `),u}async function Z(e,n){await R.promises.mkdir(n,{recursive:!0});let s=await R.promises.readdir(e,{withFileTypes:!0});for(let o of s){let c=w.join(e,o.name),r=w.join(n,o.name);if(o.isDirectory())await R.promises.mkdir(r,{recursive:!0}),await Z(c,r);else await R.promises.copyFile(c,r)}}function Yt(e={}){let n=e.cacheDir||l(process.cwd(),"ssg-cache"),s=new mt(n),o=e.revalidate||3600;return{async get(c){let r=await s.get(c);if(!r)return null;if(Date.now()>r.revalidateAfter)this.revalidate(c).catch(console.error);return{html:r.html,headers:{"Cache-Control":`public, max-age=${o}, stale-while-revalidate=${o*2}`,ETag:r.etag,"X-ISR-Generated":new Date(r.generatedAt).toISOString(),...r.headers}}},async revalidate(c){let u=re(".",{pagesDir:e.pagesDir||"pages"}).find((k)=>c.match(k.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${c}`);return}let g=c.match(u.regex),P={};if(g)u.params.forEach((k,C)=>{P[k]=g[C+1]});let b=await a(),{html:p}=await yt(u,P,{},e,b);await s.set(c,{html:p,generatedAt:Date.now(),revalidateAfter:Date.now()+o*1000,etag:Wt(p)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Zt(){return{name:"markdown",extensions:[".md",".mdx"],async load(e){let n=await Bun.file(e).text(),s=n.match(/^---\n([\s\S]*?)\n---/),o={},c=n;if(s){let b=s[1];c=n.slice(s[0].length).trim();for(let p of b.split(`
77
77
  `)){let k=p.indexOf(":");if(k>0){let C=p.slice(0,k).trim(),v=p.slice(k+1).trim();if(v==="true")v=!0;else if(v==="false")v=!1;else if(/^\d+$/.test(v))v=parseInt(v,10);else if(/^\d+\.\d+$/.test(v))v=parseFloat(v);else if(v.startsWith("[")&&v.endsWith("]"))v=v.slice(1,-1).split(",").map((E)=>E.trim().replace(/^['"]|['"]$/g,""));o[C]=v}}}let r=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),u=[],g=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,P;while((P=g.exec(r))!==null){let b=parseInt(P[1],10),p=P[2],k=p.toLowerCase().replace(/[^a-z0-9]+/g,"-");u.push({id:k,text:p,level:b})}return{content:r,data:o,toc:u}}}}function Qt(e){return Pt(e)}function te(e,n){return`<!DOCTYPE html>
78
78
  <html>
79
79
  <head>
@@ -86,4 +86,4 @@ Build complete!
86
86
  <p>Redirecting to <a href="${e}">${e}</a>...</p>
87
87
  <script>window.location.replace('${e}')</script>
88
88
  </body>
89
- </html>`}function ee(e,n){if(e==="/"||e==="")return w.join(n.outputDir,"index.html");let s=e.replace(/^\/|\/$/g,"");if(n.trailingSlash)return w.join(n.outputDir,s,"index.html");return w.join(n.outputDir,`${s}.html`)}var Oe={generateStaticSite:Xt,createISRHandler:Yt,defineStaticPaths:V,createMarkdownLoader:Zt};export{Yt as createISRHandler,Zt as createMarkdownLoader,Nt as declaresPageAction,Oe as default,V as defineStaticPaths,Xt as generateStaticSite,Jt as isExcludedFromSitemap};
89
+ </html>`}function ee(e,n){if(e==="/"||e==="")return w.join(n.outputDir,"index.html");let s=e.replace(/^\/|\/$/g,"");if(n.trailingSlash)return w.join(n.outputDir,s,"index.html");return w.join(n.outputDir,`${s}.html`)}var Oe={generateStaticSite:Xt,createISRHandler:Yt,defineStaticPaths:V,createMarkdownLoader:Zt};export{Yt as createISRHandler,Zt as createMarkdownLoader,Gt as declaresPageAction,Oe as default,V as defineStaticPaths,Xt as generateStaticSite,qt as isExcludedFromSitemap};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.894",
4
+ "version": "0.2.896",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -127,14 +127,14 @@
127
127
  },
128
128
  "dependencies": {
129
129
  "@stacksjs/clapp": "^0.2.17",
130
- "@stacksjs/desktop": "0.2.894",
131
- "@stacksjs/sanitizer": "0.2.894",
130
+ "@stacksjs/desktop": "0.2.896",
131
+ "@stacksjs/sanitizer": "0.2.896",
132
132
  "@stacksjs/ts-css": "^0.3.21",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
134
  "@types/dom-speech-recognition": "^0.0.12",
135
- "bun-plugin-stx": "0.2.894",
135
+ "bun-plugin-stx": "0.2.896",
136
136
  "bunfig": "^0.15.21",
137
- "stx-router": "0.2.894",
137
+ "stx-router": "0.2.896",
138
138
  "ts-broadcasting": "^0.0.13",
139
139
  "ts-images": "^0.2.22",
140
140
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Mh,Bo,Dh,Lh,jh,Bh}from"./chunk-8n5bjars.js";import"./chunk-4s3ts344.js";import"./chunk-mdrdp6c4.js";import"./chunk-115bb91s.js";import"./chunk-s9a9kda4.js";import"./chunk-60z8rka9.js";import"./chunk-n64zbwzr.js";import"./chunk-n6q1d66k.js";import"./chunk-e9c56r58.js";import"./chunk-hxm31y5q.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{Bh as clearStoreCache,Mh as getStoreScript,jh as getStoreScriptFor,Lh as pageStoresAll,Bo as storesRead,Dh as storesReadInFiles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{uy,dy,ug,$s}from"./chunk-c9xg8rc2.js";import"./chunk-nqarmx3w.js";import"./chunk-xvprhdcb.js";import"./chunk-n64zbwzr.js";import{jr}from"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import{yt}from"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{yt as freeIdentifiers,$s as processComponents,ug as processESImports,jr as rendersAsElement,uy as resetMarginStackWarnings,dy as resetTemplateLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Qi,Ny,My,Ml,et,Yg,yo,Dy,Ly,jy,By,Fy,zy,Hy,Uy,Vy}from"./chunk-ac3e6nhg.js";import"./chunk-0jdz31q1.js";export{zy as applyHead,Dy as definePageMeta,Qi as getHead,Ny as getPageMeta,et as mergeHeadConfigs,Hy as processHeadDirective,Vy as processMetaDirective,Uy as processTitleDirective,Fy as renderBodyAttrs,jy as renderHead,By as renderHtmlAttrs,My as resetHead,yo as seoMetaToHeadConfig,Ml as useHead,Ly as usePageTitle,Yg as useSeoMeta,Ly as useTitle};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Uo,Va,Wa,Gh}from"./chunk-z012vpdz.js";export{Uo as NATIVE_COMPONENTS,Va as compileToNative,Wa as createHotReloadServer,Gh as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hr,i}from"./chunk-cbjvabsa.js";import"./chunk-d8ptv989.js";import"./chunk-c5q6jdm9.js";import"./chunk-05x1rd86.js";import"./chunk-c9xg8rc2.js";import"./chunk-nqarmx3w.js";import"./chunk-mj0dnha4.js";import"./chunk-xvprhdcb.js";import"./chunk-s9a9kda4.js";import{Ae}from"./chunk-60z8rka9.js";import"./chunk-n64zbwzr.js";import"./chunk-hxq5tsqa.js";import"./chunk-n6q1d66k.js";import"./chunk-e9c56r58.js";import"./chunk-hxm31y5q.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import{We,io,ao}from"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{hr as buildModulesTag,Ae as injectRouterScript,i as processDirectives,io as processJsonDirective,ao as processOnceDirective,We as validateClientScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{sg,Ac,ry,Pc,og,ig,Sn,wr,sy,ag,cg,oy,S}from"./chunk-d8ptv989.js";import"./chunk-hxq5tsqa.js";import"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{Sn as buildCss,ag as extractClassNames,ig as fingerprintConfig,cg as generateCss,sy as getCachedCSS,sg as getCssServeAsset,S as injectCss,Ac as loadCssEngine,Pc as loadCssEngineConfig,wr as rebuildCss,ry as resetCssCache,og as resolveUserCssConfig,oy as withLinkedModuleBundles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{dh,Ua,Bu,ph,fh,gh,mh,hh,Fu,zu,yh,bh,wh,vh}from"./chunk-xdn58ea6.js";import"./chunk-cbjvabsa.js";import"./chunk-d8ptv989.js";import"./chunk-c5q6jdm9.js";import"./chunk-05x1rd86.js";import"./chunk-c9xg8rc2.js";import"./chunk-nqarmx3w.js";import"./chunk-mj0dnha4.js";import"./chunk-xvprhdcb.js";import"./chunk-s9a9kda4.js";import"./chunk-60z8rka9.js";import"./chunk-n64zbwzr.js";import"./chunk-hxq5tsqa.js";import"./chunk-n6q1d66k.js";import"./chunk-e9c56r58.js";import"./chunk-hxm31y5q.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{Bu as SUSPENSE_RESOLVER_RUNTIME,Ua as buildSuspenseResolveScript,hh as createStreamRenderer,gh as extractStreamBoundaries,vh as generateHydrationRuntime,zu as islandDirective,bh as processSectionDirectives,fh as processStreamDirectives,yh as registerStreamingDirectives,ph as renderStreamingPage,dh as streamTemplate,mh as streamTemplateSimple,wh as streamToResponse,Fu as streamingSuspenseDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ha,Mu,tr,lh,Du,Lu,ju,uh}from"./chunk-na92k4va.js";import"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{tr as Validator,Mu as defineForm,Du as processErrorDirective,Lu as processErrorsDirective,uh as processFormValidationDirectives,ju as processHasErrorsDirective,Ha as useForm,lh as v};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{q,bg,yi,zc,a,j,vy,xy}from"./chunk-e9c56r58.js";import"./chunk-hxm31y5q.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{j as config,q as defaultConfig,vy as defineStxConfig,yi as discoverConfig,a as loadStxConfig,zc as resolveInstalledPackage,bg as resolveStxDirectories,xy as validateConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{tu,nu}from"./chunk-66qt9q6e.js";import"./chunk-ytjn0gq2.js";import"./chunk-wk36dj2m.js";import"./chunk-ae0qvjkz.js";import"./chunk-t79khbtp.js";import"./chunk-kd7k31x3.js";import"./chunk-mhrnjaka.js";import"./chunk-tc94atxh.js";import"./chunk-khaem3zq.js";import"./chunk-z3ar05m3.js";import"./chunk-kfbw96c5.js";import"./chunk-e16ef18k.js";import"./chunk-pnmafbv5.js";import"./chunk-hdqy5v4v.js";import"./chunk-062qfv99.js";import"./chunk-xvncq3m5.js";import"./chunk-y1d3j2j7.js";import"./chunk-r5ecgcx2.js";import"./chunk-8hwfdwgn.js";import"./chunk-vf4ejngv.js";import"./chunk-na92k4va.js";import"./chunk-xdn58ea6.js";import"./chunk-1knk403z.js";import"./chunk-3qk8vf9m.js";import"./chunk-bgfs3mbg.js";import"./chunk-bw2m1e7g.js";import"./chunk-8n5bjars.js";import"./chunk-qv4qwa61.js";import"./chunk-gcjqxvbb.js";import"./chunk-pg3yatv3.js";import"./chunk-pvm48tse.js";import"./chunk-kk2p2tgv.js";import{gn}from"./chunk-5spnw5zr.js";import{tg}from"./chunk-4s3ts344.js";import"./chunk-mdrdp6c4.js";import"./chunk-115bb91s.js";import{He,i}from"./chunk-cbjvabsa.js";import"./chunk-d8ptv989.js";import"./chunk-c5q6jdm9.js";import"./chunk-05x1rd86.js";import"./chunk-c9xg8rc2.js";import"./chunk-nqarmx3w.js";import"./chunk-mj0dnha4.js";import"./chunk-xvprhdcb.js";import"./chunk-s9a9kda4.js";import{Ae}from"./chunk-60z8rka9.js";import"./chunk-n64zbwzr.js";import{_r,Cr}from"./chunk-hxq5tsqa.js";import"./chunk-n6q1d66k.js";import{js,q,a}from"./chunk-e9c56r58.js";import"./chunk-hxm31y5q.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import{B,y,Ge}from"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";import{oa}from"./chunk-hxws025y.js";import"./chunk-9f8fda1j.js";import"./chunk-8y39f6z3.js";export{js as buildWebComponents,Cr as cacheTemplate,_r as checkCache,gn as classifyAllScripts,tu as createMiddleware,nu as createRoute,q as defaultConfig,y as extractVariables,B as findSfcTemplateBlock,Ae as injectRouterScript,oa as insertBeforeBodyClose,a as loadStxConfig,Ge as processClientScript,i as processDirectives,He as readMarkdownFile,tg as withinBundlerCallback};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ht,Rg,Ag,Pg,Ig,Og,y,Ng,Bi,Mg,bl,wl}from"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{ht as STX_ENGINE_BINDING_NAMES,Bi as convertToCommonJS,bl as extractScriptFromTemplate,y as extractVariables,wl as hasVariables,Ng as isCompleteImport,Og as isMissingBindingFailure,Pg as isModuleResolutionFailure,Ig as isSyntaxFailure,Mg as splitDeclaration,Rg as stripTypeScript,Ag as withoutStxReferrer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{iy,lg,ct,Ic,ay,_s,Cs,Es}from"./chunk-c5q6jdm9.js";import"./chunk-c9xg8rc2.js";import"./chunk-nqarmx3w.js";import"./chunk-xvprhdcb.js";import"./chunk-n64zbwzr.js";import"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{ay as clearOnceStore,Ic as onceStore,ct as partialsCache,_s as processIncludes,Cs as processStackPushDirectives,Es as processStackReplacements,iy as resetUnscopedSignalWarnings,lg as topLevelElements};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fo,Fh,zh}from"./chunk-qv4qwa61.js";import"./chunk-4s3ts344.js";import"./chunk-mdrdp6c4.js";import"./chunk-115bb91s.js";import"./chunk-s9a9kda4.js";import"./chunk-60z8rka9.js";import"./chunk-n64zbwzr.js";import"./chunk-n6q1d66k.js";import"./chunk-e9c56r58.js";import"./chunk-hxm31y5q.js";import"./chunk-q0y8gv18.js";import"./chunk-rb2zbdqd.js";import"./chunk-qrk535j6.js";import"./chunk-gzc16hs8.js";import"./chunk-8a71xvx1.js";import"./chunk-8qgcvc9r.js";import"./chunk-41z7f41b.js";import"./chunk-ac3e6nhg.js";import"./chunk-vk2jy6mn.js";import"./chunk-3b3mkgpj.js";import"./chunk-0jdz31q1.js";import"./chunk-x9036mfd.js";export{zh as clearComposableCache,Fh as getComposableScript,Fo as listComposableModules};