@stacksjs/stx 0.2.266 → 0.2.268

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 (63) hide show
  1. package/dist/app-shell.js +5 -24
  2. package/dist/{chunk-scdxk8nn.js → chunk-0a2dq7g9.js} +1 -1
  3. package/dist/{chunk-nwq01xh0.js → chunk-15x3b9tp.js} +2 -2
  4. package/dist/{chunk-dpgp6rzq.js → chunk-1c0yy9rs.js} +1 -1
  5. package/dist/{chunk-7cts329z.js → chunk-2b4g32yv.js} +1 -1
  6. package/dist/{chunk-6g4mnrr0.js → chunk-477zvh3f.js} +2 -2
  7. package/dist/{chunk-6yphtg3q.js → chunk-50gk2vsn.js} +2 -2
  8. package/dist/{chunk-pbsfbgx7.js → chunk-5d4csjhx.js} +1 -1
  9. package/dist/{chunk-aagn8j9e.js → chunk-5k1bec90.js} +108 -108
  10. package/dist/{chunk-mv0syvrg.js → chunk-6kcz7bg6.js} +1 -1
  11. package/dist/{chunk-9rkcrzj4.js → chunk-7jpq01y1.js} +1 -1
  12. package/dist/{chunk-nfykda12.js → chunk-868ep3pm.js} +2 -2
  13. package/dist/{chunk-nswz1rkm.js → chunk-8n89zhmq.js} +2 -2
  14. package/dist/{chunk-2ed60g20.js → chunk-95bfzrx2.js} +2 -2
  15. package/dist/{chunk-xkb16kmv.js → chunk-9asehtpb.js} +1 -1
  16. package/dist/{chunk-q5et8k2d.js → chunk-9th0hyk5.js} +1 -1
  17. package/dist/{chunk-k4m48h62.js → chunk-a3drgebc.js} +2 -2
  18. package/dist/{chunk-p9ase2nx.js → chunk-bn1e010c.js} +1 -1
  19. package/dist/{chunk-d3v3p15c.js → chunk-bwf0xaqc.js} +1 -1
  20. package/dist/{chunk-x2mke7a1.js → chunk-c17r76es.js} +1 -1
  21. package/dist/{chunk-k5c19t7e.js → chunk-cg8dd896.js} +1 -1
  22. package/dist/{chunk-78bm61kd.js → chunk-chte720d.js} +1 -1
  23. package/dist/{chunk-a78tzerx.js → chunk-d867gwtk.js} +1 -1
  24. package/dist/{chunk-tybdapd3.js → chunk-e1a1c5b9.js} +1 -1
  25. package/dist/{chunk-0j9hrzjj.js → chunk-e6tvnnnz.js} +1 -1
  26. package/dist/{chunk-v9crchhq.js → chunk-ea5ab7zt.js} +1 -1
  27. package/dist/{chunk-mcn9mwzv.js → chunk-erjf0z2d.js} +1 -1
  28. package/dist/{chunk-mb0kqnwf.js → chunk-eszybcp6.js} +1 -1
  29. package/dist/{chunk-mbvkvac6.js → chunk-fpkgcpey.js} +18 -18
  30. package/dist/{chunk-xpsxwbw0.js → chunk-fwgqz5vv.js} +1 -1
  31. package/dist/{chunk-8evws5cc.js → chunk-gaqvk74x.js} +1 -1
  32. package/dist/{chunk-4wnnet1k.js → chunk-h6xxqg0h.js} +1 -1
  33. package/dist/{chunk-r9z71gj0.js → chunk-hzwvszyg.js} +1 -1
  34. package/dist/{chunk-5jcsg2mc.js → chunk-j135b7xt.js} +1 -1
  35. package/dist/{chunk-ym3r8ktq.js → chunk-jcped0kt.js} +1 -1
  36. package/dist/{chunk-f3k5xbhk.js → chunk-jhfmkke9.js} +1 -1
  37. package/dist/{chunk-fcv00xs9.js → chunk-kcwa9cxw.js} +1 -1
  38. package/dist/{chunk-a95rrp0j.js → chunk-khfszwjy.js} +1 -1
  39. package/dist/{chunk-2qsa4h1t.js → chunk-m87wfz2b.js} +2 -2
  40. package/dist/{chunk-fn9yw31x.js → chunk-mync09v4.js} +1 -1
  41. package/dist/{chunk-c1r9q5pk.js → chunk-p557qcrk.js} +1 -1
  42. package/dist/{chunk-qf5grrg1.js → chunk-qmpsyysd.js} +1 -1
  43. package/dist/{chunk-g4z7gah7.js → chunk-ref9c9hn.js} +1 -1
  44. package/dist/{chunk-jb7h4qgh.js → chunk-rzdar1x9.js} +1 -1
  45. package/dist/{chunk-cd4v7xyr.js → chunk-sfha6xsd.js} +1 -1
  46. package/dist/chunk-t35x61f5.js +30 -0
  47. package/dist/{chunk-ykxs16y7.js → chunk-v5qv7q0y.js} +1 -1
  48. package/dist/{chunk-z66a9nnd.js → chunk-v9xkrwxt.js} +1 -1
  49. package/dist/{chunk-gn48cpgb.js → chunk-vnrhn6b0.js} +1 -1
  50. package/dist/{chunk-6g7m08rv.js → chunk-wnt3yvxv.js} +1 -1
  51. package/dist/{chunk-n3jgypjf.js → chunk-wrg838f0.js} +1 -1
  52. package/dist/{chunk-4mw2kfqd.js → chunk-yax48zgv.js} +1 -1
  53. package/dist/{chunk-yxp7wv61.js → chunk-z8btarwy.js} +1 -1
  54. package/dist/{chunk-behbakfv.js → chunk-zr2rkgag.js} +1 -1
  55. package/dist/cli.js +10 -10
  56. package/dist/component-renderer.js +4 -4
  57. package/dist/craft-entry.js +1 -1
  58. package/dist/craft.js +1 -1
  59. package/dist/fragment-container.js +15 -1
  60. package/dist/pwa.js +1 -1
  61. package/dist/ssg.js +2 -2
  62. package/package.json +5 -5
  63. package/dist/chunk-a7x7dmtf.js +0 -30
