@stacksjs/stx 0.2.612 → 0.2.613

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 (122) hide show
  1. package/dist/{chunk-tawfv519.js → chunk-06bwys2z.js} +1 -1
  2. package/dist/{chunk-f6pjf3tb.js → chunk-1bqtsjry.js} +1 -1
  3. package/dist/chunk-1gyrk0qv.js +2 -0
  4. package/dist/{chunk-jbaedjyk.js → chunk-1q3e1w2y.js} +3 -3
  5. package/dist/chunk-1v40w4qr.js +2 -0
  6. package/dist/chunk-1xzxmnsd.js +2 -0
  7. package/dist/{chunk-1q06tw66.js → chunk-27h4ndsg.js} +2 -2
  8. package/dist/chunk-2a1sgnxf.js +2 -0
  9. package/dist/{chunk-kwfwc32d.js → chunk-2bagpncj.js} +2 -2
  10. package/dist/chunk-37n8rf75.js +2 -0
  11. package/dist/{chunk-bgcn01mr.js → chunk-3a60b9an.js} +2 -2
  12. package/dist/{chunk-jskaacqy.js → chunk-3cg5mrtq.js} +6 -6
  13. package/dist/{chunk-4x5zryhk.js → chunk-3hzr66vn.js} +8 -8
  14. package/dist/{chunk-6fmcs19t.js → chunk-3vbv4gxx.js} +5 -5
  15. package/dist/chunk-42er5gwc.js +2 -0
  16. package/dist/{chunk-1c0zvjt3.js → chunk-5hqkfqne.js} +9 -10
  17. package/dist/{chunk-t9pnkbg6.js → chunk-5mw7qawr.js} +1 -1
  18. package/dist/{chunk-zsqfvwwf.js → chunk-5pa5bbzv.js} +2 -2
  19. package/dist/chunk-6kqmr5z1.js +2 -0
  20. package/dist/{chunk-d5nxsg1p.js → chunk-71wntraa.js} +1 -1
  21. package/dist/{chunk-vbzpc1yz.js → chunk-araay35m.js} +4 -4
  22. package/dist/chunk-awvbp2t4.js +2 -0
  23. package/dist/chunk-b3g8zzc6.js +2 -0
  24. package/dist/chunk-bdn21f8c.js +2 -0
  25. package/dist/chunk-c6vb28zd.js +2 -0
  26. package/dist/chunk-cjm2d6w1.js +2 -0
  27. package/dist/{chunk-58s20ceb.js → chunk-ctf9gd40.js} +2 -2
  28. package/dist/chunk-dcdmr6cp.js +2 -0
  29. package/dist/{chunk-0s6shhb3.js → chunk-dq58tn5x.js} +1 -1
  30. package/dist/{chunk-f8kh3s0k.js → chunk-e5t4xhfk.js} +1 -1
  31. package/dist/{chunk-mfh61qdr.js → chunk-edmpxcrh.js} +15 -15
  32. package/dist/{chunk-hw97qw4k.js → chunk-ehq5j4tb.js} +2 -2
  33. package/dist/chunk-fq4xjy4k.js +2 -0
  34. package/dist/chunk-gv3se08t.js +2 -0
  35. package/dist/{chunk-qkczk53w.js → chunk-h74p4zay.js} +65 -65
  36. package/dist/chunk-hx2fc5dt.js +2 -0
  37. package/dist/{chunk-8n306p92.js → chunk-jpe8pt9m.js} +1 -1
  38. package/dist/{chunk-g18pwk0t.js → chunk-jrsvbztw.js} +1 -1
  39. package/dist/{chunk-btcc95hq.js → chunk-jwxppaj3.js} +4 -4
  40. package/dist/{chunk-qh3b1w7q.js → chunk-k0kajwdw.js} +1 -1
  41. package/dist/{chunk-adn5r0r4.js → chunk-kt9ksp8w.js} +1 -1
  42. package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
  43. package/dist/{chunk-jx1p2eza.js → chunk-m0x9gfx5.js} +1 -1
  44. package/dist/chunk-m85kmqbn.js +2 -0
  45. package/dist/chunk-mf6mqs9k.js +2 -0
  46. package/dist/chunk-mheh85ph.js +2 -0
  47. package/dist/{chunk-ewmpbxhv.js → chunk-mkss8wbh.js} +5 -5
  48. package/dist/{chunk-13xvn7vh.js → chunk-mqky9h29.js} +1 -1
  49. package/dist/chunk-n5acpvq3.js +2 -0
  50. package/dist/{chunk-zhe35k6k.js → chunk-nk0cn3yq.js} +1 -1
  51. package/dist/chunk-nvewemvh.js +2 -0
  52. package/dist/chunk-p1t8mm9b.js +2 -0
  53. package/dist/{chunk-7ed685cs.js → chunk-pv73vnyj.js} +1 -1
  54. package/dist/{chunk-970j89r5.js → chunk-pw0b0an6.js} +2 -2
  55. package/dist/{chunk-s43pj9n6.js → chunk-r9z467kx.js} +5 -5
  56. package/dist/chunk-rgg6kr7r.js +2 -0
  57. package/dist/chunk-rw3kgv2q.js +2 -0
  58. package/dist/{chunk-c9jav70j.js → chunk-s9jgsp0a.js} +3 -3
  59. package/dist/{chunk-th4x1wbc.js → chunk-t1cbac58.js} +3 -3
  60. package/dist/{chunk-z83p4bme.js → chunk-t4rxr1zj.js} +3 -3
  61. package/dist/chunk-t7h714ne.js +2 -0
  62. package/dist/{chunk-8dq3r6xw.js → chunk-t8akfx99.js} +6 -6
  63. package/dist/{chunk-ej2ka6g6.js → chunk-temrpzxj.js} +22 -22
  64. package/dist/chunk-th9t5vks.js +2 -0
  65. package/dist/{chunk-7yjyzzcp.js → chunk-tkw5mr0k.js} +1 -1
  66. package/dist/chunk-tq5nzr99.js +2 -0
  67. package/dist/{chunk-ktg9khmj.js → chunk-trhr4gzz.js} +4 -4
  68. package/dist/{chunk-j4smj8cr.js → chunk-vxa0h3yy.js} +4 -4
  69. package/dist/{chunk-xncqjkjm.js → chunk-wq6b8qgz.js} +1 -1
  70. package/dist/chunk-wr42shpx.js +2 -0
  71. package/dist/chunk-x81g1v5x.js +2 -0
  72. package/dist/{chunk-5fa9g7x1.js → chunk-xeqysa9z.js} +62 -62
  73. package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
  74. package/dist/chunk-yn2d8x8m.js +3 -0
  75. package/dist/chunk-ywf6pa29.js +2 -0
  76. package/dist/{chunk-frvn6psn.js → chunk-ywxg3f9s.js} +1 -1
  77. package/dist/chunk-yxksngda.js +2 -0
  78. package/dist/chunk-yytfje8a.js +2 -0
  79. package/dist/{chunk-6w0h6vpd.js → chunk-zb191qdx.js} +3 -3
  80. package/dist/{chunk-wy93yhce.js → chunk-zde9mef4.js} +3 -3
  81. package/dist/chunk-zxvqjzr2.js +2 -0
  82. package/dist/cli.js +42 -42
  83. package/dist/craft-entry.js +2 -2
  84. package/dist/craft.js +2 -2
  85. package/dist/native/compiler/render-screen.js +7 -0
  86. package/dist/pwa.js +3 -3
  87. package/dist/ssg.js +5 -5
  88. package/package.json +5 -5
  89. package/dist/chunk-07rryvyt.js +0 -2
  90. package/dist/chunk-0dkd5z22.js +0 -2
  91. package/dist/chunk-0hpng9by.js +0 -2
  92. package/dist/chunk-0nfysn6e.js +0 -2
  93. package/dist/chunk-0vmwp37n.js +0 -2
  94. package/dist/chunk-0x72g1jn.js +0 -2
  95. package/dist/chunk-15wmzj8j.js +0 -2
  96. package/dist/chunk-1p7v0ytv.js +0 -2
  97. package/dist/chunk-32y8adx3.js +0 -2
  98. package/dist/chunk-5003ncbh.js +0 -2
  99. package/dist/chunk-514ykzna.js +0 -2
  100. package/dist/chunk-6yn7pc5s.js +0 -2
  101. package/dist/chunk-7mee8bte.js +0 -2
  102. package/dist/chunk-7mgbh13b.js +0 -2
  103. package/dist/chunk-851cd8sc.js +0 -2
  104. package/dist/chunk-be89da2e.js +0 -2
  105. package/dist/chunk-cg8hg6cs.js +0 -3
  106. package/dist/chunk-cxv6mhky.js +0 -2
  107. package/dist/chunk-g8hwrejy.js +0 -2
  108. package/dist/chunk-gmqr7v81.js +0 -2
  109. package/dist/chunk-h94znyac.js +0 -2
  110. package/dist/chunk-j9pcvc0z.js +0 -2
  111. package/dist/chunk-m4k7f63m.js +0 -2
  112. package/dist/chunk-mtm39290.js +0 -2
  113. package/dist/chunk-n4z6evey.js +0 -2
  114. package/dist/chunk-pjh4kftn.js +0 -2
  115. package/dist/chunk-pjqrcbtt.js +0 -2
  116. package/dist/chunk-t535swnv.js +0 -2
  117. package/dist/chunk-trah2z70.js +0 -2
  118. package/dist/chunk-vrnb2xat.js +0 -2
  119. package/dist/chunk-xq9f9ftz.js +0 -2
  120. package/dist/chunk-xv9qre1x.js +0 -2
  121. package/dist/chunk-zar7fhqr.js +0 -2
  122. package/dist/chunk-zy266h8p.js +0 -2
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import{is,Xo,Jo}from"./chunk-bgcn01mr.js";import"./chunk-k1hpxgzq.js";import"./chunk-99rfdydy.js";import"./chunk-1c0zvjt3.js";import"./chunk-2bcp699b.js";import"./chunk-66e4ga0z.js";import"./chunk-5fa9g7x1.js";import"./chunk-c9jav70j.js";import"./chunk-8dq3r6xw.js";import"./chunk-nmh4pn44.js";import"./chunk-adn5r0r4.js";import"./chunk-mm8jdb4p.js";import"./chunk-0zx1400y.js";import"./chunk-dcs87qta.js";import{Bd,Ho,Fd,zd,Vo,os,Uo,Hd,Wo,Vd,Ud,qo,Go,Ko}from"./chunk-ej2ka6g6.js";import"./chunk-6fmcs19t.js";import"./chunk-q4t49t6z.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{is,Xo,Jo}from"./chunk-3a60b9an.js";import"./chunk-k1hpxgzq.js";import"./chunk-99rfdydy.js";import"./chunk-5hqkfqne.js";import"./chunk-2bcp699b.js";import"./chunk-66e4ga0z.js";import"./chunk-xeqysa9z.js";import"./chunk-s9jgsp0a.js";import"./chunk-t8akfx99.js";import"./chunk-nmh4pn44.js";import"./chunk-kt9ksp8w.js";import"./chunk-mm8jdb4p.js";import"./chunk-0zx1400y.js";import"./chunk-dcs87qta.js";import{Bu,Ho,Fu,zu,Vo,os,Uo,Hu,Wo,Vu,Uu,qo,Go,Ko}from"./chunk-temrpzxj.js";import"./chunk-3vbv4gxx.js";import"./chunk-q4t49t6z.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{Bd as CRAFT_BRIDGE_SCRIPT,os as CRAFT_COMPONENTS,Hd as CRAFT_COMPONENT_RUNTIME,Uo as CRAFT_COMPONENT_STYLES,is as NATIVE_COMPONENTS,qo as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Xo as compileToNative,Jo as createHotReloadServer,Ho as generateCraftBridgeScript,V as generateCraftOptimizations,Ko as getAvailableFormats,Go as getAvailableTargets,Ud as getCraftComponents,G as getSSRCacheStats,Vo as injectCraftBridge,Fd as isCraftEnvironment,Y as prerenderForCraft,Wo as processCraftComponents,zd as processCraftDirective,Vd 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{Bu as CRAFT_BRIDGE_SCRIPT,os as CRAFT_COMPONENTS,Hu as CRAFT_COMPONENT_RUNTIME,Uo as CRAFT_COMPONENT_STYLES,is as NATIVE_COMPONENTS,qo as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Xo as compileToNative,Jo as createHotReloadServer,Ho as generateCraftBridgeScript,V as generateCraftOptimizations,Ko as getAvailableFormats,Go as getAvailableTargets,Uu as getCraftComponents,G as getSSRCacheStats,Vo as injectCraftBridge,Fu as isCraftEnvironment,Y as prerenderForCraft,Wo as processCraftComponents,zu as processCraftDirective,Vu as registerCraftComponent,Q as renderSSR};
package/dist/craft.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import{is,Xo,Jo}from"./chunk-bgcn01mr.js";import"./chunk-k1hpxgzq.js";import"./chunk-99rfdydy.js";import"./chunk-1c0zvjt3.js";import"./chunk-2bcp699b.js";import"./chunk-66e4ga0z.js";import"./chunk-5fa9g7x1.js";import"./chunk-c9jav70j.js";import"./chunk-8dq3r6xw.js";import"./chunk-nmh4pn44.js";import"./chunk-adn5r0r4.js";import"./chunk-mm8jdb4p.js";import"./chunk-0zx1400y.js";import"./chunk-dcs87qta.js";import{Bd,Ho,Fd,zd,Vo,os,Uo,Hd,Wo,Vd,Ud,qo,Go,Ko}from"./chunk-ej2ka6g6.js";import"./chunk-6fmcs19t.js";import"./chunk-q4t49t6z.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{is,Xo,Jo}from"./chunk-3a60b9an.js";import"./chunk-k1hpxgzq.js";import"./chunk-99rfdydy.js";import"./chunk-5hqkfqne.js";import"./chunk-2bcp699b.js";import"./chunk-66e4ga0z.js";import"./chunk-xeqysa9z.js";import"./chunk-s9jgsp0a.js";import"./chunk-t8akfx99.js";import"./chunk-nmh4pn44.js";import"./chunk-kt9ksp8w.js";import"./chunk-mm8jdb4p.js";import"./chunk-0zx1400y.js";import"./chunk-dcs87qta.js";import{Bu,Ho,Fu,zu,Vo,os,Uo,Hu,Wo,Vu,Uu,qo,Go,Ko}from"./chunk-temrpzxj.js";import"./chunk-3vbv4gxx.js";import"./chunk-q4t49t6z.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{Bd as CRAFT_BRIDGE_SCRIPT,os as CRAFT_COMPONENTS,Hd as CRAFT_COMPONENT_RUNTIME,Uo as CRAFT_COMPONENT_STYLES,is as NATIVE_COMPONENTS,qo as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Xo as compileToNative,Jo as createHotReloadServer,Ho as generateCraftBridgeScript,V as generateCraftOptimizations,Ko as getAvailableFormats,Go as getAvailableTargets,Ud as getCraftComponents,G as getSSRCacheStats,Vo as injectCraftBridge,Fd as isCraftEnvironment,Y as prerenderForCraft,Wo as processCraftComponents,zd as processCraftDirective,Vd 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{Bu as CRAFT_BRIDGE_SCRIPT,os as CRAFT_COMPONENTS,Hu as CRAFT_COMPONENT_RUNTIME,Uo as CRAFT_COMPONENT_STYLES,is as NATIVE_COMPONENTS,qo as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Xo as compileToNative,Jo as createHotReloadServer,Ho as generateCraftBridgeScript,V as generateCraftOptimizations,Ko as getAvailableFormats,Go as getAvailableTargets,Uu as getCraftComponents,G as getSSRCacheStats,Vo as injectCraftBridge,Fu as isCraftEnvironment,Y as prerenderForCraft,Wo as processCraftComponents,zu as processCraftDirective,Vu as registerCraftComponent,Q as renderSSR};
@@ -41,6 +41,13 @@ export async function compileScreenSource(source, filePath, options = {}) {
41
41
  if (forcedSetup && !scripts.some((script) => script.code === forcedSetup.code))
42
42
  scripts.push({ code: forcedSetup.code });
43
43
  }
44
+ const { buildModuleRegistryScript, registeredModuleIdsIn } = await import("../../client-module-registry.js"), moduleInputs = [], modules = await buildModuleRegistryScript(registeredModuleIdsIn(...scripts.map((script) => script.code)), {
45
+ collectInputs: moduleInputs
46
+ });
47
+ for (const input of moduleInputs)
48
+ dependencies.add(input);
49
+ if (modules)
50
+ scripts.unshift({ code: modules });
44
51
  return { document, manifest, setup, scripts, diagnostics, html, dependencies: [...dependencies] };
45
52
  }
46
53
  export async function compileScreenFile(filePath, options = {}) {
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{nr,Ue,oi,pc}from"./chunk-970j89r5.js";import{tr,as,lc,dc,uc}from"./chunk-6w0h6vpd.js";import{ni,ri,si,ac,cc}from"./chunk-34tbh570.js";import{de,_t,cs}from"./chunk-58s20ceb.js";import{fl,gl,ml,hl,Ir,Mu}from"./chunk-zsqfvwwf.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-7ed685cs.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>
2
+ import{nr,Ue,oi,pc}from"./chunk-pw0b0an6.js";import{tr,as,lc,uc,dc}from"./chunk-zb191qdx.js";import{ni,ri,si,ac,cc}from"./chunk-34tbh570.js";import{ue,_t,cs}from"./chunk-ctf9gd40.js";import{fl,gl,ml,hl,Ir,Md}from"./chunk-5pa5bbzv.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-pv73vnyj.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">
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
233
233
  }, 5000);
