@stacksjs/stx 0.2.411 → 0.2.413

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 (151) hide show
  1. package/dist/builtins/image-delivery.d.ts +38 -0
  2. package/dist/builtins/image-delivery.js +17 -0
  3. package/dist/builtins/stx-image.js +1 -5
  4. package/dist/{chunk-btd7ds3x.js → chunk-0d0qeqvv.js} +1 -1
  5. package/dist/{chunk-zm4jetjz.js → chunk-0psndabd.js} +1 -1
  6. package/dist/{chunk-g5ny3aka.js → chunk-0qv8yf53.js} +1 -1
  7. package/dist/{chunk-q2ssypg6.js → chunk-0vkxyvsd.js} +1 -1
  8. package/dist/{chunk-73z5fzkn.js → chunk-0xqdmemy.js} +1 -1
  9. package/dist/{chunk-zyy4rakd.js → chunk-158wqccn.js} +12 -12
  10. package/dist/{chunk-aq1xq0r4.js → chunk-1cyxbb8y.js} +1 -1
  11. package/dist/{chunk-04tgatyy.js → chunk-1enwnh2a.js} +1 -1
  12. package/dist/{chunk-td08rnk3.js → chunk-213pzm0d.js} +1 -1
  13. package/dist/{chunk-8yfy9ch7.js → chunk-21hzqyja.js} +1 -1
  14. package/dist/{chunk-qvnbnsv9.js → chunk-24zher49.js} +1 -1
  15. package/dist/{chunk-cj3adc77.js → chunk-266t58b8.js} +1 -1
  16. package/dist/{chunk-90b2vt2n.js → chunk-2a9n102n.js} +1 -1
  17. package/dist/chunk-2eqzrczk.js +2 -0
  18. package/dist/{chunk-p4zrvt5f.js → chunk-2ke37m54.js} +1 -1
  19. package/dist/{chunk-hdysywd8.js → chunk-2snqdnk9.js} +1 -1
  20. package/dist/{chunk-1te8k8gp.js → chunk-35ds08e7.js} +1 -1
  21. package/dist/chunk-3mtwkjcg.js +2 -0
  22. package/dist/{chunk-36xaycje.js → chunk-4f9zyfdw.js} +19 -4
  23. package/dist/{chunk-50pszj17.js → chunk-4xr8zwkp.js} +1 -1
  24. package/dist/chunk-58v77x2c.js +2 -0
  25. package/dist/{chunk-9xew0kgf.js → chunk-5mhq8605.js} +1 -1
  26. package/dist/{chunk-zpcnbdhn.js → chunk-5se8xt9e.js} +2 -2
  27. package/dist/{chunk-tgadbsd4.js → chunk-5zh0h080.js} +1 -1
  28. package/dist/{chunk-y61n68ca.js → chunk-62435225.js} +1 -1
  29. package/dist/{chunk-vsbmc9kt.js → chunk-6n2rr3x7.js} +1 -1
  30. package/dist/{chunk-dzk2n4tv.js → chunk-6xk87qf2.js} +2 -2
  31. package/dist/{chunk-w4nspy4b.js → chunk-7ekd7zj9.js} +1 -1
  32. package/dist/{chunk-n2swas11.js → chunk-7pr3wdd5.js} +1 -1
  33. package/dist/{chunk-jr52y0j1.js → chunk-7rxvafwc.js} +1 -1
  34. package/dist/{chunk-zq4ssxj9.js → chunk-7tnwfa7w.js} +1 -1
  35. package/dist/chunk-8c5je0wf.js +2 -0
  36. package/dist/{chunk-kvmx7dnb.js → chunk-8dz6nyvx.js} +1 -1
  37. package/dist/{chunk-fpwzacpm.js → chunk-8sdhs0zk.js} +1 -1
  38. package/dist/{chunk-pan7wmdg.js → chunk-98zj3fv2.js} +2 -2
  39. package/dist/{chunk-2fw05hs2.js → chunk-ay6zjq8v.js} +1 -1
  40. package/dist/{chunk-gbmeh7jg.js → chunk-az4v4ard.js} +1 -1
  41. package/dist/chunk-ba5erggg.js +2 -0
  42. package/dist/chunk-bnagrdz6.js +2 -0
  43. package/dist/{chunk-5f0nwne4.js → chunk-bwjxk1dw.js} +2 -2
  44. package/dist/{chunk-spxsw4mp.js → chunk-by8wghtf.js} +1 -1
  45. package/dist/{chunk-00g9x6w2.js → chunk-cd7h4q51.js} +1 -1
  46. package/dist/{chunk-85sasgtc.js → chunk-cjmv8hgp.js} +1 -1
  47. package/dist/{chunk-ct1jwd4r.js → chunk-cthf912y.js} +1 -1
  48. package/dist/{chunk-9mm4e8hy.js → chunk-cxbpmwq5.js} +1 -1
  49. package/dist/chunk-d3sy16qn.js +2 -0
  50. package/dist/{chunk-1ws3xcea.js → chunk-dh6s7mrj.js} +1 -1
  51. package/dist/{chunk-0pkk226n.js → chunk-dm2nzg7a.js} +1 -1
  52. package/dist/{chunk-82pd4b5w.js → chunk-e2sgcnxc.js} +1 -1
  53. package/dist/chunk-e3b7jj74.js +2 -0
  54. package/dist/{chunk-mm9v8t7p.js → chunk-ec4wq2sv.js} +2 -2
  55. package/dist/{chunk-akwd34xt.js → chunk-ekzg97dn.js} +1 -1
  56. package/dist/chunk-epjt342x.js +2 -0
  57. package/dist/{chunk-60q6jwym.js → chunk-eqe26g14.js} +2 -2
  58. package/dist/chunk-ev0v1yma.js +2 -0
  59. package/dist/{chunk-m0ee1f3f.js → chunk-f53psr2y.js} +1 -1
  60. package/dist/{chunk-7kpr3fcp.js → chunk-f8p69dsg.js} +1 -1
  61. package/dist/{chunk-ph5wmtr9.js → chunk-f95drhdb.js} +1 -1
  62. package/dist/{chunk-esypgzzm.js → chunk-ff5a6hvb.js} +1 -1
  63. package/dist/chunk-fs5fy4h8.js +2 -0
  64. package/dist/chunk-fzsygce3.js +2 -0
  65. package/dist/chunk-g465x63k.js +2 -0
  66. package/dist/chunk-g708ekh1.js +2 -0
  67. package/dist/{chunk-9sxfybkc.js → chunk-gcr9e83g.js} +1 -1
  68. package/dist/{chunk-5zyeg43k.js → chunk-gdmyrsr8.js} +2 -2
  69. package/dist/{chunk-38wvkv3s.js → chunk-gkms2ngq.js} +1 -1
  70. package/dist/{chunk-rz9f3zqz.js → chunk-gnfywmgs.js} +2 -2
  71. package/dist/chunk-hpf8kq7e.js +2 -0
  72. package/dist/{chunk-0s34z9kx.js → chunk-j4x3faf8.js} +1 -1
  73. package/dist/chunk-jkavtw9f.js +2 -0
  74. package/dist/{chunk-563shnkz.js → chunk-kg1rdena.js} +2 -2
  75. package/dist/{chunk-t5ja7qkn.js → chunk-kgd8kchy.js} +1 -1
  76. package/dist/chunk-km91wx0v.js +2 -0
  77. package/dist/{chunk-1fs9jvpb.js → chunk-nk3czvnk.js} +1 -1
  78. package/dist/chunk-nmw4eewb.js +2 -0
  79. package/dist/{chunk-t1htzg9e.js → chunk-nq5zxrk0.js} +1 -1
  80. package/dist/{chunk-6kd5jjwc.js → chunk-p4wdxp2c.js} +1 -1
  81. package/dist/chunk-pdyeaxc1.js +2 -0
  82. package/dist/chunk-pf06ded4.js +2 -0
  83. package/dist/chunk-pfs0gpzm.js +2 -0
  84. package/dist/chunk-pshdwq44.js +2 -0
  85. package/dist/{chunk-s9za1vvd.js → chunk-pv3d7sfn.js} +1 -1
  86. package/dist/{chunk-x99xve3y.js → chunk-pwgv84pn.js} +2 -2
  87. package/dist/{chunk-92ysystz.js → chunk-pwsnafp3.js} +159 -159
  88. package/dist/chunk-qr346wnp.js +2 -0
  89. package/dist/{chunk-8w2mqdnv.js → chunk-r02hke04.js} +1 -1
  90. package/dist/chunk-ranshpyc.js +3 -0
  91. package/dist/{chunk-hyhba18z.js → chunk-rn194bhp.js} +1 -1
  92. package/dist/{chunk-gvbf1mhs.js → chunk-rn1hgyc8.js} +1 -1
  93. package/dist/{chunk-p5wp0ce6.js → chunk-s7z5dp70.js} +1 -1
  94. package/dist/{chunk-nvex8g39.js → chunk-smcj3442.js} +1 -1
  95. package/dist/{chunk-k80sn8d1.js → chunk-sn7exv0n.js} +1 -1
  96. package/dist/{chunk-bbt3tp6f.js → chunk-t6qx04s8.js} +1 -1
  97. package/dist/chunk-t6y6gyps.js +2 -0
  98. package/dist/chunk-tjfs7cc3.js +2 -0
  99. package/dist/chunk-tntv9hvq.js +2 -0
  100. package/dist/{chunk-gc06g35w.js → chunk-vd4cb5xr.js} +1 -1
  101. package/dist/{chunk-tgrpp58r.js → chunk-vkhdce50.js} +1 -1
  102. package/dist/{chunk-qmmp5kb5.js → chunk-w183av08.js} +1 -1
  103. package/dist/{chunk-fcnrgxck.js → chunk-w2m02njv.js} +1 -1
  104. package/dist/chunk-wpjrcrs5.js +2 -0
  105. package/dist/{chunk-pbnz7259.js → chunk-wqmppf6b.js} +1 -1
  106. package/dist/{chunk-1qq26zt0.js → chunk-wtb9fxdy.js} +1 -1
  107. package/dist/{chunk-esr0mfyc.js → chunk-xmzygmcz.js} +1 -1
  108. package/dist/{chunk-vx86cf4r.js → chunk-xssw417m.js} +1 -1
  109. package/dist/{chunk-naw4jt7j.js → chunk-xxzefj4j.js} +1 -1
  110. package/dist/{chunk-bn1edb1y.js → chunk-yq8x8bxq.js} +2 -2
  111. package/dist/{chunk-z5rwnnk1.js → chunk-ytma76qe.js} +1 -1
  112. package/dist/{chunk-603x5gb2.js → chunk-yw1m115e.js} +1 -1
  113. package/dist/{chunk-mq5ewmz6.js → chunk-z64a924m.js} +1 -1
  114. package/dist/cli.js +14 -14
  115. package/dist/craft-entry.js +1 -1
  116. package/dist/craft.js +1 -1
  117. package/dist/database.js +1 -1
  118. package/dist/index.d.ts +2 -0
  119. package/dist/index.js +1 -0
  120. package/dist/pwa.js +2 -2
  121. package/dist/ssg.js +2 -2
  122. package/dist/visual-testing.js +1 -1
  123. package/package.json +5 -5
  124. package/dist/chunk-1y6ejjrk.js +0 -2
  125. package/dist/chunk-213jwgpx.js +0 -3
  126. package/dist/chunk-21wkhpvg.js +0 -2
  127. package/dist/chunk-2a3vwvqv.js +0 -2
  128. package/dist/chunk-32mjs2sw.js +0 -2
  129. package/dist/chunk-3w6z6tw9.js +0 -2
  130. package/dist/chunk-5f6r72kw.js +0 -2
  131. package/dist/chunk-5jy3f138.js +0 -2
  132. package/dist/chunk-87egs73t.js +0 -2
  133. package/dist/chunk-a4vf72a0.js +0 -2
  134. package/dist/chunk-bcyw6frx.js +0 -2
  135. package/dist/chunk-cqn117hn.js +0 -2
  136. package/dist/chunk-ctpyb5qn.js +0 -2
  137. package/dist/chunk-g50agfg7.js +0 -2
  138. package/dist/chunk-j9760xb0.js +0 -2
  139. package/dist/chunk-jecj1xg9.js +0 -2
  140. package/dist/chunk-jxvmf02k.js +0 -2
  141. package/dist/chunk-khmgbnsa.js +0 -2
  142. package/dist/chunk-kj8wnz6f.js +0 -2
  143. package/dist/chunk-mgrckqww.js +0 -2
  144. package/dist/chunk-ndq5gnzs.js +0 -2
  145. package/dist/chunk-pjrn29gg.js +0 -2
  146. package/dist/chunk-q738pwv6.js +0 -2
  147. package/dist/chunk-smfnkpny.js +0 -2
  148. package/dist/chunk-w02zw7et.js +0 -2
  149. package/dist/chunk-wkanrfb3.js +0 -2
  150. package/dist/chunk-x4wjtspw.js +0 -2
  151. package/dist/chunk-xv1t91fk.js +0 -2
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{_t as H,bu as F}from"./chunk-1te8k8gp.js";import{ix as I}from"./chunk-2fw05hs2.js";import J from"fs";import z from"path";async function N(w,A,j){if(w.__stx_runtime_config)return;let b=H();if(b||j){w.__stx_runtime_config=b??F(j);return}let q=z.dirname(z.resolve(A));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((D)=>J.existsSync(z.join(q,D)))){let{loadStxConfig:D}=await import("./chunk-cqn117hn.js"),G=await D(q);if(G.runtimeConfig)w.__stx_runtime_config=F(G.runtimeConfig);return}let B=z.dirname(q);if(B===q)return;q=B}}async function O(w,A){function j(b){if(b===null)return"null";if(Array.isArray(b))return`Array<${b.length?[...new Set(b.map(j))].join(" | "):"unknown"}>`;if(typeof b==="object")return`{ ${Object.entries(b).map(([q,B])=>`readonly ${JSON.stringify(q)}: ${j(B)}`).join("; ")} }`;return typeof b}await Bun.write(z.join(w,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
2
+ import{au as H,du as F}from"./chunk-35ds08e7.js";import{kx as I}from"./chunk-ay6zjq8v.js";import J from"fs";import z from"path";async function N(w,A,j){if(w.__stx_runtime_config)return;let b=H();if(b||j){w.__stx_runtime_config=b??F(j);return}let q=z.dirname(z.resolve(A));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((D)=>J.existsSync(z.join(q,D)))){let{loadStxConfig:D}=await import("./chunk-tntv9hvq.js"),G=await D(q);if(G.runtimeConfig)w.__stx_runtime_config=F(G.runtimeConfig);return}let B=z.dirname(q);if(B===q)return;q=B}}async function O(w,A){function j(b){if(b===null)return"null";if(Array.isArray(b))return`Array<${b.length?[...new Set(b.map(j))].join(" | "):"unknown"}>`;if(typeof b==="object")return`{ ${Object.entries(b).map(([q,B])=>`readonly ${JSON.stringify(q)}: ${j(B)}`).join("; ")} }`;return typeof b}await Bun.write(z.join(w,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${j(A.public??{})} }
4
4
  `),await Bun.write(z.join(w,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${j(A.private??{})} }
6
6
  `)}
7
- export{N as Xt,O as Yt};
7
+ export{N as Zt,O as _t};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function j(a){return this[a]}var m=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:j.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var k=(a)=>a;function l(a,b){this[a]=k.bind(null,b)}var n=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:l.bind(b,c)})};var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=import.meta.require;
3
- export{m as fx,n as gx,o as hx,p as ix};
3
+ export{m as hx,n as ix,o as jx,p as kx};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import F from"fs";import y from"path";var U=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,D=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],H=3;function k(j,q){let J=y.resolve(y.dirname(q),j);for(let Q of D){let z=J+Q;try{if(F.statSync(z).isFile())return z}catch{}}return null}function K(j,q,J=0,Q=new Set){if(!q||J>=H)return!1;for(let z of j.matchAll(g)){let Z=k(z[1],q);if(!Z||Q.has(Z))continue;Q.add(Z);let $;try{$=F.readFileSync(Z,"utf8")}catch{continue}if(U.test($))return!0;if(K($,Z,J+1,Q))return!0}return!1}var Y=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],d=["onMount","onDestroy"];function p(j="const",q=[],J){let Q=q.length?Y.filter((z)=>!q.includes(z)):Y;if(J!==void 0)Q=Q.filter((z)=>{let Z=z.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${Z}(?![\\w$])`).test(J)});return`${j} { ${Q.join(", ")} } = window.stx;`}var x=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"],T={useServerData:{category:"server-only",reason:"loads and serializes request-scoped data from <script server>; clients consume it through a keyed useFetch/useAsyncData."},redirect:{category:"server-only",reason:"returns an HTTP Response for <script server>/edge/build; use navigate() on the client."},useAsyncData:{category:"browser-composable",reason:"inlined on demand from src/composables when a script references it; reachable, not a bare global."},Teleport:{category:"compile-time-directive",reason:"template tag resolved by processTeleportDirectives; not a script callable."},StxModalBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; drive open/close from the modal store."},StxToastBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; push toasts via the toast store."},useForm:{category:"browser-composable",reason:"reactive form primitive; lives in src/composables/use-form.ts and is inlined on demand when a <script client> references it (#1846)."},defineForm:{category:"browser-composable",reason:"deprecated alias of useForm, kept for a minor (#1843). Same delivery path \u2014 inlined on demand from src/composables/use-form.ts."},validateFields:{category:"isomorphic-import",reason:"pure validation helper; import it directly, not auto-delivered to <script client> (per client-api-delivery.test.ts)."},validateField:{category:"isomorphic-import",reason:"singular pure validation helper; same explicit-import boundary as validateFields."}},O=Y.filter((j)=>!x.includes(j));function P(j){if(!j)return!1;return O.some((q)=>new RegExp(`\\b${q}\\s*(?:<[^>]*>)?\\s*\\(`).test(j))}var C=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],u=/\s@[a-z][\w.:-]*\s*=/i;function _(j,q){if(!j)return!1;let J=X(j);return G(J,q)}function G(j,q){if(C.some((J)=>J.test(j)))return!0;if(P(j))return!0;return M(j,q)}function M(j,q){if(!q)return!1;for(let J of j.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(K(J[1],q))return!0;return!1}function E(j,q){if(!j)return!1;let J=X(j);return u.test(J)||G(J,q)}var b=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function c(j){return b.includes(j.toLowerCase())}var V=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],f=["x-init","x-transition","x-effect","x-on"],r=[...V,...f];function h(){return`{${V.map((j)=>`'${j}':1`).join(",")}}`}var L=["class","style","text","html","show","model","if","ref"];function o(){return`{${L.map((j)=>j==="if"?"'if':1":`${j}:1`).join(",")}}`}var B=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function i(){return`/^(${B.join("|")})/`}function s(j){return B.some((q)=>j===q||j.startsWith(`${q}.`))}var S=65536,v=4,w=new Map;function m(){w.clear()}function X(j){if(!j)return j;if(!j.includes("<!--")&&!/<(?:pre|code)\b/i.test(j))return j;let q=j.length>=S;if(q){let z=w.get(j);if(z!==void 0)return z}let J=(z)=>z.replace(/(<[^>]*>)|([^<]+)/g,(Z,$,W)=>$??" ".repeat(W.length)),Q=j.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/<!--[\s\S]*?-->/g,(z)=>" ".repeat(z.length));if(q){while(w.size>=v){let z=w.keys().next();if(z.done)break;w.delete(z.value)}w.set(j,Q)}return Q}
3
- export{K as Nv,Y as Ov,d as Pv,p as Qv,x as Rv,T as Sv,O as Tv,P as Uv,_ as Vv,E as Wv,b as Xv,c as Yv,V as Zv,f as _v,r as $v,h as aw,L as bw,o as cw,B as dw,i as ew,s as fw,m as gw,X as hw};
3
+ export{K as Pv,Y as Qv,d as Rv,p as Sv,x as Tv,T as Uv,O as Vv,P as Wv,_ as Xv,E as Yv,b as Zv,c as _v,V as $v,f as aw,r as bw,h as cw,L as dw,o as ew,B as fw,i as gw,s as hw,m as iw,X as jw};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{so as b,to as c,uo as d}from"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import{Hv as a}from"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{b as rendersAsElement,c as processESImports,d as processComponents,a as freeIdentifiers};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$p as d,Zp as b,_p as c,aq as e,yo as a}from"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{d as validateClientScript,c as processOnceDirective,b as processJsonDirective,e as processDirectives,a as injectRouterScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{a as x,b as u,c as b,d as Az,e as G,f as d,h as y,i as I,j as Uz,k as v}from"./chunk-0y46fbkx.js";import{l as h,m as f,n as g}from"./chunk-q9n5swx7.js";import{Wo as V}from"./chunk-92ysystz.js";import"./chunk-aq1xq0r4.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-x99xve3y.js";import"./chunk-tkyrk66a.js";import"./chunk-213jwgpx.js";import"./chunk-pan7wmdg.js";import"./chunk-1te8k8gp.js";import"./chunk-zpcnbdhn.js";import"./chunk-rz9f3zqz.js";import"./chunk-bn1edb1y.js";import"./chunk-cj3adc77.js";import"./chunk-t1htzg9e.js";import"./chunk-gbmeh7jg.js";import"./chunk-36xaycje.js";import"./chunk-vx86cf4r.js";import"./chunk-563shnkz.js";import{ix as F}from"./chunk-2fw05hs2.js";import l from"fs";import R from"path";function m(z,J){let Z=[R.join(z.root,"stx.config.ts"),R.join(z.root,"stx.config.js"),R.join(z.root,"stx.config.mjs")],K=J.debounceMs??300,$=null,X=[];for(let B of Z)try{if(!l.existsSync(B))continue;let Y=l.watch(B,(W)=>{if(W==="change"){if($)clearTimeout($);$=setTimeout(async()=>{d("Config file changed, restarting...");try{await J.onChange()}catch(j){G(`Failed to restart: ${j}`)}},K)}});X.push(Y)}catch{}return{stop(){if($)clearTimeout($);for(let B of X)B.close()}}}import E from"fs";import i from"path";var Gz=".stx/story/analytics.json",Nz=1,c=1e4;class M{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(z){this.storagePath=i.join(z,Gz),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let z=E.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Nz,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let z=i.dirname(this.storagePath);if(await E.promises.mkdir(z,{recursive:!0}),this.storage.events.length>c)this.storage.events=this.storage.events.slice(-c);await E.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:Hz(),startTime:Date.now(),componentViews:[]},this.storage.sessions.push(this.currentSession),this.dirty=!0}endSession(){if(this.currentSession)this.currentSession.endTime=Date.now(),this.currentSession=null}track(z){this.storage.events.push({...z,timestamp:Date.now()}),this.dirty=!0}trackView(z,J){if(this.endViewTiming(z),this.viewStartTimes.set(z,Date.now()),this.track({type:"view",componentId:z,variantId:J}),this.currentSession&&!this.currentSession.componentViews.includes(z))this.currentSession.componentViews.push(z)}endViewTiming(z){let J=this.viewStartTimes.get(z);if(J){let Z=Date.now()-J;this.track({type:"view",componentId:z,metadata:{duration:Z,endView:!0}}),this.viewStartTimes.delete(z)}}trackPropChange(z,J,Z){this.track({type:"prop_change",componentId:z,propName:J,metadata:{value:Z}})}trackVariantSwitch(z,J){this.track({type:"variant_switch",componentId:z,variantId:J})}trackSearch(z,J){this.track({type:"search",query:z,metadata:{resultCount:J}})}getComponentAnalytics(z,J){let Z=this.storage.events.filter((Q)=>Q.componentId===z),K=Z.filter((Q)=>Q.type==="view"&&!Q.metadata?.endView),$=Z.filter((Q)=>Q.type==="prop_change"),X=Z.filter((Q)=>Q.type==="variant_switch"),B={};for(let Q of $)if(Q.propName)B[Q.propName]=(B[Q.propName]||0)+1;let Y={};for(let Q of X)if(Q.variantId)Y[Q.variantId]=(Y[Q.variantId]||0)+1;let W=new Set(this.storage.sessions.filter((Q)=>Q.componentViews.includes(z)).map((Q)=>Q.id)),j=Z.filter((Q)=>Q.metadata?.duration).map((Q)=>Q.metadata.duration),U=j.length>0?j.reduce((Q,D)=>Q+D,0)/j.length:0,_=Object.entries(B).sort((Q,D)=>D[1]-Q[1]).slice(0,5).map(([Q])=>Q);return{componentId:z,componentName:J,viewCount:K.length,uniqueViews:W.size,lastViewed:K[K.length-1]?.timestamp,propChanges:B,topChangedProps:_,variantViews:Y,avgTimeSpent:U}}getMostViewedComponents(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="view"&&Z.componentId&&!Z.metadata?.endView)J.set(Z.componentId,(J.get(Z.componentId)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({componentId:Z,viewCount:K})).sort((Z,K)=>K.viewCount-Z.viewCount).slice(0,z)}getMostChangedProps(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="prop_change"&&Z.propName)J.set(Z.propName,(J.get(Z.propName)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({propName:Z,changeCount:K})).sort((Z,K)=>K.changeCount-Z.changeCount).slice(0,z)}getSearchAnalytics(){let z=this.storage.events.filter(($)=>$.type==="search"),J=new Map,Z=0;for(let $ of z){if($.query)J.set($.query,(J.get($.query)||0)+1);if($.metadata?.resultCount!==void 0)Z+=$.metadata.resultCount}let K=Array.from(J.entries()).map(([$,X])=>({query:$,count:X})).sort(($,X)=>X.count-$.count).slice(0,10);return{totalSearches:z.length,topQueries:K,avgResultCount:z.length>0?Z/z.length:0}}clear(){this.storage.events=[],this.storage.sessions=[],this.dirty=!0,this.startSession()}exportAnalytics(){return JSON.stringify({exportedAt:Date.now(),...this.storage},null,2)}}function Hz(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import P from"fs";import p from"path";var Fz=".stx/story/bookmarks.json",Vz=1;class T{storage;storagePath;dirty=!1;constructor(z){this.storagePath=p.join(z,Fz),this.storage=this.loadStorage()}loadStorage(){try{let z=P.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Vz,bookmarks:[]}}}async save(){if(!this.dirty)return;let z=p.dirname(this.storagePath);await P.promises.mkdir(z,{recursive:!0}),await P.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(z,J,Z,K={}){let $={id:Rz(),name:K.name||`${z}/${J}`,storyId:z,variantId:J,props:Z,created:Date.now(),notes:K.notes,color:K.color};return this.storage.bookmarks.push($),this.dirty=!0,$}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(z){return this.storage.bookmarks.filter((J)=>J.storyId===z)}getBookmark(z){return this.storage.bookmarks.find((J)=>J.id===z)}isBookmarked(z,J){return this.storage.bookmarks.some((Z)=>Z.storyId===z&&Z.variantId===J)}updateBookmark(z,J){let Z=this.getBookmark(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deleteBookmark(z){let J=this.storage.bookmarks.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.bookmarks.splice(J,1),this.dirty=!0,!0}toggleBookmark(z,J,Z){let K=this.storage.bookmarks.find((X)=>X.storyId===z&&X.variantId===J);if(K)return this.deleteBookmark(K.id),{added:!1};return{added:!0,bookmark:this.addBookmark(z,J,Z)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(z,J=!0){let Z=JSON.parse(z),K=0;for(let $ of Z.bookmarks){if(J){let X=this.storage.bookmarks.find((B)=>B.id===$.id);if(X)Object.assign(X,$);else this.storage.bookmarks.push($)}else this.storage.bookmarks.push($);K++}if(K>0)this.dirty=!0;return K}}function Rz(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var N=new Set;function s(){return{open(z){N.add(z),z.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(z){N.delete(z)},message(z,J){}}}function q(z){let J=JSON.stringify({...z,timestamp:z.timestamp||Date.now()});for(let Z of N)try{Z.send(J)}catch{N.delete(Z)}}function n(z,J){q({type:"story-update",data:{storyId:z,...J}})}function a(z,J){q({type:"story-add",data:{storyId:z,...J}})}function o(z){q({type:"story-remove",data:{storyId:z}})}function r(z){return`
2
+ import{a as x,b as u,c as b,d as Az,e as G,f as d,h as y,i as I,j as Uz,k as v}from"./chunk-0y46fbkx.js";import{l as h,m as f,n as g}from"./chunk-q9n5swx7.js";import{Wo as V}from"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import{kx as F}from"./chunk-ay6zjq8v.js";import l from"fs";import R from"path";function m(z,J){let Z=[R.join(z.root,"stx.config.ts"),R.join(z.root,"stx.config.js"),R.join(z.root,"stx.config.mjs")],K=J.debounceMs??300,$=null,X=[];for(let B of Z)try{if(!l.existsSync(B))continue;let Y=l.watch(B,(W)=>{if(W==="change"){if($)clearTimeout($);$=setTimeout(async()=>{d("Config file changed, restarting...");try{await J.onChange()}catch(j){G(`Failed to restart: ${j}`)}},K)}});X.push(Y)}catch{}return{stop(){if($)clearTimeout($);for(let B of X)B.close()}}}import E from"fs";import i from"path";var Gz=".stx/story/analytics.json",Nz=1,c=1e4;class M{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(z){this.storagePath=i.join(z,Gz),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let z=E.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Nz,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let z=i.dirname(this.storagePath);if(await E.promises.mkdir(z,{recursive:!0}),this.storage.events.length>c)this.storage.events=this.storage.events.slice(-c);await E.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:Hz(),startTime:Date.now(),componentViews:[]},this.storage.sessions.push(this.currentSession),this.dirty=!0}endSession(){if(this.currentSession)this.currentSession.endTime=Date.now(),this.currentSession=null}track(z){this.storage.events.push({...z,timestamp:Date.now()}),this.dirty=!0}trackView(z,J){if(this.endViewTiming(z),this.viewStartTimes.set(z,Date.now()),this.track({type:"view",componentId:z,variantId:J}),this.currentSession&&!this.currentSession.componentViews.includes(z))this.currentSession.componentViews.push(z)}endViewTiming(z){let J=this.viewStartTimes.get(z);if(J){let Z=Date.now()-J;this.track({type:"view",componentId:z,metadata:{duration:Z,endView:!0}}),this.viewStartTimes.delete(z)}}trackPropChange(z,J,Z){this.track({type:"prop_change",componentId:z,propName:J,metadata:{value:Z}})}trackVariantSwitch(z,J){this.track({type:"variant_switch",componentId:z,variantId:J})}trackSearch(z,J){this.track({type:"search",query:z,metadata:{resultCount:J}})}getComponentAnalytics(z,J){let Z=this.storage.events.filter((Q)=>Q.componentId===z),K=Z.filter((Q)=>Q.type==="view"&&!Q.metadata?.endView),$=Z.filter((Q)=>Q.type==="prop_change"),X=Z.filter((Q)=>Q.type==="variant_switch"),B={};for(let Q of $)if(Q.propName)B[Q.propName]=(B[Q.propName]||0)+1;let Y={};for(let Q of X)if(Q.variantId)Y[Q.variantId]=(Y[Q.variantId]||0)+1;let W=new Set(this.storage.sessions.filter((Q)=>Q.componentViews.includes(z)).map((Q)=>Q.id)),j=Z.filter((Q)=>Q.metadata?.duration).map((Q)=>Q.metadata.duration),U=j.length>0?j.reduce((Q,D)=>Q+D,0)/j.length:0,_=Object.entries(B).sort((Q,D)=>D[1]-Q[1]).slice(0,5).map(([Q])=>Q);return{componentId:z,componentName:J,viewCount:K.length,uniqueViews:W.size,lastViewed:K[K.length-1]?.timestamp,propChanges:B,topChangedProps:_,variantViews:Y,avgTimeSpent:U}}getMostViewedComponents(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="view"&&Z.componentId&&!Z.metadata?.endView)J.set(Z.componentId,(J.get(Z.componentId)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({componentId:Z,viewCount:K})).sort((Z,K)=>K.viewCount-Z.viewCount).slice(0,z)}getMostChangedProps(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="prop_change"&&Z.propName)J.set(Z.propName,(J.get(Z.propName)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({propName:Z,changeCount:K})).sort((Z,K)=>K.changeCount-Z.changeCount).slice(0,z)}getSearchAnalytics(){let z=this.storage.events.filter(($)=>$.type==="search"),J=new Map,Z=0;for(let $ of z){if($.query)J.set($.query,(J.get($.query)||0)+1);if($.metadata?.resultCount!==void 0)Z+=$.metadata.resultCount}let K=Array.from(J.entries()).map(([$,X])=>({query:$,count:X})).sort(($,X)=>X.count-$.count).slice(0,10);return{totalSearches:z.length,topQueries:K,avgResultCount:z.length>0?Z/z.length:0}}clear(){this.storage.events=[],this.storage.sessions=[],this.dirty=!0,this.startSession()}exportAnalytics(){return JSON.stringify({exportedAt:Date.now(),...this.storage},null,2)}}function Hz(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import P from"fs";import p from"path";var Fz=".stx/story/bookmarks.json",Vz=1;class T{storage;storagePath;dirty=!1;constructor(z){this.storagePath=p.join(z,Fz),this.storage=this.loadStorage()}loadStorage(){try{let z=P.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Vz,bookmarks:[]}}}async save(){if(!this.dirty)return;let z=p.dirname(this.storagePath);await P.promises.mkdir(z,{recursive:!0}),await P.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(z,J,Z,K={}){let $={id:Rz(),name:K.name||`${z}/${J}`,storyId:z,variantId:J,props:Z,created:Date.now(),notes:K.notes,color:K.color};return this.storage.bookmarks.push($),this.dirty=!0,$}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(z){return this.storage.bookmarks.filter((J)=>J.storyId===z)}getBookmark(z){return this.storage.bookmarks.find((J)=>J.id===z)}isBookmarked(z,J){return this.storage.bookmarks.some((Z)=>Z.storyId===z&&Z.variantId===J)}updateBookmark(z,J){let Z=this.getBookmark(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deleteBookmark(z){let J=this.storage.bookmarks.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.bookmarks.splice(J,1),this.dirty=!0,!0}toggleBookmark(z,J,Z){let K=this.storage.bookmarks.find((X)=>X.storyId===z&&X.variantId===J);if(K)return this.deleteBookmark(K.id),{added:!1};return{added:!0,bookmark:this.addBookmark(z,J,Z)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(z,J=!0){let Z=JSON.parse(z),K=0;for(let $ of Z.bookmarks){if(J){let X=this.storage.bookmarks.find((B)=>B.id===$.id);if(X)Object.assign(X,$);else this.storage.bookmarks.push($)}else this.storage.bookmarks.push($);K++}if(K>0)this.dirty=!0;return K}}function Rz(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var N=new Set;function s(){return{open(z){N.add(z),z.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(z){N.delete(z)},message(z,J){}}}function q(z){let J=JSON.stringify({...z,timestamp:z.timestamp||Date.now()});for(let Z of N)try{Z.send(J)}catch{N.delete(Z)}}function n(z,J){q({type:"story-update",data:{storyId:z,...J}})}function a(z,J){q({type:"story-add",data:{storyId:z,...J}})}function o(z){q({type:"story-remove",data:{storyId:z}})}function r(z){return`
3
3
  <script>
4
4
  (function() {
5
5
  const ws = new WebSocket('${z}');
@@ -556,7 +556,7 @@ window.__stxPerformance = {
556
556
 
557
557
  window.clearPerformanceMetrics = () => window.__stxPerformance.clear();
558
558
  </script>
559
- `}import w from"fs";import Xz from"path";var Mz=".stx/story/presets.json",C=1,Pz=10;class k{storage;storagePath;dirty=!1;constructor(z){this.storagePath=Xz.join(z,Mz),this.storage=this.loadStorage()}loadStorage(){try{let z=w.readFileSync(this.storagePath,"utf-8"),J=JSON.parse(z);if(J.version!==C)return this.migrateStorage(J);return J}catch{return{version:C,presets:[],recentIds:[]}}}migrateStorage(z){return{version:C,presets:z.presets||[],recentIds:z.recentIds||[]}}async save(){if(!this.dirty)return;let z=Xz.dirname(this.storagePath);await w.promises.mkdir(z,{recursive:!0}),await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(z,J,Z={}){let K={id:Tz(),name:z,description:Z.description,props:J,componentId:Z.componentId,created:Date.now(),usageCount:0,tags:Z.tags};return this.storage.presets.push(K),this.dirty=!0,K}getPreset(z){return this.storage.presets.find((J)=>J.id===z)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(z){return this.storage.presets.filter((J)=>!J.componentId||J.componentId===z)}getRecentPresets(){return this.storage.recentIds.map((z)=>this.getPreset(z)).filter((z)=>z!==void 0)}usePreset(z){let J=this.getPreset(z);if(!J)return;return J.lastUsed=Date.now(),J.usageCount++,this.storage.recentIds=[z,...this.storage.recentIds.filter((Z)=>Z!==z)].slice(0,Pz),this.dirty=!0,J}updatePreset(z,J){let Z=this.getPreset(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deletePreset(z){let J=this.storage.presets.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.presets.splice(J,1),this.storage.recentIds=this.storage.recentIds.filter((Z)=>Z!==z),this.dirty=!0,!0}searchPresets(z){let J=z.toLowerCase();return this.storage.presets.filter((Z)=>{if(Z.name.toLowerCase().includes(J))return!0;if(Z.description?.toLowerCase().includes(J))return!0;if(Z.tags?.some((K)=>K.toLowerCase().includes(J)))return!0;return!1})}getMostUsedPresets(z=5){return[...this.storage.presets].sort((J,Z)=>Z.usageCount-J.usageCount).slice(0,z)}exportPresets(z){let J=z?this.storage.presets.filter((Z)=>z.includes(Z.id)):this.storage.presets;return JSON.stringify({presets:J},null,2)}importPresets(z,J=!1){let Z=JSON.parse(z),K=0;for(let $ of Z.presets){let X=this.storage.presets.find((B)=>B.id===$.id);if(X&&!J)continue;if(X)Object.assign(X,$);else this.storage.presets.push($);K++}if(K>0)this.dirty=!0;return K}}function Tz(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";var Qz=new Map;async function H(z,J,Z={}){let K=performance.now(),$=[];try{let X=await S.promises.stat(J),B=Qz.get(J),Y;if(B&&B.mtime===X.mtimeMs)Y=B.content;else Y=await S.promises.readFile(J,"utf-8"),Qz.set(J,{content:Y,mtime:X.mtimeMs,analyzed:null});let{processDirectives:W}=await import("./chunk-kj8wnz6f.js"),j={},U=A(Y);if(U)try{await V(U,j,J)}catch(O){$.push(`Warning: Could not extract script variables: ${O instanceof Error?O.message:String(O)}`)}if(Z.props)Object.assign(j,Z.props);let Q=await W(Y,j,J,{},new Set),D=Wz(Y),L=A(Y);return Q=jz(Q),Q=Dz(Q,j),{html:Q,css:D,js:L,errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}async function qz(z){try{let J=await S.promises.readFile(z,"utf-8"),Z=A(J);if(!Z)return null;let K={};if(await V(Z,K,z),Array.isArray(K.variants))return K.variants;return null}catch{return null}}async function Bz(z,J,Z,K){let $=J.story?.variants;if(!$){let Y=await qz(J.path);if(Y)$=Y}if(!$&&Z==="default")return H(z,J.path,{props:K||{}});if(!$)return H(z,J.path,{props:K||{}});let X=$.find((Y)=>Y.id===Z);if(!X&&Z==="default")return H(z,J.path,{props:K||{}});if(!X)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${Z}' not found`],duration:0};let B={...X.state,...K};if(X.source)return wz(z,X.source,B);return H(z,J.path,{props:B})}async function wz(z,J,Z={}){let K=performance.now(),$=[];try{let{processDirectives:X}=await import("./chunk-kj8wnz6f.js"),B={...Z},Y=A(J);if(Y)try{await V(Y,B,"inline-template.stx")}catch{}let j=await X(J,B,"inline-template.stx",{},new Set);return j=jz(j),j=Dz(j,B),{html:j,css:Wz(J),js:A(J),errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}function Wz(z){let J=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
559
+ `}import w from"fs";import Xz from"path";var Mz=".stx/story/presets.json",C=1,Pz=10;class k{storage;storagePath;dirty=!1;constructor(z){this.storagePath=Xz.join(z,Mz),this.storage=this.loadStorage()}loadStorage(){try{let z=w.readFileSync(this.storagePath,"utf-8"),J=JSON.parse(z);if(J.version!==C)return this.migrateStorage(J);return J}catch{return{version:C,presets:[],recentIds:[]}}}migrateStorage(z){return{version:C,presets:z.presets||[],recentIds:z.recentIds||[]}}async save(){if(!this.dirty)return;let z=Xz.dirname(this.storagePath);await w.promises.mkdir(z,{recursive:!0}),await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(z,J,Z={}){let K={id:Tz(),name:z,description:Z.description,props:J,componentId:Z.componentId,created:Date.now(),usageCount:0,tags:Z.tags};return this.storage.presets.push(K),this.dirty=!0,K}getPreset(z){return this.storage.presets.find((J)=>J.id===z)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(z){return this.storage.presets.filter((J)=>!J.componentId||J.componentId===z)}getRecentPresets(){return this.storage.recentIds.map((z)=>this.getPreset(z)).filter((z)=>z!==void 0)}usePreset(z){let J=this.getPreset(z);if(!J)return;return J.lastUsed=Date.now(),J.usageCount++,this.storage.recentIds=[z,...this.storage.recentIds.filter((Z)=>Z!==z)].slice(0,Pz),this.dirty=!0,J}updatePreset(z,J){let Z=this.getPreset(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deletePreset(z){let J=this.storage.presets.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.presets.splice(J,1),this.storage.recentIds=this.storage.recentIds.filter((Z)=>Z!==z),this.dirty=!0,!0}searchPresets(z){let J=z.toLowerCase();return this.storage.presets.filter((Z)=>{if(Z.name.toLowerCase().includes(J))return!0;if(Z.description?.toLowerCase().includes(J))return!0;if(Z.tags?.some((K)=>K.toLowerCase().includes(J)))return!0;return!1})}getMostUsedPresets(z=5){return[...this.storage.presets].sort((J,Z)=>Z.usageCount-J.usageCount).slice(0,z)}exportPresets(z){let J=z?this.storage.presets.filter((Z)=>z.includes(Z.id)):this.storage.presets;return JSON.stringify({presets:J},null,2)}importPresets(z,J=!1){let Z=JSON.parse(z),K=0;for(let $ of Z.presets){let X=this.storage.presets.find((B)=>B.id===$.id);if(X&&!J)continue;if(X)Object.assign(X,$);else this.storage.presets.push($);K++}if(K>0)this.dirty=!0;return K}}function Tz(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";var Qz=new Map;async function H(z,J,Z={}){let K=performance.now(),$=[];try{let X=await S.promises.stat(J),B=Qz.get(J),Y;if(B&&B.mtime===X.mtimeMs)Y=B.content;else Y=await S.promises.readFile(J,"utf-8"),Qz.set(J,{content:Y,mtime:X.mtimeMs,analyzed:null});let{processDirectives:W}=await import("./chunk-bnagrdz6.js"),j={},U=A(Y);if(U)try{await V(U,j,J)}catch(O){$.push(`Warning: Could not extract script variables: ${O instanceof Error?O.message:String(O)}`)}if(Z.props)Object.assign(j,Z.props);let Q=await W(Y,j,J,{},new Set),D=Wz(Y),L=A(Y);return Q=jz(Q),Q=Dz(Q,j),{html:Q,css:D,js:L,errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}async function qz(z){try{let J=await S.promises.readFile(z,"utf-8"),Z=A(J);if(!Z)return null;let K={};if(await V(Z,K,z),Array.isArray(K.variants))return K.variants;return null}catch{return null}}async function Bz(z,J,Z,K){let $=J.story?.variants;if(!$){let Y=await qz(J.path);if(Y)$=Y}if(!$&&Z==="default")return H(z,J.path,{props:K||{}});if(!$)return H(z,J.path,{props:K||{}});let X=$.find((Y)=>Y.id===Z);if(!X&&Z==="default")return H(z,J.path,{props:K||{}});if(!X)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${Z}' not found`],duration:0};let B={...X.state,...K};if(X.source)return wz(z,X.source,B);return H(z,J.path,{props:B})}async function wz(z,J,Z={}){let K=performance.now(),$=[];try{let{processDirectives:X}=await import("./chunk-bnagrdz6.js"),B={...Z},Y=A(J);if(Y)try{await V(Y,B,"inline-template.stx")}catch{}let j=await X(J,B,"inline-template.stx",{},new Set);return j=jz(j),j=Dz(j,B),{html:j,css:Wz(J),js:A(J),errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}function Wz(z){let J=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
560
560
  `)}function jz(z){return z.replace(/<!--[\s\S]*?-->/g,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/^\s*\n/gm,"").trim()}function A(z){let J=[],Z=/<script\b[^>]*>([\s\S]*?)<\/script>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
561
561
  `)}function Dz(z,J){let Z=`<script>window.__stxProps = ${JSON.stringify(J)};</script>`;return z+Z}function Lz(z){return z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function Oz(z,J){let Z=await I(z);f(z,Z);let K=v(z.config,Z);g(z,K),console.log(` Found ${Z.length} story files`);let $=typeof J.host==="string"?J.host:J.host===!0?"0.0.0.0":"localhost",X=new k(z.root),B=new T(z.root),Y=new M(z.root),W=s(),j=Bun.serve({port:J.port,hostname:$,fetch:async(Q,D)=>{let O=new URL(Q.url).pathname;if(O==="/__hmr"){if(D.upgrade(Q,{data:{isHmr:!0}}))return;return new Response("WebSocket upgrade failed",{status:400})}if(O.startsWith("/api/"))return Cz(z,O,Q,{presetsManager:X,bookmarksManager:B,analyticsTracker:Y});return kz(z,O,J.port)},websocket:{open(Q){W.open(Q)},close(Q){W.close(Q)},message(Q,D){W.message(Q,D)}}}),U=`http://${$}:${J.port}`,_=Uz(z,async(Q,D)=>{console.log(` [${Q}] ${D.relativePath}`);let L=await I(z);f(z,L);let O=v(z.config,L);if(g(z,O),Q==="add")a(D.id,{fileName:D.fileName});else if(Q==="unlink")o(D.id);else n(D.id,{fileName:D.fileName})});if(J.open){let Q=U;try{let{exec:D}=await import("child_process"),L=process.platform;D(`${L==="darwin"?"open":L==="win32"?"start":"xdg-open"} ${Q}`)}catch{}}return{server:j,url:U,close:async()=>{_(),j.stop()}}}async function Cz(z,J,Z,K){let{presetsManager:$,bookmarksManager:X,analyticsTracker:B}=K;if(J==="/api/stories")return Response.json({files:z.storyFiles.map((Y)=>({id:Y.id,fileName:Y.fileName,relativePath:Y.relativePath,treePath:Y.treePath})),tree:z.tree});if(J.startsWith("/api/story/")){let Y=J.slice(11),W=z.storyFiles.find((j)=>j.id===Y);if(!W)return new Response("Story not found",{status:404});try{let j=await Bun.file(W.path).text();return Response.json({id:W.id,fileName:W.fileName,relativePath:W.relativePath,content:j})}catch{return new Response("Error reading story",{status:500})}}if(J==="/api/config")return Response.json({theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets});if(J.startsWith("/api/render/")){let Y=new URL(Z.url),W=J.slice(12).split("/"),j=W[0],U=W[1]||"default",_,Q=Y.searchParams.get("props");if(Q)try{_=JSON.parse(Q)}catch{}let D=z.storyFiles.find((L)=>L.id===j);if(!D)return new Response("Story not found",{status:404});try{let L=await Bz(z,D,U,_);return Response.json({html:L.html,css:L.css,js:L.js,errors:L.errors,duration:L.duration})}catch(L){return Response.json({html:"",css:"",js:"",errors:[L instanceof Error?L.message:String(L)],duration:0},{status:500})}}if(J==="/api/presets"&&Z.method==="GET")return Response.json({presets:$.getAllPresets()});if(J==="/api/presets"&&Z.method==="POST")try{let Y=await Z.json(),W=$.createPreset(Y.name,Y.props,{componentId:Y.componentId,description:Y.description});return await $.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J.startsWith("/api/presets/")&&!J.includes("/use")&&Z.method==="GET"){let Y=J.slice(13),W=$.getPreset(Y);if(!W)return new Response("Preset not found",{status:404});return Response.json(W)}if(J.endsWith("/use")&&Z.method==="POST"){let Y=J.slice(13,-4),W=$.usePreset(Y);if(!W)return new Response("Preset not found",{status:404});return await $.save(),Response.json(W)}if(J.startsWith("/api/presets/")&&Z.method==="DELETE"){let Y=J.slice(13);if(!$.deletePreset(Y))return new Response("Preset not found",{status:404});return await $.save(),Response.json({success:!0})}if(J==="/api/bookmarks"&&Z.method==="GET")return Response.json({bookmarks:X.getAllBookmarks()});if(J==="/api/bookmarks"&&Z.method==="POST")try{let Y=await Z.json(),W=X.addBookmark(Y.storyId,Y.variantId,Y.props,{name:Y.name,notes:Y.notes,color:Y.color});return await X.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J==="/api/bookmarks/toggle"&&Z.method==="POST")try{let Y=await Z.json(),W=X.toggleBookmark(Y.storyId,Y.variantId,Y.props);return await X.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J.startsWith("/api/bookmarks/")&&J!=="/api/bookmarks/toggle"&&Z.method==="GET"){let Y=J.slice(15),W=X.getBookmark(Y);if(!W)return new Response("Bookmark not found",{status:404});return Response.json(W)}if(J.startsWith("/api/bookmarks/")&&Z.method==="DELETE"){let Y=J.slice(15);if(!X.deleteBookmark(Y))return new Response("Bookmark not found",{status:404});return await X.save(),Response.json({success:!0})}if(J==="/api/analytics/track"&&Z.method==="POST")try{let Y=await Z.json();if(Y.type==="view"&&Y.componentId)B.trackView(Y.componentId,Y.variantId);else if(Y.type==="prop_change"&&Y.componentId&&Y.propName)B.trackPropChange(Y.componentId,Y.propName,null);else if(Y.type==="variant_switch"&&Y.componentId&&Y.variantId)B.trackVariantSwitch(Y.componentId,Y.variantId);else if(Y.type==="search"&&Y.query)B.trackSearch(Y.query,0);return await B.save(),Response.json({success:!0})}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J==="/api/analytics/summary"&&Z.method==="GET")return Response.json({mostViewed:B.getMostViewedComponents(10),mostChangedProps:B.getMostChangedProps(10),searchAnalytics:B.getSearchAnalytics()});if(J.startsWith("/api/analytics/component/")&&Z.method==="GET"){let Y=J.slice(25),W=z.storyFiles.find((U)=>U.id===Y),j=B.getComponentAnalytics(Y,W?.fileName||Y);return Response.json(j)}return new Response("Not found",{status:404})}function kz(z,J,Z){let K=Sz(z,Z);return new Response(K,{headers:{"Content-Type":"text/html; charset=utf-8"}})}function Sz(z,J){let{theme:Z}=z.config,K=Z.title||"STX Story",$=`ws://localhost:${J}/__hmr`,X=r($);return`<!DOCTYPE html>
562
562
  <html lang="en" class="${Z.darkClass||"dark"}">
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{dl as a,el as b,fl as c,gl as d,hl as e}from"./chunk-1ws3xcea.js";import"./chunk-563shnkz.js";import"./chunk-2fw05hs2.js";export{b as injectPwaTags,e as generateThemeColorMeta,c as generateSwRegistrationScript,a as generatePwaTags,d as generateManifestLink};
2
+ import{dl as a,el as b,fl as c,gl as d,hl as e}from"./chunk-dh6s7mrj.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{b as injectPwaTags,e as generateThemeColorMeta,c as generateSwRegistrationScript,a as generatePwaTags,d as generateManifestLink};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ai as c,Bi as d,Ci as e,yi as a,zi as b}from"./chunk-bjcsc6wx.js";import"./chunk-2fw05hs2.js";export{c as renderSSRSuspense,a as processSuspenseDirectives,e as generateSuspenseRuntime,d as generateSuspenseCSS,b as createSSRSuspense};
2
+ import{Ai as c,Bi as d,Ci as e,yi as a,zi as b}from"./chunk-bjcsc6wx.js";import"./chunk-ay6zjq8v.js";export{c as renderSSRSuspense,a as processSuspenseDirectives,e as generateSuspenseRuntime,d as generateSuspenseCSS,b as createSSRSuspense};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ri as T,Si as u,Ti as A}from"./chunk-0c2h69k2.js";import{jl as g,ql as h,wl as b}from"./chunk-esypgzzm.js";import{Mo as f,Or as I,mm as k,wq as B}from"./chunk-92ysystz.js";import{Jv as D,Kv as S}from"./chunk-cj3adc77.js";import{Ov as F}from"./chunk-gbmeh7jg.js";import P from"path";var j=new Map,K=new Map,n=["composables","functions"];function p(z){let H=P.basename(z,".ts");return H==="index"||H==="types"||z.endsWith(".d.ts")}async function r(z){if(z)return P.resolve(z);let H=`<default>:${process.cwd()}`,Y=K.get(H);if(Y!==void 0)return Y;let J=await l();if(J!==null)K.set(H,J);return J}async function l(){let z=await I(),H=z.root||process.cwd(),Y=z.composablesDir;if(Y)return P.resolve(H,Y);for(let J of n){let V=P.resolve(H,J);try{let Z=new Bun.Glob("**/*.ts");for await(let W of Z.scan({cwd:V,absolute:!0}))if(!p(W))return V}catch{}}return null}async function m(z){let H=Array.isArray(z)?z:z?[P.resolve(z)]:(await I())._layerComposableDirs??[await r()].filter((J)=>!!J),Y=new Map;for(let J of H){let V=new Bun.Glob("**/*.ts");try{for await(let Z of V.scan({cwd:J,absolute:!0})){let W=P.relative(J,Z);if(!p(Z)&&!Y.has(W))Y.set(W,Z)}}catch{}}return{key:H.join("\x00"),files:[...Y.values()].sort()}}async function Wq(z){let{files:H}=await m(z),Y=B({loader:"ts",target:"browser",define:k()}),J=[];for(let V of H)try{let Z=await Bun.file(V).text(),W=Y.scan(Z).exports.filter((G)=>G!=="default");if(W.length>0)J.push({file:V,names:W})}catch{}return J}function c(z,H){return new RegExp(`\\b${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(z)}function a(z,H,Y){let J=new Map;for(let{file:G,names:$}of z)for(let O of $)if(!J.has(O))J.set(O,G);let V=(G)=>{let $=[];for(let[O,w]of J)if(c(G,O))$.push(w);return $},Z=new Set,W=Y.flatMap(V);while(W.length>0){let G=[];for(let $ of W){if(Z.has($))continue;Z.add($);for(let O of V(H.get($)??""))if(!Z.has(O))G.push(O)}W=G}return Z}async function Yq(z,H,Y){let{key:J,files:V}=await m(z);if(!J)return null;let Z=()=>[...new Set([...V,...V.flatMap((q)=>g(q))])],W=T(Z());if(V.length===0)return A(j,J,W,""),null;V.sort();let G=B({loader:"ts",target:"browser",define:k()}),$=new Map,O=[];for(let q of V)try{let Q=await Bun.file(q).text();$.set(q,Q);let U=G.scan(Q).exports.filter((X)=>X!=="default");if(U.length>0)O.push({file:q,names:U})}catch{$.set(q,"")}let w=H===void 0?new Set(V):a(O,$,Y?[H,...Y]:[H]);if(w.size===0)return null;let _=V.filter((q)=>w.has(q)),M=`${J}\x00${_.join("\x00")}`,v=u(j,M,W);if(v!==void 0)return v||null;let R=[],L=new Set,C=new Set;for(let q of _)try{let Q=$.get(q)??await Bun.file(q).text(),U=P.basename(q,".ts");for(let X of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(X[1])C.add(X[1]);try{for(let X of G.scan(Q).exports)if(X!=="default")L.add(X)}catch{}if(Q=D(Q),h(Q))Q=await b(Q,q,{projectRoot:process.cwd(),externalizeUserModules:!1}),Q=f(Q);Q=S(Q),Q=Q.replace(/^export\s+(default\s+)?/gm,""),Q=G.transformSync(Q),R.push(`// Composable: ${U}
2
+ import{Ri as T,Si as u,Ti as A}from"./chunk-0c2h69k2.js";import{jl as g,ql as h,wl as b}from"./chunk-ff5a6hvb.js";import{Mo as f,Or as I,mm as k,wq as B}from"./chunk-pwsnafp3.js";import{Lv as D,Mv as S}from"./chunk-266t58b8.js";import{Qv as F}from"./chunk-az4v4ard.js";import P from"path";var j=new Map,K=new Map,n=["composables","functions"];function p(z){let H=P.basename(z,".ts");return H==="index"||H==="types"||z.endsWith(".d.ts")}async function r(z){if(z)return P.resolve(z);let H=`<default>:${process.cwd()}`,Y=K.get(H);if(Y!==void 0)return Y;let J=await l();if(J!==null)K.set(H,J);return J}async function l(){let z=await I(),H=z.root||process.cwd(),Y=z.composablesDir;if(Y)return P.resolve(H,Y);for(let J of n){let V=P.resolve(H,J);try{let Z=new Bun.Glob("**/*.ts");for await(let W of Z.scan({cwd:V,absolute:!0}))if(!p(W))return V}catch{}}return null}async function m(z){let H=Array.isArray(z)?z:z?[P.resolve(z)]:(await I())._layerComposableDirs??[await r()].filter((J)=>!!J),Y=new Map;for(let J of H){let V=new Bun.Glob("**/*.ts");try{for await(let Z of V.scan({cwd:J,absolute:!0})){let W=P.relative(J,Z);if(!p(Z)&&!Y.has(W))Y.set(W,Z)}}catch{}}return{key:H.join("\x00"),files:[...Y.values()].sort()}}async function Wq(z){let{files:H}=await m(z),Y=B({loader:"ts",target:"browser",define:k()}),J=[];for(let V of H)try{let Z=await Bun.file(V).text(),W=Y.scan(Z).exports.filter((G)=>G!=="default");if(W.length>0)J.push({file:V,names:W})}catch{}return J}function c(z,H){return new RegExp(`\\b${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(z)}function a(z,H,Y){let J=new Map;for(let{file:G,names:$}of z)for(let O of $)if(!J.has(O))J.set(O,G);let V=(G)=>{let $=[];for(let[O,w]of J)if(c(G,O))$.push(w);return $},Z=new Set,W=Y.flatMap(V);while(W.length>0){let G=[];for(let $ of W){if(Z.has($))continue;Z.add($);for(let O of V(H.get($)??""))if(!Z.has(O))G.push(O)}W=G}return Z}async function Yq(z,H,Y){let{key:J,files:V}=await m(z);if(!J)return null;let Z=()=>[...new Set([...V,...V.flatMap((q)=>g(q))])],W=T(Z());if(V.length===0)return A(j,J,W,""),null;V.sort();let G=B({loader:"ts",target:"browser",define:k()}),$=new Map,O=[];for(let q of V)try{let Q=await Bun.file(q).text();$.set(q,Q);let U=G.scan(Q).exports.filter((X)=>X!=="default");if(U.length>0)O.push({file:q,names:U})}catch{$.set(q,"")}let w=H===void 0?new Set(V):a(O,$,Y?[H,...Y]:[H]);if(w.size===0)return null;let _=V.filter((q)=>w.has(q)),M=`${J}\x00${_.join("\x00")}`,v=u(j,M,W);if(v!==void 0)return v||null;let R=[],L=new Set,C=new Set;for(let q of _)try{let Q=$.get(q)??await Bun.file(q).text(),U=P.basename(q,".ts");for(let X of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(X[1])C.add(X[1]);try{for(let X of G.scan(Q).exports)if(X!=="default")L.add(X)}catch{}if(Q=D(Q),h(Q))Q=await b(Q,q,{projectRoot:process.cwd(),externalizeUserModules:!1}),Q=f(Q);Q=S(Q),Q=Q.replace(/^export\s+(default\s+)?/gm,""),Q=G.transformSync(Q),R.push(`// Composable: ${U}
3
3
  ${Q.trim()}`)}catch(Q){console.warn(`[stx] Failed to load composable ${q}:`,Q)}if(R.length===0||L.size===0)return A(j,M,W,""),null;let t=[...L].map((q)=>` try { if (!(${JSON.stringify(q)} in __c)) __c[${JSON.stringify(q)}] = ${q}; } catch (e) {}`).join(`
4
4
  `),N=JSON.stringify([...L]),E=R.join(`
5
5
 
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{qi as a,ri as b}from"./chunk-xq1acw1r.js";import"./chunk-2fw05hs2.js";export{a as processTeleportDirectives,b as ensureTeleportTargets};
2
+ import{qi as a,ri as b}from"./chunk-xq1acw1r.js";import"./chunk-ay6zjq8v.js";export{a as processTeleportDirectives,b as ensureTeleportTargets};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Cg as EF,pg as e,sg as kF,tg as UF,ug as wF}from"./chunk-dzk2n4tv.js";import{Fg as BF}from"./chunk-ny67c03k.js";import{Aj as d,zj as l}from"./chunk-t5ja7qkn.js";import{Ok as HF,Pk as IF,Qk as KF}from"./chunk-anydpa34.js";import{Al as ZF,yl as YF}from"./chunk-mm9v8t7p.js";import{Bm as i,Mr as t,Or as M,Qp as GF,Yp as VF,aq as r,fq as o,hn as s,vo as zF,yp as $F,zm as p}from"./chunk-92ysystz.js";import{Os as XF}from"./chunk-9fqp72ze.js";import{Et as qF}from"./chunk-x99xve3y.js";import{Yt as WF}from"./chunk-pan7wmdg.js";import{bu as QF}from"./chunk-1te8k8gp.js";import{Tw as h,Ww as _F}from"./chunk-36xaycje.js";import G from"fs";import q from"path";import{createHash as NF}from"crypto";_F();function u(Q){return NF("sha256").update(Q).digest("hex").slice(0,8)}function c(Q=!1){let z=Q?d():l(),Z=u(z);return{content:z,filename:`runtime.${Z}.js`,hash:Z}}function a(){let Q=h(),z=u(Q);return{content:Q,filename:`router.${z}.js`,hash:z}}function bF(Q){return{runtimeTag:Q.runtime?`<script src="/__stx/${Q.runtime.filename}"></script>`:"",routerTag:Q.router?`<script src="/__stx/${Q.router.filename}"></script>`:"",cssTag:Q.css?`<link rel="stylesheet" href="/__stx/${Q.css.filename}">`:""}}import n from"path";import{createHash as OF}from"crypto";function TF(Q={}){let z=new Set;return{context:new Proxy(Q,{get(X,F){if(F in X)return X[F];if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return},has(X,F){if(F in X)return!0;if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return!1}}),accessedKeys:z}}async function FF(Q,z,Z={}){let X=n.resolve(Q),F=await Bun.file(X).text(),U=OF("sha256").update(F).digest("hex").slice(0,16);p();let w={};try{w=await M(Z.configDir)}catch{}let H=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(F))!==null){let E=k[1];if(/\bserver\b/.test(E))H.push(k[2])}let W=new Set(H.flatMap((E)=>o(E))),{context:_}=TF({__filename:X,__dirname:n.dirname(X),__stx_serverDeclared:W}),N=new Set,x={...t,...w,...Z,buildMode:"compile",strict:!1},I=await r(F,_,X,x,N),O=e(I),j=i();return{route:z,sourceFile:Q,html:I,fragment:O,placeholders:j,hasServerScripts:H.length>0,serverScriptContent:H,dependencies:Array.from(N),contentHash:U,status:s(F),streamTemplates:_.__streamTemplates}}var MF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function JF(Q,z){let Z=0,X=0;if(!G.existsSync(Q))return{copied:Z,bytes:X};G.mkdirSync(z,{recursive:!0});function F(U,w){let H=G.readdirSync(U,{withFileTypes:!0});for(let V of H){if(MF.has(V.name))continue;let k=q.join(U,V.name),W=q.join(w,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),F(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),Z++,X+=G.statSync(W).size}}}return F(Q,z),{copied:Z,bytes:X}}async function qJ(Q={}){let z=Date.now(),Z=q.resolve(Q.root||process.cwd()),X=q.resolve(Z,Q.outputDir||".output");console.log("[stx build] Starting production build...");let F=await M(Z),U=q.resolve(Z,Q.componentsDir??F.componentsDir??"components"),w=q.resolve(Z,Q.partialsDir??F.partialsDir??"partials"),H=q.resolve(Z,Q.layoutsDir??F.layoutsDir??"layouts"),V=Q.publicDir??F.publicDir??"public",k=F.app?.head||{},W=F.app?.colorMode,_=F.router?.container||"main",N=Q.routeRules??F.routeRules??{},x=BF(N),I=Q.serverApi??F.serverApi,O=typeof I==="object"?I:{};if(I)YF(Z,O);if(F.runtimeConfig)QF(F.runtimeConfig,{});if(G.existsSync(X))G.rmSync(X,{recursive:!0});let j=[q.join(X,"public","__stx"),q.join(X,"public","assets"),q.join(X,"server","pages"),q.join(X,"server","fragments")];for(let Y of j)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let E=zF(Z,{pagesDirs:F._layerPageDirs}),LF=["components","layouts","partials"],y=E.filter((Y)=>{return!LF.some((B)=>Y.pattern.startsWith(`/${B}/`)||Y.pattern===`/${B}`)});console.log(`[stx build] Found ${y.length} page routes (${E.length-y.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let L=c(Q.debug),K=a();await Bun.write(q.join(X,"public","__stx",L.filename),L.content),await Bun.write(q.join(X,"public","__stx",K.filename),K.content),console.log(`[stx build] Runtime: ${L.filename} (${(L.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${K.filename} (${(K.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let R=[],v=[];for(let Y of y){let B=x(Y.pattern),b=B.rendering==="prerender";if(b&&(Y.pattern.includes(":")||Y.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${Y.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let J=await FF(Y.filePath,Y.pattern,{configDir:Z,componentsDir:U,partialsDir:w,layoutsDir:H,debug:Q.debug});if(R.push(J),J.html=J.html.replace(/runtime\.__STX_HASH__\.js/g,L.filename).replace(/router\.__STX_HASH__\.js/g,K.filename),J.html=VF(J.html,k,{bodyScripts:[`<script src="/__stx/${K.filename}"></script>`],...W&&{colorMode:W}}),W)J.html=$F(J.html,W);if(k.htmlAttrs)J.html=GF(J.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(J.html)){let $=J.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if($&&$[1]){let m=$[1];J.html=J.html.replace(" "+m,""),J.html=J.html.replace(/<body([^>]*)>/,`<body$1 ${m}>`)}}if(J.html=J.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),J.html=await qF(J.html),b){let $=await EF(J,{params:{},request:new Request(`http://stx.build${Y.pattern}`),method:"GET",__stx_strict_hydration:!0});if($.redirect||$.cookies?.length||$.boundaries?.length||$.headers&&Object.keys($.headers).length)throw Error(`Prerendered route ${Y.pattern} cannot set response headers/cookies, redirect or stream`);J.html=$.html,J.status=$.status??J.status,J.hasServerScripts=!1,J.serverScriptContent=[],J.placeholders={}}J.fragment=kF(J.html,_);let C=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),g=q.join("server","pages",`${C}.compiled.json`),f=q.join("server","fragments",`${C}.html`);await Bun.write(q.join(X,g),JSON.stringify(J,null,2)),await Bun.write(q.join(X,f),J.fragment),v.push({pattern:Y.pattern,compiledPath:g,fragmentPath:f,isDynamic:J.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("["),prerendered:b}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(J){if(Object.keys(B).length)throw J;console.error(`[stx build] \u2717 ${Y.pattern}:`,J instanceof Error?J.message:J)}}let P=q.resolve(Z,V);if(G.existsSync(P)){let{copied:Y,bytes:B}=JF(P,q.join(X,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${V}/`)}let A=KF(Z);if(A){let{copied:Y,bytes:B}=JF(A,q.join(X,"public",IF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${HF}/`)}let S={runtime:L.filename,router:K.filename},T=UF(v,S,X);if(T.routeRules=N,T.routerContainer=_,I)T.apiRoutes=await ZF(Z,X,O);if(F.runtimeConfig)await Bun.write(q.join(X,"server/runtime-config.json"),JSON.stringify(F.runtimeConfig)),await WF(Z,F.runtimeConfig);if(F._layerGraph)await Bun.write(q.join(X,"server/layers.json"),JSON.stringify(XF(F._layerGraph),null,2));wF(T,X);let D=Date.now()-z;return console.log(`
2
+ import{Cg as EF,pg as e,sg as kF,tg as UF,ug as wF}from"./chunk-6xk87qf2.js";import{Fg as BF}from"./chunk-ny67c03k.js";import{Aj as d,zj as l}from"./chunk-kgd8kchy.js";import{Ok as HF,Pk as IF,Qk as KF}from"./chunk-anydpa34.js";import{Al as ZF,yl as YF}from"./chunk-ec4wq2sv.js";import{Bm as i,Mr as t,Or as M,Qp as GF,Yp as VF,aq as r,fq as o,hn as s,vo as zF,yp as $F,zm as p}from"./chunk-pwsnafp3.js";import{Os as XF}from"./chunk-9fqp72ze.js";import{Et as qF}from"./chunk-pwgv84pn.js";import{_t as WF}from"./chunk-98zj3fv2.js";import{du as QF}from"./chunk-35ds08e7.js";import{Vw as h,Yw as _F}from"./chunk-4f9zyfdw.js";import G from"fs";import q from"path";import{createHash as NF}from"crypto";_F();function u(Q){return NF("sha256").update(Q).digest("hex").slice(0,8)}function c(Q=!1){let z=Q?d():l(),Z=u(z);return{content:z,filename:`runtime.${Z}.js`,hash:Z}}function a(){let Q=h(),z=u(Q);return{content:Q,filename:`router.${z}.js`,hash:z}}function bF(Q){return{runtimeTag:Q.runtime?`<script src="/__stx/${Q.runtime.filename}"></script>`:"",routerTag:Q.router?`<script src="/__stx/${Q.router.filename}"></script>`:"",cssTag:Q.css?`<link rel="stylesheet" href="/__stx/${Q.css.filename}">`:""}}import n from"path";import{createHash as OF}from"crypto";function TF(Q={}){let z=new Set;return{context:new Proxy(Q,{get(X,F){if(F in X)return X[F];if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return},has(X,F){if(F in X)return!0;if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return!1}}),accessedKeys:z}}async function FF(Q,z,Z={}){let X=n.resolve(Q),F=await Bun.file(X).text(),U=OF("sha256").update(F).digest("hex").slice(0,16);p();let w={};try{w=await M(Z.configDir)}catch{}let H=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(F))!==null){let E=k[1];if(/\bserver\b/.test(E))H.push(k[2])}let W=new Set(H.flatMap((E)=>o(E))),{context:_}=TF({__filename:X,__dirname:n.dirname(X),__stx_serverDeclared:W}),N=new Set,x={...t,...w,...Z,buildMode:"compile",strict:!1},I=await r(F,_,X,x,N),O=e(I),j=i();return{route:z,sourceFile:Q,html:I,fragment:O,placeholders:j,hasServerScripts:H.length>0,serverScriptContent:H,dependencies:Array.from(N),contentHash:U,status:s(F),streamTemplates:_.__streamTemplates}}var MF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function JF(Q,z){let Z=0,X=0;if(!G.existsSync(Q))return{copied:Z,bytes:X};G.mkdirSync(z,{recursive:!0});function F(U,w){let H=G.readdirSync(U,{withFileTypes:!0});for(let V of H){if(MF.has(V.name))continue;let k=q.join(U,V.name),W=q.join(w,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),F(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),Z++,X+=G.statSync(W).size}}}return F(Q,z),{copied:Z,bytes:X}}async function qJ(Q={}){let z=Date.now(),Z=q.resolve(Q.root||process.cwd()),X=q.resolve(Z,Q.outputDir||".output");console.log("[stx build] Starting production build...");let F=await M(Z),U=q.resolve(Z,Q.componentsDir??F.componentsDir??"components"),w=q.resolve(Z,Q.partialsDir??F.partialsDir??"partials"),H=q.resolve(Z,Q.layoutsDir??F.layoutsDir??"layouts"),V=Q.publicDir??F.publicDir??"public",k=F.app?.head||{},W=F.app?.colorMode,_=F.router?.container||"main",N=Q.routeRules??F.routeRules??{},x=BF(N),I=Q.serverApi??F.serverApi,O=typeof I==="object"?I:{};if(I)YF(Z,O);if(F.runtimeConfig)QF(F.runtimeConfig,{});if(G.existsSync(X))G.rmSync(X,{recursive:!0});let j=[q.join(X,"public","__stx"),q.join(X,"public","assets"),q.join(X,"server","pages"),q.join(X,"server","fragments")];for(let Y of j)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let E=zF(Z,{pagesDirs:F._layerPageDirs}),LF=["components","layouts","partials"],y=E.filter((Y)=>{return!LF.some((B)=>Y.pattern.startsWith(`/${B}/`)||Y.pattern===`/${B}`)});console.log(`[stx build] Found ${y.length} page routes (${E.length-y.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let L=c(Q.debug),K=a();await Bun.write(q.join(X,"public","__stx",L.filename),L.content),await Bun.write(q.join(X,"public","__stx",K.filename),K.content),console.log(`[stx build] Runtime: ${L.filename} (${(L.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${K.filename} (${(K.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let R=[],v=[];for(let Y of y){let B=x(Y.pattern),b=B.rendering==="prerender";if(b&&(Y.pattern.includes(":")||Y.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${Y.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let J=await FF(Y.filePath,Y.pattern,{configDir:Z,componentsDir:U,partialsDir:w,layoutsDir:H,debug:Q.debug});if(R.push(J),J.html=J.html.replace(/runtime\.__STX_HASH__\.js/g,L.filename).replace(/router\.__STX_HASH__\.js/g,K.filename),J.html=VF(J.html,k,{bodyScripts:[`<script src="/__stx/${K.filename}"></script>`],...W&&{colorMode:W}}),W)J.html=$F(J.html,W);if(k.htmlAttrs)J.html=GF(J.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(J.html)){let $=J.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if($&&$[1]){let m=$[1];J.html=J.html.replace(" "+m,""),J.html=J.html.replace(/<body([^>]*)>/,`<body$1 ${m}>`)}}if(J.html=J.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),J.html=await qF(J.html),b){let $=await EF(J,{params:{},request:new Request(`http://stx.build${Y.pattern}`),method:"GET",__stx_strict_hydration:!0});if($.redirect||$.cookies?.length||$.boundaries?.length||$.headers&&Object.keys($.headers).length)throw Error(`Prerendered route ${Y.pattern} cannot set response headers/cookies, redirect or stream`);J.html=$.html,J.status=$.status??J.status,J.hasServerScripts=!1,J.serverScriptContent=[],J.placeholders={}}J.fragment=kF(J.html,_);let C=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),g=q.join("server","pages",`${C}.compiled.json`),f=q.join("server","fragments",`${C}.html`);await Bun.write(q.join(X,g),JSON.stringify(J,null,2)),await Bun.write(q.join(X,f),J.fragment),v.push({pattern:Y.pattern,compiledPath:g,fragmentPath:f,isDynamic:J.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("["),prerendered:b}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(J){if(Object.keys(B).length)throw J;console.error(`[stx build] \u2717 ${Y.pattern}:`,J instanceof Error?J.message:J)}}let P=q.resolve(Z,V);if(G.existsSync(P)){let{copied:Y,bytes:B}=JF(P,q.join(X,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${V}/`)}let A=KF(Z);if(A){let{copied:Y,bytes:B}=JF(A,q.join(X,"public",IF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${HF}/`)}let S={runtime:L.filename,router:K.filename},T=UF(v,S,X);if(T.routeRules=N,T.routerContainer=_,I)T.apiRoutes=await ZF(Z,X,O);if(F.runtimeConfig)await Bun.write(q.join(X,"server/runtime-config.json"),JSON.stringify(F.runtimeConfig)),await WF(Z,F.runtimeConfig);if(F._layerGraph)await Bun.write(q.join(X,"server/layers.json"),JSON.stringify(XF(F._layerGraph),null,2));wF(T,X);let D=Date.now()-z;return console.log(`
3
3
  [stx build] Done in ${D}ms \u2014 ${R.length} pages compiled`),{pageCount:R.length,assets:S,outputDir:X,duration:D}}
4
4
  export{u as Yf,c as Zf,a as _f,bF as $f,FF as ag,qJ as bg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pi as a,Qi as b}from"./chunk-gcr9e83g.js";import"./chunk-0c2h69k2.js";import"./chunk-ff5a6hvb.js";import"./chunk-ec4wq2sv.js";import"./chunk-s8jd13nb.js";import"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{a as getStoreScript,b as clearStoreCache};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{bx as S,ex as i}from"./chunk-563shnkz.js";import{fx as v,gx as k,hx as G}from"./chunk-2fw05hs2.js";import A from"fs";import B from"path";function u(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function f(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function g(j,q,K){let Q=B.extname(j).toLowerCase(),Y=h[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&f(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(g(_,O.size,K)){let $=A.readFileSync(Z),L=u($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
2
+ import{dx as S,gx as i}from"./chunk-kg1rdena.js";import{hx as v,ix as k,jx as G}from"./chunk-ay6zjq8v.js";import A from"fs";import B from"path";function u(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function f(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function g(j,q,K){let Q=B.extname(j).toLowerCase(),Y=h[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&f(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(g(_,O.size,K)){let $=A.readFileSync(Z),L=u($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
3
3
  ${j.entries.map((K)=>` { url: '${K.url}', revision: '${K.revision}' }`).join(`,
4
4
  `)}
5
5
  ]`}function E(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(2)} MB`}var h;var F=G(()=>{h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"}});function c(j){let q={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return q[j]||q["network-first"]}function R(j){return c(j).className}function M(j){let q=j.pwa;if(!q?.enabled)return"";let K=q.routes||[],Q=q.cacheStorage,Y=[];for(let X of K){let Z=R(X.strategy),O=[];if(X.maxAgeSeconds||X.maxEntries||Q?.maxEntries){let $=X.maxEntries||Q?.maxEntries||100,L=X.maxAgeSeconds||(Q?.maxAge?Q.maxAge*24*60*60:void 0);O.push(`new ExpirationPlugin({
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{qh as x,vh as M,wh as C,xh as v,yh as P}from"./chunk-pcxp4r9n.js";import{ix as y}from"./chunk-2fw05hs2.js";import{resolve as h,basename as f,extname as u,join as m}from"path";import{mkdir as l}from"fs/promises";var I={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class z{config;constructor(J={}){this.config={...I,...J}}async get(J,Z){return C(J,Z,"image",this.config)}async set(J,Z,Y){return v(J,Z,Y,"image",this.config)}async clear(){return P("image",this.config)}updateConfig(J){this.config={...this.config,...J}}}var H=null;function S(J){if(!H)H=new z(J);else if(J)H.updateConfig(J);return H}async function w(J,Z,Y){let K=Y?{directory:`${Y.outputDir}/../.cache`}:{};return S(K).get(J,Z)}async function Q(J,Z,Y,K){let X=K?{directory:`${K.outputDir}/../.cache`}:{};return S(X).set(J,Z,Y)}async function d(){return S().clear()}async function R(){try{return await import("ts-images")}catch{return null}}function b(J){switch(J){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function p(J,Z){let Y=Z?b(Z):b("web"),K=J.formatQuality||{};return{jpeg:{...Y.jpeg,...K.jpeg},png:{...Y.png,...K.png},webp:{...Y.webp,...K.webp},avif:{...Y.avif,...K.avif}}}async function g(J,Z,Y){let K=await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:J,processed:!1};let X=await w(J,Z,Y);if(X)return X;try{let N=h(J);if(!await M(N))return{src:J,processed:!1,errors:[`Source file not found: ${J}`]};let L=p(Y,Z.preset),V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await l(V,{recursive:!0});let q=await x(N),U=f(J,u(J)),E=Z.outputFormat?[Z.outputFormat]:Y.defaultFormats||["avif","webp","jpeg"],G={src:J,processed:!0,variants:[],hash:q},j=null;if(Z.transformations&&Z.transformations.length>0)j=await D(N,Z.transformations,K);for(let $ of E){let A=L[$]||{},W=`${U}-${q}.${$}`,_=m(V,W);try{let O=await K.optimizeImage({input:j||N,output:_,format:$,quality:A.quality,progressive:A.progressive});if(O){if(G.variants.push({path:_,url:`${F}/${W}`,width:O.width||0,height:O.height||0,format:$,size:O.outputSize||0}),!G.originalWidth&&O.width)G.originalWidth=O.width,G.originalHeight=O.height}}catch(O){G.errors=G.errors||[],G.errors.push(`Failed to optimize ${$}: ${O}`)}}if(Z.embedThumbhash||Z.placeholder==="thumbhash")try{let $=await K.generateThumbHash(N);G.placeholder=$.dataUrl}catch($){G.errors=G.errors||[],G.errors.push(`Failed to generate thumbhash: ${$}`)}if(Z.useDominantColor)try{let $=await K.generatePlaceholder(N,{strategy:"dominant-color"});G.dominantColor=$.dominantColor}catch($){G.errors=G.errors||[],G.errors.push(`Failed to extract dominant color: ${$}`)}return await Q(J,Z,G,Y),G}catch(N){return{src:J,processed:!1,errors:[`Processing failed: ${N}`]}}}async function n(J,Z,Y,K){let X=await R();if(!X)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await X.optimizeImage({input:J,output:K,format:Z,quality:Y}))?.outputSize}}catch(N){return{success:!1,error:String(N)}}}async function D(J,Z,Y){let K=Y||await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let X=await K.decode(J);for(let N of Z){let L=N.options||{};switch(N.type){case"resize":if(L.width||L.height)X=await K.resize(X,{width:L.width,height:L.height,fit:L.fit});break;case"blur":if(L.sigma!==void 0)X=await K.blur(X,L.sigma);break;case"sharpen":if(L.amount!==void 0)X=await K.sharpen(X,L.amount);break;case"grayscale":X=await K.grayscale(X);break;case"rotate":if(L.angle!==void 0)X=await K.rotate(X,L.angle);break;case"flip":X=await K.flip(X);break;case"flop":X=await K.flop(X);break;case"brightness":if(L.value!==void 0)X=await K.brightness(X,L.value);break;case"contrast":if(L.value!==void 0)X=await K.contrast(X,L.value);break;case"saturation":if(L.value!==void 0)X=await K.saturation(X,L.value);break}}return await K.encode(X,"png")}catch(X){return console.error(`[stx-media] Transformation failed: ${X}`),null}}import{resolve as c,basename as i,extname as r,join as o}from"path";import{mkdir as a}from"fs/promises";async function e(){try{return await import("ts-images")}catch{return null}}var s=[320,480,640,768,1024,1280,1536,1920];async function t(J,Z,Y){let K=await e();if(!K)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let X=c(J);if(!await M(X))return console.warn(`[stx-media] Source file not found: ${J}`),null;try{let N=Z.responsiveWidths||Y.breakpoints||s,L=Z.formats||Y.defaultFormats||["avif","webp","jpeg"],V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await a(V,{recursive:!0});let q=await x(X),U=i(J,r(J)),E=Y.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},G={src:J,byFormat:{},srcsets:{}};for(let $ of L){G.byFormat[$]=[];let A=[];for(let W of N){let _=`${U}-${W}w-${q}.${$}`,O=o(V,_),B=`${F}/${_}`;try{let T=E[$]?.quality||80;if(await M(O)){G.byFormat[$].push({path:O,url:B,width:W,height:0,format:$,size:0}),A.push(`${B} ${W}w`);continue}let k=await K.processImage({input:X,output:O,format:$,quality:T,resize:{width:W}});if(k)G.byFormat[$].push({path:O,url:B,width:W,height:k.height||Math.round(W*(k.height||1)/(k.width||1)),format:$,size:k.outputSize||0}),A.push(`${B} ${W}w`)}catch(T){console.warn(`[stx-media] Failed to generate ${$} at ${W}w: ${T}`)}}G.srcsets[$]=A.join(", ")}let j=Z.placeholder||Y.placeholderStrategy||"thumbhash";if(j!=="none")try{if(j==="thumbhash"){let $=await K.generateThumbHash(X);G.placeholder={dataURL:$.dataUrl,width:$.width||32,height:$.height||32,strategy:"thumbhash"}}else{let $=await K.generatePlaceholder(X,{strategy:j,width:20});G.placeholder={dataURL:$.dataURL,width:$.width,height:$.height,strategy:j}}}catch($){console.warn(`[stx-media] Failed to generate placeholder: ${$}`)}return G.sizes=Z.sizes||JJ(N),G}catch(N){return console.error(`[stx-media] Responsive generation failed: ${N}`),null}}function JJ(J){let Z=[...J].sort((K,X)=>K-X),Y=[];for(let K=0;K<Z.length-1;K++){let X=Z[K];Y.push(`(max-width: ${X}px) ${X}px`)}return Y.push(`${Z[Z.length-1]}px`),Y.join(", ")}function KJ(J,Z="width"){if(!J||J.length===0)return"";if(Z==="dpr")return J.filter((Y)=>Y.dpr).map((Y)=>`${Y.url} ${Y.dpr}x`).join(", ");return J.map((Y)=>`${Y.url} ${Y.width}w`).join(", ")}export{z as Yg,w as Zg,Q as _g,d as $g,g as ah,n as bh,D as ch,t as dh,KJ as eh};
2
+ import{qh as x,vh as M,wh as C,xh as v,yh as P}from"./chunk-pcxp4r9n.js";import{kx as y}from"./chunk-ay6zjq8v.js";import{resolve as h,basename as f,extname as u,join as m}from"path";import{mkdir as l}from"fs/promises";var I={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class z{config;constructor(J={}){this.config={...I,...J}}async get(J,Z){return C(J,Z,"image",this.config)}async set(J,Z,Y){return v(J,Z,Y,"image",this.config)}async clear(){return P("image",this.config)}updateConfig(J){this.config={...this.config,...J}}}var H=null;function S(J){if(!H)H=new z(J);else if(J)H.updateConfig(J);return H}async function w(J,Z,Y){let K=Y?{directory:`${Y.outputDir}/../.cache`}:{};return S(K).get(J,Z)}async function Q(J,Z,Y,K){let X=K?{directory:`${K.outputDir}/../.cache`}:{};return S(X).set(J,Z,Y)}async function d(){return S().clear()}async function R(){try{return await import("ts-images")}catch{return null}}function b(J){switch(J){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function p(J,Z){let Y=Z?b(Z):b("web"),K=J.formatQuality||{};return{jpeg:{...Y.jpeg,...K.jpeg},png:{...Y.png,...K.png},webp:{...Y.webp,...K.webp},avif:{...Y.avif,...K.avif}}}async function g(J,Z,Y){let K=await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:J,processed:!1};let X=await w(J,Z,Y);if(X)return X;try{let N=h(J);if(!await M(N))return{src:J,processed:!1,errors:[`Source file not found: ${J}`]};let L=p(Y,Z.preset),V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await l(V,{recursive:!0});let q=await x(N),U=f(J,u(J)),E=Z.outputFormat?[Z.outputFormat]:Y.defaultFormats||["avif","webp","jpeg"],G={src:J,processed:!0,variants:[],hash:q},j=null;if(Z.transformations&&Z.transformations.length>0)j=await D(N,Z.transformations,K);for(let $ of E){let A=L[$]||{},W=`${U}-${q}.${$}`,_=m(V,W);try{let O=await K.optimizeImage({input:j||N,output:_,format:$,quality:A.quality,progressive:A.progressive});if(O){if(G.variants.push({path:_,url:`${F}/${W}`,width:O.width||0,height:O.height||0,format:$,size:O.outputSize||0}),!G.originalWidth&&O.width)G.originalWidth=O.width,G.originalHeight=O.height}}catch(O){G.errors=G.errors||[],G.errors.push(`Failed to optimize ${$}: ${O}`)}}if(Z.embedThumbhash||Z.placeholder==="thumbhash")try{let $=await K.generateThumbHash(N);G.placeholder=$.dataUrl}catch($){G.errors=G.errors||[],G.errors.push(`Failed to generate thumbhash: ${$}`)}if(Z.useDominantColor)try{let $=await K.generatePlaceholder(N,{strategy:"dominant-color"});G.dominantColor=$.dominantColor}catch($){G.errors=G.errors||[],G.errors.push(`Failed to extract dominant color: ${$}`)}return await Q(J,Z,G,Y),G}catch(N){return{src:J,processed:!1,errors:[`Processing failed: ${N}`]}}}async function n(J,Z,Y,K){let X=await R();if(!X)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await X.optimizeImage({input:J,output:K,format:Z,quality:Y}))?.outputSize}}catch(N){return{success:!1,error:String(N)}}}async function D(J,Z,Y){let K=Y||await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let X=await K.decode(J);for(let N of Z){let L=N.options||{};switch(N.type){case"resize":if(L.width||L.height)X=await K.resize(X,{width:L.width,height:L.height,fit:L.fit});break;case"blur":if(L.sigma!==void 0)X=await K.blur(X,L.sigma);break;case"sharpen":if(L.amount!==void 0)X=await K.sharpen(X,L.amount);break;case"grayscale":X=await K.grayscale(X);break;case"rotate":if(L.angle!==void 0)X=await K.rotate(X,L.angle);break;case"flip":X=await K.flip(X);break;case"flop":X=await K.flop(X);break;case"brightness":if(L.value!==void 0)X=await K.brightness(X,L.value);break;case"contrast":if(L.value!==void 0)X=await K.contrast(X,L.value);break;case"saturation":if(L.value!==void 0)X=await K.saturation(X,L.value);break}}return await K.encode(X,"png")}catch(X){return console.error(`[stx-media] Transformation failed: ${X}`),null}}import{resolve as c,basename as i,extname as r,join as o}from"path";import{mkdir as a}from"fs/promises";async function e(){try{return await import("ts-images")}catch{return null}}var s=[320,480,640,768,1024,1280,1536,1920];async function t(J,Z,Y){let K=await e();if(!K)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let X=c(J);if(!await M(X))return console.warn(`[stx-media] Source file not found: ${J}`),null;try{let N=Z.responsiveWidths||Y.breakpoints||s,L=Z.formats||Y.defaultFormats||["avif","webp","jpeg"],V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await a(V,{recursive:!0});let q=await x(X),U=i(J,r(J)),E=Y.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},G={src:J,byFormat:{},srcsets:{}};for(let $ of L){G.byFormat[$]=[];let A=[];for(let W of N){let _=`${U}-${W}w-${q}.${$}`,O=o(V,_),B=`${F}/${_}`;try{let T=E[$]?.quality||80;if(await M(O)){G.byFormat[$].push({path:O,url:B,width:W,height:0,format:$,size:0}),A.push(`${B} ${W}w`);continue}let k=await K.processImage({input:X,output:O,format:$,quality:T,resize:{width:W}});if(k)G.byFormat[$].push({path:O,url:B,width:W,height:k.height||Math.round(W*(k.height||1)/(k.width||1)),format:$,size:k.outputSize||0}),A.push(`${B} ${W}w`)}catch(T){console.warn(`[stx-media] Failed to generate ${$} at ${W}w: ${T}`)}}G.srcsets[$]=A.join(", ")}let j=Z.placeholder||Y.placeholderStrategy||"thumbhash";if(j!=="none")try{if(j==="thumbhash"){let $=await K.generateThumbHash(X);G.placeholder={dataURL:$.dataUrl,width:$.width||32,height:$.height||32,strategy:"thumbhash"}}else{let $=await K.generatePlaceholder(X,{strategy:j,width:20});G.placeholder={dataURL:$.dataURL,width:$.width,height:$.height,strategy:j}}}catch($){console.warn(`[stx-media] Failed to generate placeholder: ${$}`)}return G.sizes=Z.sizes||JJ(N),G}catch(N){return console.error(`[stx-media] Responsive generation failed: ${N}`),null}}function JJ(J){let Z=[...J].sort((K,X)=>K-X),Y=[];for(let K=0;K<Z.length-1;K++){let X=Z[K];Y.push(`(max-width: ${X}px) ${X}px`)}return Y.push(`${Z[Z.length-1]}px`),Y.join(", ")}function KJ(J,Z="width"){if(!J||J.length===0)return"";if(Z==="dpr")return J.filter((Y)=>Y.dpr).map((Y)=>`${Y.url} ${Y.dpr}x`).join(", ");return J.map((Y)=>`${Y.url} ${Y.width}w`).join(", ")}export{z as Yg,w as Zg,Q as _g,d as $g,g as ah,n as bh,D as ch,t as dh,KJ as eh};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Af as A,Bf as B,Cf as C,Df as D,Ef as E,tf as t,uf as u,vf as v,wf as w,xf as x,yf as y,zf as z}from"./chunk-p5wp0ce6.js";import{Ff as r,Gf as s}from"./chunk-td08rnk3.js";import{Hf as b,If as c,Jf as d,Kf as e,Lf as f,Mf as g,Nf as h,Pf as i,Qf as j,Rf as k,Sf as l,Tf as m,Uf as n,Vf as o,Wf as p,Xf as q}from"./chunk-z5rwnnk1.js";import{li as a}from"./chunk-0we9nw1d.js";import"./chunk-0btmm4m2.js";import"./chunk-2fw05hs2.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
2
+ import{Af as A,Bf as B,Cf as C,Df as D,Ef as E,tf as t,uf as u,vf as v,wf as w,xf as x,yf as y,zf as z}from"./chunk-s7z5dp70.js";import{Ff as r,Gf as s}from"./chunk-213pzm0d.js";import{Hf as b,If as c,Jf as d,Kf as e,Lf as f,Mf as g,Nf as h,Pf as i,Qf as j,Rf as k,Sf as l,Tf as m,Uf as n,Vf as o,Wf as p,Xf as q}from"./chunk-ytma76qe.js";import{li as a}from"./chunk-0we9nw1d.js";import"./chunk-0btmm4m2.js";import"./chunk-ay6zjq8v.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$ as pm,$a as to,$b as Ep,$c as Eq,$d as Er,A as $k,Aa as En,Ab as Xo,Ac as dq,Ad as dr,Ae as js,B as al,Ba as Fn,Bb as Zo,Bc as eq,Bd as er,Be as ks,C as bl,Ca as Gn,Cb as _o,Cc as fq,Cd as fr,Ce as ls,D as cl,Da as Hn,Db as $o,Dc as gq,Dd as gr,De as ms,E as dl,Ea as In,Eb as ap,Ec as hq,Ed as hr,Ee as ns,F as el,Fa as Jn,Fb as bp,Fc as iq,Fd as ir,Fe as os,G as fl,Ga as Kn,Gb as cp,Gc as jq,Gd as jr,Ge as ps,H as gl,Ha as Ln,Hb as dp,Hc as kq,Hd as kr,He as qs,I as hl,Ia as Yn,Ib as ep,Ic as lq,Id as lr,Ie as rs,J as il,Ja as Zn,Jb as fp,Jc as mq,Jd as mr,Je as ss,K as _l,Ka as _n,Kb as gp,Kc as nq,Kd as nr,Ke as ts,L as $l,La as $n,Lb as hp,Lc as oq,Ld as or,Le as us,M as am,Ma as ao,Mb as ip,Mc as pq,Md as pr,Me as vs,N as bm,Na as bo,Nb as jp,Nc as qq,Nd as qr,Ne as ws,O as cm,Oa as go,Ob as kp,Oc as rq,Od as rr,Oe as xs,P as dm,Pa as ho,Pb as lp,Pc as sq,Pd as sr,Pe as ys,Q as em,Qa as io,Qb as mp,Qc as tq,Qd as tr,Qe as zs,R as fm,Ra as jo,Rb as np,Rc as uq,Rd as ur,S as gm,Sa as ko,Sb as op,Sc as vq,Sd as vr,T as hm,Ta as lo,Tb as wp,Tc as wq,Td as wr,U as im,Ua as mo,Ub as xp,Uc as xq,Ud as xr,V as jm,Va as no,Vb as yp,Vc as yq,Vd as yr,W as km,Wa as oo,Wb as zp,Wc as zq,Wd as zr,X as lm,Xa as po,Xb as Ap,Xc as Aq,Xd as Ar,Y as mm,Ya as qo,Yb as Bp,Yc as Bq,Yd as Br,Z as nm,Za as ro,Zb as Cp,Zc as Cq,Zd as Cr,_ as om,_a as so,_b as Dp,_c as Dq,_d as Dr,aa as qm,ab as uo,ac as Fp,ad as Fq,ae as Fr,ba as rm,bb as vo,bc as Gp,bd as Gq,be as Gr,ca as sm,cb as wo,cc as Hp,cd as Hq,ce as Hr,da as tm,db as xo,dc as Ip,dd as Iq,de as Ir,ea as um,eb as yo,ec as Jp,ed as Jq,ee as Jr,fa as vm,fb as zo,fc as Kp,fd as Kq,fe as Kr,ga as wm,gb as Ao,gc as Lp,gd as Lq,ge as Lr,ha as xm,hb as Bo,hc as Mp,hd as Mq,he as Sr,ia as ym,ib as Co,ic as Np,id as Nq,ie as Tr,ja as zm,jb as Do,jc as Op,jd as Oq,je as Ur,ka as Am,kb as Eo,kc as Pp,kd as Pq,ke as Vr,la as Bm,lb as Fo,lc as Qp,ld as Qq,le as Wr,ma as Cm,mb as Go,mc as Rp,md as Rq,me as Xr,na as Dm,nb as Ho,nc as Sp,nd as Sq,ne as Yr,o as a,oa as Em,ob as Io,oc as Tp,od as Tq,oe as Zr,p as Mk,pa as Fm,pb as Jo,pc as Up,pd as Uq,pe as _r,q as Nk,qa as Gm,qb as Ko,qc as Vp,qd as Vq,qe as $r,r as Ok,ra as Hm,rb as Lo,rc as Wp,rd as Wq,re as as,s as Pk,sa as Im,sb as Mo,sc as Xp,sd as Xq,se as bs,t as Qk,ta as Jm,tb as Po,tc as Yp,td as Yq,te as cs,u as Rk,ua as Km,ub as Qo,uc as Zp,ud as Zq,ue as ds,v as Sk,va as zn,vb as Ro,vc as _p,vd as _q,ve as es,w as Tk,wa as An,wb as So,wc as $p,wd as $q,we as fs,x as Uk,xa as Bn,xb as Uo,xc as aq,xd as ar,xe as gs,y as Zk,ya as Cn,yb as Vo,yc as bq,yd as br,ye as hs,z as _k,za as Dn,zb as Wo,zc as cq,zd as cr,ze as is}from"./chunk-158wqccn.js";import{Re as pp,Se as qp,Te as rp,Ue as sp,Ve as tp,We as up,Xe as vp}from"./chunk-rn194bhp.js";import{Ye as No,Ze as Oo}from"./chunk-72rwcbp6.js";import{_e as To}from"./chunk-7rxvafwc.js";import{$e as yn}from"./chunk-wqmppf6b.js";import{af as co,bf as eo,cf as fo,df as Yo}from"./chunk-xmzygmcz.js";import{ef as jl,ff as kl,gf as ll,hf as ml,if as nl,jf as ol,kf as pl,lf as ql,mf as rl,nf as sl,of as tl,pf as ul,qf as vl,rf as wl,sf as xl}from"./chunk-6kdrncsx.js";import{Af as Vl,Bf as Wl,Cf as Xl,Df as Yl,Ef as Zl,tf as Ol,uf as Pl,vf as Ql,wf as Rl,xf as Sl,yf as Tl,zf as Ul}from"./chunk-s7z5dp70.js";import{Ff as Ml,Gf as Nl}from"./chunk-213pzm0d.js";import{Hf as yl,If as zl,Jf as Al,Kf as Bl,Lf as Cl,Mf as Dl,Nf as El,Pf as Fl,Qf as Gl,Rf as Hl,Sf as Il,Tf as Jl,Uf as Kl,Xf as Ll}from"./chunk-ytma76qe.js";import{$f as kn,Yf as gn,Zf as hn,_f as jn,ag as ln,bg as xn}from"./chunk-cxbpmwq5.js";import{Ag as tn,Bg as un,Cg as vn,Dg as wn,cg as Lm,dg as Mm,eg as Nm,fg as Om,gg as Pm,hg as Qm,ig as Rm,jg as Sm,kg as Tm,lg as Um,mg as Vm,ng as Wm,og as Xm,pg as Ym,qg as Zm,rg as _m,sg as $m,tg as mn,ug as nn,vg as on,wg as pn,xg as qn,yg as rn,zg as sn}from"./chunk-6xk87qf2.js";import{Eg as an,Fg as bn}from"./chunk-ny67c03k.js";import{Gg as Mn,Hg as Nn,Ig as On,Jg as Pn,Kg as Qn,Lg as Rn,Mg as Sn,Ng as Tn,Og as Un,Pg as Vn,Qg as Wn,Rg as Xn}from"./chunk-xsng1mtq.js";import{Sg as vi,Tg as wi,Ug as xi,Vg as yi,Wg as zi,Xg as Ai}from"./chunk-0xqdmemy.js";import{Yg as Qj,Zg as Rj,_g as Sj,ch as Tj,dh as Uj,eh as Vj}from"./chunk-dm2nzg7a.js";import{fh as $j,gh as ak,hh as bk,ih as ck,jh as dk,kh as ek,lh as fk,mh as gk,nh as hk,oh as ik,ph as jk}from"./chunk-ekzg97dn.js";import{Ah as Pj,qh as Gj,rh as Hj,sh as Ij,th as Jj,uh as Kj,wh as Lj,xh as Mj,yh as Nj,zh as Oj}from"./chunk-pcxp4r9n.js";import{Bh as Bk,Dh as Ck}from"./chunk-76w34xne.js";import{Jh as Qh,Kh as Rh,Lh as Sh,Mh as Th,Nh as Uh,Oh as Vh}from"./chunk-t1tdjjht.js";import{$h as fi,Qh as Wh,Rh as Xh,Sh as Yh,Th as Zh,Uh as _h,Vh as $h,Wh as ai,Xh as bi,Yh as ci,Zh as di,_h as ei,ai as gi,bi as hi}from"./chunk-bjar18jd.js";import{di as ii,ei as ji,fi as ki,gi as li}from"./chunk-27fgag95.js";import{li as mi}from"./chunk-0we9nw1d.js";import{oi as ph}from"./chunk-cjmv8hgp.js";import{pi as qh}from"./chunk-bwsxym3d.js";import{qi as rh,ri as sh}from"./chunk-xq1acw1r.js";import{si as th,ti as uh,ui as vh,vi as wh,wi as xh,xi as yh}from"./chunk-hx998w7n.js";import{Ai as Bh,Bi as Ch,Ci as Dh,yi as zh,zi as Ah}from"./chunk-bjcsc6wx.js";import{Di as Eh,Ei as Fh,Fi as Gh,Gi as Hh,Hi as Ih}from"./chunk-qn5srnj3.js";import{Ii as Jh,Ji as Kh,Ki as Lh,Li as Mh,Mi as Nh,Ni as Oh,Oi as Ph}from"./chunk-4m7ajama.js";import{Pi as nh,Qi as oh}from"./chunk-gcr9e83g.js";import"./chunk-0c2h69k2.js";import{$i as Xe,Ui as Qe,Vi as Re,Wi as Se,Xi as Te,Yi as Ue,Zi as Ve,_i as We,aj as Ye,bj as Ze,cj as _e,dj as $e,ej as af,fj as bf}from"./chunk-f95drhdb.js";import{Aj as Jf,gj as tf,hj as uf,ij as vf,jj as wf,kj as xf,lj as yf,mj as zf,nj as Af,oj as Bf,pj as Cf,qj as Df,rj as Ef,sj as Ff,tj as Gf,uj as Hf,zj as If}from"./chunk-kgd8kchy.js";import{Hj as ef,Ij as ff,Jj as gf,Kj as hf,Lj as jf,Mj as kf,Nj as lf,Oj as mf,Pj as nf,Qj as of,Rj as pf,Sj as qf,Tj as rf,Uj as sf}from"./chunk-9e8t0twa.js";import{$j as Qf,Vj as Kf,Wj as Lf,Xj as Mf,Yj as Nf,Zj as Of,_j as Pf,ak as Rf,bk as Sf,ck as Tf,dk as Uf,ek as Vf,fk as Wf,gk as Xf}from"./chunk-f8p69dsg.js";import{Ak as Mr,Bk as Nr,Ck as Or,Dk as Pr,Ek as Qr,Fk as Rr}from"./chunk-eqe26g14.js";import{Gk as Vk,Hk as Wk,Ik as Xk,Jk as Yk,Kk as cn,Lk as dn,Mk as en,Nk as fn}from"./chunk-f53psr2y.js";import"./chunk-anydpa34.js";import"./chunk-ff5a6hvb.js";import{Dl as gc,yl as ec,zl as fc}from"./chunk-ec4wq2sv.js";import{Fl as bc}from"./chunk-s8jd13nb.js";import{$l as lb,$m as bd,$n as ue,$o as bg,$p as mh,$q as pj,Am as tc,An as Fd,Ap as Ng,Aq as Hi,Ar as pk,Bm as uc,Bn as Gd,Bp as Og,Bq as Ii,Br as qk,Cm as vc,Cn as Hd,Cp as Pg,Cq as Ji,Cr as rk,Dm as wc,Dn as Id,Dp as Qg,Dq as Ki,Dr as sk,Em as xc,En as Jd,Ep as Rg,Eq as Li,Er as tk,Fm as yc,Fn as Kd,Fp as Sg,Fq as Mi,Fr as uk,Gl as xa,Gm as zc,Gn as Ld,Gp as Tg,Gq as Ni,Gr as vk,Hl as ya,Hm as Ac,Hn as Md,Hp as Ug,Hq as Oi,Hr as wk,Il as za,Im as Bc,In as Nd,Ip as Vg,Iq as Pi,Ir as xk,Jl as Aa,Jm as Cc,Jn as Od,Jp as Wg,Jq as Qi,Jr as yk,Kl as Ba,Km as Dc,Kn as Pd,Kp as Xg,Kq as Ri,Kr as zk,Ll as Ca,Lm as Ec,Ln as Qd,Lp as Yg,Lq as Si,Lr as Ak,Ml as Da,Mm as Fc,Mn as Rd,Mp as Zg,Mq as aj,Mr as Dk,Nl as Ea,Nm as Gc,Nn as Sd,Np as _g,Nq as bj,Nr as Ek,Ol as Fa,Om as Hc,On as Td,Oo as Zf,Op as $g,Oq as cj,Or as Fk,Pl as Ga,Pm as Ic,Pn as Ud,Pp as ah,Pq as dj,Pr as Gk,Ql as Ha,Qm as Jc,Qn as Vd,Qp as bh,Qq as ej,Qr as Hk,Rl as Ia,Rm as Kc,Rn as Wd,Rp as ch,Rq as fj,Rr as Ik,Sl as Ja,Sm as Lc,Sn as Xd,Sp as dh,Sq as gj,Sr as Jk,Tl as Ka,Tm as Mc,Tn as Yd,Tp as eh,Tq as hj,Tr as Kk,Ul as La,Um as Nc,Un as Zd,Up as fh,Uq as ij,Ur as Lk,Vl as Ma,Vm as Oc,Vn as _d,Vp as gh,Vq as jj,Wl as Na,Wm as Pc,Wn as $d,Wo as _f,Wp as hh,Wq as kj,Xl as Oa,Xm as Qc,Xn as ae,Xp as ih,Xq as lj,Yl as ib,Ym as _c,Yn as re,Yo as $f,Yp as jh,Yq as mj,Zl as jb,Zm as $c,Zn as se,Zp as kh,Zq as nj,_l as kb,_m as ad,_n as te,_o as ag,_p as lh,_q as oj,am as mb,an as cd,ao as ve,ap as cg,aq as ni,ar as qj,bm as nb,bn as dd,bo as we,bp as dg,bq as oi,br as rj,cn as ed,co as xe,cp as eg,cr as sj,do as ye,dp as fg,dr as tj,em as Kb,en as fd,eo as ze,ep as rg,eq as pi,er as uj,fm as Lb,fn as gd,fo as Ae,fp as sg,fr as vj,gm as Mb,gn as hd,go as Be,gp as tg,gr as wj,hm as Nb,hn as id,ho as Ce,hp as ug,hr as xj,im as Ob,in as jd,io as De,ip as vg,ir as yj,jm as Pb,jn as kd,jo as Ee,jp as wg,jr as zj,km as Qb,kn as ld,kp as xg,kr as Aj,lm as Ub,ln as md,lo as Je,lp as yg,lr as Bj,mm as Vb,mn as nd,mo as Ke,mp as zg,mr as Cj,nm as Wb,nn as od,no as Le,np as Ag,nr as Dj,om as hc,on as pd,oo as Me,op as Bg,or as Ej,pm as ic,pn as qd,po as Ne,pp as Cg,pq as qi,pr as Fj,qm as jc,qn as vd,qo as Oe,qp as Dg,qq as ri,qr as Wj,rm as kc,rn as wd,ro as Pe,rp as Eg,rq as si,rr as Xj,sm as lc,sn as xd,sp as Fg,sq as ti,sr as Yj,tm as mc,tn as yd,tp as Gg,tq as ui,tr as Zj,um as nc,un as zd,up as Hg,uq as Bi,ur as _j,vm as oc,vn as Ad,vo as cf,vp as Ig,vq as Ci,vr as kk,wm as pc,wn as Bd,wo as df,wp as Jg,wq as Di,wr as lk,xm as qc,xn as Cd,xp as Kg,xq as Ei,xr as mk,ym as rc,yn as Dd,yo as Yf,yp as Lg,yq as Fi,yr as nk,zm as sc,zn as Ed,zp as Mg,zq as Gi,zr as ok}from"./chunk-pwsnafp3.js";import{$r as S,As as ta,Bs as ua,Cs as va,Ds as wa,Vr as M,Wr as N,Xr as O,Yr as P,Zr as Q,_r as R,as as T,bs as U,cs as V,ds as W,es as X,fs as Y,gs as Z,hs as _,is as $,js as aa,ks as ba,ls as ca,ms as da,ns as ea,os as fa,ps as ia,qs as ja,rs as ka,ss as la,ts as ma,us as na,vs as oa,ws as pa,xs as qa,ys as ra,zs as sa}from"./chunk-1cyxbb8y.js";import{Es as ga,Fs as ha}from"./chunk-zcz9rs6p.js";import{Gs as Rb,Hs as Sb,Is as Tb}from"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import{Ps as Ti,Qs as Ui,Rs as Vi,Ss as Wi,Ts as Xi,Us as Yi,Vs as Zi,Ws as _i,Xs as $i}from"./chunk-0btmm4m2.js";import{Ct as Xc,Dt as Yc,Et as Zc,nt as Rc,ot as Sc,pt as Tc,qt as Uc,rt as Vc,tt as Wc}from"./chunk-pwgv84pn.js";import{Ft as Xb,Gt as Yb,Ht as Zb,It as _b,Jt as $b,Kt as ac}from"./chunk-tkyrk66a.js";import{Rt as Fe,Ut as Ge,Vt as He,Yt as Ie}from"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import{bu as cc,cu as dc}from"./chunk-35ds08e7.js";import{gu as gg,hu as hg,iu as ig,ju as jg,ku as kg,lu as lg,mu as mg,ou as ng,pu as og,qu as pg,ru as qg}from"./chunk-5se8xt9e.js";import{Fu as be,Gu as ce,Hu as de,Iu as ee,Ju as fe,Ku as ge,Lu as he,Mu as ie,Nu as je,Ou as ke,Pu as le,Qu as me,Ru as ne,Su as oe,Tu as pe,Uu as qe,su as rd,tu as sd,uu as td,vu as ud}from"./chunk-gnfywmgs.js";import{$u as h,Av as L,Vu as b,Wu as c,Xu as d,Yu as e,Zu as f,_u as g,av as i,bv as m,cv as n,dv as o,ev as p,fv as q,gv as r,hv as s,iv as t,jv as u,kv as v,lv as w,mv as x,nv as y,ov as z,pv as A,qv as B,rv as C,sv as D,tv as E,uv as F,vv as G,wv as H,xv as I,yv as J,zv as K}from"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import{$v as zb,Qv as ob,Rv as pb,Sv as qb,Tv as rb,Uv as sb,Vv as tb,Wv as ub,Xv as vb,Yv as wb,Zv as xb,_v as yb,aw as Ab,bw as Bb,cw as Cb,dw as Db,ew as Eb,fw as Fb,gw as Gb,hw as Hb,iw as Ib,jw as Jb}from"./chunk-az4v4ard.js";import{Dw as Ua,Ew as Va,Fw as Wa,Gw as Xa,Hw as Ya,Iw as Za,Jw as _a,Kw as $a,Lw as ab,Mw as bb,Nw as cb,Ow as db,Pw as eb,Qw as fb,Rw as gb,Tw as hb,nw as Pa,ow as Qa,rw as Ra,ww as Sa,xw as Ta}from"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import{dx as j,ex as k,fx as l}from"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{tl as writeNetlifyConfig,nn as writeManifest,Yl as writeImageManifest,Fp as wrapComponentForHMR,ms as withDefaults,Ak as webComponentDirectiveHandler,uq as watermark,wr as watchViews,gm as watchMultiple,hm as watchEffect,fm as watch,Ne as warmImagePlaceholders,um as waitForStore,X as waitForLocale,qp as virtualPathFor,nk as videoDirective,G as validators,qs as validated,Ce as validateValueEnhanced,qi as validateTemplate,an as validateRouteRules,zq as validateParams,De as validateFormEnhanced,lr as validateFile,ye as validateFields,xe as validateField,si as validateDirective,Xd as validateCspDirectives,Ik as validateConfig,An as validateComponentScripts,Yn as validateComponentProps,mh as validateClientScript,li as v,Hc as usesSignalsInScript,ub as usesReactiveRuntime,Gi as userComponentFileExists,Th as useVirtualList,je as useTitle,tm as useStoreOrThrow,Xp as useStore,al as useStorage,Bf as useSlots,cl as useSessionStorage,cc as useServerRuntimeConfig,Zf as useServerData,ge as useSeoMeta,dc as useRuntimeConfig,vm as useRouteParams,xm as useRouteParamOrThrow,wm as useRouteParam,je as usePageTitle,sf as useOptimistic,Gf as useModel,zm as useMiddlewareValue,ym as useMiddlewareState,bl as useLocalStorage,yp as useLoadingIndicator,ee as useHead,ii as useForm,Df as useAttrs,nr as uploadFiles,mr as uploadFile,qm as updateInstance,qf as untrack,Wi as unregisterDirective,rm as unmountInstance,Qc as unescapeHtml,up as typecheckStxFiles,Ei as transpileTypeScript,$r as translate,Ba as transitionDirective,lc as transformAutoImports,Sn as toUsers,Rn as toUser,dq as thumbnail,er as thumbHashToRGBA,fr as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,Kf as templateCache,nd as syncRecordedResponse,Cp as stxClientHelpers,lg as structuredDataDirective,cs as stripLocalePrefix,Ym as stripDocumentWrapper,Sb as stripCommentsAndLiterals,Do as stringToStream,Ld as strictCspPreset,Ye as streamingSuspenseDirective,af as streamToResponse,We as streamTemplateSimple,Qe as streamTemplate,Uk as stopHmrServer,On as stopBroadcasting,_b as stateDirName,$b as stateDir,ef as state,gh as startsDocument,Yo as startProductionServer,To as startInteractive,Nn as startBroadcasting,es as stampLocaleLayoutGroup,Ia as staggerDirective,xq as srcsetUrls,Ja as springDirective,ud as splitByPipe,Um as spaNavVaryHeaders,rp as sourcePathFor,Eq as smartBatchSign,Ii as slotContentHasExpressions,Cq as signUrl,Ci as shouldTranspileTypeScript,Rk as shouldReloadOnChange,Hq as shouldRefreshSignature,Sk as shouldIgnoreFile,Lh as shouldCacheComponent,hq as sharpen,ts as shape,Zb as setStateDir,Dm as setRouteParams,Em as setMiddlewareState,_k as setKeptScope,Me as setImagePlaceholder,vf as setGlobalProvide,b as setErrorLocale,_l as setCurrentInstance,bk as setCachedVideoResult,Sj as setCachedImageResult,Mj as setCached,ws as serveStxFile,ys as serveMultipleStxFiles,Mk as serveMarkdownFile,hp as serveFile,zs as serveApp,gp as serve,Ip as serializeState,pn as serializeSetCookie,jq as sepia,he as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,Fi as scopeOnRootElement,rk as scopeHTML,qk as scopeCSS,og as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,nq as saturation,Aq as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,Gb as runtimeEventRegexLiteral,Eb as runtimeDirectiveNamesLiteral,zg as runPreProcessingMiddleware,Ag as runPostProcessingMiddleware,sn as runPageAction,lf as runMountCallbacks,gb as runMiddleware,om as runHooks,Ur as runDoctor,mf as runDestroyCallbacks,Dg as runComposers,oq as rotate,mi as rewriteImagesWithSiblings,od as responseBindings,Mi as resolveTemplatePath,ha as resolveStxTargets,Ek as resolveStxDirectories,_r as resolveI18n,bq as resize,rg as resetUnscopedSignalWarnings,Oc as resetRejectedExpressionWarnings,sc as resetPlaceholders,de as resetHead,Hp as resetHMRHandler,o as resetErrorConfig,os as required,dg as reportDeferredLoopWarnings,wc as replacePlaceholders,Ec as replaceInterpolations,ur as renderView,kk as renderVideoComponent,ic as renderVendorStyleTags,Dr as renderToString,Er as renderToStream,Fr as renderToDOM,dr as renderThumbhashToCanvas,Rr as renderTemplateString,Pr as renderTemplate,Qr as renderString,Te as renderStreamingPage,xi as renderSlot,Bh as renderSSRSuspense,Pq as renderProtectedVideo,Oq as renderProtectedImg,Bq as renderMediaUpload,Or as renderMarkdownView,en as renderLayoutTypes,Wj as renderImgComponent,Ol as renderImageComponent,le as renderHtmlAttrs,ke as renderHead,xr as renderEmail,Ki as renderComponentWithSlot,me as renderBodyAttrs,Sp as render,Nd as relaxedCspPreset,we as registerValidationRule,_e as registerStreamingDirectives,Zp as registerStoresClient,Bm as registerStore,Sf as registerServeModuleBundle,mg as registerSeoDirectives,_a as registerMiddleware,Ac as registerFilters,zc as registerFilter,d as registerErrorMessages,Be as registerEnhancedValidationRule,Ti as registerDirective,Wd as registerCspDirectives,$n as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,mc as referencesName,cm as ref,Lo as redirect,jd as recordResponseStatus,kd as recordResponseHeader,ac as rebaseOntoStateDir,ld as readResponseStatus,md as readResponseHeaders,Kk as readMarkdownFile,Lf as readFileCached,dm as reactive,sq as quality,Mq as pruneSignatureCache,Pj as pruneCache,tf as provide,Nr as protectCodeBlocks,ns as prop,Gg as processVueTemplate,Rh as processVirtualListDirectives,Vh as processVirtualGridDirectives,jk as processVideo,ze as processValidateDirective,ea as processTranslateDirective,vh as processTransitionDirectives,yh as processTransitionAttributes,pe as processTitleDirective,bd as processTemplateBindings,rh as processTeleportDirectives,zh as processSuspenseDirectives,hg as processStructuredData,Ue as processStreamDirectives,pd as processStatusDirective,gi as processStaticDirectives,xg as processStackReplacements,wg as processStackPushDirectives,yi as processSlots,Wm as processShell,Pe as processServerBindings,ig as processSeoDirective,$e as processSectionDirectives,Vc as processScopedStyles,$c as processReactiveBindings,Qq as processProtectedMedia,$h as processPartialHydrationDirectives,lh as processOnceDirective,yg as processMiddleware,gg as processMetaDirectives,qe as processMetaDirective,Lk as processMarkdownFileDirectives,Ri as processMarkdownDirectives,eg as processLoops,Jh as processKeepAliveDirectives,kh as processJsonDirective,Uh as processInfiniteListDirectives,vg as processIncludes,Yj as processImgComponents,Ql as processImageComponents,Dl as processImage,oe as processHeadDirective,se as processForms,ue as processFormInputDirectives,Mc as processExpressions,Pb as processEventDirectives,ve as processErrorDirective,Hg as processDynamicComponents,ni as processDirectives,$i as processDirectiveAttributes,qh as processDeferDirectives,$d as processCustomDirectives,Td as processCspDirectives,us as processComponentProps,rc as processClientScript,te as processBasicFormDirectives,Eh as processAsyncDirectives,ae as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,Ie as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,xp as preloadIslandHandlers,Oe as preloadIconCollection,Jn as poolStrings,Ck as pluginManager,Ke as placeholdersWarmed,uh as performLeave,th as performEnter,nf as pendingLifecycleCounts,rf as peek,sg as partialsCache,lk as parseVideoDirectiveOptions,$p as parseUrl,gr as parseThumbhashString,Ad as parseSwitchBlock,vi as parseSlots,wi as parseSlotElement,Fd as parseScriptDeclarations,yk as parseSFCComponent,Rq as parseProtectedArgs,cg as parseLoopBinding,Xj as parseImgComponent,nj as parseImageUrl,Pl as parseImageComponent,qn as parseFormBody,Cd as parseExpressionWithFilters,ao as parseDefaults,Io as parseCookies,Nm as parseContainerSelector,xd as parseConditionalBlock,Dd as parseArguments,Ma as parseAnimationShorthand,ps as optional,Kn as optimizeTemplate,Vl as optimizeImage,Wl as optimizeDirectory,rs as oneOf,tg as onceStore,lm as onUpdated,_c as onUpdate,nm as onUnmounted,Im as onServer,jm as onMounted,jf as onMount,fi as onHydrated,zf as onErrorCaptured,kf as onDestroy,Ph as onDeactivated,Hm as onClient,km as onBeforeUpdate,mm as onBeforeUnmount,im as onBeforeMount,Oh as onActivated,$q as observeElement,Mo as notFound,Mg as normalizeCriticalHeadOrder,yf as nextTick,eo as negotiateEncoding,Ua as navigateTo,pm as mountInstance,Ea as motionDirective,Md as moderateCspPreset,In as minifyHtml,kg as metaDirective,_g as metaDedupKey,aq as mergeParams,ah as mergeHtmlAttrs,fe as mergeHeadConfigs,Sc as mergeCssConfig,Qd as mergeCspDirectives,Ra as matchRoute,Si as markdownDirectiveHandler,Jk as markdownCache,ga as looksLikeGlob,bs as localizePath,U as loadTranslationLazy,_ as loadTranslation,Fk as loadStxConfig,db as loadMiddlewareFromDirectory,on as loadManifest,Xq as loadElement,Pn as loadChannels,Lb as listensPassively,is as lintStxStrict,Zq as lazyLoadAll,Yq as lazyLoad,Ha as keyframeDirective,hl as keptState,Br as jsxs,Cr as jsxDEV,Ar as jsx,Ko as jsonResponse,Ze as islandDirective,l as isTest,_m as isSpaNavigation,Sm as isSpaNavRequest,Fq as isSignatureValid,of as isSignal,Bl as isSharpAvailable,wo as isServerEnvironment,Fm as isServer,yb as isRuntimeOwnedColonAttr,Hb as isRuntimeEventName,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Uq as isNativeLazySupported,Mr as isMarkdownPath,Q as isLoading,R as isLoaded,Bi as isJavaScriptScript,Vq as isIntersectionObserverSupported,Jl as isImageFile,Cl as isImageBackendAvailable,aa as isICUFormat,ei as isHydrated,Hi as isHydrateTrigger,hd as isHttpStatus,vo as isEdgeEnvironment,js as isDirectiveKind,k as isDevelopment,pf as isDerived,Qk as isCssOnlyChange,co as isCompressible,Gm as isClient,Zm as isChromeInstanceScript,Gh as isAsyncComponent,rn as isActionableMethod,kq as invert,Nf as invalidateFileCacheByDir,Mf as invalidateFileCache,Lc as interpolateScriptsInTemplate,Jc as interpolateScriptExpressions,Kc as interpolateScriptAttributes,x as inlineError,Zr as injectThemeBootstrap,jg as injectSeoTags,Wr as injectSeo,Yf as injectRouterScript,Pk as injectHotReload,kb as injectHeatmap,Zc as injectCss,Rd as injectCspMetaTag,ih as injectConfigHeadTags,Lg as injectColorModeBootScript,ch as injectCloakStyle,Sg as injectBuildId,kc as injectBrowserCoreAutoImports,dd as injectAnalytics,uf as inject,Am as initStoreRegistry,wl as initNetlify,zp as initLoadingIndicator,Wq as initLazyLoading,So as initFile,cr as initBlurUp,ir as initAllBlurUp,_j as imgDirective,Tl as imageDirective,vn as hydrateTemplateStream,un as hydrateTemplate,wp as hydrateIslands,bi as hydrateIsland,wn as hydrateFragment,ci as hydrateByStrategy,di as hydrateAll,Pp as hydrate,fp as htmlResponse,eh as hoistLeadingHeadTags,Ng as hoistColorModeBootScript,lb as heatmapDirective,Ij as hashString,Xf as hashFilePath,Gj as hashFile,Hj as hashBuffer,Fg as hasVueTemplateSyntax,bg as hasVariables,Up as hasStore,xc as hasPlaceholders,ul as hasNetlifyConfig,ab as hasMiddleware,Qb as hasEventDirectives,hh as hasDocumentShell,ti as hasDirectives,ma as hasDOMSupport,Ml as handleImageRequest,Af as handleError,Jr as h,Il as groupVariantsByFormat,iq as grayscale,_o as gitHash,Cn as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,pl as getTotalSize,Gq as getTimeUntilExpiry,nh as getStoreScript,Vp as getStoreNames,Tp as getStore,fl as getStorageSize,el as getStorageKeys,Ni as getSourceLineInfo,Di as getSharedTranspiler,Tf as getServeModuleBundle,Rf as getServeClientAsset,la as getScreenReaderOnlyStyle,sk as getScopeAttribute,df as getRouteParams,Vb as getPublicEnvDefine,Wb as getPublicEnv,ri as getPositionInfo,uc as getPlaceholderRegistry,Fj as getPlaceholderCacheStats,ce as getPageMeta,Hd as getNonce,Kl as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,Je as getImagePlaceholder,El as getImageMetadata,Fe as getImageDelivery,Op as getHydrationRuntime,Cm as getHydratedStoreState,Tk as getHmrServer,be as getHead,Gp as getHMRHandler,rj as getFormatExtension,Kj as getFileMtime,Hl as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,Vi as getDirectives,Ui as getDirective,$l as getCurrentInstance,Wc as getCssServeAsset,Pd as getCspPreset,Yd as getCspHeaderName,Qi as getComponentCacheStats,ak as getCachedVideoResult,Kq as getCachedSignature,Pf as getCachedSignalsRuntime,Qf as getCachedRouterScript,Dj as getCachedPlaceholder,Rj as getCachedImageResult,Lj as getCached,Oj as getCacheStats,Qg as getBuildId,Mn as getBroadcastServer,qj as getBestVariant,Bc as getAllFilters,ej as generateWidthSrcset,Sh as generateVirtualListCSS,pr as generateVideoPreview,Ee as generateValidationScript,qr as generateUploadRuntime,Dn as generateTreeShakenBundle,xh as generateTransitionRuntime,wh as generateTransitionCSS,ek as generateThumbnails,wj as generateThumbhashPlaceholder,no as generateTemplatesDocs,Dh as generateSuspenseRuntime,Ch as generateSuspenseCSS,Jp as generateStateScript,oj as generateSrcsetData,Vj as generateSrcset,Fl as generateSrcSet,fk as generateSpriteSheet,yr as generateSpaShell,pj as generateSourceTags,kj as generateSizesFromBreakpoints,jj as generateSizesAttribute,Gl as generateSizes,ng as generateSitemapIndex,Xr as generateSitemap,Tq as generateSimpleMediaPicker,Nq as generateSignatureRuntime,Jf as generateSignalsRuntimeDev,If as generateSignalsRuntime,qc as generateServerDataBridge,pk as generateScopeId,zk as generateSFCWebComponent,Nb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,pg as generateRobotsTxt,Yr as generateRobots,Uj as generateResponsiveVariants,vk as generateReactiveWebComponentTS,uk as generateReactiveWebComponent,xk as generateReactiveRuntime,wk as generateReactiveMixin,dk as generatePoster,Cj as generatePlaceholderStyle,Bj as generatePlaceholderCSS,vj as generatePlaceholder,ai as generatePartialHydrationCSS,Wg as generateOfflineWorker,Gd as generateNonce,ql as generateNetlifyToml,sr as generateMinifiedMediaRuntime,rr as generateMediaRuntime,Sq as generateMediaManagerEmbed,mn as generateManifest,Bp as generateLoadingIndicatorHtml,br as generateLazyLoadRuntime,fn as generateLayoutTypes,yj as generateLQIP,Nh as generateKeepAliveRuntime,Mh as generateKeepAliveCSS,hi as generateIslandManifest,or as generateImagePreview,Xl as generateImageManifest,Np as generateHydrationScript,bf as generateHydrationRuntime,Qp as generateHydrationCSS,Wh as generateHydrationBootstrap,Ok as generateHotReloadScript,jb as generateHeatmapScript,Ep as generateHMRClientScript,gk as generateHLSManifest,Kp as generateEventBindings,ij as generateDprSrcsetWithVariableQuality,hj as generateDprSrcset,fh as generateDocumentShell,so as generateDocs,oo as generateDirectivesDocs,_i as generateDirectiveRuntime,qg as generateDefaultRobotsTxt,hk as generateDASHManifest,Yc as generateCss,Kd as generateCspMetaTag,Jd as generateCspHeader,Ff as generateCompositionRuntime,mo as generateComponentsDocs,Xh as generateComponentManifest,ko as generateComponentDoc,Aj as generateColorPlaceholder,Kg as generateColorModeBootScript,sm as generateClientRuntime,Jj as generateCacheKey,oc as generateBrowserAutoImportDestructuring,jr as generateBlurUpRuntime,kr as generateBlurUpCSS,ad as generateBindingsRuntime,fj as generateAutoWidthSrcset,nc as generateAutoImportDestructuring,Ih as generateAsyncComponentRuntime,Hh as generateAsyncComponentCSS,fc as generateApiTypes,Na as generateAnimationRuntime,La as generateAnimationCSS,cd as generateAnalyticsScript,vp as formatTypecheckDiagnostics,op as formatTypeErrors,Po as formatStxContent,ol as formatSize,Ta as formatRoutes,Qo as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,Vr as formatDoctorReport,po as formatDocsAsMarkdown,ro as formatDocsAsJson,qo as formatDocsAsHtml,rq as format,il as forgetKeptState,Hn as foldConstants,$k as flushKeptState,qq as flipVertical,pq as flipHorizontal,gn as fingerprint,tp as findStxModuleDeclarations,sp as findRuntimeTypeDeclarations,Tr as findPantryPackage,Dc as findMustacheEnd,wd as findMatchingEndTag,sd as findMatchingDelimiter,Rb as findInterpolationEnd,yd as findIfBlocks,Bd as findExpressions,Sa as findErrorPage,Tc as findDuplicateScopedStyleRanges,zd as findDirectiveBlocks,En as findDeadCode,En as findDeadBranches,Om as findContainerRegion,lo as findComponentFiles,xs as findCommonDir,nl as filterRequiredFiles,Li as fileExists,_f as extractVariables,pi as extractTemplateExpressions,Ve as extractStreamBoundaries,Lp as extractState,zi as extractSlotContent,ag as extractScriptFromTemplate,oi as extractScriptBlocks,vc as extractPlaceholders,vd as extractParenthesizedExpression,id as extractPageResponseStatus,hb as extractLayoutMetadata,zj as extractDominantColor,Ed as extractDirectiveParams,ui as extractDirectiveNames,$m as extractContainerContent,io as extractComponentProps,Yh as extractComponentName,jo as extractComponentDescription,Xc as extractClassNames,pc as extractBridgeData,Zh as extractBoundProps,td as extractBalancedExpression,hc as extractAndStripCssImports,tk as extractAndScopeStyles,Ob as extractAndProcessEvents,Xk as externalizeSharedAssets,Yk as externalizeRepeatedAssets,Wk as externalizeHtml,Pc as evaluateExpression,Gn as evaluateConstant,qd as evaluateAuthExpression,Gc as escapeHtmlValue,Fc as escapeHtml,C as errorRecovery,E as errorLogger,sh as ensureTeleportTargets,jh as ensureDocumentShell,Ae as enhancedValidationRules,go as enableDevTools,Fn as eliminateDeadCode,gf as effect,yq as dprUrls,to as docsCommand,ec as discoverServerApi,dn as discoverLayoutNames,ar as disconnectObserver,ho as disableDevTools,F as devHelpers,Vm as detectShell,uo as detectRuntime,rl as detectProjectConfig,sj as detectFormat,zn as detectBuildMode,ff as derived,vl as deploy,Ge as deliveredImage,Hk as defineStxConfig,Yp as defineStore,Cf as defineSlots,hs as defineSiteConfig,ls as definePropsWithValidation,ks as defineProps,Bk as definePlugin,ie as definePageMeta,Wa as defineMiddleware,ji as defineForm,xf as defineExpose,wf as defineEmits,Xi as defineDirective,Lr as defineCustomElement,Xo as defineConfig,Yi as defineClientDirective,Fh as defineAsyncComponent,Zo as defineApiHandler,tr as defaultMediaConfig,Zl as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,re as defaultFormClasses,yc as defaultFilters,_d as defaultCspConfig,Dk as defaultConfig,vs as default,Rc as deepMergeThemes,Uc as dedupeScopedStyles,Rm as decodeTitleEntities,xj as decodeThumbhash,fg as declareBareLoopHead,Vd as cspNonceDirective,Ud as cspDirective,hr as crossfadeTransition,cq as crop,Qh as createVirtualList,mk as createVideoDirective,Go as createVercelHandler,lp as createTypeChecker,fa as createTranslateFilter,Co as createTextEncoderStream,Kr as createStxApp,Bo as createStreamingResponse,Xe as createStreamRenderer,Wp as createStore,Za as createStorageManager,Xa as createServerCookieManager,gc as createServerApi,bm as createScope,Ah as createSSRSuspense,cf as createRouter,bn as createRouteRuleResolver,eb as createRouteLocation,jp as createRoute,cm as createRef,dm as createReactive,Ef as createProvideContext,ap as createProject,Wo as createProductionBuild,tc as createPlaceholder,Ln as createOptimizedBuild,Ho as createNetlifyHandler,jl as createNetlifyClient,fb as createMiddlewareContext,ip as createMiddleware,_q as createLazyObserver,Kh as createKeepAliveCache,yo as createKVNamespace,_h as createIslandRegistry,Zj as createImgDirective,Ul as createImagePlugin,Nl as createImageHandler,Sl as createImageDirective,nb as createHeatmapAggregator,ml as createFileManifest,xo as createEnvAccessor,z as createEnhancedError,Ao as createEdgeHandler,zo as createEdgeCache,Oi as createDetailedErrorMessage,Fo as createDenoHandler,sl as createDefaultNetlifyConfig,Zd as createCspHeaders,Jo as createCookie,em as createComputed,am as createComponentInstance,Eo as createCloudflareHandler,Ya as createClientCookieManager,Zi as createBuiltinDirectives,Kr as createApp,Ka as createAnimationTimeline,fq as cover,$f as convertToCommonJS,mq as contrast,eq as contain,y as consoleError,m as configureErrorHandling,Gk as config,em as computed,fo as compressResponse,Cg as composerPattern,Bg as composer,Xm as composeShellWithPage,_n as componentDirective,Ji as componentClientSignalNames,ln as compileTemplate,a as collectRepeatedFlag,ll as collectDeployFiles,dh as cloakStyleFragment,Ic as clientLoopScopes,ck as clearVideoCache,N as clearTranslationCache,oh as clearStoreCache,dl as clearStorage,Lq as clearSignatureCache,Hf as clearServerData,Ej as clearPlaceholderCache,ug as clearOnceStore,Id as clearNonce,bb as clearMiddleware,Le as clearImagePlaceholders,He as clearImageDeliveryCatalog,Rl as clearImageCache,e as clearErrorMessages,Uf as clearDevCaches,Cc as clearCustomFilters,Eg as clearComposers,ph as clearComposableCache,Pi as clearComponentCache,Nj as clearCache,Ib as clearBlankCache,Ap as cleanupLoadingIndicator,Lm as classifyScript,Mm as classifyAllScripts,mp as checkTemplateFile,np as checkTemplate,Vf as checkCache,Iq as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,Vn as channel,Oo as captureScreenshots,No as captureScreenshot,Z as cancelPendingLoads,kl as calculateSha1,gj as calculateOptimalWidths,Zk as cachedQuery,Wf as cacheTemplate,bc as cacheEngineFingerprint,ok as buildWebComponents,pp as buildVirtualSource,vr as buildViews,_p as buildUrl,Re as buildSuspenseResolveScript,gs as buildStaticSite,qb as buildRuntimeGlobalsDestructure,hn as buildRuntimeAsset,jn as buildRouterAsset,fs as buildLangPickerScript,mj as buildImageUrl,Tg as buildIdFragment,$g as buildHtmlAttrs,xn as buildForProduction,bo as buildComponentLibrary,Jq as buildAuthParams,yn as buildApp,ds as buildAlternateLinks,Vo as build,Tn as broadcastPrivate,Un as broadcastPresence,Qn as broadcast,lq as brightness,Tb as bracketDepths,gq as blur,Jb as blankInertHtmlRegions,Dq as batchSignUrls,hf as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,tq as auto,ja as attributeValue,kn as assetTags,Mb as asInvocableStatement,ss as arrayOf,as as applyTranslations,Tj as applyTransformations,Ai as applySlots,Zn as applyPropDefaults,wq as applyPreset,bh as applyHtmlAttrs,ne as applyHead,Nc as applyFilters,Tm as appendVary,Od as apiCspPreset,Da as animationGroupDirective,ik as analyzeVideo,Bn as analyzeUsage,Jm as analyzeTemplate,Km as analyzeProject,Bn as analyzeDirectiveUsage,ed as analyticsDirective,dp as addStore,cp as addPage,Sd as addNonceToInlineContent,ep as addLayout,bp as addComponent,tn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,Of as __setSignalsGeneratorsForTest,Rg as __setBuildIdForTest,$j as VideoProcessorCache,ki as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,rd as Tokenizer,kp as TemplateTypeChecker,Ro as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,Gr as Show,Se as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,jc as STX_AUTO_IMPORTS,Yb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Pm as SPA_NAV_HEADER,Kb as SCROLL_BLOCKING_EVENTS,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Fb as RUNTIME_EVENT_NAMES,Db as RUNTIME_DIRECTIVE_NAMES,fd as RESPONSE_STATUS_KEY,gd as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Uo as ProductionBuild,Ir as Portal,$o as PROJECT_TEMPLATES,vq as PRESETS,Ug as OFFLINE_WORKER_PATH,Vg as OFFLINE_REGISTER_SCRIPT,sb as NON_CLIENT_PRIMITIVES,Rp as MemorySessionStore,dj as MIME_TYPES,aj as MEDIA_DEFAULT_WIDTHS,cj as MEDIA_DEFAULT_FORMATS,cn as LAYOUT_TYPES_FILE,gl as KEPT_STATE_PREFIX,Qj as ImageProcessorCache,Ll as ImageProcessingError,Mp as HydrationRuntime,Nk as HotReloadServer,mb as HeatmapAggregator,Zg as HTML_CLASS_MARKER,Yg as HTML_ATTRS_MARKER,zr as Fragment,Hr as For,Qm as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,Vk as EXTERNALIZED_ASSET_DIR,xl as DeployError,yl as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Xb as DEFAULT_STATE_DIR,Al as DEFAULT_QUALITY,tj as DEFAULT_PLACEHOLDER_OPTIONS,zl as DEFAULT_FORMATS,bj as DEFAULT_DPR_VALUES,Dp as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,lj as COMMON_SIZES,Ig as COLOR_MODE_BOOT_MARKER,Jg as COLOR_MODE_BOOT_GLOBAL,Xg as CLOAK_STYLE,Xn as BroadcastServer,Wn as Broadcast,Og as BUILD_ID_META,Pg as BUILD_ID_HEADER,Ub as BROWSER_CORE_IMPORTS,uj as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,Sr as $path};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{Js as x}from"./chunk-9fqp72ze.js";import{Jt as A}from"./chunk-tkyrk66a.js";import{Zt as T,bu as q}from"./chunk-1te8k8gp.js";import{Ww as y,ow as C}from"./chunk-36xaycje.js";import{ix as P}from"./chunk-2fw05hs2.js";y();import H from"fs";import $ from"path";import{pathToFileURL as b}from"url";var R=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],O=new Set;function N(J,Y={}){let K=$.resolve(J,Y.dir??"server/api"),Q=[],Z=new Map;if(!H.existsSync(K))return Q;let B=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:K})).sort();for(let z of B){if(z.endsWith(".d.ts"))continue;let W=z.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),I=W.pop(),X=I.lastIndexOf("."),_=X>=0?I.slice(X+1):"get",F=_.toUpperCase();if(!R.includes(F)||_!==_.toLowerCase())throw Error(`Unsupported API method suffix in ${z}; use ${R.map((k)=>k.toLowerCase()).join(", ")}`);if(X>=0)I=I.slice(0,X);if(I!=="index")W.push(I);let G=new Set,j=W.map((k,S)=>{let E=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(k);if(E){if(G.has(E[2])||E[1]&&S!==W.length-1)throw Error(`Invalid API parameter in ${z}`);return G.add(E[2]),`:${E[2]}${E[1]?"*":""}`}if(!/^[\w-]+$/.test(k))throw Error(`Unsupported API path segment ${k} in ${z}`);return k}),U=`/api${j.length?`/${j.join("/")}`:""}`,L=`${F} ${U.replace(/:\w+/g,":param")}`;if(Z.has(L))throw Error(`Ambiguous API route ${F} ${U}: ${Z.get(L)} and ${z}`);Z.set(L,z);let M=$.join(K,z);O.add($.resolve(M)),O.add(H.realpathSync(M)),Q.push({pattern:U,method:F,filePath:M})}return Q.sort((z,V)=>{let W=z.pattern.split("/"),I=V.pattern.split("/"),X=(_)=>_?.endsWith("*")?0:_?.startsWith(":")?1:2;for(let _=0;_<Math.max(W.length,I.length);_++){let F=X(I[_])-X(W[_]);if(F)return F}return z.pattern.localeCompare(V.pattern)||z.method.localeCompare(V.method)})}async function w(J,Y){let K=A(J,"api-types.d.ts"),Q=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let B of Y){let z=`./${$.relative($.dirname(K),B.filePath).replace(/\\/g,"/")}`,{params:V}=C(B.pattern);Q.push(` ${JSON.stringify(`${B.method} ${B.pattern}`)}: { params: { ${V.map((W)=>`${JSON.stringify(W)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(z)}).default>> }`)}Q.push(" }","}","export {}","");let Z=Q.join(`
2
+ import{Js as x}from"./chunk-9fqp72ze.js";import{Jt as A}from"./chunk-tkyrk66a.js";import{$t as T,du as q}from"./chunk-35ds08e7.js";import{Yw as y,qw as C}from"./chunk-4f9zyfdw.js";import{kx as P}from"./chunk-ay6zjq8v.js";y();import H from"fs";import $ from"path";import{pathToFileURL as b}from"url";var R=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],O=new Set;function N(J,Y={}){let K=$.resolve(J,Y.dir??"server/api"),Q=[],Z=new Map;if(!H.existsSync(K))return Q;let B=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:K})).sort();for(let z of B){if(z.endsWith(".d.ts"))continue;let W=z.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),I=W.pop(),X=I.lastIndexOf("."),_=X>=0?I.slice(X+1):"get",F=_.toUpperCase();if(!R.includes(F)||_!==_.toLowerCase())throw Error(`Unsupported API method suffix in ${z}; use ${R.map((k)=>k.toLowerCase()).join(", ")}`);if(X>=0)I=I.slice(0,X);if(I!=="index")W.push(I);let G=new Set,j=W.map((k,S)=>{let E=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(k);if(E){if(G.has(E[2])||E[1]&&S!==W.length-1)throw Error(`Invalid API parameter in ${z}`);return G.add(E[2]),`:${E[2]}${E[1]?"*":""}`}if(!/^[\w-]+$/.test(k))throw Error(`Unsupported API path segment ${k} in ${z}`);return k}),U=`/api${j.length?`/${j.join("/")}`:""}`,L=`${F} ${U.replace(/:\w+/g,":param")}`;if(Z.has(L))throw Error(`Ambiguous API route ${F} ${U}: ${Z.get(L)} and ${z}`);Z.set(L,z);let M=$.join(K,z);O.add($.resolve(M)),O.add(H.realpathSync(M)),Q.push({pattern:U,method:F,filePath:M})}return Q.sort((z,V)=>{let W=z.pattern.split("/"),I=V.pattern.split("/"),X=(_)=>_?.endsWith("*")?0:_?.startsWith(":")?1:2;for(let _=0;_<Math.max(W.length,I.length);_++){let F=X(I[_])-X(W[_]);if(F)return F}return z.pattern.localeCompare(V.pattern)||z.method.localeCompare(V.method)})}async function w(J,Y){let K=A(J,"api-types.d.ts"),Q=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let B of Y){let z=`./${$.relative($.dirname(K),B.filePath).replace(/\\/g,"/")}`,{params:V}=C(B.pattern);Q.push(` ${JSON.stringify(`${B.method} ${B.pattern}`)}: { params: { ${V.map((W)=>`${JSON.stringify(W)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(z)}).default>> }`)}Q.push(" }","}","export {}","");let Z=Q.join(`
3
3
  `);if(!await Bun.file(K).exists()||await Bun.file(K).text()!==Z)await Bun.write(K,Z);return K}async function p(J,Y,K={}){let Q=N(J,K);await w(J,Q);let Z=[];for(let B of Q){let z=await Bun.build({entrypoints:[B.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!z.success)throw Error(`API build failed for ${B.filePath}: ${z.logs.join(`
4
- `)}`);let V=z.outputs.find((X)=>X.kind==="entry-point");if(!V)throw Error(`No API bundle for ${B.filePath}`);if(z.outputs.length!==1)throw Error(`API endpoint ${B.filePath} emits assets; package those explicitly instead`);let I=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await V.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write($.join(Y,I),V),Z.push({...B,filePath:I})}return Z}function D(J,Y){let K=J.map((Q)=>({route:Q,...C(Q.pattern)}));return async(Q)=>{let Z=new URL(Q.url).pathname,B=K.filter((G)=>G.regex.test(Z));if(!B.length)return null;let z=B[0].route.pattern,V=(G)=>G.replace(/:\w+/g,":param"),W=B.filter((G)=>V(G.route.pattern)===V(z)),I=Q.method,X=W.find((G)=>G.route.method===I)??(I==="HEAD"?W.find((G)=>G.route.method==="GET"):void 0);if(!X){let G=new Set(W.map((j)=>j.route.method));if(G.has("GET"))G.add("HEAD");return G.add("OPTIONS"),new Response(null,{status:I==="OPTIONS"?204:405,headers:{Allow:Array.from(G).sort().join(", ")}})}let _=X.regex.exec(Z),F=Object.create(null);try{X.params.forEach((G,j)=>{F[G]=decodeURIComponent(_[j+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let G=await Y(X.route);if(typeof G!=="function")throw Error(`API endpoint ${X.route.filePath} must default-export a handler`);let j=await G(Q,{params:F}),U=j instanceof Response?j:j===void 0?new Response(null,{status:204}):Response.json(j);if(I==="HEAD")return new Response(null,{status:U.status,headers:U.headers});return U}catch(G){return console.error(`[stx] API error for ${I} ${z}:`,G),Response.json({error:"Internal Server Error"},{status:500})}}}function l(J,Y){return D(Y,async(K)=>(await import(b($.resolve(J,K.filePath)).href)).default)}async function s(J,Y){if(!Y)return async()=>null;let K=Y===!0?{}:Y,Q=N(J,K);return await w(J,Q),async(Z)=>{if(!new URL(Z.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let B=N(J,K);await w(J,B);let{loadStxConfig:z}=await import("./chunk-cqn117hn.js"),V=q((await z(J)).runtimeConfig);return await T(V,()=>D(B,async(W)=>{let I=await Bun.build({entrypoints:[W.filePath],target:"bun",format:"esm",splitting:!1});if(!I.success)throw Error(I.logs.join(`
4
+ `)}`);let V=z.outputs.find((X)=>X.kind==="entry-point");if(!V)throw Error(`No API bundle for ${B.filePath}`);if(z.outputs.length!==1)throw Error(`API endpoint ${B.filePath} emits assets; package those explicitly instead`);let I=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await V.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write($.join(Y,I),V),Z.push({...B,filePath:I})}return Z}function D(J,Y){let K=J.map((Q)=>({route:Q,...C(Q.pattern)}));return async(Q)=>{let Z=new URL(Q.url).pathname,B=K.filter((G)=>G.regex.test(Z));if(!B.length)return null;let z=B[0].route.pattern,V=(G)=>G.replace(/:\w+/g,":param"),W=B.filter((G)=>V(G.route.pattern)===V(z)),I=Q.method,X=W.find((G)=>G.route.method===I)??(I==="HEAD"?W.find((G)=>G.route.method==="GET"):void 0);if(!X){let G=new Set(W.map((j)=>j.route.method));if(G.has("GET"))G.add("HEAD");return G.add("OPTIONS"),new Response(null,{status:I==="OPTIONS"?204:405,headers:{Allow:Array.from(G).sort().join(", ")}})}let _=X.regex.exec(Z),F=Object.create(null);try{X.params.forEach((G,j)=>{F[G]=decodeURIComponent(_[j+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let G=await Y(X.route);if(typeof G!=="function")throw Error(`API endpoint ${X.route.filePath} must default-export a handler`);let j=await G(Q,{params:F}),U=j instanceof Response?j:j===void 0?new Response(null,{status:204}):Response.json(j);if(I==="HEAD")return new Response(null,{status:U.status,headers:U.headers});return U}catch(G){return console.error(`[stx] API error for ${I} ${z}:`,G),Response.json({error:"Internal Server Error"},{status:500})}}}function l(J,Y){return D(Y,async(K)=>(await import(b($.resolve(J,K.filePath)).href)).default)}async function s(J,Y){if(!Y)return async()=>null;let K=Y===!0?{}:Y,Q=N(J,K);return await w(J,Q),async(Z)=>{if(!new URL(Z.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let B=N(J,K);await w(J,B);let{loadStxConfig:z}=await import("./chunk-tntv9hvq.js"),V=q((await z(J)).runtimeConfig);return await T(V,()=>D(B,async(W)=>{let I=await Bun.build({entrypoints:[W.filePath],target:"bun",format:"esm",splitting:!1});if(!I.success)throw Error(I.logs.join(`
5
5
  `));let X=I.outputs.find((_)=>_.kind==="entry-point");if(!X||I.outputs.length!==1)throw Error(`Unsupported API bundle output: ${W.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await X.text()).toString("base64")}`)).default})(Z))}catch(B){return console.error("[stx] API discovery failed:",B),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function u(J,Y,K){if(x(J))return!0;let Q=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(Q.test($.basename(J)))return!0;try{if(Q.test($.basename(H.realpathSync(J))))return!0}catch{}if(O.has($.resolve(J)))return!0;if(!K)return!1;let Z=$.resolve(Y,typeof K==="object"?K.dir??"server/api":"server/api"),B=(V)=>{try{return H.realpathSync(V)}catch{return $.resolve(V)}},z=B(J);return[Z,$.resolve(Y,"server"),$.resolve(Y,".output/server")].some((V)=>{let W=B(V);return z===W||z.startsWith(`${W}${$.sep}`)})}
6
6
  export{N as yl,w as zl,p as Al,D as Bl,l as Cl,s as Dl,u as El};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{qh as x,vh as B,wh as c,xh as u,yh as n}from"./chunk-pcxp4r9n.js";import{ix as v}from"./chunk-2fw05hs2.js";import{resolve as JJ,basename as WJ,extname as _J,join as LJ}from"path";import{mkdir as QJ}from"fs/promises";var ZJ={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class V{config;constructor(K={}){this.config={...ZJ,...K}}async get(K,J){return c(K,J,"video",this.config)}async set(K,J,X){return u(K,J,X,"video",this.config)}async clear(){return n("video",this.config)}updateConfig(K){this.config={...this.config,...K}}}var S=null;function D(K){if(!S)S=new V(K);else if(K)S.updateConfig(K);return S}async function q(K,J,X){let N=X?{directory:`${X.outputDir}/../.cache`}:{};return D(N).get(K,J)}async function b(K,J,X,N){let Z=N?{directory:`${N.outputDir}/../.cache`}:{};return D(Z).set(K,J,X)}async function $J(){return D().clear()}import{resolve as y,basename as P,extname as f,join as U}from"path";import{mkdir as g}from"fs/promises";async function m(){try{return await import("ts-videos")}catch{return null}}async function h(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",M=J.timestamp||0,E=`${z}-poster-${Y}.${G}`,W=U(X,E),Q=await Z.extractThumbnails($,{timestamps:[M],width:J.width||1280,height:J.height,format:G,quality:J.quality||85,outputDir:X,outputPattern:E.replace(`.${G}`,"")});if(Q&&Q.length>0){let _=Q[0];return{path:W,url:`${N}/${E}`,width:_.width||J.width||1280,height:_.height||720,timestamp:M,size:_.size||0}}return null}catch($){return console.warn(`[stx-media] Failed to generate poster: ${$}`),null}}async function d(K,J,X,N){let Z=await m();if(!Z)return[];try{let $=y(K);if(!await B($))return[];await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",W=(await new Z.Input($).getInfo()).duration||60,Q=J.count||10,_=J.interval||W/Q,O=[];for(let w=0;w<Q&&w*_<W;w++)O.push(w*_);let L=await Z.extractThumbnails($,{timestamps:O,width:J.width||320,format:G,quality:J.quality||80,outputDir:X,outputPattern:`${z}-thumb-${Y}`});if(L&&L.length>0)return L.map((w,j)=>({path:w.path||U(X,`${z}-thumb-${Y}-${j}.${G}`),url:`${N}/${z}-thumb-${Y}-${j}.${G}`,width:w.width||J.width||320,height:w.height||180,timestamp:O[j],size:w.size||0}));return[]}catch($){return console.warn(`[stx-media] Failed to generate thumbnails: ${$}`),[]}}async function zJ(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),E=(await new Z.Input($).getInfo()).duration||60,W=J.columns||10,Q=J.interval||5,_=J.thumbnailWidth||160,O=J.thumbnailHeight||90,L=J.format||"jpeg",w=Math.ceil(E/Q),j=Math.ceil(w/W),F=`${z}-sprite-${Y}.${L}`,k=U(X,F),T=[];for(let I=0;I<w;I++)T.push(I*Q);let A=await Z.extractThumbnails($,{timestamps:T,width:_,height:O,format:L,quality:J.quality||70,outputDir:U(X,".temp")});if(!A||A.length===0)return null;try{let I=await import("ts-images"),H=W*_,kJ=j*O,jJ=await I.createSprite({images:A.map((YJ)=>YJ.path),columns:W,padding:0,outputPath:k,format:L,quality:J.quality||70});return{url:`${N}/${F}`,path:k,columns:W,rows:j,thumbnailWidth:_,thumbnailHeight:O,interval:Q,totalFrames:w}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch($){return console.warn(`[stx-media] Failed to generate sprite sheet: ${$}`),null}}import{resolve as r,basename as e,extname as i,join as C}from"path";import{mkdir as R,writeFile as o}from"fs/promises";async function t(){try{return await import("ts-videos")}catch{return null}}var s=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function p(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-hls`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||6,O=(await new $.Input(Y).getInfo()).duration||0,L=[],w=0;for(let k of E){let T=C(M,k.label);await R(T,{recursive:!0});let A=`${k.label}.m3u8`,I=C(T,A);try{let H=await $.generateHLS(Y,{outputDir:T,segmentDuration:W,width:k.width,height:k.height,videoBitrate:k.bitrate,audioBitrate:k.audioBitrate,playlistName:k.label});if(H)L.push({quality:k,url:`${N}/${G}-${z}-hls/${k.label}/${A}`,path:I}),w+=H.segmentCount||Math.ceil(O/W)}catch(H){console.warn(`[stx-media] Failed to generate HLS for ${k.label}: ${H}`)}}if(L.length===0)return null;let j=C(M,"master.m3u8"),F=GJ(L,N,G,z);return await o(j,F),{manifestUrl:`${N}/${G}-${z}-hls/master.m3u8`,manifestPath:j,playlists:L,segmentCount:w,duration:O}}catch(Y){return console.warn(`[stx-media] Failed to generate HLS manifest: ${Y}`),null}}function GJ(K,J,X,N){let Z=["#EXTM3U","#EXT-X-VERSION:3"];for(let $ of K){let{quality:Y}=$,z=Y.bitrate+(Y.audioBitrate||128000),G=`${Y.width}x${Y.height||Math.round(Y.width*9/16)}`;Z.push(`#EXT-X-STREAM-INF:BANDWIDTH=${z},RESOLUTION=${G},NAME="${Y.label}"`,`${Y.label}/${Y.label}.m3u8`)}return Z.join(`
2
+ import{qh as x,vh as B,wh as c,xh as u,yh as n}from"./chunk-pcxp4r9n.js";import{kx as v}from"./chunk-ay6zjq8v.js";import{resolve as JJ,basename as WJ,extname as _J,join as LJ}from"path";import{mkdir as QJ}from"fs/promises";var ZJ={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class V{config;constructor(K={}){this.config={...ZJ,...K}}async get(K,J){return c(K,J,"video",this.config)}async set(K,J,X){return u(K,J,X,"video",this.config)}async clear(){return n("video",this.config)}updateConfig(K){this.config={...this.config,...K}}}var S=null;function D(K){if(!S)S=new V(K);else if(K)S.updateConfig(K);return S}async function q(K,J,X){let N=X?{directory:`${X.outputDir}/../.cache`}:{};return D(N).get(K,J)}async function b(K,J,X,N){let Z=N?{directory:`${N.outputDir}/../.cache`}:{};return D(Z).set(K,J,X)}async function $J(){return D().clear()}import{resolve as y,basename as P,extname as f,join as U}from"path";import{mkdir as g}from"fs/promises";async function m(){try{return await import("ts-videos")}catch{return null}}async function h(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",M=J.timestamp||0,E=`${z}-poster-${Y}.${G}`,W=U(X,E),Q=await Z.extractThumbnails($,{timestamps:[M],width:J.width||1280,height:J.height,format:G,quality:J.quality||85,outputDir:X,outputPattern:E.replace(`.${G}`,"")});if(Q&&Q.length>0){let _=Q[0];return{path:W,url:`${N}/${E}`,width:_.width||J.width||1280,height:_.height||720,timestamp:M,size:_.size||0}}return null}catch($){return console.warn(`[stx-media] Failed to generate poster: ${$}`),null}}async function d(K,J,X,N){let Z=await m();if(!Z)return[];try{let $=y(K);if(!await B($))return[];await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",W=(await new Z.Input($).getInfo()).duration||60,Q=J.count||10,_=J.interval||W/Q,O=[];for(let w=0;w<Q&&w*_<W;w++)O.push(w*_);let L=await Z.extractThumbnails($,{timestamps:O,width:J.width||320,format:G,quality:J.quality||80,outputDir:X,outputPattern:`${z}-thumb-${Y}`});if(L&&L.length>0)return L.map((w,j)=>({path:w.path||U(X,`${z}-thumb-${Y}-${j}.${G}`),url:`${N}/${z}-thumb-${Y}-${j}.${G}`,width:w.width||J.width||320,height:w.height||180,timestamp:O[j],size:w.size||0}));return[]}catch($){return console.warn(`[stx-media] Failed to generate thumbnails: ${$}`),[]}}async function zJ(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),E=(await new Z.Input($).getInfo()).duration||60,W=J.columns||10,Q=J.interval||5,_=J.thumbnailWidth||160,O=J.thumbnailHeight||90,L=J.format||"jpeg",w=Math.ceil(E/Q),j=Math.ceil(w/W),F=`${z}-sprite-${Y}.${L}`,k=U(X,F),T=[];for(let I=0;I<w;I++)T.push(I*Q);let A=await Z.extractThumbnails($,{timestamps:T,width:_,height:O,format:L,quality:J.quality||70,outputDir:U(X,".temp")});if(!A||A.length===0)return null;try{let I=await import("ts-images"),H=W*_,kJ=j*O,jJ=await I.createSprite({images:A.map((YJ)=>YJ.path),columns:W,padding:0,outputPath:k,format:L,quality:J.quality||70});return{url:`${N}/${F}`,path:k,columns:W,rows:j,thumbnailWidth:_,thumbnailHeight:O,interval:Q,totalFrames:w}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch($){return console.warn(`[stx-media] Failed to generate sprite sheet: ${$}`),null}}import{resolve as r,basename as e,extname as i,join as C}from"path";import{mkdir as R,writeFile as o}from"fs/promises";async function t(){try{return await import("ts-videos")}catch{return null}}var s=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function p(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-hls`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||6,O=(await new $.Input(Y).getInfo()).duration||0,L=[],w=0;for(let k of E){let T=C(M,k.label);await R(T,{recursive:!0});let A=`${k.label}.m3u8`,I=C(T,A);try{let H=await $.generateHLS(Y,{outputDir:T,segmentDuration:W,width:k.width,height:k.height,videoBitrate:k.bitrate,audioBitrate:k.audioBitrate,playlistName:k.label});if(H)L.push({quality:k,url:`${N}/${G}-${z}-hls/${k.label}/${A}`,path:I}),w+=H.segmentCount||Math.ceil(O/W)}catch(H){console.warn(`[stx-media] Failed to generate HLS for ${k.label}: ${H}`)}}if(L.length===0)return null;let j=C(M,"master.m3u8"),F=GJ(L,N,G,z);return await o(j,F),{manifestUrl:`${N}/${G}-${z}-hls/master.m3u8`,manifestPath:j,playlists:L,segmentCount:w,duration:O}}catch(Y){return console.warn(`[stx-media] Failed to generate HLS manifest: ${Y}`),null}}function GJ(K,J,X,N){let Z=["#EXTM3U","#EXT-X-VERSION:3"];for(let $ of K){let{quality:Y}=$,z=Y.bitrate+(Y.audioBitrate||128000),G=`${Y.width}x${Y.height||Math.round(Y.width*9/16)}`;Z.push(`#EXT-X-STREAM-INF:BANDWIDTH=${z},RESOLUTION=${G},NAME="${Y.label}"`,`${Y.label}/${Y.label}.m3u8`)}return Z.join(`
3
3
  `)}async function l(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate DASH manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-dash`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||4,Q=Z?.minBufferTime||2,L=(await new $.Input(Y).getInfo()).duration||0,w=[],j=[];for(let A of E){let I=C(M,A.label);await R(I,{recursive:!0});try{if(await $.generateDASH(Y,{outputDir:I,segmentDuration:W,width:A.width,height:A.height,videoBitrate:A.bitrate,audioBitrate:A.audioBitrate})){if(w.push({bandwidth:A.bitrate,width:A.width,height:A.height||Math.round(A.width*9/16),url:`${N}/${G}-${z}-dash/${A.label}/video`}),A.audioBitrate)j.push({bandwidth:A.audioBitrate,url:`${N}/${G}-${z}-dash/${A.label}/audio`})}}catch(H){console.warn(`[stx-media] Failed to generate DASH for ${A.label}: ${H}`)}}if(w.length===0)return null;let F=C(M,"manifest.mpd"),k=NJ(w,j,L,W,Q);await o(F,k);let T=[{type:"video",representations:w}];if(j.length>0)T.push({type:"audio",representations:j});return{manifestUrl:`${N}/${G}-${z}-dash/manifest.mpd`,manifestPath:F,adaptationSets:T,duration:L}}catch(Y){return console.warn(`[stx-media] Failed to generate DASH manifest: ${Y}`),null}}function NJ(K,J,X,N,Z){let $=a(X),Y=a(Z),z=`<?xml version="1.0" encoding="UTF-8"?>
4
4
  <MPD xmlns="urn:mpeg:dash:schema:mpd:2011"
5
5
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$i as h,Ui as a,Vi as b,Wi as c,Xi as d,Yi as e,Zi as f,_i as g,aj as i,bj as j,cj as k,dj as l,ej as m,fj as n}from"./chunk-f95drhdb.js";import"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Mr as P,No as x,Wo as k,aq as w,cm as A,dm as b,ko as M,mn as T,nn as y,wm as B,ym as F,yo as R}from"./chunk-92ysystz.js";import{ix as v}from"./chunk-2fw05hs2.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
2
+ import{Mr as P,No as x,Wo as k,aq as w,cm as A,dm as b,ko as M,mn as T,nn as y,wm as B,ym as F,yo as R}from"./chunk-pwsnafp3.js";import{kx as v}from"./chunk-ay6zjq8v.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -14,5 +14,5 @@ ${Q.join(`
14
14
  `)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=Y.__stx_event_bindings||[],X=B(Y),Z=(await Promise.all(Q.map(async(I)=>{let W=I.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return I;return await F(W[1],{eventBindings:N,templateContent:q,serverData:X,filePath:z})}))).join(`
15
15
  `);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
16
16
  $1`);else q+=`
17
- ${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-y61n68ca.js");q=await N(q)}catch{}return q}
17
+ ${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-62435225.js");q=await N(q)}catch{}return q}
18
18
  export{j as Ak,C as Bk,D as Ck,o as Dk,r as Ek,V as Fk};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Zt as a,_t as b}from"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-ay6zjq8v.js";export{a as prepareRuntimeConfig,b as generateRuntimeConfigTypes};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ww as y}from"./chunk-36xaycje.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
2
+ import{Yw as y}from"./chunk-4f9zyfdw.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
3
3
  `);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
4
4
  `)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
5
5
  export{Y as Gk,_ as Hk,a as Ik,s as Jk,h as Kk,f as Lk,c as Mk,HM as Nk};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Fl as G}from"./chunk-s8jd13nb.js";import{Eq as U,Iq as B}from"./chunk-92ysystz.js";import{at as O}from"./chunk-x99xve3y.js";import{Jt as L}from"./chunk-tkyrk66a.js";import{ix as y}from"./chunk-2fw05hs2.js";import X from"fs";import Z from"path";var H=new Map,$=new Map;async function p(j){let J;for(let V=0;V<3;V++)try{let q=(await X.promises.stat(j)).mtime.getTime(),W=$.get(j);if(W&&W.mtime===q)return W.content;let I=await Bun.file(j).text(),T=(await X.promises.stat(j)).mtime.getTime();if(T!==q)continue;return $.set(j,{content:I,mtime:T}),I}catch(Q){J=Q;break}throw $.delete(j),Error(`File not found: ${j}${J?` (${J.message})`:""}`)}function m(j){$.delete(j)}function f(j){for(let z of $.keys())if(z.startsWith(j))$.delete(z)}var M=null,v=null,b=null;function r(j){b=j}async function k(j=!1){let z=b??await import("./chunk-tgrpp58r.js");if(j)return z.generateSignalsRuntimeDev();if(M===null)M=z.generateSignalsRuntime();return M}var N=null;async function R(){if(N===null){let{getRouterScript:j}=await import("./chunk-g5ny3aka.js");N=j()}return N}var x={};async function d(j,z=!1){let J=j==="runtime"?await k(z):await R(),V=j==="runtime"&&z?"runtime-debug":j,Q=x[V];if(!Q||Q.content!==J)Q={content:J,hash:Bun.hash(J).toString(16).padStart(16,"0").slice(0,16)},x[V]=Q;return{content:J,hash:Q.hash,url:`/_stx/${j}.${Q.hash}.js`}}var E=500,Y=new Map;function w(j){return L(process.cwd(),"module-bundles",`${j}.js`)}function c(j){let z=Bun.hash(j).toString(16).padStart(16,"0").slice(0,16),J=Y.has(z);if(J)Y.delete(z);Y.set(z,j);while(Y.size>E)Y.delete(Y.keys().next().value);if(!J)try{let V=w(z);if(!X.existsSync(V))X.mkdirSync(Z.dirname(V),{recursive:!0}),X.writeFileSync(V,j)}catch{}return`/_stx/modules.${z}.js`}function l(j){if(!/^[0-9a-f]{16}$/.test(j))return;let z=Y.get(j);if(z!==void 0)return z;try{return X.readFileSync(w(j),"utf8")}catch{return}}function o(){$.clear(),B(),O(),M=null,v=null,N=null}function A(j){let z={debug:j.debug===!0,middleware:(j.middleware??[]).map((J)=>({name:J.name,timing:J.timing,handler:String(J.handler)})),customDirectives:(j.customDirectives??[]).map((J)=>({name:J.name,hasEndTag:J.hasEndTag===!0,rawParams:J.rawParams===!0,handler:String(J.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(z)).digest("hex")}async function s(j,z){try{if(!z.cachePath)return null;let J=Z.resolve(z.cachePath),V=Z.join(J,`${D(j)}.html`),Q=Z.join(J,`${D(j)}.meta.json`);if(!await U(V)||!await U(Q))return null;let q=await Bun.file(Q).text(),W=JSON.parse(q);if(W.cacheVersion!==z.cacheVersion)return null;if(W.engine!==G())return null;if(W.optionsSignature!==A(z))return null;if((await X.promises.stat(j)).mtime.getTime()>W.mtime)return null;for(let K of W.dependencies)if(await U(K)){if((await X.promises.stat(K)).mtime.getTime()>W.mtime)return null}else return null;return await Bun.file(V).text()}catch(J){return console.warn(`Cache error for ${j}:`,J),null}}async function n(j,z,J,V){try{if(!V.cachePath)return;let Q=Z.resolve(V.cachePath);await X.promises.mkdir(Q,{recursive:!0});let q=Z.join(Q,`${D(j)}.html`),W=Z.join(Q,`${D(j)}.meta.json`),I=await X.promises.stat(j);await Bun.write(q,z);let K={sourcePath:j,mtime:I.mtime.getTime(),dependencies:Array.from(J),cacheVersion:V.cacheVersion,engine:G(),optionsSignature:A(V),generatedAt:Date.now()};await Bun.write(W,JSON.stringify(K,null,2)),H.set(j,{output:z,mtime:I.mtime.getTime(),dependencies:J})}catch(Q){console.warn(`Failed to cache template ${j}:`,Q)}}var F=16;function D(j){return new Bun.CryptoHasher("sha1").update(j).digest("hex").substring(0,F)}
2
+ import{Fl as G}from"./chunk-s8jd13nb.js";import{Eq as U,Iq as B}from"./chunk-pwsnafp3.js";import{at as O}from"./chunk-pwgv84pn.js";import{Jt as L}from"./chunk-tkyrk66a.js";import{kx as y}from"./chunk-ay6zjq8v.js";import X from"fs";import Z from"path";var H=new Map,$=new Map;async function p(j){let J;for(let V=0;V<3;V++)try{let q=(await X.promises.stat(j)).mtime.getTime(),W=$.get(j);if(W&&W.mtime===q)return W.content;let I=await Bun.file(j).text(),T=(await X.promises.stat(j)).mtime.getTime();if(T!==q)continue;return $.set(j,{content:I,mtime:T}),I}catch(Q){J=Q;break}throw $.delete(j),Error(`File not found: ${j}${J?` (${J.message})`:""}`)}function m(j){$.delete(j)}function f(j){for(let z of $.keys())if(z.startsWith(j))$.delete(z)}var M=null,v=null,b=null;function r(j){b=j}async function k(j=!1){let z=b??await import("./chunk-vkhdce50.js");if(j)return z.generateSignalsRuntimeDev();if(M===null)M=z.generateSignalsRuntime();return M}var N=null;async function R(){if(N===null){let{getRouterScript:j}=await import("./chunk-0qv8yf53.js");N=j()}return N}var x={};async function d(j,z=!1){let J=j==="runtime"?await k(z):await R(),V=j==="runtime"&&z?"runtime-debug":j,Q=x[V];if(!Q||Q.content!==J)Q={content:J,hash:Bun.hash(J).toString(16).padStart(16,"0").slice(0,16)},x[V]=Q;return{content:J,hash:Q.hash,url:`/_stx/${j}.${Q.hash}.js`}}var E=500,Y=new Map;function w(j){return L(process.cwd(),"module-bundles",`${j}.js`)}function c(j){let z=Bun.hash(j).toString(16).padStart(16,"0").slice(0,16),J=Y.has(z);if(J)Y.delete(z);Y.set(z,j);while(Y.size>E)Y.delete(Y.keys().next().value);if(!J)try{let V=w(z);if(!X.existsSync(V))X.mkdirSync(Z.dirname(V),{recursive:!0}),X.writeFileSync(V,j)}catch{}return`/_stx/modules.${z}.js`}function l(j){if(!/^[0-9a-f]{16}$/.test(j))return;let z=Y.get(j);if(z!==void 0)return z;try{return X.readFileSync(w(j),"utf8")}catch{return}}function o(){$.clear(),B(),O(),M=null,v=null,N=null}function A(j){let z={debug:j.debug===!0,middleware:(j.middleware??[]).map((J)=>({name:J.name,timing:J.timing,handler:String(J.handler)})),customDirectives:(j.customDirectives??[]).map((J)=>({name:J.name,hasEndTag:J.hasEndTag===!0,rawParams:J.rawParams===!0,handler:String(J.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(z)).digest("hex")}async function s(j,z){try{if(!z.cachePath)return null;let J=Z.resolve(z.cachePath),V=Z.join(J,`${D(j)}.html`),Q=Z.join(J,`${D(j)}.meta.json`);if(!await U(V)||!await U(Q))return null;let q=await Bun.file(Q).text(),W=JSON.parse(q);if(W.cacheVersion!==z.cacheVersion)return null;if(W.engine!==G())return null;if(W.optionsSignature!==A(z))return null;if((await X.promises.stat(j)).mtime.getTime()>W.mtime)return null;for(let K of W.dependencies)if(await U(K)){if((await X.promises.stat(K)).mtime.getTime()>W.mtime)return null}else return null;return await Bun.file(V).text()}catch(J){return console.warn(`Cache error for ${j}:`,J),null}}async function n(j,z,J,V){try{if(!V.cachePath)return;let Q=Z.resolve(V.cachePath);await X.promises.mkdir(Q,{recursive:!0});let q=Z.join(Q,`${D(j)}.html`),W=Z.join(Q,`${D(j)}.meta.json`),I=await X.promises.stat(j);await Bun.write(q,z);let K={sourcePath:j,mtime:I.mtime.getTime(),dependencies:Array.from(J),cacheVersion:V.cacheVersion,engine:G(),optionsSignature:A(V),generatedAt:Date.now()};await Bun.write(W,JSON.stringify(K,null,2)),H.set(j,{output:z,mtime:I.mtime.getTime(),dependencies:J})}catch(Q){console.warn(`Failed to cache template ${j}:`,Q)}}var F=16;function D(j){return new Bun.CryptoHasher("sha1").update(j).digest("hex").substring(0,F)}
3
3
  export{H as Vj,p as Wj,m as Xj,f as Yj,r as Zj,k as _j,R as $j,d as ak,c as bk,l as ck,o as dk,s as ek,n as fk,D as gk};