@stacksjs/stx 0.2.843 → 0.2.845
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.
- package/dist/{chunk-9zjr0ty9.js → chunk-010yhk6m.js} +1 -1
- package/dist/{chunk-wyprsedf.js → chunk-0gg7k9cj.js} +2 -2
- package/dist/chunk-12tkqtrv.js +2 -0
- package/dist/{chunk-80cnt2vg.js → chunk-168fwztf.js} +1 -1
- package/dist/{chunk-9rcpahyb.js → chunk-1k751fgt.js} +1 -1
- package/dist/{chunk-hp3n1b9r.js → chunk-302gek13.js} +1 -1
- package/dist/{chunk-ast5jmcg.js → chunk-315q48qy.js} +4 -4
- package/dist/chunk-3qa40hgd.js +2 -0
- package/dist/{chunk-qz18x7f0.js → chunk-48vnw9t9.js} +1 -1
- package/dist/{chunk-dbsexg52.js → chunk-4rfedg2f.js} +1 -1
- package/dist/{chunk-3vh945rk.js → chunk-5a7etvxz.js} +1 -1
- package/dist/chunk-64evx0my.js +2 -0
- package/dist/{chunk-8cahff21.js → chunk-69b8mr68.js} +2 -2
- package/dist/{chunk-rs6evw29.js → chunk-6trgwvt0.js} +1 -1
- package/dist/{chunk-y4j82p7j.js → chunk-6tyjvxgb.js} +4 -4
- package/dist/{chunk-cnav1x5k.js → chunk-6x6w0v1k.js} +1 -1
- package/dist/{chunk-f39xf08q.js → chunk-7r4p7zjn.js} +4 -4
- package/dist/chunk-7tdwa595.js +2 -0
- package/dist/{chunk-53b8r8d2.js → chunk-8hy5g1hq.js} +3 -3
- package/dist/{chunk-gspxyygw.js → chunk-97bvpszy.js} +1 -1
- package/dist/chunk-afyvnpr9.js +2 -0
- package/dist/{chunk-xrhr7dmv.js → chunk-aw45yjrw.js} +1 -1
- package/dist/chunk-b30fzxwd.js +2 -0
- package/dist/{chunk-29chh7cd.js → chunk-b3wcs8bk.js} +1 -1
- package/dist/chunk-c3y7cxe7.js +2 -0
- package/dist/{chunk-4mqr462h.js → chunk-c62wxswd.js} +5 -5
- package/dist/{chunk-jfm28sz3.js → chunk-dhgjq9jx.js} +2 -2
- package/dist/{chunk-25swv3t2.js → chunk-dmmt4psb.js} +1 -1
- package/dist/{chunk-6wgbm5tc.js → chunk-eaz30495.js} +1 -1
- package/dist/chunk-emzz6seq.js +2 -0
- package/dist/chunk-exr9599h.js +2 -0
- package/dist/{chunk-6ygr2syc.js → chunk-f34ce0pn.js} +1 -1
- package/dist/{chunk-8k8m9vf2.js → chunk-fpc1n3je.js} +1 -1
- package/dist/chunk-fyesbfvr.js +2 -0
- package/dist/{chunk-9egg8bb8.js → chunk-fz433ybr.js} +1 -1
- package/dist/chunk-hbkh87n2.js +2 -0
- package/dist/chunk-hgk1v60t.js +42 -0
- package/dist/chunk-j274w1ac.js +2 -0
- package/dist/chunk-jf37tpj2.js +2 -0
- package/dist/{chunk-3hfmeb1z.js → chunk-k1tbgnhf.js} +1 -1
- package/dist/{chunk-kaxsavhg.js → chunk-k7am94hr.js} +2 -2
- package/dist/{chunk-sw0e1sad.js → chunk-kbv5nwwd.js} +1 -1
- package/dist/{chunk-pz1y8krt.js → chunk-md84j62m.js} +4 -4
- package/dist/{chunk-fdq4ryhv.js → chunk-msd0ezxm.js} +1 -1
- package/dist/{chunk-r7tr5dvd.js → chunk-mveqaxkr.js} +3 -3
- package/dist/{chunk-m95pk7fk.js → chunk-ndsygfeb.js} +1 -1
- package/dist/{chunk-jn8jny22.js → chunk-nqj1mkkz.js} +1 -1
- package/dist/{chunk-ge54kqfy.js → chunk-pb9347sn.js} +1 -1
- package/dist/chunk-pj1xj34h.js +2 -0
- package/dist/chunk-pv2mrc9g.js +2 -0
- package/dist/chunk-pwdnqe30.js +2 -0
- package/dist/chunk-qeej9h56.js +2 -0
- package/dist/{chunk-756bf5nt.js → chunk-r8xwd8r1.js} +3 -3
- package/dist/{chunk-r8pkv9s1.js → chunk-rapk2r7b.js} +1 -1
- package/dist/{chunk-pdzt72p8.js → chunk-rb6vr5v9.js} +6 -6
- package/dist/{chunk-58pc09a1.js → chunk-rncmfgpk.js} +5 -5
- package/dist/{chunk-1474zjtx.js → chunk-s68p10zh.js} +1 -1
- package/dist/{chunk-akw5585n.js → chunk-sss23kn5.js} +1 -1
- package/dist/chunk-sv52qc36.js +3 -0
- package/dist/{chunk-gfcgtxnb.js → chunk-t4n23dh5.js} +1 -1
- package/dist/{chunk-y8nx9aa6.js → chunk-tjnf4a8g.js} +11 -11
- package/dist/{chunk-qg3hp77v.js → chunk-vf0xbptq.js} +1 -1
- package/dist/{chunk-cjm92sfd.js → chunk-vhxrrqrg.js} +1 -1
- package/dist/{chunk-dj0xp789.js → chunk-wvwca1e9.js} +1 -1
- package/dist/chunk-xjbc3bhs.js +2 -0
- package/dist/{chunk-rdmm3zvb.js → chunk-xr8hg79c.js} +1 -1
- package/dist/chunk-xtbmntht.js +2 -0
- package/dist/{chunk-hnhq2f69.js → chunk-y06rw18j.js} +1 -1
- package/dist/{chunk-y7rdw6td.js → chunk-y7aqf8r7.js} +2 -2
- package/dist/{chunk-zjek9py2.js → chunk-zwxncs2e.js} +2 -2
- package/dist/chunk-zztfp9qh.js +2 -0
- package/dist/cli.js +7 -7
- package/dist/component-renderer.d.ts +1 -0
- package/dist/component-renderer.js +15 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/document-shell.d.ts +16 -0
- package/dist/native/runtime/browser-screen.js +27 -4
- package/dist/native/runtime/craft.d.ts +8 -1
- package/dist/pwa.js +3 -3
- package/dist/server-bindings.d.ts +1 -1
- package/dist/server-bindings.js +1 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-0571wwem.js +0 -2
- package/dist/chunk-0h3qftkx.js +0 -2
- package/dist/chunk-339cn2s8.js +0 -2
- package/dist/chunk-3kg5a5gp.js +0 -2
- package/dist/chunk-4a93qzdg.js +0 -2
- package/dist/chunk-689qm4h4.js +0 -2
- package/dist/chunk-9gkc04h5.js +0 -2
- package/dist/chunk-bv4rews8.js +0 -2
- package/dist/chunk-c0grsrqj.js +0 -2
- package/dist/chunk-fw7va7h4.js +0 -2
- package/dist/chunk-gvf0g8nf.js +0 -2
- package/dist/chunk-kxydr8z4.js +0 -2
- package/dist/chunk-mjhhvf6e.js +0 -2
- package/dist/chunk-nrn44374.js +0 -42
- package/dist/chunk-nv0hnx9x.js +0 -2
- package/dist/chunk-qtfj8z5d.js +0 -2
- package/dist/chunk-tp67ka3x.js +0 -2
- package/dist/chunk-vwyxvjnh.js +0 -2
- package/dist/chunk-vytbqwaz.js +0 -3
- package/dist/chunk-z8qdhn60.js +0 -2
- package/dist/chunk-zfmcbhv2.js +0 -2
- package/dist/chunk-zwzbcz37.js +0 -2
|
@@ -67,14 +67,14 @@ export function createBrowserScreenBridge(platform, options) {
|
|
|
67
67
|
rows[0]?.focus();
|
|
68
68
|
}, shell = document.createElement("div");
|
|
69
69
|
shell.setAttribute("data-stx-screen-shell", "");
|
|
70
|
-
shell.style.cssText = "display:flex;flex-direction:column;height:100dvh;max-width:512px;margin:auto;color:#1c1c1e;background:#f2f2f7;font:17px system-ui,-apple-system,sans-serif;overflow:hidden";
|
|
70
|
+
shell.style.cssText = "position:relative;display:flex;flex-direction:column;height:100dvh;max-width:512px;margin:auto;color:#1c1c1e;background:#f2f2f7;font:17px system-ui,-apple-system,sans-serif;overflow:hidden";
|
|
71
71
|
content.style.cssText = "display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden";
|
|
72
72
|
container.before(shell);
|
|
73
73
|
shell.append(nav, content, tabs);
|
|
74
74
|
content.append(container);
|
|
75
75
|
container.style.cssText = "display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden";
|
|
76
76
|
nav.style.cssText = "display:flex;align-items:center;gap:12px;min-height:52px;padding:env(safe-area-inset-top) 16px 0;flex-shrink:0";
|
|
77
|
-
tabs.style.cssText = "display:flex;justify-content:space-around;gap:4px;padding:8px 8px max(8px,env(safe-area-inset-bottom));flex-shrink:0;border-top:1px solid #8884";
|
|
77
|
+
tabs.style.cssText = "position:relative;display:flex;justify-content:space-around;gap:4px;padding:8px 8px max(8px,env(safe-area-inset-bottom));flex-shrink:0;border-top:1px solid #8884";
|
|
78
78
|
tabs.setAttribute("aria-label", "Main navigation");
|
|
79
79
|
tabPill.style.cssText = "display:flex;flex:1;align-items:center;min-width:0;border-radius:32px;padding:4px;background:#8882";
|
|
80
80
|
tabs.append(tabPill);
|
|
@@ -130,7 +130,18 @@ export function createBrowserScreenBridge(platform, options) {
|
|
|
130
130
|
dismissAccessoryMenu?.();
|
|
131
131
|
accessoryRenderers.splice(0).forEach((renderer) => renderer.dispose());
|
|
132
132
|
tabs.querySelectorAll("[data-tab-accessory]").forEach((button) => button.remove());
|
|
133
|
-
|
|
133
|
+
shell.querySelector("[data-tab-accessory-group]")?.remove();
|
|
134
|
+
const primary = patch.tabAccessory, grouped = primary?.layout === "vertical" || primary?.layout === "horizontal";
|
|
135
|
+
let actionContainer = tabs;
|
|
136
|
+
if (grouped) {
|
|
137
|
+
actionContainer = document.createElement("div");
|
|
138
|
+
actionContainer.setAttribute("data-tab-accessory-group", primary.layout);
|
|
139
|
+
actionContainer.setAttribute("role", "group");
|
|
140
|
+
actionContainer.setAttribute("aria-label", primary.accessibilityLabel || primary.title);
|
|
141
|
+
actionContainer.style.cssText = `position:absolute;z-index:2;inset-inline-end:20px;bottom:calc(100% + 8px);display:flex;flex-direction:${primary.layout === "vertical" ? "column" : "row"};padding:2px;border-radius:26px;background:color-mix(in srgb,currentColor 8%,transparent);backdrop-filter:blur(20px);box-shadow:0 4px 16px #0002`;
|
|
142
|
+
tabs.append(actionContainer);
|
|
143
|
+
}
|
|
144
|
+
const actions = primary ? [...(primary.companions || []).slice(0, 2), primary] : [];
|
|
134
145
|
for (const item of actions) {
|
|
135
146
|
if (typeof item.path !== "string" || !item.path.startsWith("/") || item.path.startsWith("//"))
|
|
136
147
|
continue;
|
|
@@ -139,6 +150,15 @@ export function createBrowserScreenBridge(platform, options) {
|
|
|
139
150
|
button.setAttribute("data-tab-accessory", "");
|
|
140
151
|
button.setAttribute("aria-label", `${item.accessibilityLabel || item.title}${item.badge ? `, ${item.badge}` : ""}`);
|
|
141
152
|
button.style.cssText = "position:relative;display:flex;align-items:center;justify-content:center;width:56px;height:56px;flex-shrink:0;border:0;border-radius:50%;background:#8882;color:inherit";
|
|
153
|
+
if (grouped) {
|
|
154
|
+
button.style.cssText = "position:relative;display:flex;align-items:center;justify-content:center;width:48px;height:48px;flex-shrink:0;border:0;border-radius:24px;background:transparent;color:inherit;cursor:pointer";
|
|
155
|
+
if (actionContainer.children.length) {
|
|
156
|
+
const separator = document.createElement("span");
|
|
157
|
+
separator.setAttribute("aria-hidden", "true");
|
|
158
|
+
separator.style.cssText = primary?.layout === "vertical" ? "height:1px;margin:0 12px;background:#8885" : "width:1px;margin:12px 0;background:#8885";
|
|
159
|
+
actionContainer.append(separator);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
142
162
|
const holder = document.createElement("span");
|
|
143
163
|
button.append(holder);
|
|
144
164
|
const accessoryRenderer = new BrowserScreenRenderer(holder, { icons: options.icons, event() {} });
|
|
@@ -162,7 +182,7 @@ export function createBrowserScreenBridge(platform, options) {
|
|
|
162
182
|
};
|
|
163
183
|
} else
|
|
164
184
|
button.onclick = () => platform.navigate(item.path);
|
|
165
|
-
|
|
185
|
+
actionContainer.append(button);
|
|
166
186
|
}
|
|
167
187
|
}
|
|
168
188
|
const item = patch.tabItem, tab = item?.id ? tabIcons.get(item.id) : null;
|
|
@@ -199,6 +219,9 @@ export function createBrowserScreenBridge(platform, options) {
|
|
|
199
219
|
if (typeof settings.tabBarHidden === "boolean") {
|
|
200
220
|
tabs.hidden = settings.tabBarHidden;
|
|
201
221
|
tabs.style.display = settings.tabBarHidden ? "none" : "flex";
|
|
222
|
+
const group = shell.querySelector("[data-tab-accessory-group]");
|
|
223
|
+
if (group)
|
|
224
|
+
group.hidden = settings.tabBarHidden;
|
|
202
225
|
}
|
|
203
226
|
nav.hidden = settings.hidden === !0;
|
|
204
227
|
nav.style.display = nav.hidden ? "none" : "flex";
|
|
@@ -62,6 +62,13 @@ export declare interface NativeAccessoryCompanion {
|
|
|
62
62
|
accessibilityLabel?: string
|
|
63
63
|
menu?: NativeAccessoryMenuItem[]
|
|
64
64
|
}
|
|
65
|
+
/** Floating actions outside the tab stacks, in companion order followed by the primary action. */
|
|
66
|
+
export declare interface NativeTabAccessory extends Omit<NativeAccessoryCompanion, 'menu'> {
|
|
67
|
+
badge?: string | null
|
|
68
|
+
iconOnly?: boolean
|
|
69
|
+
layout?: 'vertical' | 'horizontal'
|
|
70
|
+
companions?: NativeAccessoryCompanion[]
|
|
71
|
+
}
|
|
65
72
|
export declare interface NativeNavigationOptions {
|
|
66
73
|
title?: string
|
|
67
74
|
titleColor?: string | null
|
|
@@ -72,7 +79,7 @@ export declare interface NativeNavigationOptions {
|
|
|
72
79
|
backTitle?: string
|
|
73
80
|
leftButtons?: NativeNavigationButton[]
|
|
74
81
|
rightButtons?: NativeNavigationButton[]
|
|
75
|
-
tabAccessory?:
|
|
82
|
+
tabAccessory?: NativeTabAccessory | null
|
|
76
83
|
tabItem?: NativeTabItemOptions
|
|
77
84
|
}
|
|
78
85
|
/** A button every screen of the app carries, unless the screen is where it goes. */
|
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{no,Vt,El,Pg}from"./chunk-tzdwg9rw.js";import{to,Di,$g,Rg,Ag}from"./chunk-8g5dsjr0.js";import{kl,_l,Cl,Eg,Tg}from"./chunk-2ytaezad.js";import{We,An,Mi}from"./chunk-rk2ex6qx.js";import{Ig,Og,Ng,Dg,ro,
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{no,Vt,El,Pg}from"./chunk-tzdwg9rw.js";import{to,Di,$g,Rg,Ag}from"./chunk-8g5dsjr0.js";import{kl,_l,Cl,Eg,Tg}from"./chunk-2ytaezad.js";import{We,An,Mi}from"./chunk-rk2ex6qx.js";import{Ig,Og,Ng,Dg,ro,by}from"./chunk-69b8mr68.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-64evx0my.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=no(n,t);if(a){let s=Vt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Di(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,_l as auditBuildOutput,kl as auditConfig,re as buildPwaAssets,Cl as calculateAuditResult,Tg as formatAuditResult,Mi as formatSize,j as generateManifest,_ as generateManifestJson,Rg as generateManifestLink,F as generateOfflinePage,We as generatePrecacheManifest,An as generatePrecacheManifestJs,M as generatePwaIcons,to as generatePwaTags,no as generateServiceWorker,Pg as generateServiceWorkerAuto,$g as generateSwRegistrationScript,Ag as generateThemeColorMeta,N as getExpectedIconPaths,Vt as getServiceWorkerFileName,Di as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,El as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,ro as pwaDirectives,Ig as pwaInstallDirective,Ng as pwaOfflineDirective,Dg as pwaPushDirective,Og as pwaUpdateDirective,
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=no(n,t);if(a){let s=Vt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Di(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,_l as auditBuildOutput,kl as auditConfig,re as buildPwaAssets,Cl as calculateAuditResult,Tg as formatAuditResult,Mi as formatSize,j as generateManifest,_ as generateManifestJson,Rg as generateManifestLink,F as generateOfflinePage,We as generatePrecacheManifest,An as generatePrecacheManifestJs,M as generatePwaIcons,to as generatePwaTags,no as generateServiceWorker,Pg as generateServiceWorkerAuto,$g as generateSwRegistrationScript,Ag as generateThemeColorMeta,N as getExpectedIconPaths,Vt as getServiceWorkerFileName,Di as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,El as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,ro as pwaDirectives,Ig as pwaInstallDirective,Ng as pwaOfflineDirective,Dg as pwaPushDirective,Og as pwaUpdateDirective,by as registerPwaDirectives,Eg as runPwaAudit,D as validateManifest};
|
|
@@ -15,7 +15,7 @@ export declare function reactiveLoopRanges(template: string): Array<[number, num
|
|
|
15
15
|
* A component tag inside one of these renders its slot in a separate pass,
|
|
16
16
|
* which needs the names to keep treating them as the loop's.
|
|
17
17
|
*/
|
|
18
|
-
export declare function reactiveLoopScopes(template: string): Array<{ start: number, end: number, names: string[] }>;
|
|
18
|
+
export declare function reactiveLoopScopes(template: string): Array<{ start: number, end: number, names: string[], tag: string }>;
|
|
19
19
|
/**
|
|
20
20
|
* Process server-side `:attr="expr"` bindings in a template.
|
|
21
21
|
*
|
package/dist/server-bindings.js
CHANGED
|
@@ -55,7 +55,7 @@ export function reactiveLoopScopes(template) {
|
|
|
55
55
|
scope.end = tag.end;
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
|
-
const loopAttr = /(?::for|x-for|v-for|@for)\s*=/.test(tag.attributes) ? parseAttributes(tag.attributes).find((attr) => LOOP_ATTRIBUTES.has(attr.name)) : void 0, loopValue = typeof loopAttr?.value === "string" ? loopAttr.value : null, scope = loopValue !== null ? { start: tag.start, end: tag.end, names: loopBoundNames(loopValue) } : null;
|
|
58
|
+
const loopAttr = /(?::for|x-for|v-for|@for)\s*=/.test(tag.attributes) ? parseAttributes(tag.attributes).find((attr) => LOOP_ATTRIBUTES.has(attr.name)) : void 0, loopValue = typeof loopAttr?.value === "string" ? loopAttr.value : null, scope = loopValue !== null ? { start: tag.start, end: tag.end, names: loopBoundNames(loopValue), tag: tagName } : null;
|
|
59
59
|
if (scope)
|
|
60
60
|
ranges.push(scope);
|
|
61
61
|
if (!tag.selfClosing && !VOID_TAGS.has(tagName)) {
|
package/dist/ssg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-4y6hes3h.js";import{x,al}from"./chunk-
|
|
2
|
+
import"./chunk-4y6hes3h.js";import{x,al}from"./chunk-r8xwd8r1.js";import"./chunk-n91sm385.js";import"./chunk-zjqvbcwa.js";import{At,y}from"./chunk-tjnf4a8g.js";import"./chunk-47n5s7wk.js";import"./chunk-vhxrrqrg.js";import"./chunk-9mtyxvhk.js";import{_t,Ct,Et,Tt,$t,Rt}from"./chunk-kxj5sp5w.js";import{a}from"./chunk-md84j62m.js";import{$s}from"./chunk-rb6vr5v9.js";import"./chunk-ncrrxp60.js";import"./chunk-010yhk6m.js";import{ye,tn,nn}from"./chunk-xr8hg79c.js";import"./chunk-y7aqf8r7.js";import{b}from"./chunk-zwxncs2e.js";import{bt,i}from"./chunk-rncmfgpk.js";import"./chunk-hgk1v60t.js";import"./chunk-315q48qy.js";import{ms}from"./chunk-mveqaxkr.js";import"./chunk-pb9347sn.js";import"./chunk-4dxq7ft1.js";import{tc,nc,rc}from"./chunk-02qbawwq.js";import{Qt,er,tr}from"./chunk-rrj3gv46.js";import{en}from"./chunk-nqj1mkkz.js";import"./chunk-sv52qc36.js";import"./chunk-48vnw9t9.js";import{G,ve}from"./chunk-7r4p7zjn.js";import"./chunk-kbv5nwwd.js";import"./chunk-302gek13.js";import{c}from"./chunk-bygxt820.js";import{s,me}from"./chunk-x0dx1pyf.js";import D from"fs";import f from"path";import{createHash as vt}from"crypto";function Pt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Dt(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let n=new Map,o=t.replace(kt,(e,u,g,v)=>{let w=v.trim();if(!w)return e;if(/\bdata-stx-src=/.test(g))return e;if(r.minify)w=Pt(w);let p=Dt(w);if(!n.has(p))n.set(p,w);let P=r.integrity?` data-stx-integrity="sha384-${vt("sha384").update(w).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),l=Array.from(n,([e,u])=>({hash:e,code:u}));return{html:o,chunks:l}}var It=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,n=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=n.exec(t))!==null)r.set(o[1],o[2]);let l=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(It.has(r.get(u[1])||""))l.add(u[2]);let g=/<\/head\s*>/iy,v=y(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(l.size===0||v===-1)return t;let w=Array.from(l).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!w)return t;return t.slice(0,v)+w+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let r=t.trim();if(!r)return null;let n=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(n).origin+new URL(n).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let r of Bt){let n=t[r];if(!n)continue;let o=X(n);if(o)return{url:o,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,n=r.site?.url??r.url??r.app?.url;return typeof n==="string"?X(n):null}async function Ft(t){let{existsSync:r}=await import("fs"),n=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let l=n.resolve(t,o);if(!r(l))continue;try{let e=await import(l),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let r=t.cwd??process.cwd(),n=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let l=await Ft(r);if(l)return{url:l,source:"site.config",via:"url"};let e=jt(n);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
3
|
`)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let r=s(t),{depths:n}=me(r),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=o.exec(r))!==null){if(n[l.index]!==0)continue;let u=x(r,"(",")",o.lastIndex-1),g=r.indexOf("{",u+1),v=x(r,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(l.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(r))!==null){if(n[l.index]!==0)continue;let u=al(r,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let r="read";try{let n=await Bun.file(t).text();r="parse";let o=en(n),l=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(s(e.attrs))).sort((e,u)=>n.indexOf(e.fullTag)-n.indexOf(u.fullTag));for(let e of l){if(!/\bgetStaticPaths\b/.test(s(e.content)))continue;let u=(Ot??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(s(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(s(g))&&At(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");r="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let w=await v();r="result";let p=Array.isArray(w)?{paths:w}:w;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(n){return{kind:"error",phase:r,error:n instanceof Error?n:Error(String(n))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,r=""){this.cacheDir=t,this.salt=r}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let r=JSON.parse(await Bun.file(t).text());for(let[n,o]of Object.entries(r))this.cache.set(n,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),r={};for(let[n,o]of this.cache)r[n]=o;await Bun.write(t,JSON.stringify(r))}getHash(t,r){let n=D.statSync(t),o=`${this.salt}|${t}:${n.mtimeMs}`;for(let e of r)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let l=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);l=(l<<5)-l+u,l=l&l}return Math.abs(l).toString(36)}get(t,r){let n=this.cache.get(t);if(!n)return null;let o=ft(r).some((u)=>D.existsSync(u)),l=[r,...n.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&ms(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||l)return this.cache.delete(t),null;let e=this.getHash(r,n.dependencies??[]);if(n.hash!==e)return this.cache.delete(t),null;return n.html}set(t,r,n,o){let l=this.getHash(r,n);this.cache.set(t,{hash:l,html:o,generatedAt:Date.now(),dependencies:n})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let r=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",r)}async get(t){let r=this.getFilePath(t);if(!await Bun.file(r).exists())return null;try{return JSON.parse(await Bun.file(r).text())}catch{return null}}async set(t,r){let n=this.getFilePath(t);await D.promises.mkdir(f.dirname(n),{recursive:!0}),await Bun.write(n,JSON.stringify(r))}async invalidate(t){let r=this.getFilePath(t);if(await Bun.file(r).exists())await D.promises.unlink(r)}async invalidatePattern(t){let r=f.join(this.cacheDir,"isr");if(!D.existsSync(r))return;let n=await D.promises.readdir(r);for(let o of n){let l=o.replace(/_/g,"/").replace(".json","");if(t.test(l))await D.promises.unlink(f.join(r,o))}}async needsRevalidation(t){let r=await this.get(t);if(!r)return!0;return Date.now()>r.revalidateAfter}}async function Ut(t){let r=[];if(!t.isDynamic)r.push({url:t.pattern,params:{}});else{let n=await gt(t.filePath);if(n.kind==="error")throw Error(`getStaticPaths ${n.phase} failed for ${t.pattern} (${t.filePath}): ${n.error.message}`,{cause:n.error});if(n.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),r;let o=n.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),r;for(let l of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(l.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);r.push({url:e,params:l.params,props:l.props,revalidate:l.revalidate})}}return r}function ft(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let r of ft(t))if(await Bun.file(r).exists())try{let n=await import(r);if(typeof n.default==="function")return await n.default();else if(typeof n.default==="object")return n.default;else if(typeof n.getData==="function")return await n.getData();else{let{default:o,...l}=n;return l}}catch(n){console.error(`Error loading data file ${r}:`,n)}return null}async function Gt(t,r,n){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let l=o[1];if(!l.includes("getStaticProps"))return null;try{let e=l.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
|
|
4
4
|
return (async function getStaticProps() {
|
|
5
5
|
${e[1]}
|
|
@@ -37,7 +37,7 @@ ${t.map((o)=>{let l=new URL(o.loc,r).href,e=` <url>
|
|
|
37
37
|
${n.join(`
|
|
38
38
|
`)}
|
|
39
39
|
</channel>
|
|
40
|
-
</rss>`}async function Vt(t={}){let r=Date.now();nn();let n=await a(process.cwd()),o=n.build||{},l=await ut({explicit:t.domain||o.domain,stxConfig:n});if(l.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??n?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:l.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||n?.partialsDir||"",componentsDir:t.componentsDir||n?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,w={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-
|
|
40
|
+
</rss>`}async function Vt(t={}){let r=Date.now();nn();let n=await a(process.cwd()),o=n.build||{},l=await ut({explicit:t.domain||o.domain,stxConfig:n});if(l.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??n?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:l.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||n?.partialsDir||"",componentsDir:t.componentsDir||n?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,w={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-msd0ezxm.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:S}=await import("./chunk-t4n23dh5.js"),R=await S(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let A=new pt(e.cacheDir,E);if(e.cache)await A.load();try{let{generateCss:d}=await import("./chunk-msd0ezxm.js");await d('<div class="bg-black"></div>')}catch{}_t();let wt=n?.routeMiddleware?.dir||"middleware";await Et(process.cwd(),wt);let V=Ct();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let yt=n?.routeMiddleware?.global||[];rc(n?.layoutsDir,c(process.cwd()));let Z=G(".",{pagesDir:e.pagesDir,pagesDirs:n?._layerPageDirs});console.log(`Found ${Z.length} routes`);let L=[];for(let d of Z)try{let m=await Ut(d);for(let k of m)L.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=L.length+u.failedCount,console.log(`Generating ${L.length} pages...`);let U=[],Q=[];for(let d=0;d<L.length;d+=e.concurrency)Q.push(L.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:_,props:St,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let M=await Bun.file(k.filePath).text(),T=Yt(M),xt=T?.middleware?Array.isArray(T.middleware)?T.middleware:[T.middleware]:[],nt=[...yt,...xt];if(nt.length>0){let B=Tt(h,_,T||{}),H=$t(B,null,void 0,{isServer:!0}),j=await Rt(nt,H);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,z=Zt(String(C),h),O=te(h,e);await D.promises.mkdir(f.dirname(O),{recursive:!0}),await Bun.write(O,z),u.successCount++,u.pages.push({route:h,outputPath:O,size:Buffer.byteLength(z),cached:!1}),U.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=T?.validate;if(typeof it==="function")try{if(!await it({params:_})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=A.get(h,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await mt(k,_,St,e,n);if(I=B.html,e.failOnIncludeError&&B.includeFailures.length>0)throw Error(`${B.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
41
41
|
${B.includeFailures.join(`
|
|
42
42
|
`)}
|
|
43
43
|
Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&B.serverScriptFailures.length>0)throw Error(`${B.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.845",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/ts-css": "^0.3.21",
|
|
130
130
|
"@stacksjs/clapp": "^0.2.16",
|
|
131
|
-
"@stacksjs/desktop": "0.2.
|
|
132
|
-
"@stacksjs/sanitizer": "0.2.
|
|
131
|
+
"@stacksjs/desktop": "0.2.845",
|
|
132
|
+
"@stacksjs/sanitizer": "0.2.845",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
|
-
"bun-plugin-stx": "0.2.
|
|
134
|
+
"bun-plugin-stx": "0.2.845",
|
|
135
135
|
"bunfig": "^0.15.21",
|
|
136
|
-
"stx-router": "0.2.
|
|
136
|
+
"stx-router": "0.2.845",
|
|
137
137
|
"ts-broadcasting": "^0.0.11",
|
|
138
138
|
"ts-images": "^0.2.22",
|
|
139
139
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-0571wwem.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Hf,Bh,Fh,zh,Hh,Vf,Uf,Vh,Uh,Yo,Wh,dr,pr,xs}from"./chunk-y7rdw6td.js";import{rt}from"./chunk-car6nhfe.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Hh as __setSignalsGeneratorsForTest,rt as cacheEngineFingerprint,pr as cacheTemplate,dr as checkCache,Wh as clearDevCaches,Uf as getCachedRouterScript,Vf as getCachedSignalsRuntime,Vh as getServeClientAsset,Yo as getServeModuleBundle,xs as hashFilePath,Fh as invalidateFileCache,zh as invalidateFileCacheByDir,Bh as readFileCached,Uh as registerServeModuleBundle,Hf as templateCache};
|
package/dist/chunk-0h3qftkx.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xo,gh,mh}from"./chunk-gspxyygw.js";import"./chunk-rdmm3zvb.js";import"./chunk-9zjr0ty9.js";import"./chunk-4y6hes3h.js";import"./chunk-r7tr5dvd.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{mh as clearComposableCache,gh as getComposableScript,xo as listComposableModules};
|
package/dist/chunk-339cn2s8.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Pi,iy,ay,fl,Ue,Cg,Qs,cy,ly,uy,dy,py,fy,gy,my,hy}from"./chunk-756bf5nt.js";export{fy as applyHead,cy as definePageMeta,Pi as getHead,iy as getPageMeta,Ue as mergeHeadConfigs,gy as processHeadDirective,hy as processMetaDirective,my as processTitleDirective,py as renderBodyAttrs,uy as renderHead,dy as renderHtmlAttrs,ay as resetHead,Qs as seoMetaToHeadConfig,fl as useHead,ly as usePageTitle,Cg as useSeoMeta,ly as useTitle};
|
package/dist/chunk-3kg5a5gp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Wl,vm,ql,Kl,xm,Sm}from"./chunk-hnhq2f69.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Sm as applySlots,xm as extractSlotContent,vm as parseSlotElement,Wl as parseSlots,Kl as processSlots,ql as renderSlot};
|
package/dist/chunk-4a93qzdg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{gs,jf,Ho,Bf}from"./chunk-ge54kqfy.js";import"./chunk-qz18x7f0.js";import"./chunk-r7tr5dvd.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import{It}from"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Bf as declareBareLoopHead,It as parseLoopBinding,jf as processLoops,Ho as processLoopsAsync,gs as reportDeferredLoopWarnings};
|
package/dist/chunk-689qm4h4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ra,Aa,Pa,Ia,Th}from"./chunk-m95pk7fk.js";import"./chunk-r3jf8v5a.js";import"./chunk-wyprsedf.js";import"./chunk-fm8gfj2g.js";import"./chunk-58pc09a1.js";import"./chunk-zjek9py2.js";import"./chunk-ast5jmcg.js";import"./chunk-4dxq7ft1.js";import"./chunk-nrn44374.js";import"./chunk-vytbqwaz.js";import"./chunk-ge54kqfy.js";import"./chunk-qz18x7f0.js";import"./chunk-r7tr5dvd.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-y7rdw6td.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Ra as buildNative,Th as default,Aa as findCraftBinary,Ia as getAvailableFormats,Pa as getAvailableTargets};
|
package/dist/chunk-9gkc04h5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Qg}from"./chunk-1474zjtx.js";import"./chunk-53b8r8d2.js";import"./chunk-jn8jny22.js";import"./chunk-9zjr0ty9.js";import"./chunk-vytbqwaz.js";import"./chunk-f39xf08q.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Qg as startProductionServer};
|
package/dist/chunk-bv4rews8.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{lh,vo,uh,dh,ph,fh}from"./chunk-3vh945rk.js";import"./chunk-rdmm3zvb.js";import"./chunk-9zjr0ty9.js";import"./chunk-4y6hes3h.js";import"./chunk-r7tr5dvd.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{fh as clearStoreCache,lh as getStoreScript,ph as getStoreScriptFor,dh as pageStoresAll,vo as storesRead,uh as storesReadInFiles};
|
package/dist/chunk-c0grsrqj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{am}from"./chunk-6wgbm5tc.js";import"./chunk-53b8r8d2.js";import"./chunk-8qjf16yr.js";import"./chunk-jn8jny22.js";import"./chunk-9zjr0ty9.js";import"./chunk-58pc09a1.js";import"./chunk-zjek9py2.js";import"./chunk-ast5jmcg.js";import"./chunk-4dxq7ft1.js";import"./chunk-nrn44374.js";import"./chunk-vytbqwaz.js";import"./chunk-ge54kqfy.js";import"./chunk-qz18x7f0.js";import"./chunk-r7tr5dvd.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-y7rdw6td.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{am as buildForProduction};
|
package/dist/chunk-fw7va7h4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Al,Pl}from"./chunk-4mqr462h.js";import"./chunk-bqsrtvad.js";import"./chunk-dbsexg52.js";import"./chunk-qg3hp77v.js";import"./chunk-1474zjtx.js";import"./chunk-7s411sa9.js";import"./chunk-1h6pb8d1.js";import"./chunk-rs6evw29.js";import"./chunk-6wgbm5tc.js";import"./chunk-53b8r8d2.js";import"./chunk-3ba0nqwm.js";import"./chunk-ka5ea34g.js";import"./chunk-79wb76ya.js";import"./chunk-hnhq2f69.js";import"./chunk-tpyk6b4c.js";import"./chunk-78q3apyy.js";import"./chunk-b6qf7w2b.js";import"./chunk-c6yc6qsv.js";import"./chunk-6hb75r07.js";import"./chunk-9vg3jtzw.js";import"./chunk-cnav1x5k.js";import"./chunk-6ygr2syc.js";import"./chunk-5y3m5vzg.js";import"./chunk-mnt7jbek.js";import"./chunk-fs5mshcs.js";import"./chunk-3rjgm7qk.js";import"./chunk-3vh945rk.js";import"./chunk-gspxyygw.js";import"./chunk-8qjf16yr.js";import"./chunk-wyprsedf.js";import"./chunk-fm8gfj2g.js";import"./chunk-02qbawwq.js";import{en}from"./chunk-jn8jny22.js";import"./chunk-rdmm3zvb.js";import"./chunk-9zjr0ty9.js";import"./chunk-4y6hes3h.js";import{Ae,i}from"./chunk-58pc09a1.js";import"./chunk-zjek9py2.js";import"./chunk-ast5jmcg.js";import"./chunk-4dxq7ft1.js";import"./chunk-nrn44374.js";import"./chunk-vytbqwaz.js";import"./chunk-ge54kqfy.js";import"./chunk-qz18x7f0.js";import"./chunk-r7tr5dvd.js";import{ve}from"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import{dr,pr}from"./chunk-y7rdw6td.js";import{ks,F,a}from"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import{m,je}from"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";import"./chunk-11kp389s.js";import"./chunk-rpapxkdm.js";export{ks as buildWebComponents,pr as cacheTemplate,dr as checkCache,en as classifyAllScripts,Al as createMiddleware,Pl as createRoute,F as defaultConfig,m as extractVariables,ve as injectRouterScript,a as loadStxConfig,je as processClientScript,i as processDirectives,Ae as readMarkdownFile};
|
package/dist/chunk-gvf0g8nf.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Lf,ps}from"./chunk-nrn44374.js";import"./chunk-vytbqwaz.js";import"./chunk-qz18x7f0.js";import"./chunk-sw0e1sad.js";import{Cr}from"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import{ot}from"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{ot as freeIdentifiers,ps as processComponents,Lf as processESImports,Cr as rendersAsElement};
|
package/dist/chunk-kxydr8z4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ti,ni,ri,si,Es,Ts,Xh,Gh,Jh,Yh,$s,Zh}from"./chunk-pdzt72p8.js";import"./chunk-756bf5nt.js";export{Zh as generateDefaultRobotsTxt,$s as generateRobotsTxt,Gh as generateSitemap,Jh as generateSitemapIndex,si as injectSeoTags,Es as metaDirective,ti as processMetaDirectives,ri as processSeoDirective,ni as processStructuredData,Xh as registerSeoDirectives,Yh as scanForSitemapEntries,Ts as structuredDataDirective};
|
package/dist/chunk-mjhhvf6e.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Bm,Sa,gu,Fm,zm,Hm,Vm,Um,mu,hu,Wm,qm,Km,Xm}from"./chunk-6ygr2syc.js";import"./chunk-58pc09a1.js";import"./chunk-zjek9py2.js";import"./chunk-ast5jmcg.js";import"./chunk-4dxq7ft1.js";import"./chunk-nrn44374.js";import"./chunk-vytbqwaz.js";import"./chunk-ge54kqfy.js";import"./chunk-qz18x7f0.js";import"./chunk-r7tr5dvd.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-y7rdw6td.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{gu as SUSPENSE_RESOLVER_RUNTIME,Sa as buildSuspenseResolveScript,Um as createStreamRenderer,Hm as extractStreamBoundaries,Xm as generateHydrationRuntime,hu as islandDirective,qm as processSectionDirectives,zm as processStreamDirectives,Wm as registerStreamingDirectives,Fm as renderStreamingPage,Bm as streamTemplate,Vm as streamTemplateSimple,Km as streamToResponse,mu as streamingSuspenseDirective};
|
package/dist/chunk-nrn44374.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{yl,bl}from"./chunk-n91sm385.js";import{f,P,ot,d}from"./chunk-756bf5nt.js";import{U,wr,Ds,Ms,ci,li,Ls,fn,De,fe,J,Sr,kr,ie,Y,N,st,_r,pi,Tr,ze,r,p,W,Sn}from"./chunk-y8nx9aa6.js";import{n}from"./chunk-vytbqwaz.js";import{oe}from"./chunk-qz18x7f0.js";import{s}from"./chunk-x0dx1pyf.js";import{g}from"./chunk-0dve54ne.js";import{createHash as St}from"crypto";import Q from"fs";import Z from"path";import Me from"fs";function Ce(e,i,t){let o=Buffer.alloc(t),a=Me.readSync(e,o,0,t,i);return o.subarray(0,a)}function Le(e){if(e.length<25)return!1;let i=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(i(0,4)!=="RIFF"||i(8,12)!=="WEBP")return!1;let t=i(12,16);if(t==="VP8X")return(e[20]&16)!==0;if(t==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Ue(e){let i;try{i=Me.openSync(e,"r");let t=Ce(i,0,33);if(t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255)return"none";if(t.length>=26&&t[0]===137&&t.toString("latin1",1,4)==="PNG"){let o=t[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ce(i,a,8);if(l.length<8)return"unknown";let u=l.toString("latin1",4,8);if(u==="tRNS")return"possible";if(u==="IDAT"||u==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(t.length>=25&&t.toString("latin1",0,4)==="RIFF"&&t.toString("latin1",8,12)==="WEBP"){if(Le(t))return"possible";let o=t.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(i!==void 0)Me.closeSync(i)}}import Jt from"fs";import ke from"os";import{join as gt}from"path";import{fileURLToPath as pt}from"url";var Pe=Symbol("stx.image-worker.unavailable");function Yt(e=typeof ke.availableParallelism==="function"?ke.availableParallelism():ke.cpus().length){return Math.max(1,Math.min(2,e-1))}var Ae=0,ht=[];async function Qt(){if(Ae<Yt()){Ae++;return}await new Promise((e)=>ht.push(e)),Ae++}function en(){Ae--,ht.shift()?.()}var tn="@stacksjs/stx/builtins/image-warmup-worker";function nn(e=process.cwd()){let i=import.meta.url.endsWith(".ts")?"ts":"js";try{let t=new URL(`./image-warmup-worker.${i}`,import.meta.url);if(t.protocol==="file:"&&Jt.existsSync(pt(t)))return pt(t)}catch{}try{let t=typeof Bun<"u"?Bun.resolveSync(tn,e):void 0;return t&&rn(t)?t:void 0}catch{return}}function rn(e,i=process.env){let t=e.replace(/\\/g,"/");if(t.split("/").some((a)=>/@\d[^/]*@@@\d+$/.test(a)))return!1;return![i.BUN_INSTALL_CACHE_DIR,gt(i.BUN_INSTALL||gt(ke.homedir(),".bun"),"install","cache")].filter((a)=>!!a).map((a)=>`${a.replace(/\\/g,"/").replace(/\/$/,"")}/`).some((a)=>t.startsWith(a))}var mt=!1;function ue(e){if(!mt)mt=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return Pe}function Re(e){return e instanceof Error?e.message:String(e)}async function Fe(e,i){let t;try{t=(await import("worker_threads")).Worker}catch(a){return ue(`could not load node:worker_threads: ${Re(a)}`)}if(typeof t!=="function")return ue("node:worker_threads has no Worker in this runtime");let o=nn();if(!o)return ue("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await Qt();try{return await new Promise((a,c)=>{let l;try{l=new t(o)}catch(y){a(ue(`could not start ${o}: ${Re(y)}`));return}let u=!1,m=!1,v=(y)=>{if(m)return;m=!0,y(),l.terminate()};l.on("message",(y)=>{if(y.type==="ready"){u=!0,l.postMessage({task:e,args:i});return}if(y.type==="result"){v(()=>a(y.value));return}let h=Error(y.error?.message??"image worker failed");if(y.error?.name)h.name=y.error.name;if(y.error?.stack)h.stack=y.error.stack;v(()=>c(h))}),l.on("error",(y)=>{v(()=>u?c(y instanceof Error?y:Error(Re(y)||"image worker crashed")):a(ue(`the worker failed before it was ready: ${Re(y)}`)))}),l.on("exit",(y)=>{v(()=>u?c(Error("image worker exited before it finished")):a(ue(`the worker exited with code ${y} before it was ready`)))})})}finally{en()}}var sn=new Set([".avif",".jpeg",".jpg",".png",".webp"]),on=[320,640,960,1280,1920],ye="/_stx/images",an=`stx:${ye}:alpha-1`,cn=`stx:${ye}:opaque-1`,ln=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Ie;function un(e,i){let t=Z.dirname(Bun.resolveSync(e,i));while(t!==Z.dirname(t)){let o=Z.join(t,"package.json");if(Q.existsSync(o)){let a=JSON.parse(Q.readFileSync(o,"utf8"));if(a.name===e)return a.version}t=Z.dirname(t)}return}function yt(){if(Ie!==void 0)return Ie;let e;try{e=Z.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Ie=ln.map((i)=>{let t;try{t=e?un(i,e):void 0}catch{}return`${i.replace("@stacksjs/","")}@${t??"unknown"}`}).join("+"),Ie}var bt=Symbol.for("stx.image-delivery");function be(){let e=globalThis;return e[bt]??={catalog:new Map,transparent:new Set},e[bt]}var vt=new Set;function dn(e){return`/${e.split(Z.sep).map(encodeURIComponent).join("/")}`}function gn(e){let i=Z.extname(e),t=e.slice(0,-i.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=St("sha256").update(e).digest("hex").slice(0,8);return`${t||"image"}-${o}`}function xt(e,i=`stx:${ye}`){let t=(o)=>`${ye}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:i,async stat(o){let a=Z.join(e,o);try{let c=await Q.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:t(o)}:null}catch{return null}},async write(o,a){let c=Z.join(e,o);await Q.promises.mkdir(Z.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await Q.promises.writeFile(l,a),await Q.promises.rename(l,c),{bytes:a.byteLength,path:c,url:t(o)}},url:t}}async function Ct(e,i=e){let t=await Q.promises.readdir(i,{withFileTypes:!0});t.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of t){let c=Z.join(i,a.name);if(a.isDirectory()){o.push(...await Ct(e,c));continue}if(!a.isFile()||!sn.has(Z.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:Z.relative(e,c)})}return o}function wt(e,i){return e.map((t)=>({key:dn(t.relativePath),input:t.absolutePath,name:gn(t.relativePath),...pn(t.absolutePath)?{options:{storage:i}}:{}}))}function pn(e){return Ue(e)==="possible"}function mn(e){for(let i=3;i<e.length;i+=4)if(e[i]!==255)return!0;return!1}async function hn(e){let i=Object.entries(e).filter(([,c])=>c.fallback.format==="png"),t=new Set,o=8;if(i.length===0)return t;let{decode:a}=await import("ts-images");for(let c=0;c<i.length;c+=8)await Promise.all(i.slice(c,c+8).map(async([l,u])=>{let m=u.variants.filter((v)=>v.format==="png").sort((v,y)=>v.width-y.width)[0];try{let v=await a(new Uint8Array(await Q.promises.readFile(m?.path??u.fallback.path)));if(mn(v.data))t.add(l)}catch{t.add(l)}}));return t}function yn(e,i){let t=[];for(let o of i){let a=e[o],c=a?.variants.filter((u)=>u.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((u)=>{let m;try{return m=Q.openSync(u.path,"r"),!Le(Ce(m,0,32))}catch{return!0}finally{if(m!==void 0)Q.closeSync(m)}}))continue;if(a.variants=a.variants.filter((u)=>u.format!=="webp"),delete a.sources.webp,t.push(o),!vt.has(o))vt.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return t}async function bn(e){let i=[],t=8;if(e.length===0)return i;let{generateThumbHash:o}=await import("ts-images");for(let a=0;a<e.length;a+=8){let c=e.slice(a,a+8),l=await Promise.all(c.map(async(u)=>{try{return await o(u.absolutePath),u}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${u.relativePath}`),null}}));i.push(...l.filter((u)=>u!==null))}return i}function We(e){return Z.join(e,"undecodable.json")}function vn(e){try{let i=Q.readFileSync(We(e),"utf-8"),t=JSON.parse(i);return t&&typeof t==="object"?t:{}}catch{return{}}}function xn(e,i){try{Q.mkdirSync(Z.dirname(We(e)),{recursive:!0}),Q.writeFileSync(We(e),JSON.stringify(i))}catch{}}function $t(e){try{let i=Q.statSync(e);return{mtimeMs:i.mtimeMs,size:i.size}}catch{return}}function Rt(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let i=e.split(/[?#]/,1)[0];if(!i)return;try{return`/${i.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function Bo(e){let i=Rt(e);return i?be().catalog.get(i):void 0}function Fo(e){let i=Rt(e);return i?be().transparent.has(i):!1}function zo(e){let i=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),t=i(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:i(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<t).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function Mh(e){let i=Bo(e);if(!i)return;return{src:i.fallback.url,srcset:i.sources[i.fallback.format]||"",sources:zo(i).map(({format:t,srcset:o})=>({type:`image/${t}`,srcset:o})),width:i.source.width,height:i.source.height,placeholder:Fo(e)?void 0:i.placeholder?.dataUrl}}function ds(){let e=be();e.catalog=new Map,e.transparent=new Set}function wn(e){let i=be();i.catalog=new Map(e.entries),i.transparent=new Set(e.transparent)}async function Lh(e,i,t={}){if(!e||!Q.existsSync(e))return ds(),{count:0,fingerprint:""};if(t.offThread){let b=await Fe("delivery",{publicDir:e,outputDir:i});if(b!==Pe)return wn(b.state),b.result}let o=await Ct(e);if(o.length===0)return ds(),{count:0,fingerprint:""};let a=vn(i),c=o.filter((b)=>{let w=a[b.relativePath];if(!w)return!0;let A=$t(b.absolutePath);return!A||A.mtimeMs!==w.mtimeMs||A.size!==w.size});if(c.length===0)return ds(),{count:0,fingerprint:""};let l=xt(Z.join(i,"_stx","images"),`${an}:${yt()}`),u={outDir:Z.join(i,"_stx","images"),storage:xt(Z.join(i,"_stx","images"),`${cn}:${yt()}`),baseUrl:ye,widths:on,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},{createImageDeliveryCatalog:m}=await import("ts-images/delivery"),v=c,y;try{y=await m({...u,entries:wt(c,l)})}catch(b){if(v=await bn(c),v.length===c.length)throw b;let w=new Set(v.map((k)=>k.relativePath)),A=!1;for(let k of c){if(w.has(k.relativePath))continue;let R=$t(k.absolutePath);if(!R)continue;a[k.relativePath]=R,A=!0}if(A)xn(i,a);if(v.length===0)return ds(),{count:0,fingerprint:""};y=await m({...u,entries:wt(v,l)})}let h=await hn(y.entries),C=yn(y.entries,h),x=be();x.catalog=new Map(Object.entries(y.entries)),x.transparent=h;let S=h.size===0&&C.length===0?y.fingerprint:St("sha256").update(y.fingerprint).update(JSON.stringify({transparent:[...h].sort(),droppedWebp:C.sort()})).digest("hex");return{count:v.length,fingerprint:S}}class kt{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let i of e.aliases)this.builtins.set(i.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,i,t,o){let a=ci(e,o);if(a!==void 0)return a;for(let c of li(e,i,t,o))if(await r(c))return c;return null}}var de=new kt;var re="\x00stx-boolean-attribute";function He(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var $n=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function qe(e){let i=e.toLowerCase();return i.startsWith("aria-")||i.startsWith("data-")||$n.has(i)}function se(e,i){let t=[];for(let[o,a]of Object.entries(e.static)){if(i.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)t.push(p(c));continue}if(a===re){t.push(p(c));continue}t.push(`${p(c)}="${Sn(c,He(String(a)))}"`)}return t}function ae(e,i){let t=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(i.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){t.push(p(c));continue}if(typeof a==="object")continue;t.push(`${p(c)}="${Sn(c,He(String(a)))}"`)}return t}function Cn(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var Xe={name:"StxLink",aliases:["stx-link"],render(e,i,t){let o=Cn(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",u=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,m=[];if(o.reactive)m.push(`:href="${n(o.value)}"`);else m.push(`href="${n(Sr(o.value,"navigable"))}"`);if(a)m.push(`class="${n(a)}"`);if(m.push("data-stx-link"),m.push(`data-stx-active-class="${n(c)}"`),m.push(`data-stx-exact-active-class="${n(l)}"`),u)m.push("data-stx-prefetch");let v=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(v)m.push(`data-stx-active-match="${n(v)}"`);let y=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return m.push(...se(e,y)),m.push(...ae(e,y)),`<a ${m.join(" ")}>${i}</a>`}};var Rn=new Map;function Ve(e){if(!e)return;let i=e.split("?")[0].split("#")[0];return Rn.get(i)}var kn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Ze=[320,640,768,1024,1280,1536,1920];function V(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function _e(e,i,t=!1){let o=e.serverDynamic[i];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[i];if(a!==void 0)return a!=="false"&&a!==!1;return t}function Ge(e){if(e.includes("(")||e.includes(","))return e;let i=e.trim().split(/\s+/),t=[];for(let o of i)if(o.includes(":")){let[a,c]=o.split(":"),l=kn[a];if(l)t.push(`(max-width: ${l}px) ${c}`);else{let u=Number.parseInt(a);if(!Number.isNaN(u))t.push(`(max-width: ${u}px) ${c}`)}}else t.push(o);return t.join(", ")}function Ke(e,i,t,o){return i.map((a)=>`${ve(e,a,void 0,t,o)} ${a}w`).join(", ")}function An(e,i,t,o,a){return i.map((c)=>{let l=t?t*c:void 0;return`${ve(e,l,void 0,o,a)} ${c}x`}).join(", ")}function ve(e,i,t,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(i)c.push(`w_${i}`);if(t)c.push(`h_${t}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(i)c.set("w",String(i));if(t)c.set("h",String(t));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(i)c.set("width",String(i));if(t)c.set("height",String(t));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function Pn(e){return`var s=this.style;${e.map((i)=>`s.${i}=''`).join(";")}`}function In(e,i,t="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${i}"><rect width="100%" height="100%" fill="${t}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var Je={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,i,t){let o=V(e,"src")||"",a=Bo(o),c=V(e,"alt")||"",l=V(e,"width")||(a?String(a.source.width):void 0),u=V(e,"height")||(a?String(a.source.height):void 0),m=V(e,"sizes"),v=V(e,"srcset"),y=V(e,"densities"),h=V(e,"format"),C=Fo(o)||Ve(o)?.transparent===!0,x=V(e,"placeholder")||(a&&!C?"thumbhash":void 0),S=V(e,"placeholderColor")||"#e5e7eb",b=V(e,"provider"),w=V(e,"class")||V(e,"className")||"",A=V(e,"style")||"",k=V(e,"objectFit")||V(e,"fit"),R=V(e,"objectPosition")||V(e,"position"),B=V(e,"quality"),G=_e(e,"lazy",!0),M=_e(e,"preload",!1),F=_e(e,"priority",!1),H=V(e,"loading"),E=V(e,"decoding")||"async",D=!!a||_e(e,"picture",!1)||!!h,O=l?Number.parseInt(l):void 0,q=u?Number.parseInt(u):void 0,z=v||"",X="";if(a)z=a.sources[a.fallback.format]||"",X=m?Ge(m):"100vw";else if(!z&&m&&b&&b!=="local"&&b!=="static")z=Ke(o,Ze,b,h),X=Ge(m);else if(!z&&y){let I=y.split(/\s+/).map((_)=>Number.parseFloat(_.replace("x","")));z=An(o,I,O,b,h)}else if(m)X=Ge(m);let L=[];if(A)L.push(A);if(k)L.push(`object-fit:${k}`);if(R)L.push(`object-position:${R}`);if(O&&q)L.push(`aspect-ratio:${O}/${q}`);let T=[],ce=x==="blur"||x==="color"||x==="thumbhash";if(ce&&!C){let I=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:S}:Ve(o);if(I&&x==="color")L.push(`background-color:${I.color}`),T.push("backgroundColor");else if(I)L.push(`background-color:${I.color}`),L.push(`background-image:url(${I.dataUrl})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),T.push("backgroundColor","backgroundImage");else{let _=In(O||16,q||9,S);L.push(`background-image:url(${_})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),T.push("backgroundImage")}}else if(!ce&&x&&x!=="empty"&&x!=="none")L.push(`background-image:url(${n(x)})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),T.push("backgroundImage");let $e=a?.fallback.url||ve(o,O,q,b,h),K=[];if(K.push(`src="${n(Sr($e,"fetched"))}"`),K.push(`alt="${n(c)}"`),l)K.push(`width="${n(l)}"`);if(u)K.push(`height="${n(u)}"`);let le=H||(F||M?"eager":G?"lazy":"");if(le)K.push(`loading="${n(le)}"`);if(F)K.push('fetchpriority="high"');if(K.push(`decoding="${n(E)}"`),w)K.push(`class="${n(w)}"`);if(L.length>0)K.push(`style="${n(L.join(";"))}"`);if(z)K.push(`srcset="${n(Sr(z,"fetched"))}"`);if(X)K.push(`sizes="${n(X)}"`);let te=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(T.length>0){let I=typeof e.static.onload==="string"?e.static.onload:"",_=Pn(T)+(I?`;${I}`:"");K.push(`onload="${n(_)}"`),te.add("onload")}K.push(...se(e,te)),K.push(...ae(e,te));let je=`<img ${K.join(" ")} />`,j="";if(M){let _=h==="webp"?"image/webp":h==="avif"?"image/avif":"";j=`<link rel="preload" as="image" href="${n($e)}"${_?` type="${_}"`:""}${z?` imagesrcset="${n(z)}"`:""}${X?` imagesizes="${n(X)}"`:""} />
|
|
3
|
-
`}if(D){let I=[];if(a)for(let _ of zo(a))I.push(`<source type="image/${_.format}" srcset="${n(_.srcset)}"${X?` sizes="${n(X)}"`:""} />`);if(!a&&(h==="avif"||h==="auto")){let _=ve(o,O,q,b,"avif"),ee=z?Ke(o,Ze,b,"avif"):`${_}`;I.push(`<source type="image/avif" srcset="${n(ee)}"${X?` sizes="${n(X)}"`:""} />`)}if(!a&&(h==="webp"||h==="auto")){let _=ve(o,O,q,b,"webp"),ee=z?Ke(o,Ze,b,"webp"):`${_}`;I.push(`<source type="image/webp" srcset="${n(ee)}"${X?` sizes="${n(X)}"`:""} />`)}return`${j}<picture>
|
|
4
|
-
${I.join(`
|
|
5
|
-
`)}
|
|
6
|
-
${je}
|
|
7
|
-
</picture>`}return`${j}${je}`}};var At="/images/safe-image-default.svg";function ge(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var _n=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${At}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,Ye={name:"SafeImage",aliases:["safe-image","safe-img"],render(e,i,t){let o=ge(e,"src")||"",a=ge(e,"alt")||"",c=ge(e,"fallback")||At,l=ge(e,"class")||ge(e,"className")||"",u=ge(e,"fallbackClassName")||"",m=[];if(m.push(`src="${n(o)}"`),m.push(`alt="${n(a)}"`),l)m.push(`class="${n(l)}"`);if(m.push(`data-fallback="${n(c)}"`),u)m.push(`data-fallback-class="${n(u)}"`);m.push('onerror="window.__stxSafeImageHandler(this)"');let v=new Set(["src","alt","fallback","class","className","fallbackClassName"]);m.push(...se(e,v)),m.push(...ae(e,v));let y=`<img ${m.join(" ")} />`,h=t.context;if(!h.__safeImageHandlerEmitted)return h.__safeImageHandlerEmitted=!0,`${_n}${y}`;return y}};function Qe(e){return e.replace(/[;{}()]/g,"").replace(/url/gi,"")}function xe(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function Ee(e,i,t){let o=xe(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return t}var et={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render(e,i,t){let o=Qe(xe(e,"color")||"#6366f1"),a=Qe(xe(e,"initialColor")||xe(e,"initial-color")||""),c=Qe(xe(e,"height")||"3px"),l=Ee(e,"duration",2000),u=Ee(e,"throttle",200),m=Ee(e,"zIndex",999999)||Ee(e,"z-index",999999),v=a?`linear-gradient(to right, ${a}, ${o})`:o;return`
|
|
8
|
-
<div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${c};background:${v};z-index:${m};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
|
|
9
|
-
<div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
|
|
10
|
-
</div>
|
|
11
|
-
<style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
|
|
12
|
-
<script>
|
|
13
|
-
(function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${u})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
|
|
14
|
-
</script>`}};function It(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function En(e,i,t){let o=It(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return t}var Pt={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},tt={name:"StxToast",aliases:["stx-toast"],render(e,i,t){let o=n(It(e,"position")||"top-right"),a=En(e,"max",5),c=Pt[o]||Pt["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${o}" data-stx-toast-max="${a}" style="position:fixed;${c};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
|
|
15
|
-
<style>
|
|
16
|
-
@keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
|
|
17
|
-
@keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
|
|
18
|
-
@keyframes stx-toast-in-left{from{opacity:0;transform:translateX(-100%)}to{opacity:1;transform:translateX(0)}}
|
|
19
|
-
@keyframes stx-toast-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-100%)}}
|
|
20
|
-
@keyframes stx-toast-in-center{from{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}
|
|
21
|
-
@keyframes stx-toast-out-center{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-1rem)}}
|
|
22
|
-
</style>`}};function Ne(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var _t={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},nt={name:"StxModal",aliases:["stx-modal"],render(e,i,t){let o=Ne(e,"id");if(!o)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let a=n(o),c=Ne(e,"size")||"md",l=Ne(e,"closeOnBackdrop")!=="false",u=Ne(e,"closeOnEscape")!=="false",m=_t[c]||_t.md;return`<div id="stx-modal-${a}" class="stx-modal-backdrop" data-stx-modal="${a}" data-close-backdrop="${l}" data-close-escape="${u}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
|
|
23
|
-
<div class="stx-modal-panel" style="${m};width:100%;margin:1rem;border-radius:0.75rem;box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow:hidden;transform:scale(0.95) translateY(8px);transition:transform 0.2s ease,opacity 0.2s ease;opacity:0;background:var(--stx-modal-bg,#fff);color:var(--stx-modal-text,#1f2937)">
|
|
24
|
-
<div style="padding:1.5rem">${i}</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<style>
|
|
28
|
-
@media(prefers-color-scheme:dark){[data-stx-modal]{--stx-modal-bg:#1f2937;--stx-modal-text:#f3f4f6}}
|
|
29
|
-
.stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
|
|
30
|
-
.stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
|
|
31
|
-
</style>`}};function pe(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var Et={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},rt={name:"StxDrawer",aliases:["stx-drawer"],render(e,i,t){let o=pe(e,"id");if(!o)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let a=n(o),c=pe(e,"side")||"right",l=pe(e,"size")||"md",u=pe(e,"closeOnBackdrop")!=="false",m=pe(e,"closeOnEscape")!=="false",v=pe(e,"overlay")!=="false",y=Et[l]||Et.md,h=c==="left",C=h?"left:0":"right:0",x=h?"translateX(-100%)":"translateX(100%)",S=h?"stx-drawer-slide-left":"stx-drawer-slide-right";return`<div id="stx-drawer-${a}" class="stx-drawer-backdrop" data-stx-drawer="${a}" data-close-backdrop="${u}" data-close-escape="${m}" style="display:none;position:fixed;inset:0;z-index:99999;${v?"background:rgba(0,0,0,0.5);backdrop-filter:blur(2px)":"background:transparent;pointer-events:none"};opacity:0;transition:opacity 0.2s ease" role="dialog" aria-modal="true">
|
|
32
|
-
<div class="stx-drawer-panel" style="position:fixed;top:0;bottom:0;${C};width:${y};max-width:100vw;transform:${x};transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);background:var(--stx-drawer-bg,#fff);color:var(--stx-drawer-text,#1f2937);box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow-y:auto;pointer-events:auto">
|
|
33
|
-
<div style="padding:1.5rem">${i}</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
<style>
|
|
37
|
-
@media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
|
|
38
|
-
.stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
|
|
39
|
-
.stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
|
|
40
|
-
</style>`}};import{existsSync as Nn,readFileSync as On}from"fs";var Oe=new Map,Nt=new Set;function Bn(e){if(Nt.has(e))return;Nt.add(e),console.warn(`[stx] icon collection "${e}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${e}\`.`)}function Dn(e){let i=process.cwd();for(let t of[`${i}/node_modules/@iconify-json/${e}/icons.json`,`${i}/pantry/@iconify-json/${e}/icons.json`,`${i}/node_modules/@iconify/json/json/${e}.json`,`${i}/pantry/@iconify/json/json/${e}.json`])if(Nn(t))return t;for(let t of[`@iconify-json/${e}/icons.json`,`@iconify/json/json/${e}.json`])try{return g.resolve(t)}catch{}return null}function Tn(e){if(Oe.has(e))return Oe.get(e);let i=Dn(e);if(!i)return Bn(e),null;try{let t=JSON.parse(On(i,"utf8"));return Oe.set(e,t),t}catch{return null}}function jn(e,i,t,o){let a=[];if(i.rotate)a.push(`rotate(${i.rotate*90} ${t/2} ${o/2})`);if(i.hFlip)a.push(`translate(${t} 0) scale(-1 1)`);if(i.vFlip)a.push(`translate(0 ${o}) scale(1 -1)`);return a.length?`<g transform="${a.join(" ")}">${e}</g>`:e}function Mn(e,i){let t=i,o=e.icons[t],a={hFlip:!1,vFlip:!1,rotate:0};for(let u=0;!o&&u<8;u++){let m=e.aliases?.[t];if(!m)return null;if(m.hFlip)a.hFlip=!a.hFlip;if(m.vFlip)a.vFlip=!a.vFlip;if(m.rotate)a.rotate=((a.rotate+m.rotate)%4+4)%4;t=m.parent,o=e.icons[t]}if(!o)return null;let c=o.width??e.width??24,l=o.height??e.height??24;return{body:jn(o.body,a,c,l),width:c,height:l}}function me(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);if(e.static[i]!==void 0)return String(e.static[i]);if(e.clientReactive[i]!==void 0)return e.clientReactive[i];return}var it={name:"Icon",aliases:["icon","stx-icon"],render(e,i,t){let o=me(e,"name")??me(e,"icon");if(!o)return"<!-- Icon: missing name/icon prop -->";let a="lucide",c=o;if(o.includes(":")){let w=o.split(":");a=w[0],c=w[1]}let l=n(me(e,"size")||"24"),u=n(me(e,"color")||"currentColor"),m=n(me(e,"class")||""),v=n(me(e,"style")||""),y=Oe.get(a)??Tn(a);if(!y)return`<!-- Icon: collection "${a}" not loaded -->`;let h=Mn(y,c);if(!h)return`<!-- Icon: "${c}" not found in ${a} -->`;let C=`0 0 ${h.width} ${h.height}`,x=h.body;if(u!=="currentColor")x=x.replace(/currentColor/g,u);let S=m?` class="${m}"`:"",b=v?` style="${v}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="${C}" fill="none"${S}${b}>${x}</svg>`}};function Ot(e,...i){for(let t of i){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o}return}function Bt(e,i){let t=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${i}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),o=e.match(t);if(!o)return{region:null,rest:e};return{region:o[2],rest:e.replace(o[0],"")}}var at={name:"Suspense",aliases:["suspense"],render(e,i,t){let o=Bt(i,"fallback"),a=o.rest,c=Bt(a,"error"),l=c.rest,u=o.region??Ot(e,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',m=c.region??Ot(e,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${u}</div><div data-stx-suspense-error hidden>${m}</div><div data-stx-suspense-content hidden>${l}</div></div>`}};function Be(e,...i){for(let t of i){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o}return}var ct={name:"TransitionGroup",aliases:["transition-group"],render(e,i,t){let o=(Be(e,"name")||"v").replace(/["'<>]/g,""),a=(Be(e,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",c=Be(e,"class"),l=Be(e,"id"),u=[`data-stx-transition-group="${o}"`,c?`class="${c}"`:"",l?`id="${l}"`:""].filter(Boolean).join(" ");return`<${a} ${u}>${i}</${a}>`}};function Dt(e=de){e.registerBuiltin(Xe),e.registerBuiltin(Je),e.registerBuiltin(Ye),e.registerBuiltin(et),e.registerBuiltin(tt),e.registerBuiltin(nt),e.registerBuiltin(rt),e.registerBuiltin(it),e.registerBuiltin(at),e.registerBuiltin(ct)}var Tt=new Map;function Ln(e){let i=Tt.get(e.source);if(!i)i=new RegExp(`(${e.source})(?![\\w.:-])`,"y"),Tt.set(e.source,i);return i}var jt=new WeakMap;function Mt(e){let i=jt.get(e);if(!i)i=new Set([...e].map((o)=>o.toLowerCase())),jt.set(e,i);let t=i;return(o)=>!/[a-z]/.test(o)&&t.has(o.toLowerCase())}function zn(e,i){let t="";for(let o=i;o<e.length;o++){let a=e[o];if(t){if(a==="\\")o++;else if(a===t)t=""}else if(a==='"'||a==="'")t=a;else if(a===">")return o}return e.length}function Lt(e,i,t){let o=[],a=0,c=typeof t==="function"?t:t?(l)=>t.has(l.toLowerCase()):void 0;while(a<e.length){let l=e.indexOf("<",a);if(l===-1)break;let u=Ln(i);u.lastIndex=l+1;let m=u.exec(e);if(!m){a=l+1;continue}let v=m[1];if(c&&c(v)){let w=l+1+v.length;while(w<e.length&&e[w]!==">")w++;a=w+1;continue}let y=l+1+v.length,h=null,C=y,x=-1,S=!1;while(y<e.length){let w=e[y];if(h){if(w==="\\"&&y+1<e.length){y+=2;continue}if(w===h)h=null;y++;continue}if(w==='"'||w==="'"){h=w,y++;continue}if(w==="/"&&y+1<e.length&&e[y+1]===">"){x=y+2,S=!0;break}if(w===">"){x=y+1;break}y++}if(x===-1){a=l+1;continue}let b=e.slice(C,S?x-2:x-1).trim();if(S)o.push({fullMatch:e.slice(l,x),tagName:v,attributes:b,content:"",startIndex:l,endIndex:x,isSelfClosing:!0}),a=x;else{let w=`<${v}`,A=`</${v}>`,k=1,R=x,B=-1;while(k>0&&R<e.length){let F=e.indexOf(w,R),H=e.indexOf(A,R);if(H===-1)break;if(F!==-1&&F<H){let E=e[F+w.length];if(E===" "||E===">"||E==="/"||E===`
|
|
41
|
-
`||E==="\t"){let D=zn(e,F+w.length);if(e[D-1]!=="/")k++;R=D+1}else R=F+w.length}else{if(k--,k===0){B=H;break}R=H+A.length}}if(B===-1){a=x;continue}let G=e.slice(x,B),M=B+A.length;o.push({fullMatch:e.slice(l,M),tagName:v,attributes:b,content:G,startIndex:l,endIndex:M,isSelfClosing:!1}),a=M}}return o}function lt(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/'/gi,"'").replace(/&/g,"&")}function zt(e,i){try{let t=Buffer.from(e,"base64").toString("utf8");return JSON.parse(t)}catch{}try{let t=e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");return JSON.parse(t)}catch(t){if(i?.debug)console.error("Error decoding __stx_ prop:",t);return e}}function Te(e,i){let t=0,o="",a=i;while(a<e.length){let c=e[a];if(o){if(c==="\\")a++;else if(c===o)o=""}else if(c==='"'||c==="'"||c==="`")o=c;else if(c==="{")t++;else if(c==="}"){if(t--,t===0)return e.slice(i,a+1)}a++}return e.slice(i)}function Ut(e){let i=e.trim();if(!i.startsWith("{")||!i.endsWith("}"))return null;if(Te(i,0).length!==i.length)return null;return i.slice(1,-1).trim()}function Ft(e){let i=[],t=0,o=e.length;while(t<o){while(t<o&&/\s/.test(e[t]))t++;if(t>=o)break;let a="";while(t<o&&!/[\s=]/.test(e[t]))a+=e[t],t++;if(!a)break;while(t<o&&/\s/.test(e[t]))t++;if(t<o&&e[t]==="="){t++;while(t<o&&/\s/.test(e[t]))t++;let c="";if(t<o&&(e[t]==='"'||e[t]==="'")){let l=e[t];t++;while(t<o&&e[t]!==l){if(e[t]==="\\"&&t+1<o)t++,c+=e[t];else c+=e[t];t++}if(t<o)t++}else if(e[t]==="{")c=Te(e,t),t+=c.length;else while(t<o&&!/\s/.test(e[t]))c+=e[t],t++;i.push({name:a,value:c})}else i.push({name:a,value:!0})}return i}var Un=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),Fn=new Set([":for","x-for","v-for","@for"]),Wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Hn(e){return ut(e).map((i)=>[i.start,i.end])}function ut(e){let i=[],t=new Map;for(let o of fn(e)){let a=o.name.toLowerCase();if(o.closing){let v=t.get(a)?.pop();if(v)v.end=o.end;continue}let l=/(?::for|x-for|v-for|@for)\s*=/.test(o.attributes)?Ft(o.attributes).find((v)=>Fn.has(v.name)):void 0,u=typeof l?.value==="string"?l.value:null,m=u!==null?{start:o.start,end:o.end,names:Y(u)}:null;if(m)i.push(m);if(!o.selfClosing&&!Wn.has(a)){let v=t.get(a);if(!v)v=[],t.set(a,v);v.push(m)}}return i}function Wt(e){if(typeof e==="string")return e;if(Array.isArray(e))return e.filter(Boolean).map((i)=>Wt(i)).join(" ");if(e&&typeof e==="object")return Object.entries(e).filter(([,i])=>i).map(([i])=>i).join(" ");return e?String(e):""}function dc(e,i){if(!/:[\w-]+=/.test(e))return e;let t=e,o=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,a=[],c;while((c=o.exec(e))!==null)a.push([c.index,c.index+c[0].length]);a.push(...Hn(e));let l=new Set([...st(i),...Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]]);function u(h){return a.some(([C,x])=>h>=C&&h<x)}let m=[],v=new Map,y=256;for(let h of fn(t)){if(h.closing||u(h.start))continue;let C=h.attributes.trimEnd();if(!C||!C.includes(":"))continue;let x=/(?:^|\s)data-native(?:\s|=|$)/i.test(C.replace(/"[^"]*"|'[^']*'/g,"")),S=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,b,w=C,A=!1;while((b=S.exec(C))!==null){if(kr(C,b.index,!0)?.kind==="attribute")continue;let k=b[1],R=b[2];if(yl(k))continue;if(N(R,l))continue;if(R.includes("()")&&!R.includes(".get(")||R.includes("$store")||R.includes("$ref"))continue;try{let B=Object.keys(i),G=Object.values(i),M=R.match(/^([a-zA-Z_$][\w$]*)/);if(M&&!B.includes(M[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(M[1]))continue;let F=JSON.stringify([B,R]),H=v.get(F);if(!H){if(H=Function(...B,`return (${R})`),v.size>=y)v.clear();v.set(F,H)}let E=H(...G);if(k==="class"){let D=W(Wt(E));if(D){let O=w.match(/\sclass="([^"]*)"/);if(O)w=w.replace(O[0],()=>` class="${O[1]} ${D}"`);else w=w.replace(b[0],()=>` class="${D}"`)}else w=w.replace(b[0],"");A=!0;continue}if(Un.has(k)){if(E)w=w.replace(b[0],` ${k}`);else w=w.replace(b[0],"");A=!0;continue}if(E===null||E===void 0||E===!1)w=w.replace(b[0],"");else{let D=x&&typeof E==="object"?JSON.stringify(E):String(E),O=Sn(k,D);w=w.replace(b[0],()=>` ${k}="${O}"`)}A=!0}catch(B){if(B instanceof ie)throw B;continue}}if(A){let k=h.selfClosing?" /":"",B=`<${h.name}${w}${k}>`;m.push({start:h.start,end:h.end,replacement:B})}}if(m.length>0){let h=Array(m.length*2+1),C=0;for(let x=0;x<m.length;x++){let{start:S,end:b,replacement:w}=m[x];h[x*2]=t.slice(C,S),h[x*2+1]=w,C=b}h[m.length*2]=t.slice(C),t=h.join("")}return t}import Ht from"fs";import qt from"path";var Xt=!1;function qn(e,i,t,o=!1,a=new Set){let c={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},l=new Set(Array.isArray(i.__stx_client_signal_names)?i.__stx_client_signal_names:[]),u=(h)=>{if(l.size===0)return!1;let C=s(h),x=C.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(x&&l.has(x))return!0;for(let S of l){let b=S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${b}\\s*\\(`).test(C))return!0}return!1},m=new Set(bl),v=(h)=>{if(!h.includes("-")||h.startsWith("@")||h.startsWith(":")||h.startsWith("x-")||h.startsWith("__"))return h;if(h.startsWith("aria-")||h.startsWith("data-"))return h;return h.replace(/-([a-z0-9])/g,(C,x)=>x.toUpperCase())},y=(h,C)=>{let x=v(h);if(c.static[x]=C,x!==h)c.staticNames[x]=h};for(let[h,C]of Object.entries(e)){let x=h.startsWith("x-")&&!m.has(h)&&!h.startsWith("x-bind:")&&!h.startsWith("x-on:")?`:${h.slice(2)}`:h;if(x.startsWith("@")){c.events[x]=C;continue}if(x.startsWith("__stx_")){let S=v(x.slice(6));c.serverDynamic[S]=zt(C,t);continue}if(x.startsWith(":")){let S=v(x.slice(1)),b=C===re?S:C;if(S==="if"||S==="for"||S==="show"){c.clientReactive[S]=b;continue}if(o){c.clientReactive[S]=b;continue}if(N(b,a)){c.clientReactive[S]=b;continue}if(u(b)){c.clientReactive[S]=b;continue}try{if(!f(b)){if(t.debug)console.error(`Unsafe expression in :${S} binding: ${b}`);c.clientReactive[S]=b;continue}let w=Object.keys(i),A=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]),k=new Set(Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]);if(ot(b).some((M)=>!A.has(M)&&!w.includes(M)&&(!(M in globalThis)||k.has(M)))){c.clientReactive[S]=b;continue}let G=d(b,w)(...Object.values(i));if(c.serverDynamic[S]=G,S!==x.slice(1)&&c.serverDynamicNames)c.serverDynamicNames[S]=x.slice(1)}catch{c.clientReactive[S]=b}continue}if(typeof C==="string"&&C.includes("{{")&&C.includes("}}")){let S=Xn(C,a);if(S!==null){c.clientReactive[v(x)]=S;continue}let b=C.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(b)try{let w=b[1];if(f(w)){let k=d(w,Object.keys(i))(...Object.values(i));y(x,k!=null?String(k):"")}else{if(t.debug)console.error(`Unsafe expression in ${x}: ${w}`);y(x,C)}}catch(w){if(t.debug)console.error(`Error evaluating expression for ${x}:`,w);y(x,C)}else{let w=C,A=/\{\{\s*([\s\S]+?)\s*\}\}/g,k;while((k=A.exec(C))!==null)try{let R=k[1];if(!f(R)){if(t.debug)console.error(`Unsafe expression in ${x}: ${R}`);continue}let G=d(R,Object.keys(i))(...Object.values(i));w=w.replace(k[0],String(G??""))}catch(R){if(t.debug)console.error(`Error evaluating expression in ${x}:`,R)}y(x,w)}continue}y(x,C===re?"true":lt(C))}return c}function Xn(e,i){if(i.size===0)return null;let t=/\{\{\s*([\s\S]+?)\s*\}\}/g,o=[...e.matchAll(t)];if(!o.some((u)=>N(u[1],i)))return null;let a=e.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(a&&o.length===1)return a[1];let c="",l=0;for(let u of o)c+=e.slice(l,u.index).replace(/[`\\$]/g,(m)=>`\\${m}`),c+=`\${${u[1]}}`,l=u.index+u[0].length;return c+=e.slice(l).replace(/[`\\$]/g,(u)=>`\\${u}`),`\`${c}\``}var Vn=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function Zn(e,i,t){if(!e.includes("@"))return e;if(!Vn.some(([a,c])=>a.test(e)&&e.includes(c)))return e;try{return oe(e,i,t)}catch{return e}}function he(e){let i={},t=0,o=e.length;while(t<o){while(t<o&&/\s/.test(e[t]))t++;if(t>=o)break;let a="";while(t<o&&!/[\s=]/.test(e[t]))a+=e[t],t++;if(!a)break;while(t<o&&/\s/.test(e[t]))t++;if(t<o&&e[t]==="="){t++;while(t<o&&/\s/.test(e[t]))t++;let c="";if(t<o&&(e[t]==='"'||e[t]==="'")){let l=e[t];t++;while(t<o){let u=e[t];if(u==="\\"&&t+1<o){t++,c+=e[t],t++;continue}if(u===l){t++;break}c+=u,t++}}else if(e[t]==="{"){c=Te(e,t),t+=c.length;let l=Ut(c);if(l!==null){i[`:${a}`]=l;continue}}else while(t<o&&!/\s/.test(e[t]))c+=e[t],t++;i[a]=c}else i[a]=re}return i}function Vt(e){return Object.entries(e).map(([i,t])=>t===re?i:`${i}="${Gn(t)}"`).join(" ")}function Gn(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Kn(e){let i=new Set,t=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,o;while((o=t.exec(e))!==null){let a=o[1];if(de.isBuiltin(a))i.add(a)}return[...i].sort()}async function Lf(e,i,t,o,a){if(!/import\s/.test(e))return e;if(!i.__importedComponents)i.__importedComponents=new Map;let c=i.__importedComponents,l=qt.dirname(t),u=[],m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let h of e.matchAll(m)){let[C,x,S]=h,b=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,w=S,A,k=[];while((A=b.exec(S))!==null){let[R,B,G,M]=A,F=null,H=null;if(M.startsWith(".")||M.startsWith("/")){let O=qt.resolve(l,M);if(O.endsWith(".stx"))H=O;else{let q=`${O}.stx`;try{if(Ht.statSync(q).isFile())H=q}catch{try{if(Ht.statSync(O).isDirectory())F=O}catch{}}}}else F=Ds(M,l);if(!F&&!H)continue;let E=!1,D=(O,q)=>{c.set(O,q),c.set(O.toLowerCase(),q);let z=O.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();c.set(z,q),a.add(q)};if(G&&H)D(G,H),E=!0;else if(B){let O=B.slice(1,-1).split(",").map((z)=>z.trim()).filter(Boolean).map((z)=>{let X=z.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(X)return{source:X[1],local:X[2]};return{source:z,local:z}}),q=F?wr(F):null;for(let{source:z,local:X}of O){let L=null;if(H)L=H;else if(q)L=q.get(z)??q.get(z.toLowerCase())??q.get(z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(L)D(X,L),E=!0}}if(E)k.push({start:A.index,end:A.index+R.length})}if(k.length===0)continue;for(let R=k.length-1;R>=0;R--)w=w.slice(0,k[R].start)+w.slice(k[R].end);u.push({start:h.index,end:h.index+C.length,value:`<script${x}>${w}</script>`})}if(u.length===0)return e;let v=[],y=0;for(let h of u)v.push(e.slice(y,h.start),h.value),y=h.end;return v.push(e.slice(y)),v.join("")}async function Jn(e,i,t,o,a){let c=e;if(!i.__importedComponents)i.__importedComponents=new Map;let l=i.__importedComponents,u=/@import\s*\(\s*([^)]+)\s*\)/g,m;while((m=u.exec(c))!==null){let[v,y]=m,h=y.split(",").map((C)=>C.trim().replace(/^['"]|['"]$/g,"")).filter((C)=>C.length>0);for(let C of h){let x=C.split("/"),b=x[x.length-1].replace(/\.stx$/,""),w=b.includes("-")?b.split("-").map((R)=>R.charAt(0).toUpperCase()+R.slice(1)).join(""):b.charAt(0).toUpperCase()+b.slice(1),A=null,k=Ms(C,t,o);for(let R of k)try{if(await Bun.file(R).exists()){A=R;break}}catch{}if(A){l.set(w,A),l.set(b,A),l.set(b.toLowerCase(),A);let R=w.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(l.set(R,A),a.add(A),o.debug)console.log(`Imported component: ${w} -> ${A}`)}else if(o.debug)console.warn(`Could not resolve imported component: ${C}`)}c=c.replace(v,""),u.lastIndex=0}return c}async function Yn(e,i,t,o,a){let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,m=/@component\s*\(/g,v;while((v=m.exec(c))!==null){let y=v.index,h=y+v[0].length-1,C=1,x=h+1;while(x<c.length&&C>0){if(c[x]==="(")C++;else if(c[x]===")"){if(C--,C===0)break}x++}if(C!==0)break;let S=c.substring(h+1,x),b=x+1,w=S.match(/^\s*['"]([^'"]+)['"]/);if(!w){m.lastIndex=b;continue}let A=w[1],k,R=S.slice(w[0].length),B=R.match(/^\s*,\s*/);if(B)k=R.slice(B[0].length).trim();let G={};if(k)try{G=P(k,i)}catch(O){let q=O instanceof Error?O.message:String(O);c=c.replace(c.substring(y,b),`[Error parsing component props: ${q}]`);continue}let M="",F=b,E=c.substring(b).match(/^([\s\S]*?)@endcomponent/);if(E)M=E[1].trim(),F=b+E[0].length;let D=await ze(A,G,M,l,i,t,o,u,a);c=c.substring(0,y)+D+c.substring(F),m.lastIndex=0}return c}async function Qn(e,i,t,o,a){if(!e)return e;let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,m=nr(c);if(m.size>0){let b=Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[];i.__stx_client_declared_names=[...new Set([...b,...m])]}let v=J(c);c=v.output;let y=st(i);return c=await S(c,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),c=await S(c,/[A-Z][a-zA-Z0-9]*/,!0,Mt(_r)),c=await S(c,/[a-z][a-z0-9]*/,!1,_r),c=v.restore(c),c;async function S(b,w,A,k){if(!b)return b;let R=b,B=Lt(R,w,k),G=ut(R),M=new Map;for(let E=B.length-1;E>=0;E--){let D=B[E],O=A?U(D.tagName):D.tagName,q=he(Zn(D.attributes,i,t)),z=G.filter(({start:I,end:_})=>D.startIndex>=I&&D.startIndex<_),X=z.length>0,L=new Set(y);for(let I of z)for(let _ of I.names)L.add(_);let T=qn(q,i,o,X,L);if(typeof T.clientReactive.for==="string")for(let I of Y(T.clientReactive.for))L.add(I);let ce=de.getBuiltin(D.tagName),$e=ce?await Tr(D.tagName,l,i,t,o):!1,K=D.tagName==="Image"&&Ls([...Object.keys(T.static),...Object.keys(T.serverDynamic),...Object.keys(T.clientReactive)],Object.keys(T.events),{...T.static,...T.serverDynamic})&&(o._pluginComponentDirs??[]).some((I)=>wr(I).has("Image"));if(ce&&!$e&&!K){let I={context:i,filePath:t,options:o,dependencies:a},_=ce.render(T,D.content,I);if(Object.keys(T.events).length>0){let ee=Vt(T.events);_=_.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${ee}`)}if(Object.keys(T.clientReactive).length>0)_=Zt(_,T.clientReactive);M.set(E,_);continue}if(!A&&D.tagName.includes("-")&&!await Tr(O,l,i,t,o))continue;let le={};for(let[I,_]of Object.entries(T.static))le[I]=_;for(let[I,_]of Object.entries(T.serverDynamic))le[I]=_;let te={declaredProps:new Set,consumedProps:new Set,reactiveProps:Object.keys(T.clientReactive),events:Object.keys(T.events)},j=await ze(O,le,v.restore(D.content),l,i,t,o,u,a,[...L],te,D.tagName);if(j=er(j,T,te.declaredProps,te.consumedProps,o._nativeHostAttrs),o._nativeHostAttrs){let I=te.reactiveProps.filter((ne)=>!te.consumedProps.has(ne)&&!["if","for","show","key","ref"].includes(ne)).map(U),_=ft(j,!0);if(I.length&&_){if(!Object.hasOwn(he(j.slice(_.insertPos,_.tagEnd)),"data-stx-native-host-root"))j=j.slice(0,_.insertPos)+' data-stx-native-host-root="true"'+j.slice(_.insertPos);let ne=we(j);j=j.slice(0,ne.insertPos)+` data-stx-native-forward="${I.join(" ")}"`+j.slice(ne.insertPos)}let ee=ft(j,!0);if(ee){let ne=he(j.slice(ee.insertPos,ee.tagEnd)),Se=we(j),Kt=he(j.slice(Se.insertPos,Se.tagEnd));if(Object.hasOwn(ne,"data-stx-native-host-root")&&!Object.hasOwn(Kt,"data-stx-native-host-owner"))j=j.slice(0,Se.insertPos)+" data-stx-native-host-owner"+j.slice(Se.insertPos)}}if(Object.keys(T.events).length>0){let I=we(j);if(I){let _=Vt(T.events),ee=Object.keys(T.events).map((ne)=>ne.replace(/^@/,"").split(".")[0]).join(" ");j=j.substring(0,I.insertPos)+` data-stx-parent-events="${ee}" ${_}`+j.substring(I.insertPos)}}if(Object.keys(T.clientReactive).length>0)j=Zt(j,T.clientReactive);M.set(E,j)}if(M.size===0)return R;let F="",H=0;for(let E=0;E<B.length;E++){let D=M.get(E);if(D===void 0)continue;F+=R.slice(H,B[E].startIndex),F+=D,H=B[E].endIndex}return F+=R.slice(H),F}}function Zt(e,i){let t=new Set(["if","for"]),o=new Set(["show"]),a=Object.entries(i).filter(([y])=>!t.has(y)),c=a.filter(([y])=>!o.has(y)).map(([y])=>U(y)).join(" "),l=e,u=a.length>0?we(l):null;if(u){let y=a.map(([C,x])=>`:${U(C)}="${x.replace(/"/g,""")}"`).join(" "),h=c?` data-stx-parent-bindings="${c}"`:"";l=l.substring(0,u.insertPos)+`${h} ${y}`+l.substring(u.insertPos)}let m=i.if;if(m)l=`<template :if="${m.replace(/"/g,""")}">${l}</template>`;let v=i.for;if(v){let y=i.key,h=y?` :key="${y.replace(/"/g,""")}"`:"";l=`<template :for="${v.replace(/"/g,""")}"${h}>${l}</template>`}return l}function er(e,i,t=new Set,o=new Set,a=!1){let c=ft(e,a);if(!c)return e;let l=e.slice(c.insertPos,c.tagEnd),u=i.serverDynamic.class??i.static.class;if(a&&typeof u==="string"&&u&&!o.has("class")){let S=/(^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i,b=S.test(l)?l.replace(S,(w,A,k,R,B)=>`${A}class="${n(`${lt(k??R??B)} ${u}`)}"`):` class="${n(u)}"${l}`;e=e.slice(0,c.insertPos)+b+e.slice(c.tagEnd),c.tagEnd+=b.length-l.length,l=b}let m=a||/\bdata-native(?:\s|=)/i.test(l),v=m?o:t,y=new Set(Object.keys(he(l))),h=new Set(["class","className"]);for(let S of Object.keys(i.static)){let b=i.staticNames[S]??S;if(y.has(b)||v.has(S)||!m&&!qe(b))h.add(S)}for(let S of Object.keys(i.serverDynamic)){let b=i.serverDynamicNames?.[S]??S;if(y.has(b)||v.has(S)||!m&&!qe(b))h.add(S)}let C=[];if(m){for(let[S,b]of Object.entries(i.static)){if(h.has(S)||b!==!0&&b!==re)continue;h.add(S),C.push(`${n(i.staticNames?.[S]??S)}="true"`)}for(let[S,b]of Object.entries(i.serverDynamic)){if(h.has(S)||b!==!0)continue;h.add(S),C.push(`${n(i.serverDynamicNames?.[S]??S)}="true"`)}}let x=[...se(i,h),...ae(i,h),...C];if(m){for(let[S,b]of Object.entries(i.serverDynamic)){if(h.has(S)||b!==!1)continue;let w=i.serverDynamicNames?.[S]??S;x.push(`${n(w)}="false"`)}for(let[S,b]of Object.entries(i.serverDynamic)){if(h.has(S)||b===null||typeof b!=="object")continue;let w=JSON.stringify(b);if(w!==void 0){let A=i.serverDynamicNames?.[S]??S;x.push(`${n(A)}="${n(w)}"`)}}}if(x.length===0)return e;return`${e.slice(0,c.insertPos)} ${x.join(" ")}${e.slice(c.insertPos)}`}function we(e){let i=Gt(e,0);if(i)return i;let t=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec(e);if(t)return{insertPos:t.index+1+t[1].length,tagEnd:dt(e,t.index+1+t[1].length)};return null}function ft(e,i=!1){let t=we(e);if(!t)return null;let o=e.slice(t.insertPos,t.tagEnd),a=/\bdata-stx-component-wrapper(?:\s|=|>|$)/i.test(o)?Gt(e,t.tagEnd+1):t;return a&&i?tr(e,a)??a:a}function tr(e,i){if(!e.includes("data-stx-native-host-root"))return null;let t=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),o=e.lastIndexOf("<",i.insertPos),a=0,c;while(o>=0&&o<e.length){if(e.startsWith("<!--",o)){let y=e.indexOf("-->",o+4);if(y<0)return null;o=e.indexOf("<",y+3);continue}let l=/^<(\/?)([a-z][\w-]*)\b/i.exec(e.slice(o));if(!l){o=e.indexOf("<",o+1);continue}let u=l[2].toLowerCase(),m=o+l[0].length,v=dt(e,m);if(l[1]){if(a--,c!==void 0&&a<c)c=void 0;if(a<=0)return null}else if(u==="script"||u==="style"){let y=new RegExp(`</${u}\\s*>`,"gi");if(y.lastIndex=v+1,!y.exec(e))return null;o=e.indexOf("<",y.lastIndex);continue}else{let y=he(e.slice(m,v)),h=a>0&&(Object.hasOwn(y,"data-stx-component-wrapper")||Object.hasOwn(y,"data-stx-native-host-owner"));if(c===void 0&&!h&&Object.hasOwn(y,"data-stx-native-host-root"))return{insertPos:m,tagEnd:v};if(!t.has(u)&&e[v-1]!=="/"){if(a++,c===void 0&&h)c=a}else if(a===0)return null}o=e.indexOf("<",v+1)}return null}function Gt(e,i){let t=i;while(t<e.length){let o=e.slice(t),a=o.match(/^\s+/);if(a){t+=a[0].length;continue}if(o.startsWith("<!--")){let u=e.indexOf("-->",t+4);if(u===-1)return null;t=u+3;continue}let c=o.match(/^<(script|style)\b[^>]*>/i);if(c){let u=`</${c[1].toLowerCase()}>`,m=e.toLowerCase().indexOf(u,t+c[0].length);if(m===-1)return null;t=m+u.length;continue}let l=o.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!l)return null;return{insertPos:t+1+l[1].length,tagEnd:dt(e,t+1+l[1].length)}}return null}function dt(e,i){let t="";for(let o=i;o<e.length;o++){let a=e[o];if(t){if(a==="\\")o++;else if(a===t)t=""}else if(a==='"'||a==="'")t=a;else if(a===">")return o}return e.length}function nr(e){let i=new Set;for(let t of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)){let o=t[1];if(!/\bclient\b/.test(o)||/\bserver\b/.test(o))continue;for(let a of pi(t[2]))i.add(a);for(let a of t[2].matchAll(/^\s*import\s+(?:type\s+)?(?:([\w$]+)\s*,?\s*)?(?:\{([^}]*)\}|\*\s+as\s+([\w$]+))?\s*from\s/gm)){if(a[1])i.add(a[1]);if(a[3])i.add(a[3]);for(let c of(a[2]??"").split(",")){let l=c.replace(/^\s*type\s+/,"").split(/\s+as\s+/).pop().trim();if(/^[A-Za-z_$][\w$]*$/.test(l))i.add(l)}}}return i}async function ps(e,i,t,o,a){if(!Xt)Dt(de),Xt=!0;let c=await Lf(e,i,t,o,a);c=await Jn(c,i,t,o,a),c=await Yn(c,i,t,o,a);let l=[];for(let u=0;u<3;u++){let m=l.length,v=fe(c,De,(h,C)=>`\x00STX_COMPONENT_COMMENT_${m+C}\x00`,`STX_COMPONENT_COMMENT:${m}`);l.push(...v.tokens);let y=c;if(c=await Qn(v.output,i,t,o,a),c===y)break}if(l.length>0)c=c.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(u,m)=>l[Number(m)]??"");if(o.debug){let u=Kn(c);if(u.length>0)console.warn(`[stx] ${t}: unresolved component tag(s) after render passes: ${u.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return c}
|
|
42
|
-
export{Bo,Fo,zo,Mh,ds,Lh,dc,Lf,ps};
|
package/dist/chunk-nv0hnx9x.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xe,qs,vg,ty,xg,ny,xn,p,W,Q,Sn,ke,Sg,Si,kg,ry,E,ki,_g,sy,A,oy}from"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{_g as applyFilters,ny as clearCustomFilters,Sg as clientLoopScopes,qs as defaultFilters,Sn as escapeAttributeValue,p as escapeHtml,W as escapeHtmlValue,Q as escapeInterpolatedHtmlValue,A as evaluateExpression,xe as findMustacheEnd,xg as getAllFilters,kg as interpolateScriptAttributes,Si as interpolateScriptExpressions,ry as interpolateScriptsInTemplate,E as processExpressions,ki as processExpressionsChunked,vg as registerFilter,ty as registerFilters,xn as replaceInterpolations,sy as resetRejectedExpressionWarnings,oy as unescapeHtml,ke as usesSignalsInScript};
|
package/dist/chunk-qtfj8z5d.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{F,Wf,Zo,a,O,qh,Kh}from"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{O as config,F as defaultConfig,qh as defineStxConfig,Zo as discoverConfig,a as loadStxConfig,Wf as resolveStxDirectories,Kh as validateConfig};
|
package/dist/chunk-tp67ka3x.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Zg}from"./chunk-qg3hp77v.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Zg as buildApp};
|
package/dist/chunk-vwyxvjnh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{sr,i}from"./chunk-58pc09a1.js";import"./chunk-zjek9py2.js";import"./chunk-ast5jmcg.js";import"./chunk-4dxq7ft1.js";import"./chunk-nrn44374.js";import"./chunk-vytbqwaz.js";import"./chunk-ge54kqfy.js";import"./chunk-qz18x7f0.js";import"./chunk-r7tr5dvd.js";import{ve}from"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-y7rdw6td.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import{Ne,Vs,Us}from"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{sr as buildModulesTag,ve as injectRouterScript,i as processDirectives,Vs as processJsonDirective,Us as processOnceDirective,Ne as validateClientScript};
|
package/dist/chunk-vytbqwaz.js
DELETED
package/dist/chunk-z8qdhn60.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Nh,Mf,Ye,uc,Dh,cs,ls,us}from"./chunk-ast5jmcg.js";import"./chunk-nrn44374.js";import"./chunk-vytbqwaz.js";import"./chunk-qz18x7f0.js";import"./chunk-sw0e1sad.js";import"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Dh as clearOnceStore,uc as onceStore,Ye as partialsCache,cs as processIncludes,ls as processStackPushDirectives,us as processStackReplacements,Nh as resetUnscopedSignalWarnings,Mf as topLevelElements};
|
package/dist/chunk-zfmcbhv2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{la,rm,ua,sm,zl,Hl,om,im}from"./chunk-rs6evw29.js";import"./chunk-gspxyygw.js";import"./chunk-rdmm3zvb.js";import"./chunk-9zjr0ty9.js";import"./chunk-4y6hes3h.js";import"./chunk-r7tr5dvd.js";import"./chunk-f39xf08q.js";import"./chunk-sw0e1sad.js";import"./chunk-pz1y8krt.js";import"./chunk-hp3n1b9r.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-pdzt72p8.js";import"./chunk-kxj5sp5w.js";import{Ot,ng}from"./chunk-y8nx9aa6.js";import"./chunk-cjm92sfd.js";import"./chunk-47n5s7wk.js";import"./chunk-756bf5nt.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{la as buildScriptVirtualFile,rm as buildVirtualSource,Ot as extractScriptBlocks,ng as extractTemplateExpressions,zl as findRuntimeTypeDeclarations,Hl as findStxModuleDeclarations,im as formatTypecheckDiagnostics,sm as sourcePathFor,om as typecheckStxFiles,ua as virtualPathFor};
|