234
234
  </script>
235
235
  </body>
236
- </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=de(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=nr(n,t);if(a){let s=Ue(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return as(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,ri as auditBuildOutput,ni as auditConfig,re as buildPwaAssets,si as calculateAuditResult,cc as formatAuditResult,cs as formatSize,j as generateManifest,_ as generateManifestJson,dc as generateManifestLink,F as generateOfflinePage,de as generatePrecacheManifest,_t as generatePrecacheManifestJs,M as generatePwaIcons,tr as generatePwaTags,nr as generateServiceWorker,pc as generateServiceWorkerAuto,lc as generateSwRegistrationScript,uc as generateThemeColorMeta,N as getExpectedIconPaths,Ue as getServiceWorkerFileName,as as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,oi as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,Ir as pwaDirectives,fl as pwaInstallDirective,ml as pwaOfflineDirective,hl as pwaPushDirective,gl as pwaUpdateDirective,Mu as registerPwaDirectives,ac as runPwaAudit,D as validateManifest};
236
+ </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=ue(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=nr(n,t);if(a){let s=Ue(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return as(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,ri as auditBuildOutput,ni as auditConfig,re as buildPwaAssets,si as calculateAuditResult,cc as formatAuditResult,cs as formatSize,j as generateManifest,_ as generateManifestJson,uc as generateManifestLink,F as generateOfflinePage,ue as generatePrecacheManifest,_t as generatePrecacheManifestJs,M as generatePwaIcons,tr as generatePwaTags,nr as generateServiceWorker,pc as generateServiceWorkerAuto,lc as generateSwRegistrationScript,dc as generateThemeColorMeta,N as getExpectedIconPaths,Ue as getServiceWorkerFileName,as as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,oi as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,Ir as pwaDirectives,fl as pwaInstallDirective,ml as pwaOfflineDirective,hl as pwaPushDirective,gl as pwaUpdateDirective,Md as registerPwaDirectives,ac as runPwaAudit,D as validateManifest};
package/dist/ssg.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import"./chunk-5rtatjwq.js";import"./chunk-k1hpxgzq.js";import"./chunk-99rfdydy.js";import{ut,pt,ft,gt,mt,ht}from"./chunk-1c0zvjt3.js";import"./chunk-2bcp699b.js";import"./chunk-66e4ga0z.js";import{f,Xe,L,Z,n,o}from"./chunk-5fa9g7x1.js";import"./chunk-c9jav70j.js";import{wr}from"./chunk-8dq3r6xw.js";import"./chunk-nmh4pn44.js";import"./chunk-adn5r0r4.js";import"./chunk-mm8jdb4p.js";import"./chunk-0zx1400y.js";import"./chunk-ktg9khmj.js";import{ue,Et,Tt}from"./chunk-btcc95hq.js";import{Qo,ei,ti}from"./chunk-d16jgsyv.js";import{Ct,fn,gn}from"./chunk-hjp38m0w.js";import"./chunk-q4t49t6z.js";import{a}from"./chunk-6ta850w8.js";import x from"fs";import g from"path";import{createHash as bt}from"crypto";function Pt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var $t=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Dt(t){return Bun.hash(t).toString(16)}function it(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace($t,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Pt(h);let S=Dt(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${bt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Rt=new Set(["visible","idle"]);function st(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Rt.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var kt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function It(t){for(let i of kt){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function at(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function Bt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=at(e.default??e);if(l)return l}catch{}}return null}async function ot(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=at(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await Bt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=It(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ct(){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
- `)}class lt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,i=""){this.cacheDir=t,this.salt=i}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let i=JSON.parse(await Bun.file(t).text());for(let[s,r]of Object.entries(i))this.cache.set(s,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),i={};for(let[s,r]of this.cache)i[s]=r;await Bun.write(t,JSON.stringify(i))}getHash(t,i){let s=x.statSync(t),r=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of i)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,i){let s=this.cache.get(t);if(!s)return null;let r=this.getHash(i,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(t),null;return s.html}set(t,i,s,r){let c=this.getHash(i,s);this.cache.set(t,{hash:c,html:r,generatedAt:Date.now(),dependencies:s})}}class dt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let i=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",i)}async get(t){let i=this.getFilePath(t);if(!await Bun.file(i).exists())return null;try{return JSON.parse(await Bun.file(i).text())}catch{return null}}async set(t,i){let s=this.getFilePath(t);await x.promises.mkdir(g.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(i))}async invalidate(t){let i=this.getFilePath(t);if(await Bun.file(i).exists())await x.promises.unlink(i)}async invalidatePattern(t){let i=g.join(this.cacheDir,"isr");if(!x.existsSync(i))return;let s=await x.promises.readdir(i);for(let r of s){let c=r.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(i,r))}}async needsRevalidation(t){let i=await this.get(t);if(!i)return!0;return Date.now()>i.revalidateAfter}}async function jt(t){try{let s=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let r=s[1];if(!r.includes("getStaticPaths"))return null;let c=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
2
+ import"./chunk-5rtatjwq.js";import"./chunk-k1hpxgzq.js";import"./chunk-99rfdydy.js";import{dt,pt,ft,gt,mt,ht}from"./chunk-5hqkfqne.js";import"./chunk-2bcp699b.js";import"./chunk-66e4ga0z.js";import{f,Xe,L,Z,n,o}from"./chunk-xeqysa9z.js";import"./chunk-s9jgsp0a.js";import{wr}from"./chunk-t8akfx99.js";import"./chunk-nmh4pn44.js";import"./chunk-kt9ksp8w.js";import"./chunk-mm8jdb4p.js";import"./chunk-0zx1400y.js";import"./chunk-trhr4gzz.js";import{de,Et,Tt}from"./chunk-jwxppaj3.js";import{Qo,ei,ti}from"./chunk-d16jgsyv.js";import{Ct,fn,gn}from"./chunk-hjp38m0w.js";import"./chunk-q4t49t6z.js";import{a}from"./chunk-6ta850w8.js";import x from"fs";import g from"path";import{createHash as bt}from"crypto";function Pt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var $t=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Dt(t){return Bun.hash(t).toString(16)}function it(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace($t,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Pt(h);let S=Dt(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${bt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Rt=new Set(["visible","idle"]);function st(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Rt.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var kt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function It(t){for(let i of kt){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function at(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function Bt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=at(e.default??e);if(l)return l}catch{}}return null}async function ot(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=at(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await Bt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=It(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ct(){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
+ `)}class lt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,i=""){this.cacheDir=t,this.salt=i}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let i=JSON.parse(await Bun.file(t).text());for(let[s,r]of Object.entries(i))this.cache.set(s,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),i={};for(let[s,r]of this.cache)i[s]=r;await Bun.write(t,JSON.stringify(i))}getHash(t,i){let s=x.statSync(t),r=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of i)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,i){let s=this.cache.get(t);if(!s)return null;let r=this.getHash(i,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(t),null;return s.html}set(t,i,s,r){let c=this.getHash(i,s);this.cache.set(t,{hash:c,html:r,generatedAt:Date.now(),dependencies:s})}}class ut{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let i=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",i)}async get(t){let i=this.getFilePath(t);if(!await Bun.file(i).exists())return null;try{return JSON.parse(await Bun.file(i).text())}catch{return null}}async set(t,i){let s=this.getFilePath(t);await x.promises.mkdir(g.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(i))}async invalidate(t){let i=this.getFilePath(t);if(await Bun.file(i).exists())await x.promises.unlink(i)}async invalidatePattern(t){let i=g.join(this.cacheDir,"isr");if(!x.existsSync(i))return;let s=await x.promises.readdir(i);for(let r of s){let c=r.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(i,r))}}async needsRevalidation(t){let i=await this.get(t);if(!i)return!0;return Date.now()>i.revalidateAfter}}async function jt(t){try{let s=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let r=s[1];if(!r.includes("getStaticPaths"))return null;let c=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
4
4
  return (async function getStaticPaths() {
5
5
  ${c[1]}
6
6
  })()
@@ -9,7 +9,7 @@ import"./chunk-5rtatjwq.js";import"./chunk-k1hpxgzq.js";import"./chunk-99rfdydy.
9
9
  ${e[1]}
10
10
  })()
11
11
  `)(i)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Lt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function wt(t,i,s={},r,c){let e=await Bun.file(t.filePath).text(),l=await Ot(t.filePath),w=await At(e,i,t.filePath),y={...l||{},...w||{},...s,params:i,$route:{path:t.pattern,params:i}},h=new Set,S=[],P=[],D={...c,...r.partialsDir?{partialsDir:r.partialsDir}:{},...r.componentsDir?{componentsDir:r.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(b)=>{S.push(`${g.relative(process.cwd(),b.templatePath)}: ${b.message}
12
- resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Lt(e))console.warn(`Warning: ${t.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 p=await n(e,y,t.filePath,D,h);for(let b of[t.filePath,...h])for(let B of ue(b))h.add(B);if(Object.keys(i).length>0){let b=`<script>if(window.stx)window.stx._rp=${JSON.stringify(i)};else window.__stx_rp=${JSON.stringify(i)};</script>`;if(p.includes("</head>"))p=p.replace("</head>",`${b}
12
+ resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Lt(e))console.warn(`Warning: ${t.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 p=await n(e,y,t.filePath,D,h);for(let b of[t.filePath,...h])for(let B of de(b))h.add(B);if(Object.keys(i).length>0){let b=`<script>if(window.stx)window.stx._rp=${JSON.stringify(i)};else window.__stx_rp=${JSON.stringify(i)};</script>`;if(p.includes("</head>"))p=p.replace("</head>",`${b}
13
13
  </head>`);else p=`${b}
14
14
  ${p}`}if(p=await Z(p,{router:r.router}),p=await f(p),r.minify!==!1)return{html:Mt(p),dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P};return{html:p,dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P}}function Mt(t){let i=[],s=0,r=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=r.exec(t))!==null){let l=t.slice(s,c.index);i.push(l.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let w=c[1],y=c[2],h=c[3];y=y.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),i.push(w+y+h),s=c.index+c[0].length}let e=t.slice(s);return i.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),i.join("").trim()}function Ut(t){let i=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);i=(i<<5)-i+r,i=i&i}return`"${Math.abs(i).toString(36)}"`}function _t(t,i,s,r){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(i))return!0;return r.some((c)=>{if(c instanceof RegExp)return c.test(t);return c.endsWith("/")?t===c.slice(0,-1)||t.startsWith(c):t===c})}function Gt(t,i){return`<?xml version="1.0" encoding="UTF-8"?>
15
15
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@@ -41,7 +41,7 @@ ${t.map((r)=>{let c=new URL(r.loc,i).href,e=` <url>
41
41
  ${s.join(`
42
42
  `)}
43
43
  </channel>
44
- </rss>`}async function zt(t={}){let i=Date.now();Tt();let s=await o(process.cwd()),r=s.build||{},c=await ot({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ct());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-5003ncbh.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-15wmzj8j.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new lt(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-5003ncbh.js");await u('<div class="bg-black"></div>')}catch{}ut();let yt=s?.routeMiddleware?.dir||"middleware";await ft(process.cwd(),yt);let H=pt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let St=s?.routeMiddleware?.global||[];ti(s?.layoutsDir,a(process.cwd()));let V=L(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${V.length} routes`);let G=[];for(let u of V){let m=await Ft(u);for(let v of m)G.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=G.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],K=[];for(let u=0;u<G.length;u+=e.concurrency)K.push(G.slice(u,u+e.concurrency));for(let u of K)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:M,props:xt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Jt(j),vt=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],tt=[...St,...vt];if(tt.length>0){let C=gt(d,M,F||{}),O=mt(C,null,void 0,{isServer:!0}),E=await ht(tt,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,_=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,_),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(_),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let et=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(et)try{if(!await Function("route",`
44
+ </rss>`}async function zt(t={}){let i=Date.now();Tt();let s=await o(process.cwd()),r=s.build||{},c=await ot({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ct());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-cjm2d6w1.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-gv3se08t.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new lt(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-cjm2d6w1.js");await u('<div class="bg-black"></div>')}catch{}dt();let yt=s?.routeMiddleware?.dir||"middleware";await ft(process.cwd(),yt);let H=pt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let St=s?.routeMiddleware?.global||[];ti(s?.layoutsDir,a(process.cwd()));let V=L(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${V.length} routes`);let G=[];for(let u of V){let m=await Ft(u);for(let v of m)G.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=G.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],K=[];for(let u=0;u<G.length;u+=e.concurrency)K.push(G.slice(u,u+e.concurrency));for(let u of K)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:M,props:xt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Jt(j),vt=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],tt=[...St,...vt];if(tt.length>0){let C=gt(d,M,F||{}),O=mt(C,null,void 0,{isServer:!0}),E=await ht(tt,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,_=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,_),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(_),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let et=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(et)try{if(!await Function("route",`
45
45
  const validate = ${et[1]};
46
46
  return validate(route);
47
47
  `)({params:M})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,rt=!1;if(e.cache){if(k=B.get(d,v.filePath),k)rt=!0,l.cachedCount++}if(!k){let C=await wt(v,M,xt,e,s);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
@@ -81,7 +81,7 @@ Build complete!
81
81
  Cached: ${l.cachedCount}
82
82
  Failed: ${l.failedCount}
83
83
  Time: ${l.buildTime}ms${P}
84
- `),l}async function J(t,i){await x.promises.mkdir(i,{recursive:!0});let s=await x.promises.readdir(t,{withFileTypes:!0});for(let r of s){let c=g.join(t,r.name),e=g.join(i,r.name);if(r.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await J(c,e);else await x.promises.copyFile(c,e)}}function Ht(t={}){let i=t.cacheDir||a(process.cwd(),"ssg-cache"),s=new dt(i),r=t.revalidate||3600;return{async get(c){let e=await s.get(c);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(c).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${r}, stale-while-revalidate=${r*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(c){let l=L(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>c.match(P.regex)!==null);if(!l){console.warn(`Route not found for revalidation: ${c}`);return}let w=c.match(l.regex),y={};if(w)l.params.forEach((P,D)=>{y[P]=w[D+1]});let h=await o(),{html:S}=await wt(l,y,{},t,h);await s.set(c,{html:S,generatedAt:Date.now(),revalidateAfter:Date.now()+r*1000,etag:Ut(S)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Wt(t){return async()=>({paths:await t(),fallback:!1})}function qt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let i=await Bun.file(t).text(),s=i.match(/^---\n([\s\S]*?)\n---/),r={},c=i;if(s){let h=s[1];c=i.slice(s[0].length).trim();for(let S of h.split(`
84
+ `),l}async function J(t,i){await x.promises.mkdir(i,{recursive:!0});let s=await x.promises.readdir(t,{withFileTypes:!0});for(let r of s){let c=g.join(t,r.name),e=g.join(i,r.name);if(r.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await J(c,e);else await x.promises.copyFile(c,e)}}function Ht(t={}){let i=t.cacheDir||a(process.cwd(),"ssg-cache"),s=new ut(i),r=t.revalidate||3600;return{async get(c){let e=await s.get(c);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(c).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${r}, stale-while-revalidate=${r*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(c){let l=L(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>c.match(P.regex)!==null);if(!l){console.warn(`Route not found for revalidation: ${c}`);return}let w=c.match(l.regex),y={};if(w)l.params.forEach((P,D)=>{y[P]=w[D+1]});let h=await o(),{html:S}=await wt(l,y,{},t,h);await s.set(c,{html:S,generatedAt:Date.now(),revalidateAfter:Date.now()+r*1000,etag:Ut(S)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Wt(t){return async()=>({paths:await t(),fallback:!1})}function qt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let i=await Bun.file(t).text(),s=i.match(/^---\n([\s\S]*?)\n---/),r={},c=i;if(s){let h=s[1];c=i.slice(s[0].length).trim();for(let S of h.split(`
85
85
  `)){let P=S.indexOf(":");if(P>0){let D=S.slice(0,P).trim(),p=S.slice(P+1).trim();if(p==="true")p=!0;else if(p==="false")p=!1;else if(/^\d+$/.test(p))p=parseInt(p,10);else if(/^\d+\.\d+$/.test(p))p=parseFloat(p);else if(p.startsWith("[")&&p.endsWith("]"))p=p.slice(1,-1).split(",").map((b)=>b.trim().replace(/^['"]|['"]$/g,""));r[D]=p}}}let e=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>"),l=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,y;while((y=w.exec(e))!==null){let h=parseInt(y[1],10),S=y[2],P=S.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:P,text:S,level:h})}return{content:e,data:r,toc:l}}}}function Jt(t){return Xe(t)}function Vt(t,i){return`<!DOCTYPE html>
86
86
  <html>
87
87
  <head>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.612",
4
+ "version": "0.2.613",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -128,12 +128,12 @@
128
128
  "dependencies": {
129
129
  "@stacksjs/ts-css": "^0.3.11",
130
130
  "@stacksjs/clapp": "^0.2.16",
131
- "@stacksjs/desktop": "0.2.612",
132
- "@stacksjs/sanitizer": "0.2.612",
131
+ "@stacksjs/desktop": "0.2.613",
132
+ "@stacksjs/sanitizer": "0.2.613",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
- "bun-plugin-stx": "0.2.612",
134
+ "bun-plugin-stx": "0.2.613",
135
135
  "bunfig": "^0.15.21",
136
- "stx-router": "0.2.612",
136
+ "stx-router": "0.2.613",
137
137
  "ts-broadcasting": "^0.0.11",
138
138
  "ts-images": "^0.2.22",
139
139
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hd,yd,bd,vd,wd}from"./chunk-j4smj8cr.js";export{yd as defineAsyncComponent,vd as generateAsyncComponentCSS,wd as generateAsyncComponentRuntime,bd as isAsyncComponent,hd as processAsyncDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{gu,Nc,Ts,$s,Ci,_i,Rs,As,dr,Mc,Ei,Ti,Lc,et}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{gu as clearScriptScanCache,Rs as convertServerLoopAttributesToDirectives,Ci as convertSignalDirectivesToAttributes,As as convertSignalLoopsToAttributes,Mc as extractExports,Ti as findMarkupIndexOutsideScripts,$s as hasSignalsSyntax,Ts as parseLoopExpression,_i as preEvalLiteralReactiveIfs,dr as processScriptSetup,Ei as processSignals,Lc as rewriteStxImportSpecifiers,Nc as scanScriptTags,et as stripStxRuntimeImports};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{rd,sd}from"./chunk-jbaedjyk.js";export{sd as ensureTeleportTargets,rd as processTeleportDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qo,Go,Ko,Wd}from"./chunk-ej2ka6g6.js";import"./chunk-6fmcs19t.js";import"./chunk-dcs87qta.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{qo as buildNative,Wd as default,Ko as getAvailableFormats,Go as getAvailableTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cn,Dc,Es}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import{Pe}from"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{Pe as freeIdentifiers,Es as processComponents,Dc as processESImports,Cn as rendersAsElement};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{He,cn,kd}from"./chunk-th4x1wbc.js";import{G,ln,Cd,dn,rs,Zn,Qn,_d,Ed,Td,un,pn,ss,er,$d}from"./chunk-kwfwc32d.js";import"./chunk-2bcp699b.js";export{rs as batch,kd as default,ln as derived,dn as effect,He as generateSignalsRuntime,cn as generateSignalsRuntimeDev,pn as isDerived,un as isSignal,Cd as memo,Qn as onDestroy,Zn as onMount,er as peek,Td as pendingLifecycleCounts,Ed as runDestroyCallbacks,_d as runMountCallbacks,G as state,ss as untrack,$d as useOptimistic};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ws,xs,Ss,pu,cr,fu}from"./chunk-5fa9g7x1.js";export{cr as clearImageDeliveryCatalog,pu as deliveredImage,Ss as efficientDeliverySources,ws as getImageDelivery,xs as isTransparentImage,fu as prepareImageDelivery};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{nd}from"./chunk-hw97qw4k.js";export{nd as processDeferDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{tr,as,lc,dc,uc}from"./chunk-6w0h6vpd.js";import"./chunk-970j89r5.js";export{dc as generateManifestLink,tr as generatePwaTags,lc as generateSwRegistrationScript,uc as generateThemeColorMeta,as as injectPwaTags};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cu,gi,lu,mi,Rc,Ac,Lt,kn,du,Pc,Ic,uu,f}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{Lt as buildCss,Pc as extractClassNames,Ac as fingerprintConfig,Ic as generateCss,du as getCachedCSS,cu as getCssServeAsset,f as injectCss,gi as loadCssEngine,mi as loadCssEngineConfig,kn as rebuildCss,lu as resetCssCache,Rc as resolveUserCssConfig,uu as withLinkedModuleBundles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ud,pd,fd,gd,md}from"./chunk-ewmpbxhv.js";export{pd as createSSRSuspense,gd as generateSuspenseCSS,md as generateSuspenseRuntime,ud as processSuspenseDirectives,fd as renderSSRSuspense};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Bt,jc,Bc,Fc,zc,Hc,d,Vc,Ps,Uc,$i,Ri}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{Bt as STX_ENGINE_BINDING_NAMES,Ps as convertToCommonJS,$i as extractScriptFromTemplate,d as extractVariables,Ri as hasVariables,Vc as isCompleteImport,Hc as isMissingBindingFailure,Fc as isModuleResolutionFailure,zc as isSyntaxFailure,Uc as splitDeclaration,jc as stripTypeScript,Bc as withoutStxReferrer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rd,zo,sc,Ad,Pd,Id,Od,Dd,oc,ic,Nd,Md,Ld,jd}from"./chunk-jskaacqy.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{sc as SUSPENSE_RESOLVER_RUNTIME,zo as buildSuspenseResolveScript,Dd as createStreamRenderer,Id as extractStreamBoundaries,jd as generateHydrationRuntime,ic as islandDirective,Md as processSectionDirectives,Pd as processStreamDirectives,Nd as registerStreamingDirectives,Ad as renderStreamingPage,Rd as streamTemplate,Od as streamTemplateSimple,Ld as streamToResponse,oc as streamingSuspenseDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qe,Ec,tu,nu,ru,su,Tc,$c,ou,iu,fi,au,vn,wn,ir}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{su as __setSignalsGeneratorsForTest,qe as cacheEngineFingerprint,wn as cacheTemplate,vn as checkCache,au as clearDevCaches,$c as getCachedRouterScript,Tc as getCachedSignalsRuntime,ou as getServeClientAsset,fi as getServeModuleBundle,ir as hashFilePath,nu as invalidateFileCache,ru as invalidateFileCacheByDir,tu as readFileCached,iu as registerServeModuleBundle,Ec as templateCache};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pt,ds,us,ps,Kd,gs}from"./chunk-ktg9khmj.js";import"./chunk-0zx1400y.js";import"./chunk-nmh4pn44.js";import"./chunk-1c0zvjt3.js";export{us as buildServerApi,Kd as createServerApi,Pt as discoverServerApi,ds as generateApiTypes,gs as isServerApiSource,ps as productionApiDispatcher};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{od,id,ad,cd,ld,dd}from"./chunk-s43pj9n6.js";export{cd as generateTransitionCSS,ld as generateTransitionRuntime,od as performEnter,id as performLeave,dd as processTransitionAttributes,ad as processTransitionDirectives};
@@ -1,3 +0,0 @@
1
- // @bun
2
- var u=import.meta.require;
3
- export{u};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{yl}from"./chunk-0s6shhb3.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{yl as startInteractive};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ws,qs,Gs,Ks,br,vr,wu,xu,Su,ku,wr,Cu}from"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";export{Cu as generateDefaultRobotsTxt,wr as generateRobotsTxt,xu as generateSitemap,Su as generateSitemapIndex,Ks as injectSeoTags,br as metaDirective,Ws as processMetaDirectives,Gs as processSeoDirective,qs as processStructuredData,wu as registerSeoDirectives,ku as scanForSitemapEntries,vr as structuredDataDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{is,Xo,Jo,qd}from"./chunk-bgcn01mr.js";export{is as NATIVE_COMPONENTS,Xo as compileToNative,Jo as createHotReloadServer,qd as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{El}from"./chunk-frvn6psn.js";import"./chunk-4x5zryhk.js";import"./chunk-th4x1wbc.js";import"./chunk-ktg9khmj.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{El as buildForProduction};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Zs,_u,Eu,Ji,we,rl,kr,Tu,$u,Ru,Au,Pu,Iu,Ou,Du,Nu}from"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";export{Iu as applyHead,Tu as definePageMeta,Zs as getHead,_u as getPageMeta,we as mergeHeadConfigs,Ou as processHeadDirective,Nu as processMetaDirective,Du as processTitleDirective,Pu as renderBodyAttrs,Ru as renderHead,Au as renderHtmlAttrs,Eu as resetHead,kr as seoMetaToHeadConfig,Ji as useHead,$u as usePageTitle,rl as useSeoMeta,$u as useTitle};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Dt,Is,Ai,Wc}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{Wc as declareBareLoopHead,Dt as parseLoopBinding,Ai as processLoops,Is as reportDeferredLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{A,tl,Fs,o,P,bu,vu}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{P as config,A as defaultConfig,bu as defineStxConfig,Fs as discoverConfig,o as loadStxConfig,tl as resolveStxDirectories,vu as validateConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{jl}from"./chunk-8n306p92.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{jl as buildApp};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xa,_o,Sl,Sa,ka,kl,Cl}from"./chunk-d5nxsg1p.js";import"./chunk-wy93yhce.js";import"./chunk-btcc95hq.js";import"./chunk-ktg9khmj.js";import"./chunk-5rtatjwq.js";import{Qe,Oc}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{xa as buildVirtualSource,Qe as extractScriptBlocks,Oc as extractTemplateExpressions,Sa as findRuntimeTypeDeclarations,ka as findStxModuleDeclarations,Cl as formatTypecheckDiagnostics,Sl as sourcePathFor,kl as typecheckStxFiles,_o as virtualPathFor};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ns,ed,td}from"./chunk-wy93yhce.js";import"./chunk-btcc95hq.js";import"./chunk-ktg9khmj.js";import"./chunk-5rtatjwq.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{td as clearComposableCache,ed as getComposableScript,ns as listComposableModules};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ue,fc,ii,Et,Tt,Gd,ai,$t,mn,gc,mc,hc,ls,Rt,yc,At,bc}from"./chunk-btcc95hq.js";import"./chunk-ktg9khmj.js";import"./chunk-5rtatjwq.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{mn as MODULE_SPECIFIER_PREFIX,At as bundleClientScript,Tt as clearBundleFailures,ue as clientBundleDependencies,Et as getBundleFailures,$t as hasUserImports,Rt as moduleSubstitutionKey,mc as normalizeRegistrySpecifiers,yc as queueClientBundleBuild,ii as recordBundleFailure,gc as registryIdForPath,ai as resolveBundlerFallback,hc as rewriteRegistryImports,Gd as setBundlerFallbackMode,fc as shouldLogBundlerDiagnostics,bc as tempBuildName,ls as withModuleSubstitutes};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{mu,qc,Te,Pi,hu,Os,Ds,Ns}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{hu as clearOnceStore,Pi as onceStore,Te as partialsCache,Os as processIncludes,Ds as processStackPushDirectives,Ns as processStackReplacements,mu as resetUnscopedSignalWarnings,qc as topLevelElements};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{sr,wc,Jd,xc,Yd,Sc,or,b,Nt,Ce,kc,vs,Cc,Zd,Y,_c,Qd,x,eu}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{_c as applyFilters,Yd as clearCustomFilters,kc as clientLoopScopes,sr as defaultFilters,b as escapeHtml,Nt as escapeHtmlValue,x as evaluateExpression,Sc as findMustacheEnd,xc as getAllFilters,Cc as interpolateScriptAttributes,vs as interpolateScriptExpressions,Zd as interpolateScriptsInTemplate,Y as processExpressions,wc as registerFilter,Jd as registerFilters,or as replaceInterpolations,Qd as resetRejectedExpressionWarnings,eu as unescapeHtml,Ce as usesSignalsInScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{bl}from"./chunk-13xvn7vh.js";import"./chunk-4x5zryhk.js";import"./chunk-ktg9khmj.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{bl as startProductionServer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xd,Sd}from"./chunk-z83p4bme.js";import"./chunk-btcc95hq.js";import"./chunk-ktg9khmj.js";import"./chunk-5rtatjwq.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{Sd as clearStoreCache,xd as getStoreScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$a,Fl,Ra,Aa,zl,Hl}from"./chunk-qh3b1w7q.js";import"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{Hl as applySlots,zl as extractSlotContent,Fl as parseSlotElement,$a as parseSlots,Aa as processSlots,Ra as renderSlot};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ua,pa}from"./chunk-qkczk53w.js";import"./chunk-0s6shhb3.js";import"./chunk-13xvn7vh.js";import"./chunk-x7jmchd5.js";import"./chunk-8vdsewsa.js";import"./chunk-d5nxsg1p.js";import"./chunk-qxr7e0y2.js";import"./chunk-frvn6psn.js";import{Eo}from"./chunk-4x5zryhk.js";import"./chunk-q3a13hvc.js";import"./chunk-5fxh7fc3.js";import"./chunk-8n306p92.js";import"./chunk-4h62y8dn.js";import"./chunk-34a1jdhq.js";import"./chunk-qh3b1w7q.js";import"./chunk-qzfq8342.js";import"./chunk-83h5ydvw.js";import"./chunk-45gz1yff.js";import"./chunk-8jqdb1qr.js";import"./chunk-5vs12p6m.js";import"./chunk-f6pjf3tb.js";import"./chunk-azj2cj8h.js";import"./chunk-wy93yhce.js";import"./chunk-hw97qw4k.js";import"./chunk-jbaedjyk.js";import"./chunk-s43pj9n6.js";import"./chunk-ewmpbxhv.js";import"./chunk-j4smj8cr.js";import"./chunk-z83p4bme.js";import"./chunk-th4x1wbc.js";import"./chunk-jskaacqy.js";import"./chunk-6fmcs19t.js";import"./chunk-dcs87qta.js";import"./chunk-d16jgsyv.js";import"./chunk-btcc95hq.js";import"./chunk-ktg9khmj.js";import"./chunk-5rtatjwq.js";import{ke,vn,wn,Z,d,n,gr,A,o,he}from"./chunk-5fa9g7x1.js";import"./chunk-q4t49t6z.js";import"./chunk-99rfdydy.js";import"./chunk-0zx1400y.js";import"./chunk-adn5r0r4.js";import"./chunk-nmh4pn44.js";import"./chunk-8dq3r6xw.js";import"./chunk-c9jav70j.js";import"./chunk-k1hpxgzq.js";import"./chunk-66e4ga0z.js";import"./chunk-2bcp699b.js";import"./chunk-1c0zvjt3.js";import"./chunk-mm8jdb4p.js";export{gr as buildWebComponents,wn as cacheTemplate,vn as checkCache,Eo as classifyAllScripts,ua as createMiddleware,pa as createRoute,A as defaultConfig,d as extractVariables,Z as injectRouterScript,o as loadStxConfig,ke as processClientScript,n as processDirectives,he as readMarkdownFile};