package/dist/app-shell.js CHANGED
@@ -1,6 +1,7 @@
1
1
  var {require}=import.meta;import path from "node:path";
2
2
  import { classifyAllScripts } from "./script-classifier.js";
3
3
  import { startsDocument } from "./document-shell.js";
4
+ import { findContainerRegion } from "./fragment-container.js";
4
5
  import { isSpaNavRequest } from "./spa-nav.js";
5
6
  export { extractLayoutMetadata } from "stx-router/layout-metadata";
6
7
  const PAGE_HEAD_MARKER = "stx-page-head:", PAGE_HEAD_MARKER_RE = /<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/;
@@ -173,33 +174,13 @@ export function extractContainerContent(html, containerSelector = "main") {
173
174
  while ((m = routeParamsRegex.exec(headContent)) !== null)
174
175
  headScripts.push(m[0]);
175
176
  }
176
- const tag = containerSelector.replace(/^[.#]/, "").toLowerCase(), openRe = new RegExp(`<${tag}\\b[^>]*>`, "i"), openMatch = trimmed.match(openRe);
177
- if (!openMatch || openMatch.index === void 0)
177
+ const containerRegion = findContainerRegion(trimmed, containerSelector);
178
+ if (!containerRegion)
178
179
  return stripDocumentWrapper(html);
179
- const openEnd = openMatch.index + openMatch[0].length, openTagRe = new RegExp(`<${tag}\\b[^>]*>`, "gi"), closeTagRe = new RegExp(`</${tag}\\s*>`, "gi");
180
- openTagRe.lastIndex = openEnd;
181
- closeTagRe.lastIndex = openEnd;
182
- let depth = 1, closeIdx = -1;
183
- while (depth > 0) {
184
- const nextOpen = openTagRe.exec(trimmed), nextClose = closeTagRe.exec(trimmed);
185
- if (!nextClose)
186
- break;
187
- if (nextOpen && nextOpen.index < nextClose.index) {
188
- depth++;
189
- closeTagRe.lastIndex = nextOpen.index + nextOpen[0].length;
190
- } else {
191
- depth--;
192
- closeIdx = nextClose.index;
193
- if (depth > 0)
194
- openTagRe.lastIndex = nextClose.index + nextClose[0].length;
195
- }
196
- }
197
- if (closeIdx === -1)
198
- return stripDocumentWrapper(html);
199
- const innerContent = trimmed.slice(openEnd, closeIdx).trim(), bodyScripts = [], bodyOpenMatch = trimmed.match(/<body\b[^>]*>/i), bodyCloseIdx = trimmed.lastIndexOf("</body>");
180
+ const { tagName: tag, start: openEnd, end: closeIdx } = containerRegion, innerContent = trimmed.slice(openEnd, closeIdx).trim(), bodyScripts = [], bodyOpenMatch = trimmed.match(/<body\b[^>]*>/i), bodyCloseIdx = trimmed.lastIndexOf("</body>");
200
181
  if (bodyOpenMatch && bodyOpenMatch.index !== void 0 && bodyCloseIdx !== -1) {
201
182
  const regions = [
202
- [bodyOpenMatch.index + bodyOpenMatch[0].length, openMatch.index],
183
+ [bodyOpenMatch.index + bodyOpenMatch[0].length, containerRegion.openIndex],
203
184
  [closeIdx + `</${tag}>`.length, bodyCloseIdx]
204
185
  ], scriptRe = /<script\b[^>]*>[\s\S]*?<\/script>/gi;
205
186
  for (const [start, end] of regions) {
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Oj as a,Pj as b,Qj as c,Rj as d,Sj as e,Tj as f,Uj as g,Vj as h,Wj as i,Xj as j,Yj as k}from"./chunk-yxp7wv61.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
2
+ import{Oj as a,Pj as b,Qj as c,Rj as d,Sj as e,Tj as f,Uj as g,Vj as h,Wj as i,Xj as j,Yj as k}from"./chunk-z8btarwy.js";import"./chunk-fpkgcpey.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-rzdar1x9.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fq as X,ym as W}from"./chunk-mbvkvac6.js";import V from"fs";import M from"path";import*as Y from"readline";var j={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},Q={help:{description:"Show available commands",usage:"help [command]",handler:async(q,z)=>{if(q[0]&&Q[q[0]]){let A=Q[q[0]];console.log(`
2
+ import{Fq as X,ym as W}from"./chunk-fpkgcpey.js";import V from"fs";import M from"path";import*as Y from"readline";var j={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},Q={help:{description:"Show available commands",usage:"help [command]",handler:async(q,z)=>{if(q[0]&&Q[q[0]]){let A=Q[q[0]];console.log(`
3
3
  ${j.bold}${q[0]}${j.reset} - ${A.description}`),console.log(` Usage: ${j.cyan}${A.usage}${j.reset}
4
4
  `)}else{console.log(`
5
5
  ${j.bold}Available Commands:${j.reset}
@@ -21,4 +21,4 @@ ${j.bold}${j.blue}stx Interactive Mode${j.reset}
21
21
  ${j.dim}Type 'help' for available commands, 'exit' to quit${j.reset}
22
22
  `);let B=()=>{let G=z.cwd.replace(process.env.HOME||"","~");A.question(`${j.cyan}stx${j.reset} ${j.dim}${G}${j.reset} ${j.green}>${j.reset} `,async(I)=>{let K=I.trim();if(!K){if(z.running)B();return}z.history.push(K);let L=K.match(/(?:[^\s"]|"[^"]*")+/g)||[],J=L[0]?.toLowerCase(),O=L.slice(1).map((U)=>U.replace(/^"|"$/g,""));if(J&&Q[J])try{await Q[J].handler(O,z)}catch(U){console.log(`${j.red}Error:${j.reset}`,U)}else if(J)if(K.includes("{{")||K.includes("}}"))try{let U=await W(K,z.context,"eval");console.log(`${j.green}\u2192${j.reset} ${U}`)}catch{console.log(`${j.red}Unknown command: ${J}${j.reset}`),console.log(`${j.dim}Type 'help' for available commands${j.reset}`)}else console.log(`${j.red}Unknown command: ${J}${j.reset}`),console.log(`${j.dim}Type 'help' for available commands${j.reset}`);if(z.running)B();else A.close()})};A.on("SIGINT",()=>{console.log(`
23
23
  ${j.dim}(Use 'exit' to quit)${j.reset}`),B()}),B()}
24
- export{R as Gf};
24
+ export{R as Ef};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ik as a,jk as b,kk as c,lk as d}from"./chunk-r9z71gj0.js";import"./chunk-2qsa4h1t.js";import"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
2
+ import{ik as a,jk as b,kk as c,lk as d}from"./chunk-hzwvszyg.js";import"./chunk-m87wfz2b.js";import"./chunk-fpkgcpey.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-rzdar1x9.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{pp as a,qp as b,rp as c,sp as d,tp as e,up as f,vp as g,wp as h,xp as i,yp as j}from"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{b as stripTypeScript,h as splitDeclaration,c as isModuleResolutionFailure,d as isMissingBindingFailure,f as isCompleteImport,j as hasVariables,e as extractVariables,i as extractScriptFromTemplate,g as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};
2
+ import{pp as a,qp as b,rp as c,sp as d,tp as e,up as f,vp as g,wp as h,xp as i,yp as j}from"./chunk-fpkgcpey.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-rzdar1x9.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{b as stripTypeScript,h as splitDeclaration,c as isModuleResolutionFailure,d as isMissingBindingFailure,f as isCompleteImport,j as hasVariables,e as extractVariables,i as extractScriptFromTemplate,g as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{cs as E}from"./chunk-mbvkvac6.js";import{Yu as D}from"./chunk-f8wjdg40.js";import I from"path";async function M(k={}){let G=performance.now(),J=k.root||process.cwd(),j=await E(),q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-f3k5xbhk.js");B=await z({outputDir:".output",debug:k.debug,...k.ssr})}let H=Math.round(performance.now()-G);return{mode:q,ssg:A,ssr:B,duration:H}}
3
- export{M as kg};
2
+ import{cs as E}from"./chunk-fpkgcpey.js";import{Yu as D}from"./chunk-f8wjdg40.js";import I from"path";async function M(k={}){let G=performance.now(),J=k.root||process.cwd(),j=await E(),q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-jhfmkke9.js");B=await z({outputDir:".output",debug:k.debug,...k.ssr})}let H=Math.round(performance.now()-G);return{mode:q,ssg:A,ssr:B,duration:H}}
3
+ export{M as ig};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ql as C}from"./chunk-mbvkvac6.js";import{Ks as Y}from"./chunk-f1jd5qjb.js";import{Nt as D}from"./chunk-sde45gh3.js";import u from"path";var S=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function m(K){let J=[],Q=h(K);S.lastIndex=0;let $;while(($=S.exec(Q))!==null){let j=($[1]||"").trim(),F=($[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=($[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=$.index+F,Z=$.index+$[0].length-z,G=K.slice(W,Z);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",U=B(K,W);J.push({kind:X,code:G,startLine:U,attrs:j})}return J}function B(K,J){let Q=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Q++;return Q}function N(K,J){let Q=K.lastIndexOf(`
2
+ import{Ql as C}from"./chunk-fpkgcpey.js";import{Ks as Y}from"./chunk-f1jd5qjb.js";import{Nt as D}from"./chunk-sde45gh3.js";import u from"path";var S=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function m(K){let J=[],Q=h(K);S.lastIndex=0;let $;while(($=S.exec(Q))!==null){let j=($[1]||"").trim(),F=($[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=($[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=$.index+F,Z=$.index+$[0].length-z,G=K.slice(W,Z);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",U=B(K,W);J.push({kind:X,code:G,startLine:U,attrs:j})}return J}function B(K,J){let Q=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Q++;return Q}function N(K,J){let Q=K.lastIndexOf(`
3
3
  `,J-1)+1;return J-Q+1}function g(K){let J=K.split(""),Q=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
4
4
  `)J[z]=" "},$=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of $){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Q(F.index,F.index+F[0].length)}return J.join("")}function p(K){let J=0,Q="";for(let $=0;$<K.length;$++){let j=K[$];if(Q){if(j==="\\"){$++;continue}if(j===Q)Q="";continue}if(j==='"'||j==="'"||j==="`"){Q=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[$+1]==="|"){$++;continue}if(K[$-1]==="|")continue;return K.slice(0,$)}}return K}var R=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,O="__stx_interpolated",y="__StxElement",f="__StxTemplateValue",l=`type ${f}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function L(K){return K.replace(/\{\{[\s\S]*?\}\}/g,O).replace(/\{!![\s\S]*?!!\}/g,O)}function Vj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
5
5
  `).length-1,$=J.length-Q;return`0${" ".repeat(Math.max(0,$-1))}${`
@@ -19,4 +19,4 @@ import{Ql as C}from"./chunk-mbvkvac6.js";import{Ks as Y}from"./chunk-f1jd5qjb.js
19
19
  `))z(Z);for(let Z of t().split(`
20
20
  `))z(Z);for(let Z of C)z(`declare var ${Z}: any`);for(let Z of Zj)z(`declare var ${Z}: any`);z(`declare var ${O}: any`);let W=new Set(Q.flatMap((Z)=>V(Z.code)));z(`type ${y}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let Z of n(K)){if(W.has(Z.name))continue;let G=Z.iterable&&W.has(Z.iterable)?`${y}<typeof ${Z.iterable}>`:"any";z(`declare var ${Z.name}: ${G}`)}}if(J.templateExpressions!==!1){let W=c(K).map((Z)=>({expression:Z,statement:Wj(Z)})).filter((Z)=>Z.statement!==null);if(W.length>0){let Z=g(K),q=[...new Set(Q.flatMap((U)=>V(U.code)))].filter((U)=>/^[A-Z_$][\w$]*$/i.test(U)),X=0;if(q.length>0){z(l);for(let U of q)z(`type __StxT_${U} = ${f}<typeof ${U}>`);z(`;((${q.map((U)=>`${U}: __StxT_${U}`).join(", ")}) => {`),X=1}for(let{expression:U,statement:H}of W){let P=" ".repeat(X),M=U.offset===void 0?[]:zj(Z,U.offset),v=M.length>0?`${M.map((b)=>`if (${b}) `).join("")}{ `:"",E=M.length>0?" }":"";z(P+v+H.text+E,{line:U.line,column:U.column,expression:U,prefixLength:H.prefixLength+P.length+v.length})}if(X>0)z("});")}}return z("export {}"),{text:j.join(`
21
21
  `),lineMap:F,sourceLineCount:$.length}}function Nj(K,J,Q){let $=K.lineMap.get(J);if(!$)return J<=K.sourceLineCount?{line:J,column:Q}:null;let j=Math.max(0,Q-1-($.prefixLength??0));return{line:$.line,column:$.column+j,expression:$.expression}}
22
- export{m as Nf,Vj as Of,Yj as Pf,c as Qf,V as Rf,t as Sf,Bj as Tf,wj as Uf,Uj as Vf,Mj as Wf,Nj as Xf};
22
+ export{m as Lf,Vj as Mf,Yj as Nf,c as Of,V as Pf,t as Qf,Bj as Rf,wj as Sf,Uj as Tf,Mj as Uf,Nj as Vf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var{WebView:F}=globalThis.Bun;import{existsSync as V,mkdirSync as k,readdirSync as O,statSync as E}from"fs";import $ from"path";var C=16384;function X(j){if(/^https?:\/\//.test(j)||j.startsWith("file://"))return j;return`file://${$.resolve(j)}`}function K(j,B,z,L){return new Promise((Q)=>{let J=!1,G,Y,R=()=>{if(!J){if(J=!0,clearTimeout(Y),G)clearTimeout(G);j.onNavigated=void 0,Q()}};Y=setTimeout(R,L),j.onNavigated=()=>{if(!J)G=setTimeout(R,z)};try{let Z=j.navigate(B);if(Z&&typeof Z.catch==="function")Z.catch(R)}catch{R()}})}async function U(j,B,z){let L=`!!document.querySelector(${JSON.stringify(B)})`,Q=Date.now()+z;while(Date.now()<Q){try{if(await j.evaluate(L))return}catch{}await new Promise((J)=>setTimeout(J,100))}}async function _(j){try{let B=await j.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof B==="number"&&Number.isFinite(B)&&B>0?Math.min(B,C):0}catch{return 0}}async function x(j,B,z={}){let L=Math.min(z.width??1440,C),Q=Math.min(z.height??2200,C),J=z.waitMs??800,G=z.timeoutMs??15000,Y=z.format??"png",R=X(j),Z=(q)=>new F({width:L,height:q,headless:!0,...z.backend?{backend:z.backend}:{}}),P=Z(Q);try{if(await K(P,R,J,G),z.waitSelector)await U(P,z.waitSelector,G);if(z.fullPage){let H=await _(P);if(H>Q){if(P.close(),P=Z(H),await K(P,R,J,G),z.waitSelector)await U(P,z.waitSelector,G)}}let q=await P.screenshot({encoding:"buffer",format:Y});k($.dirname($.resolve(B)),{recursive:!0}),await Bun.write(B,q)}finally{P.close()}if(!V(B))throw Error(`Screenshot was not produced for ${j}`);return{input:j,output:B,bytes:E(B).size}}async function W(j,B,z={}){k(B,{recursive:!0});let L;if(!/^https?:\/\//.test(j)&&V(j)&&E(j).isDirectory())L=O(j).filter((G)=>G.endsWith(".html")).map((G)=>$.join(j,G));else L=[j];let Q=z.format??"png",J=[];for(let G of L){let Y=/^https?:\/\//.test(G)?new URL(G).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":$.basename(G).replace(/\.html?$/,"");J.push(await x(G,$.join(B,`${Y}.${Q}`),z))}return J}
3
- export{x as Ef,W as Ff};
3
+ export{x as Cf,W as Df};