@stacksjs/stx 0.2.433 → 0.2.434
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-f0f7qv7t.js → chunk-11h97cn9.js} +1 -1
- package/dist/{chunk-b8r87s8q.js → chunk-1j2z24r5.js} +1 -1
- package/dist/{chunk-zaz9phx6.js → chunk-1njrhrmw.js} +5 -5
- package/dist/{chunk-eaa5rxst.js → chunk-1yj3p63h.js} +1 -1
- package/dist/{chunk-r7xbp439.js → chunk-4x884b3c.js} +1 -1
- package/dist/{chunk-dkbcfevd.js → chunk-4xqtfka6.js} +1 -1
- package/dist/{chunk-bge8ptbd.js → chunk-5dh5cdmv.js} +1 -1
- package/dist/{chunk-yr7b4x3y.js → chunk-60pc7151.js} +1 -1
- package/dist/{chunk-ec32acc4.js → chunk-7envdam0.js} +1 -1
- package/dist/{chunk-d5xnsqj9.js → chunk-7jw2zhb9.js} +1 -1
- package/dist/{chunk-yqtqqsaa.js → chunk-80q2becc.js} +1 -1
- package/dist/{chunk-720pm5yj.js → chunk-8bew5svs.js} +1 -1
- package/dist/{chunk-cqwbzm5r.js → chunk-8bpf8d7n.js} +1 -1
- package/dist/{chunk-sw8j8rnc.js → chunk-9jr7jbgv.js} +18 -18
- package/dist/{chunk-kvzbmn2x.js → chunk-9xmdj73x.js} +1 -1
- package/dist/{chunk-52pc79vk.js → chunk-9zf2xmj5.js} +1 -1
- package/dist/{chunk-51a50b67.js → chunk-a0v1fxzj.js} +1 -1
- package/dist/{chunk-ynzyzrqs.js → chunk-a5qzw9te.js} +1 -1
- package/dist/{chunk-f4m0n9hr.js → chunk-basztgd4.js} +1 -1
- package/dist/chunk-begfdc6a.js +17 -0
- package/dist/{chunk-3yrg4kfm.js → chunk-bqjty9dx.js} +1 -1
- package/dist/{chunk-2psf6w7b.js → chunk-d2z6tmzw.js} +1 -1
- package/dist/{chunk-61r70km9.js → chunk-d35y8thn.js} +1 -1
- package/dist/{chunk-zf4zdasc.js → chunk-d7stgehg.js} +1 -1
- package/dist/chunk-dpxj1gez.js +2 -0
- package/dist/{chunk-p07v3har.js → chunk-et2kt16p.js} +1 -1
- package/dist/{chunk-adgn0e36.js → chunk-f6cz5n4m.js} +1 -1
- package/dist/{chunk-848mx840.js → chunk-hb3epf4b.js} +1 -1
- package/dist/{chunk-b1qa6444.js → chunk-j4kqw34b.js} +1 -1
- package/dist/{chunk-vswb4bcb.js → chunk-jtysg2ss.js} +1 -1
- package/dist/chunk-m73mswbe.js +2 -0
- package/dist/{chunk-vbb02yfw.js → chunk-mq75bc92.js} +1 -1
- package/dist/{chunk-7g7500r7.js → chunk-nhg3r4ae.js} +2 -2
- package/dist/{chunk-a16fcrd1.js → chunk-nvr0ph6b.js} +1 -1
- package/dist/{chunk-82kf8t4n.js → chunk-qrzhpzdw.js} +1 -1
- package/dist/{chunk-xhnn2yj8.js → chunk-r2ahyhj0.js} +1 -1
- package/dist/chunk-sbs74y50.js +2 -0
- package/dist/{chunk-tdx1srqq.js → chunk-tf11gc47.js} +1 -1
- package/dist/{chunk-xdv4d3vt.js → chunk-tmj5b3r0.js} +1 -1
- package/dist/{chunk-pd0qtjj1.js → chunk-v190nt4m.js} +1 -1
- package/dist/{chunk-q0vpbe85.js → chunk-vn8qdcxp.js} +1 -1
- package/dist/{chunk-gnghq9yc.js → chunk-w6gyrqjp.js} +18 -19
- package/dist/{chunk-rf4xssb2.js → chunk-w926gc13.js} +1 -1
- package/dist/chunk-weegyd19.js +2 -0
- package/dist/{chunk-ssrcvz36.js → chunk-x3vv7hhh.js} +1 -1
- package/dist/{chunk-d347pv7p.js → chunk-x6cyhkk6.js} +1 -1
- package/dist/{chunk-7ynzah39.js → chunk-x819gynv.js} +2 -2
- package/dist/{chunk-b9a5hkm2.js → chunk-xc6x218s.js} +2 -2
- package/dist/{chunk-sce9mzjk.js → chunk-z0t6509y.js} +1 -1
- package/dist/{chunk-jadv7091.js → chunk-zc6k6164.js} +1 -1
- package/dist/{chunk-z5vkrfn5.js → chunk-zgj9fsrd.js} +1 -1
- package/dist/cli.js +8 -8
- package/dist/client-script-bundler.js +27 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/native/compiler/html-to-ir.js +2 -0
- package/dist/native/runtime/native-host.js +1 -0
- package/dist/pwa.js +1 -1
- package/dist/runtime-globals.d.ts +2 -1
- package/dist/runtime-globals.js +1 -1
- package/dist/signals.js +17 -18
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-2q95we1n.js +0 -17
- package/dist/chunk-7wfa6665.js +0 -2
- package/dist/chunk-epf4s6qm.js +0 -2
- package/dist/chunk-wg36jd98.js +0 -2
- package/dist/chunk-zt89wcns.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Vl,Ul}from"./chunk-
|
|
2
|
+
import{Vl,Ul}from"./chunk-tf11gc47.js";import"./chunk-begfdc6a.js";import"./chunk-d2z6tmzw.js";import"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{Ul as clearStoreCache,Vl as getStoreScript};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ou,nc,es,ts,Vi,Ui,ns,rs,Ln,rc,Wi,qi,sc,ze}from"./chunk-
|
|
2
|
+
import{Ou,nc,es,ts,Vi,Ui,ns,rs,Ln,rc,Wi,qi,sc,ze}from"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{Ou as clearScriptScanCache,ns as convertServerLoopAttributesToDirectives,Vi as convertSignalDirectivesToAttributes,rs as convertSignalLoopsToAttributes,rc as extractExports,qi as findMarkupIndexOutsideScripts,ts as hasSignalsSyntax,es as parseLoopExpression,Ui as preEvalLiteralReactiveIfs,Ln as processScriptSetup,Wi as processSignals,sc as rewriteStxImportSpecifiers,nc as scanScriptTags,ze as stripStxRuntimeImports};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{m}from"./chunk-
|
|
2
|
+
import{m}from"./chunk-1yj3p63h.js";import{R,Tt}from"./chunk-axydabse.js";import{y,ze,N,i}from"./chunk-9jr7jbgv.js";import{oe,mt,ht}from"./chunk-begfdc6a.js";import{Ae,Vt,J}from"./chunk-j7zywbq0.js";import _ from"path";var g=new Map,v=new Map,P=["composables","functions"];function E(n){let t=_.basename(n,".ts");return t==="index"||t==="types"||n.endsWith(".d.ts")}async function G(n){if(n)return _.resolve(n);let t=`<default>:${process.cwd()}`,l=v.get(t);if(l!==void 0)return l;let s=await T();if(s!==null)v.set(t,s);return s}async function T(){let n=await i(),t=n.root||process.cwd(),l=n.composablesDir;if(l)return _.resolve(t,l);for(let s of P){let r=_.resolve(t,s);try{let c=new Bun.Glob("**/*.ts");for await(let a of c.scan({cwd:r,absolute:!0}))if(!E(a))return r}catch{}}return null}async function j(n){let t=Array.isArray(n)?n:n?[_.resolve(n)]:(await i())._layerComposableDirs??[await G()].filter((s)=>!!s),l=new Map;for(let s of t){let r=new Bun.Glob("**/*.ts");try{for await(let c of r.scan({cwd:s,absolute:!0})){let a=_.relative(s,c);if(!E(c)&&!l.has(a))l.set(a,c)}}catch{}}return{key:t.join("\x00"),files:[...l.values()].sort()}}async function Ir(n){let{files:t}=await j(n),l=N({loader:"ts",target:"browser",define:y()}),s=[];for(let r of t)try{let c=await Bun.file(r).text(),a=l.scan(c).exports.filter((d)=>d!=="default");if(a.length>0)s.push({file:r,names:a})}catch{}return s}function z(n,t){return new RegExp(`\\b${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(n)}function U(n,t,l){let s=new Map;for(let{file:d,names:f}of n)for(let u of f)if(!s.has(u))s.set(u,d);let r=(d)=>{let f=[];for(let[u,w]of s)if(z(d,u))f.push(w);return f},c=new Set,a=l.flatMap(r);while(a.length>0){let d=[];for(let f of a){if(c.has(f))continue;c.add(f);for(let u of r(t.get(f)??""))if(!c.has(u))d.push(u)}a=d}return c}async function ml(n,t,l){let{key:s,files:r}=await j(n);if(!s)return null;let c=()=>[...new Set([...r,...r.flatMap((e)=>oe(e))])],a=Ae(c());if(r.length===0)return J(g,s,a,""),null;r.sort();let d=N({loader:"ts",target:"browser",define:y()}),f=new Map,u=[];for(let e of r)try{let o=await Bun.file(e).text();f.set(e,o);let h=d.scan(o).exports.filter((p)=>p!=="default");if(h.length>0)u.push({file:e,names:h})}catch{f.set(e,"")}let w=t===void 0?new Set(r):U(u,f,l?[t,...l]:[t]);if(w.size===0)return null;let B=r.filter((e)=>w.has(e)),x=`${s}\x00${B.join("\x00")}`,M=Vt(g,x,a);if(M!==void 0)return M||null;let S=[],b=new Set,D=new Set;for(let e of B)try{let o=f.get(e)??await Bun.file(e).text(),h=_.basename(e,".ts");for(let p of o.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(p[1])D.add(p[1]);try{for(let p of d.scan(o).exports)if(p!=="default")b.add(p)}catch{}if(o=R(o),mt(o))o=await ht(o,e,{projectRoot:process.cwd(),externalizeUserModules:!1}),o=ze(o);o=Tt(o),o=o.replace(/^export\s+(default\s+)?/gm,""),o=d.transformSync(o),S.push(`// Composable: ${h}
|
|
3
3
|
${o.trim()}`)}catch(o){console.warn(`[stx] Failed to load composable ${e}:`,o)}if(S.length===0||b.size===0)return J(g,x,a,""),null;let F=[...b].map((e)=>` try { if (!(${JSON.stringify(e)} in __c)) __c[${JSON.stringify(e)}] = ${e}; } catch (e) {}`).join(`
|
|
4
4
|
`),k=JSON.stringify([...b]),C=S.join(`
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-1yj3p63h.js";import"./chunk-axydabse.js";import{y,I,O,N}from"./chunk-9jr7jbgv.js";import"./chunk-b9wpgn7b.js";import"./chunk-8x47zcfa.js";import"./chunk-pxqs3psa.js";import"./chunk-721yq8qx.js";import"./chunk-my3jkpv7.js";import"./chunk-t7x753ga.js";import"./chunk-ptjqacjd.js";import"./chunk-8bew5svs.js";import"./chunk-114zdbnd.js";import"./chunk-8wkja2z2.js";import f from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var l=new Map,h=I(64),S=new Set,v=0,E=new Set(b);function W(){l.clear(),h.clear()}function R(o){let n=new Map;for(let r of o){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=n.get(t);if(i&&!i.endsWith(".js"))continue;n.set(t,r)}return[...n.values()].sort()}function P(o,n){let r=n.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(o)}function M(o){if(!o)return[];let n=O(o,v),r=h.get(n);if(r)return r.slice();let a=o.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of E){if(S.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),h.set(n,t),t.slice()}async function U(o,n){let r=M(o);if(r.length===0)return null;let a=n??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=N({loader:"ts",target:"browser",define:y()}),k=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=R(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>k.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${u.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let w=r.filter((s)=>!d.has(s)&&!P(o,s));if(w.length>0)console.warn(`[stx] could not bundle ${w.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return l.set(t,""),null;let C=[...d].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
|
|
4
4
|
`),x=`<script data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p,l}from"./chunk-b9wpgn7b.js";import{h}from"./chunk-
|
|
2
|
+
import{p,l}from"./chunk-b9wpgn7b.js";import{h}from"./chunk-9jr7jbgv.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var x=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function b(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=b(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=b(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let c=i.lastIndexOf(u);if(c!==-1)i.splice(c);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let c=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||x.has(u)?-1:N(t,u,s);if(S===-1)o.push({start:n,end:s,slotName:c,element:m}),e=s;else o.push({start:n,end:S,slotName:c,element:m+t.slice(s,S)}),e=S;continue}if(!g&&!x.has(u)){if(i.push(u),u==="script"||u==="style"){let c=t.toLowerCase().indexOf(`</${u}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=b(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let c=i.lastIndexOf(g);if(c!==-1)i.splice(c);e=s;continue}if(g==="template"&&i.length===0){let c=a.match(r);if(c){let m=y(t,s);if(m!==-1){let S=c[1]||c[2]||c[3];o.push({start:n,end:m,slotName:S,content:t.slice(s,m-11).trim(),propsBinding:c[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!x.has(g)){if(i.push(g),g==="script"||g==="style"){let c=t.toLowerCase().indexOf(`</${g}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function Go(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function cl(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Jo(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((c)=>c.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return h(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return l(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Yo(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",c=f||"",m={},S=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,w;while((w=S.exec(c))!==null){let E=w[1],R=w[2];m[E]=k(R,i)}return await Jo(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function ll(t){let o=Go(t);return{defaultSlot:o.default,namedSlots:o.named}}async function ul(t,o,i,r){return await Yo(t,{default:o,named:i},r)}
|
|
3
3
|
export{Go,cl,Jo,Yo,ll,ul};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{y,Me,I,Yt,i,T}from"./chunk-9jr7jbgv.js";import{Vr}from"./chunk-d2z6tmzw.js";import{s,be}from"./chunk-3pxp0r0a.js";import{a}from"./chunk-wtms9jhs.js";import m from"path";import j from"fs";function pe(e){if(!e||typeof e!=="object")return!1;let t=e;return typeof t.message==="string"&&(t.name==="BuildMessage"||t.name==="ResolveMessage"||("position"in t))}function fe(e){if(e&&typeof e==="object"&&Array.isArray(e.errors))return e.errors;return[e]}function J(e,t){let r=[];for(let l of fe(e)){if(pe(l)){let u=l.position||void 0;r.push({file:t||u?.file,line:u?.line,column:u?.column,message:l.message??"",lineText:u?.lineText});continue}r.push({file:t,message:l instanceof Error?l.message:String(l)})}return r}function De(e,t){return J(e,t).map((r)=>{let l=r.file?`${r.file}${r.line?`:${r.line}${r.column?`:${r.column}`:""}`:""}`:"",u=r.lineText?`
|
|
3
|
+
${r.lineText.trim()}`:"";return l?`${l}: ${r.message}${u}`:`${r.message}${u}`}).join(`
|
|
4
|
+
`)}var me=10;function P(e,t,r){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(m.basename(e))||Vr(e,t,r)}var re=1,se=new Map,W=600,ge=100,G=new Map;async function he(e){let t=G.get(e)??0;if(t>0&&t<ge){G.set(e,t+1);return}G.set(e,1);try{let r=(await j.promises.readdir(e)).filter((p)=>p.endsWith(".js"));if(r.length<=W)return;let u=(await Promise.all(r.map(async(p)=>{try{return{name:p,at:(await j.promises.stat(m.join(e,p))).mtimeMs}}catch{return null}}))).filter((p)=>p!==null);u.sort((p,d)=>d.at-p.at);for(let p of u.slice(W)){let d=p.name.slice(0,-3);await j.promises.rm(m.join(e,`${d}.js`),{force:!0}),await j.promises.rm(m.join(e,`${d}.deps.json`),{force:!0})}A("pruned bundle cache to",W,"entries")}catch{}}function oe(e){return se.get(e)??[]}function q(e,t){if(e)se.set(e,t)}function Oa(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function A(...e){if(Oa())console.log("[stx:bundler]",...e)}var Y=[];function Ii(e,t,r){Y.push({filePath:e||"<inline>",message:t,details:r})}function ft(){return Y.slice()}function gt(){Y.length=0}var H;function gu(e){H=e}function Di(){if(H)return H;try{let e=T.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Z=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function mt(e){let t=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,r;while((r=t.exec(e))!==null){let u=r[1];if(!Z.some((d)=>d.test(u)))return A("detected user import:",u),!0}let l=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((r=l.exec(e))!==null){let u=r[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!Z.some((d)=>d.test(u)))return A("detected side-effect import:",u),!0}return!1}var Jt="stx-module:",xe=/\.(?:[cm]?[jt]sx?|json)$/i;function Ma(e,t){return m.relative(e,t).split(m.sep).join("/")}function Na(e,t){if(t.size===0)return e;return e.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,(r,l,u,p)=>{let d=t.get(p);return d&&!p.startsWith(Jt)?`${l}${u}${d}${u}`:r})}function La(e,t){let r=0,l=(p)=>{let d=`__stxMod${r++}`,b=JSON.stringify(p);return t.push(`var ${d} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${d} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),d},u=(p,d)=>{for(let b of p.split(",")){let M=b.trim();if(!M)continue;let c=M.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!c)continue;let n=c[1].startsWith('"')?JSON.parse(c[1]):c[1],o=c[2]??n;t.push(`var ${o} = ${d}[${JSON.stringify(n)}];`)}};return e=e.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d,b)=>{let M=b.slice(Jt.length),c=l(M),n=d.trim(),o=n.match(/^([\w$]+)\s*(?:,\s*|$)/);if(o&&!n.startsWith("{")&&!n.startsWith("*"))t.push(`var ${o[1]} = ${c}.default;`),n=n.slice(o[0].length).trim();let f=n.match(/^\*\s*as\s+([\w$]+)$/);if(f)t.push(`var ${f[1]} = ${c};`);else if(n.startsWith("{"))u(n.replace(/^\{|\}$/g,""),c);return""}),e=e.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d)=>(l(d.slice(Jt.length)),"")),e}function te(e){let t=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,m.join(e,"index.ts"),m.join(e,"index.tsx"),m.join(e,"index.js"),m.join(e,"index.mjs")];for(let r of t)try{if(j.existsSync(r)&&j.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return}function $e(e,t,r,l,u,p=new Map,d){let b=(c,n,o)=>{if(P(n,e,d))return null;if(!u||c!==r||!xe.test(n))return null;try{if(!j.statSync(n,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(n);let f=`${Jt}${Ma(process.cwd(),n)}`;return p.set(o,f),{path:f,external:!0}},M=(c,n)=>{let o=c===r?t:m.dirname(c),f=m.resolve(o,n);return te(f)??f};return{name:"stx-client-bundle",setup(c){if(c.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^\//},(n)=>{let o=te(n.path);if(o){let f=b(n.importer,o,n.path);if(f)return f;if(o!==r)l.add(o);return{path:o}}return{path:n.path,external:!0}}),c.onResolve({filter:/^\.\.?\//},(n)=>{let o=M(n.importer,n.path),f=b(n.importer,o,n.path);if(f)return f;return l.add(o),{path:o}}),c.onResolve({filter:/^[@~]\//},(n)=>{let o=m.resolve(e,n.path.slice(2)),f=[o,`${o}.ts`,`${o}.tsx`,`${o}.js`,`${o}.mjs`,`${o}.jsx`,m.join(o,"index.ts"),m.join(o,"index.tsx"),m.join(o,"index.js"),m.join(o,"index.mjs")];for(let E of f)if(j.existsSync(E)&&j.statSync(E,{throwIfNoEntry:!1})?.isFile()){let N=b(n.importer,E,n.path);if(N)return N;return A(`resolved ${n.path[0]}/ import:`,n.path,"\u2192",E),l.add(E),{path:E}}return console.warn(`[stx:bundler] could not resolve ${n.path[0]}/ import:`,n.path),{path:o}}),u)c.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(n)=>{if(n.importer!==r)return;let o=`${Jt}npm:${n.path}`;return p.set(n.path,o),{path:o,external:!0}});c.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(n)=>{if(P(n.path,e,d))throw Error(`Server-only API source cannot be imported by a client script: ${n.path}`);let o=m.extname(n.path).toLowerCase(),f=o===".json"?"json":o===".tsx"?"tsx":o===".jsx"?"jsx":o===".ts"||o===".mts"||o===".cts"?"ts":"js";if(n.path!==r)l.add(n.path);return{contents:j.readFileSync(n.path,"utf8"),loader:f}})}}}var X=new Map,U=I(64),ne=Symbol.for("stx.client-bundle-build-queue");function ja(e){let t=globalThis,l=(t[ne]??Promise.resolve()).then(e,e);return t[ne]=l.then(()=>{return},()=>{return}),l}async function ht(e,t,r={}){let l=r.projectRoot||process.cwd(),u=(await i(l)).serverApi,p=r.minify??!1,d=r.externalizeUserModules??!0,b=r.cacheDir||a(l,"bundle-cache"),M=new Bun.CryptoHasher("md5");M.update(`${me}\x00${Me()}\x00${JSON.stringify(u??!1)}\x00${d?"registry":"inline"}\x00${e}\x00${t}`);let c=M.digest("hex").slice(0,12),n=m.join(b,`${c}.js`),o=U.get(n);if(o){if(Yt(o.files)&&o.files.every((F)=>!P(F.path,l,u))){A("memo hit:",c);let F=o.files.map((_)=>_.path);return q(t,F),r.collectInputs?.push(...F),o.code}U.delete(n),A("memo invalidated by dep change:",c)}let f=m.join(b,`${c}.deps.json`),E=Bun.file(n);if(await E.exists()){let F=Bun.file(f),_=!1,v=null;if(await F.exists())try{let D=JSON.parse(await F.text());if(D.metadataVersion!==re||!Array.isArray(D.files))_=!1;else v=D.files,_=!0;if(v&&(!Yt(v)||v.some((k)=>P(k.path,l,u))))_=!1}catch{_=!1}if(_){if(A("cache hit:",c),v)q(t,v.map((k)=>k.path)),r.collectInputs?.push(...v.map((k)=>k.path));let D=await E.text();if(v)U.set(n,{code:D,files:v});return D}A("cache invalidated by dep change:",c)}let N=X.get(c);if(N){let F=await N;if(r.collectInputs)r.collectInputs.push(...(U.get(n)?.files??[]).map((_)=>_.path));return F}let S=ja(()=>ye(e,t,{projectRoot:l,minify:p,cacheDir:b,hash:c,cachePath:n,depsPath:f,collectInputs:r.collectInputs,externalizeUserModules:d,serverApi:u}));X.set(c,S);try{return await S}finally{X.delete(c)}}var we=0;function Ba(e){return`${e}-${process.pid}-${++we}`}async function ye(e,t,r){let{projectRoot:l,minify:u,cacheDir:p,hash:d,cachePath:b,depsPath:M,externalizeUserModules:c}=r,n=a(l,"bundle-tmp"),o=Ba(d),f=m.join(n,`${o}.ts`),E=m.join(n,"out",o);j.mkdirSync(n,{recursive:!0}),j.mkdirSync(E,{recursive:!0});let N=m.dirname(t),S=new Set,F=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,_=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,v=s(e),{depths:D,balanced:k}=be(v),V=(w)=>!k||D[w]===0,h;while((h=F.exec(v))!==null){if(h[1])continue;if(!V(h.index))continue;if(h[2])h[2].split(",").forEach((w)=>{let g=Be(w);if(g)S.add(g)});else if(h[3])S.add(h[3])}while((h=_.exec(v))!==null){if(h[1])continue;if(!V(h.index))continue;S.add(h[2])}let ie=/^[ \t]*import\s+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((h=ie.exec(v))!==null){if(!V(h.index))continue;let w=/^\s*['"]([^'"]+)['"]/.exec(e.slice(h.index+h[0].length))?.[1];if(w&&Z.some((g)=>g.test(w)))continue;if(h[1])S.add(h[1]);if(h[2])S.add(h[2]);for(let g of(h[3]??"").split(",")){let B=g.trim();if(!B||/^type\s/.test(B))continue;let L=/\bas\s+(\w+)\s*$/.exec(B)?.[1]??/^\w+$/.exec(B)?.[0];if(L)S.add(L)}}for(let w of v.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let g of w[1].split(",")){let B=/\bas\s+(\w+)\s*$/.exec(g)?.[1]??/^\s*(\w+)\s*$/.exec(g)?.[1];if(B)S.delete(B)}let le=S.size>0?`
|
|
5
|
+
export { ${[...S].join(", ")} }`:"";await Bun.write(f,e+le),A("bundling:",d,"from:",m.basename(t));let Q=new Set,K=new Map;try{let w=await Bun.build({entrypoints:[f],outdir:E,target:"browser",format:"esm",minify:u,plugins:[$e(l,N,f,Q,c,K,r.serverApi)],define:{"process.env.NODE_ENV":u?'"production"':'"development"',...y()},root:l});if(!w.success){let R=w.logs.filter((C)=>C.level==="error").map((C)=>C.message).join(", ")||`Unable to bundle ${m.basename(t)}`,O=J(w.logs,t||void 0);if(console.warn("[stx:bundler] build failed:",R),Ii(t||"",R,O),Di()==="error")throw Error(R);return e}let g="";for(let x of w.outputs){g=await x.text();break}let B=[];for(let x of g.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let R of x[1].split(",")){let O=R.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(O){B.push([O[2],O[1]]);continue}let C=R.trim();if(/^[A-Za-z_$][\w$]*$/.test(C))B.push([C,C])}let L=[];g=La(Na(g,K),L);let ae=g.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];g=g.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let ee=`__stxBundle_${d}`,ce=B.map(([x,R])=>`${JSON.stringify(x)}: ${R}`).join(", "),ue=B.map(([x])=>`var ${x} = undefined;`).join(`
|
|
6
|
+
`),de=B.map(([x])=>`${x} = ${ee}[${JSON.stringify(x)}];`).join(`
|
|
7
|
+
`);if(g=`${ae.join(`
|
|
8
|
+
`)}
|
|
9
|
+
${ue}
|
|
10
|
+
var ${ee} = (function() {
|
|
11
|
+
${L.join(`
|
|
12
|
+
`)}
|
|
13
|
+
${g}
|
|
14
|
+
return { ${ce} };
|
|
15
|
+
})();
|
|
16
|
+
${de}`.trim(),A("bundled:",d,"output:",g.length,"bytes"),S.size>0&&B.length===0)return console.warn(`[stx:bundler] dropped every binding for ${m.basename(t)} (${d}); serving the unbundled source and not caching this result`),e;j.mkdirSync(p,{recursive:!0}),await Bun.write(b,g);let z=Array.from(Q).map((x)=>{try{return{path:x,mtimeMs:j.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(M,JSON.stringify({metadataVersion:re,files:z})),q(t,z.map((x)=>x.path)),r.collectInputs?.push(...z.map((x)=>x.path)),U.set(b,{code:g,files:z}),await he(p),g}catch(w){let g=J(w,t||void 0),B=De(w,t||void 0);if(console.warn(`[stx:bundler] error: ${B}`),Ii(t||"",B,g),Di()==="error")throw w;return e}finally{try{j.rmSync(f,{force:!0}),j.rmSync(E,{recursive:!0,force:!0})}catch{}}}function Be(e){let t=e.trim();if(!t)return null;let r=t.indexOf("=");if(r!==-1)t=t.slice(0,r).trim();let l=t.indexOf(":");if(l!==-1)t=t.slice(l+1).trim();if(t.startsWith("..."))t=t.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(t)?t:null}
|
|
17
|
+
export{De,oe,Oa,Ii,ft,gt,gu,Di,mt,Jt,Ma,Na,La,ja,ht,Ba};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{V,ae}from"./chunk-
|
|
2
|
+
import{V,ae}from"./chunk-9jr7jbgv.js";import{le,S,Ke}from"./chunk-ptjqacjd.js";import{Ze,X,xe}from"./chunk-pxqs3psa.js";import{_e,ne,C,re,oi,vr,ai,Pt}from"./chunk-x819gynv.js";import{Hr}from"./chunk-d2z6tmzw.js";import{It}from"./chunk-8zf5q1m3.js";import H from"zlib";import{promisify as Y}from"util";var Q=Y(H.brotliCompress),Z=Y(H.gzip),K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((i)=>e.startsWith(i)))return!1;return K.some((i)=>e.startsWith(i))}function oe(t){let e=new Map;for(let i of t.split(",")){let[s,...c]=i.trim().split(";"),l=s.trim().toLowerCase();if(!l)continue;let m=1;for(let f of c){let x=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(f);if(!x)continue;let g=Number.parseFloat(x[1]);if(Number.isFinite(g))m=g}e.set(l,m)}return e}function ie(t){if(!t)return null;let e=oe(t),i=e.get("*"),s=(c)=>e.get(c)??i??0;if(s("br")>0)return"br";if(s("gzip")>0)return"gzip";return null}async function At(t,e,i={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let s=ie(t.headers.get("accept-encoding"));if(!s)return e;let c;try{c=new Uint8Array(await e.arrayBuffer())}catch{return e}let l=()=>new Response(c,{status:e.status,statusText:e.statusText,headers:q(e.headers)});if(c.length<(i.threshold??te))return l();try{let m=s==="br"?await Q(c,{params:{[H.constants.BROTLI_PARAM_QUALITY]:i.quality??5,[H.constants.BROTLI_PARAM_SIZE_HINT]:c.length}}):await Z(c);if(m.length>=c.length)return l();let f=q(e.headers);return f.set("Content-Encoding",s),f.set("Content-Length",String(m.length)),new Response(m,{status:e.status,statusText:e.statusText,headers:f})}catch{return l()}}function q(t){let e=new Headers(t),i=e.get("Vary");if(!i)return e.set("Vary","Accept-Encoding"),e;if(!i.split(",").some((c)=>c.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${i}, Accept-Encoding`);return e}import J from"fs";import M from"path";var{serve:ce}=globalThis.Bun;class G{now;entries=new V(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,i){let s,c=async()=>{let r=s??await i();return r.headers.set("Cache-Control","private, no-store"),r.headers.set("Vary",C(r.headers.get("Vary")).Vary),r};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return c();let l=new URL(t.url),m=`${l.origin}${l.pathname}${l.search}|${ne(t)?"fragment":"document"}`,f=this.entries.get(m),x=(r)=>{let T=new Headers(r.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-r.created)/1000)))),new Response(r.body.slice(0),{headers:T})},g=f?(this.now()-f.created)/1000:1/0;if(f&&g<e.maxAge)return x(f);let b=this.generation,O=async()=>{let r=await i();s=r;let T=(r.headers.get("Vary")??"").toLowerCase().split(",").map((R)=>R.trim()).filter(Boolean);if(r.status!==200||r.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(r.headers.get("Cache-Control")??"")||T.some((R)=>R!=="x-stx-router"&&R!=="accept-encoding"))return null;let L=await r.clone().arrayBuffer();if(L.byteLength>1048576)return null;r.headers.set("Vary",C(r.headers.get("Vary")).Vary);let n={body:L,headers:Array.from(r.headers.entries()),created:this.now(),path:l.pathname};if(this.generation===b)this.entries.set(m,n);return n},v=this.pending.get(m);if(!v){if(this.pending.size>=1000)return c();v=O().finally(()=>{if(this.pending.get(m)===v)this.pending.delete(m)}),this.pending.set(m,v)}if(f&&g<e.maxAge+(e.swr??0))return v.catch(()=>{}),x(f);let E=await v;return E?x(E):c()}}var pe={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function ol(t={}){let e=M.resolve(t.outputDir||".output"),i=t.port??3000,s=oi(e);if(!s)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${s.routes.length} routes...`);let c=It(s.routeRules),l=new G,m=Hr(e,s.apiRoutes??[]),f=Bun.file(M.join(e,"server/runtime-config.json")),x=t.runtimeConfig??(await f.exists()?await f.json():void 0),g=x?S(x):void 0,b=new Map,O=new Map,v=new Map,E=new Map;for(let n of s.routes)try{let R=M.join(e,n.compiledPath),o=JSON.parse(await Bun.file(R).text());if(g)o.html=Ke(o.html,g);b.set(n.pattern,o),v.set(n.pattern,xe(o.html)),E.set(n.pattern,ae(o.html));let _=M.join(e,n.fragmentPath);if(await Bun.file(_).exists()){let A=await Bun.file(_).text();O.set(n.pattern,g?Ke(A,g):A)}}catch(R){console.warn(`[stx] Failed to load route ${n.pattern}:`,R)}let r=new Map,T=[];for(let n of s.routes)if(n.hasParams){let{regex:R,params:o}=X(n.pattern,{page:!0});T.push({regex:R,route:n,paramNames:o})}else r.set(n.pattern,n);let L=ce({port:i,async fetch(n){return At(n,await le(g??S(),async()=>{let o=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[o])return t.apiRoutes[o](n);let _=await m(n);if(_)return _;if((n.method==="GET"||n.method==="HEAD")&&o!=="/"){let p=M.resolve(e,"public"),d;try{d=decodeURIComponent(o)}catch{d=o}if(!d.includes("\x00")){let u=M.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${M.sep}`))try{if(J.existsSync(u)&&J.statSync(u).isFile()){let h=M.extname(u).toLowerCase(),j=pe[h]||"application/octet-stream",B=o.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(o);return new Response(Bun.file(u),{headers:{"Content-Type":j,"Cache-Control":B?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=ne(n),y=null,U={};if(y=r.get(o)||null,!y)for(let{regex:p,route:d,paramNames:u}of T){let a=o.match(p);if(a){y=d,u.forEach((h,j)=>{U[h]=a[j+1]});break}}if(!y){let p=Ze(o)?null:r.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let k=c(o),W=Object.keys(k).length>0;return l.respond(n,k.cache,async()=>{let p=b.get(y.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let a=O.get(y.pattern);if(a){let h=v.get(y.pattern);return new Response(a,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(y.pattern)?{"X-STX-Runtime":E.get(y.pattern)?"true":"false"}:{},...h?{"X-STX-Layout":h.layout,"X-STX-Layout-Group":h.group}:{},...C(),...k.cache?{}:{"Cache-Control":_e}}})}}let d=vr(n.method),u=b.get(y.pattern);if(!u){let a=r.get("/500")||null;if(a){let h=b.get(a.pattern);if(h)return new Response(h.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(y.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...C(),"Cache-Control":"public, max-age=60"}});try{let{html:a,boundaries:h,redirect:j,cookies:B,status:I,headers:z}=await Pt(u,{params:U,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:g});if(j)return ai(j,B,z);if(h&&h.length>0){let{renderStreamingPage:P,streamToResponse:D}=await import("./chunk-80q2becc.js"),N=new Headers({...C(),...z,"Cache-Control":"private, no-store"});for(let F of B??[])N.append("Set-Cookie",F);if(A&&!d){let F=xe(a);N.set("X-STX-Fragment","true"),N.set("X-STX-Runtime",ae(a)?"true":"false"),N.set("X-STX-Layout",F.layout),N.set("X-STX-Layout-Group",F.group)}return D(P(A&&!d?re(a,s.routerContainer||"main"):a,h,{timeoutMs:30000}),{status:I??u.status??200,headers:N})}let w=new Headers({"Content-Type":"text/html",...C(),...k.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of B??[])w.append("Set-Cookie",P);for(let[P,D]of Object.entries(z??{}))w.set(P,D);if(w.set("Vary",C(w.get("Vary")).Vary),A&&!d){let P=xe(a);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",ae(a)?"true":"false"),w.set("X-STX-Layout",P.layout),w.set("X-STX-Layout-Group",P.group),new Response(re(a,s.routerContainer||"main"),{status:I??u.status??200,headers:w})}return new Response(a,{status:I??u.status??200,headers:w})}catch(a){if(console.error(`[stx] Hydration error for ${o}:`,a),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${L.port}`),console.log(`[stx] Serving ${s.routes.length} routes (${b.size} pre-loaded)`),{port:L.port,stop:()=>{l.invalidate(),L.stop()},invalidate:(n)=>l.invalidate(n)}}
|
|
3
3
|
export{At,ol};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{X}from"./chunk-pxqs3psa.js";import{le,S}from"./chunk-ptjqacjd.js";import{go}from"./chunk-t7x753ga.js";import{a}from"./chunk-wtms9jhs.js";import v from"fs";import m from"path";import{pathToFileURL as O}from"url";var E=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],P=new Set;function yt(s,l={}){let o=m.resolve(s,l.dir??"server/api"),i=[],f=new Map;if(!v.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let u=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=u.pop(),c=n.lastIndexOf("."),d=c>=0?n.slice(c+1):"get",g=d.toUpperCase();if(!E.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${E.map((A)=>A.toLowerCase()).join(", ")}`);if(c>=0)n=n.slice(0,c);if(n!=="index")u.push(n);let r=new Set,h=u.map((A,I)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&I!==u.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,x=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(x))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(x)} and ${e}`);f.set(x,e);let R=m.join(o,e);P.add(m.resolve(R)),P.add(v.realpathSync(R)),i.push({pattern:w,method:g,filePath:R})}return i.sort((e,p)=>{let u=e.pattern.split("/"),n=p.pattern.split("/"),c=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(u.length,n.length);d++){let g=c(n[d])-c(u[d]);if(g)return g}return e.pattern.localeCompare(p.pattern)||e.method.localeCompare(p.method)})}async function Fr(s,l){let o=a(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of l){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:p}=X(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${p.map((u)=>`${JSON.stringify(u)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
|
|
3
3
|
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function zr(s,l,o={}){let i=yt(s,o);await Fr(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
|
|
4
|
-
`)}`);let p=e.outputs.find((c)=>c.kind==="entry-point");if(!p)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await p.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),p),f.push({...t,filePath:n})}return f}function j(s,l){let o=s.map((i)=>({route:i,...X(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,p=(r)=>r.replace(/:\w+/g,":param"),u=t.filter((r)=>p(r.route.pattern)===p(e)),n=i.method,c=u.find((r)=>r.route.method===n)??(n==="HEAD"?u.find((r)=>r.route.method==="GET"):void 0);if(!c){let r=new Set(u.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=c.regex.exec(f),g=Object.create(null);try{c.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(c.route);if(typeof r!=="function")throw Error(`API endpoint ${c.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function Hr(s,l){return j(l,async(o)=>(await import(O(m.resolve(s,o.filePath)).href)).default)}async function mu(s,l){if(!l)return async()=>null;let o=l===!0?{}:l,i=yt(s,o);return await Fr(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=yt(s,o);await Fr(s,t);let{loadStxConfig:e}=await import("./chunk-
|
|
4
|
+
`)}`);let p=e.outputs.find((c)=>c.kind==="entry-point");if(!p)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await p.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),p),f.push({...t,filePath:n})}return f}function j(s,l){let o=s.map((i)=>({route:i,...X(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,p=(r)=>r.replace(/:\w+/g,":param"),u=t.filter((r)=>p(r.route.pattern)===p(e)),n=i.method,c=u.find((r)=>r.route.method===n)??(n==="HEAD"?u.find((r)=>r.route.method==="GET"):void 0);if(!c){let r=new Set(u.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=c.regex.exec(f),g=Object.create(null);try{c.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(c.route);if(typeof r!=="function")throw Error(`API endpoint ${c.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function Hr(s,l){return j(l,async(o)=>(await import(O(m.resolve(s,o.filePath)).href)).default)}async function mu(s,l){if(!l)return async()=>null;let o=l===!0?{}:l,i=yt(s,o);return await Fr(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=yt(s,o);await Fr(s,t);let{loadStxConfig:e}=await import("./chunk-7jw2zhb9.js"),p=S((await e(s)).runtimeConfig);return await le(p,()=>j(t,async(u)=>{let n=await Bun.build({entrypoints:[u.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
|
|
5
5
|
`));let c=n.outputs.find((d)=>d.kind==="entry-point");if(!c||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${u.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await c.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function Vr(s,l,o){if(go(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(v.realpathSync(s))))return!0}catch{}if(P.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(l,typeof o==="object"?o.dir??"server/api":"server/api"),t=(p)=>{try{return v.realpathSync(p)}catch{return m.resolve(p)}},e=t(s);return[f,m.resolve(l,"server"),m.resolve(l,".output/server")].some((p)=>{let u=t(p);return e===u||e.startsWith(`${u}${m.sep}`)})}
|
|
6
6
|
export{yt,Fr,zr,Hr,mu,Vr};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Me,Ka,Su,ku,Cu,$u,Xa,Ga,Eu,Tu,Bi,_u,Zt,Qt,On}from"./chunk-
|
|
2
|
+
import{Me,Ka,Su,ku,Cu,$u,Xa,Ga,Eu,Tu,Bi,_u,Zt,Qt,On}from"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{$u as __setSignalsGeneratorsForTest,Me as cacheEngineFingerprint,Qt as cacheTemplate,Zt as checkCache,_u as clearDevCaches,Ga as getCachedRouterScript,Xa as getCachedSignalsRuntime,Eu as getServeClientAsset,Bi as getServeModuleBundle,On as hashFilePath,ku as invalidateFileCache,Cu as invalidateFileCacheByDir,Su as readFileCached,Tu as registerServeModuleBundle,Ka as templateCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{In,za,yu,Ha,bu,Va,Dn,h,wt,he,Ua,Gr,Wa,wu,W,qa,vu,b,xu}from"./chunk-
|
|
2
|
+
import{In,za,yu,Ha,bu,Va,Dn,h,wt,he,Ua,Gr,Wa,wu,W,qa,vu,b,xu}from"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{qa as applyFilters,bu as clearCustomFilters,Ua as clientLoopScopes,In as defaultFilters,h as escapeHtml,wt as escapeHtmlValue,b as evaluateExpression,Va as findMustacheEnd,Ha as getAllFilters,Wa as interpolateScriptAttributes,Gr as interpolateScriptExpressions,wu as interpolateScriptsInTemplate,W as processExpressions,za as registerFilter,yu as registerFilters,Dn as replaceInterpolations,vu as resetRejectedExpressionWarnings,xu as unescapeHtml,he as usesSignalsInScript};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Io,Do}from"./chunk-1njrhrmw.js";import"./chunk-thx147nq.js";import"./chunk-9w5nse46.js";import"./chunk-1j2z24r5.js";import"./chunk-5vwg3h5g.js";import"./chunk-qrzhpzdw.js";import"./chunk-r2ahyhj0.js";import"./chunk-spx27cs4.js";import"./chunk-b8dbq51z.js";import"./chunk-5dh5cdmv.js";import"./chunk-bqjty9dx.js";import{ei}from"./chunk-x819gynv.js";import"./chunk-3rbz496d.js";import"./chunk-24e7qjb8.js";import"./chunk-basztgd4.js";import"./chunk-hc9242wm.js";import"./chunk-dtvwes4f.js";import"./chunk-p4wvc7wx.js";import"./chunk-4wf68rht.js";import"./chunk-nvht5259.js";import"./chunk-s28eh0jn.js";import"./chunk-a0v1fxzj.js";import"./chunk-j1q65enz.js";import"./chunk-4xemkkm8.js";import"./chunk-bjnvymb7.js";import"./chunk-w2085fwx.js";import"./chunk-zfzcedw4.js";import"./chunk-3hmy75tw.js";import"./chunk-tf11gc47.js";import"./chunk-w6gyrqjp.js";import"./chunk-nvr0ph6b.js";import"./chunk-xc6x218s.js";import"./chunk-ccq35xp7.js";import"./chunk-begfdc6a.js";import"./chunk-d2z6tmzw.js";import{me,Zt,Qt,q,d,n,Wn,A,i,ce}from"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{Wn as buildWebComponents,Qt as cacheTemplate,Zt as checkCache,ei as classifyAllScripts,Io as createMiddleware,Do as createRoute,A as defaultConfig,d as extractVariables,q as injectRouterScript,i as loadStxConfig,me as processClientScript,n as processDirectives,ce as readMarkdownFile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{q,us,ds,ps,n}from"./chunk-
|
|
2
|
+
import{q,us,ds,ps,n}from"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{q as injectRouterScript,n as processDirectives,us as processJsonDirective,ds as processOnceDirective,ps as validateClientScript};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{d,ss,Ki,Xi,gc,mc,hc,yc,bc,wc,Ve,N,Ue,vc,Vn,xc,io,Sc,We,r,Un,oo,g,ee,Lu}from"./chunk-
|
|
2
|
+
import{d,ss,Ki,Xi,gc,mc,hc,yc,bc,wc,Ve,N,Ue,vc,Vn,xc,io,Sc,We,r,Un,oo,g,ee,Lu}from"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{ee as clearComponentCache,Sc as componentClientSignalNames,ss as convertToCommonJS,g as createDetailedErrorMessage,bc as extractDirectiveNames,Ki as extractScriptFromTemplate,d as extractVariables,r as fileExists,Lu as getComponentCacheStats,mc as getPositionInfo,N as getSharedTranspiler,oo as getSourceLineInfo,yc as hasDirectives,Xi as hasVariables,xc as isHydrateTrigger,wc as isJavaScriptScript,We as renderComponentWithSlot,Un as resolveTemplatePath,vc as scopeOnRootElement,Ve as shouldTranspileTypeScript,io as slotContentHasExpressions,Ue as transpileTypeScript,Vn as userComponentFileExists,hc as validateDirective,gc as validateTemplate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rr,Ps,To}from"./chunk-eaa5rxst.js";import"./chunk-axydabse.js";import{Ln,n}from"./chunk-sw8j8rnc.js";import"./chunk-b9wpgn7b.js";import"./chunk-ptjqacjd.js";import"./chunk-720pm5yj.js";import"./chunk-721yq8qx.js";import"./chunk-8x47zcfa.js";import"./chunk-pxqs3psa.js";import"./chunk-my3jkpv7.js";import"./chunk-t7x753ga.js";import"./chunk-114zdbnd.js";import{Pe}from"./chunk-gnghq9yc.js";import"./chunk-8wkja2z2.js";import{existsSync as j,mkdirSync as ot,readFileSync as st}from"fs";import T from"path";import{existsSync as tt,mkdirSync as nt}from"fs";import y from"path";import{existsSync as Ze}from"fs";import C from"path";var de="data-stx-b",F=new Set(Ps),pe=new Set(rr);function ge(t){if(t==="ref"||t==="data-stx-ref")return"ref";if(t.startsWith("::"))return null;if(t.startsWith("@bind:")||t.startsWith("x-bind:"))return"attr";if(t.startsWith("@")||t.startsWith(":")){let e=t.slice(1).split(".")[0];if(F.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(To(e))return"event";if(t.startsWith("@"))return"event";return"attr"}if(t.startsWith("x-")){let e=t.split(".")[0];if(!pe.has(e))return"attr";let r=e.slice(2);if(r==="cloak"||r==="data"||r==="bind")return null;if(r==="tooltip"||r==="tooltip-position")return null;return F.has(r)?r==="if"?"if":r:"attr"}return null}function me(t){let e=[];for(let[r,i]of t){let o=ge(r);if(o)e.push({name:r,value:i,kind:o})}return e}var he=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,D=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function M(t){let e=[],r=0;return{html:t.replace(he,(o,s,c)=>{if(!c||!/[:@]|x-/.test(c))return o;let f=[];D.lastIndex=0;for(let l=D.exec(c);l;l=D.exec(c))f.push([l[1],l[2]??l[3]??l[4]??""]);let d=me(f);if(!d.length)return o;let p={id:r++,bindings:d};if(d.some((l)=>l.kind==="for"))p.template=!0;e.push(p);let a=o.endsWith("/>");return`${o.slice(0,a?-2:-1).trimEnd()} ${de}="${p.id}"${a?"/>":">"}`}),manifest:{entries:e}}}var be=["accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumTrackTintColor","minimumValue","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize"],Se=new Map(be.map((t)=>[H(t),t]));function H(t){return t.replace(/[-_]/g,"").toLowerCase()}function L(t){return Se.get(H(t))??t}var xe={view:"View",text:"Text",button:"Button",image:"Image",img:"Image",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function G(t){return xe[t.toLowerCase()]||t}var we={transparent:"transparent",current:"currentColor",black:"#000000",white:"#ffffff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},J={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},U={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},w={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function W(t){let e=t.lastIndexOf("/");if(e>0&&!t.endsWith("]")){let i=W(t.slice(0,e)),o=t.slice(e+1),s=/^\[(.+)\]$/.test(o)?Number.parseFloat(o.slice(1,-1))*(o.includes("%")?1:100):Number.parseFloat(o);if(!i||!Number.isFinite(s))return;return Te(i,s/100)}if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="black")return"#000000";if(t==="white")return"#ffffff";let r=t.split("-");if(r.length===2){let[i,o]=r,s=we[i];if(s&&typeof s==="object")return s[o]}if(t.startsWith("[")&&t.endsWith("]")){let i=t.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function Te(t,e){if(t==="transparent")return t;let r=t.startsWith("#")?t.slice(1):"";if(r.length===3)r=r.split("").map((o)=>o+o).join("");if(r.length===8)r=r.slice(0,6);if(r.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${r}${i.toString(16).padStart(2,"0")}`}function O(t,e=16){if(!t.startsWith("[")||!t.endsWith("]"))return;let r=t.slice(1,-1),i=Number.parseFloat(r);if(!Number.isFinite(i))return;if(r.endsWith("rem"))return i*16;if(r.endsWith("em"))return i*e;return i}function g(t){if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1),r=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(r)?r:void 0}return J[t]}var ye={flex:(t,e)=>(e.display="flex",!0),hidden:(t,e)=>(e.display="none",!0),grid:(t,e)=>(e.display="grid",!0),"flex-row":(t,e)=>(e.flexDirection="row",!0),"flex-col":(t,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(t,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(t,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(t,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(t,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(t,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(t,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(t,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(t,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(t,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(t,e)=>(e.flexGrow=1,!0),"grow-0":(t,e)=>(e.flexGrow=0,!0),shrink:(t,e)=>(e.flexShrink=1,!0),"shrink-0":(t,e)=>(e.flexShrink=0,!0),"justify-start":(t,e)=>(e.justifyContent="flex-start",!0),"justify-center":(t,e)=>(e.justifyContent="center",!0),"justify-end":(t,e)=>(e.justifyContent="flex-end",!0),"justify-between":(t,e)=>(e.justifyContent="space-between",!0),"justify-around":(t,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(t,e)=>(e.justifyContent="space-evenly",!0),"items-start":(t,e)=>(e.alignItems="flex-start",!0),"items-center":(t,e)=>(e.alignItems="center",!0),"items-end":(t,e)=>(e.alignItems="flex-end",!0),"items-stretch":(t,e)=>(e.alignItems="stretch",!0),"items-baseline":(t,e)=>(e.alignItems="baseline",!0),"self-auto":(t,e)=>(e.alignSelf="auto",!0),"self-start":(t,e)=>(e.alignSelf="flex-start",!0),"self-center":(t,e)=>(e.alignSelf="center",!0),"self-end":(t,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(t,e)=>(e.alignSelf="stretch",!0),"self-baseline":(t,e)=>(e.alignSelf="baseline",!0),"min-w-0":(t,e)=>(e.minWidth=0,!0),"aspect-square":(t,e)=>(e.aspectRatio=1,!0),"inset-0":(t,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(t,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(t,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(t,e)=>(e.letterSpacing=0,!0),"tracking-wide":(t,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(t,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(t,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(t,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(t,e)=>(e.position="relative",!0),absolute:(t,e)=>(e.position="absolute",!0),"overflow-visible":(t,e)=>(e.overflow="visible",!0),"overflow-hidden":(t,e)=>(e.overflow="hidden",!0),"overflow-scroll":(t,e)=>(e.overflow="scroll",!0),"font-thin":(t,e)=>(e.fontWeight="100",!0),"font-extralight":(t,e)=>(e.fontWeight="200",!0),"font-light":(t,e)=>(e.fontWeight="300",!0),"font-normal":(t,e)=>(e.fontWeight="400",!0),"font-medium":(t,e)=>(e.fontWeight="500",!0),"font-semibold":(t,e)=>(e.fontWeight="600",!0),"font-bold":(t,e)=>(e.fontWeight="bold",!0),"font-extrabold":(t,e)=>(e.fontWeight="800",!0),"font-black":(t,e)=>(e.fontWeight="900",!0),italic:(t,e)=>(e.fontStyle="italic",!0),"not-italic":(t,e)=>(e.fontStyle="normal",!0),"text-left":(t,e)=>(e.textAlign="left",!0),"text-center":(t,e)=>(e.textAlign="center",!0),"text-right":(t,e)=>(e.textAlign="right",!0),"text-justify":(t,e)=>(e.textAlign="justify",!0),uppercase:(t,e)=>(e.textTransform="uppercase",!0),lowercase:(t,e)=>(e.textTransform="lowercase",!0),capitalize:(t,e)=>(e.textTransform="capitalize",!0),"normal-case":(t,e)=>(e.textTransform="none",!0),underline:(t,e)=>(e.textDecorationLine="underline",!0),"line-through":(t,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(t,e)=>(e.textDecorationLine="none",!0)};function ve(t,e){if(!t.startsWith("bg-"))return!1;let r=t.slice(3),i=W(r);if(i)return e.backgroundColor=i,!0;return!1}function Re(t,e){if(!t.startsWith("text-"))return!1;let r=t.slice(5);if(U[r])return e.fontSize=U[r],!0;if(r.startsWith("[")&&r.endsWith("]")){let o=r.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(o)){let s=o.endsWith("rem")||o.endsWith("em")?Number.parseFloat(o)*16:Number.parseFloat(o);if(Number.isFinite(s))return e.fontSize=s,!0}}let i=W(r);if(i)return e.color=i,!0;return!1}function _e(t,e){if(t.startsWith("p-")){let r=g(t.slice(2));if(r!==void 0)return e.padding=r,!0}if(t.startsWith("px-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingHorizontal=r,!0}if(t.startsWith("py-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingVertical=r,!0}if(t.startsWith("pt-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingTop=r,!0}if(t.startsWith("pr-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingRight=r,!0}if(t.startsWith("pb-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingBottom=r,!0}if(t.startsWith("pl-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingLeft=r,!0}return!1}function ke(t,e){if(t.startsWith("m-")){let r=g(t.slice(2));if(r!==void 0)return e.margin=r,!0}if(t.startsWith("mx-")){let r=g(t.slice(3));if(r!==void 0)return e.marginHorizontal=r,!0}if(t.startsWith("my-")){let r=g(t.slice(3));if(r!==void 0)return e.marginVertical=r,!0}if(t.startsWith("mt-")){let r=g(t.slice(3));if(r!==void 0)return e.marginTop=r,!0}if(t.startsWith("mr-")){let r=g(t.slice(3));if(r!==void 0)return e.marginRight=r,!0}if(t.startsWith("mb-")){let r=g(t.slice(3));if(r!==void 0)return e.marginBottom=r,!0}if(t.startsWith("ml-")){let r=g(t.slice(3));if(r!==void 0)return e.marginLeft=r,!0}return!1}function Ce(t,e){if(!t.startsWith("w-"))return!1;let r=t.slice(2);if(r==="full")return e.width="100%",!0;if(r==="screen")return e.width="100%",!0;if(r==="auto")return e.width="auto",!0;if(r.includes("/")){let[o,s]=r.split("/"),c=Number.parseInt(o)/Number.parseInt(s)*100;return e.width=`${c}%`,!0}let i=g(r);if(i!==void 0)return e.width=i,!0;return!1}function We(t,e){if(!t.startsWith("h-"))return!1;let r=t.slice(2);if(r==="full")return e.height="100%",!0;if(r==="screen")return e.height="100%",!0;if(r==="auto")return e.height="auto",!0;let i=g(r);if(i!==void 0)return e.height=i,!0;return!1}function Ne(t,e){if(!t.startsWith("rounded"))return!1;if(t==="rounded")return e.borderRadius=w.DEFAULT,!0;let r=t.slice(8);if(r==="")return!1;let i=/^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(r);if(i){let s=O(i[2]);if(s===void 0)return!1;let c={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"]};for(let f of i[1]?c[i[1]]:["borderRadius"])e[f]=s;return!0}if(r.startsWith("t-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderTopLeftRadius=s,e.borderTopRightRadius=s,!0}if(r.startsWith("b-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderBottomLeftRadius=s,e.borderBottomRightRadius=s,!0}if(r.startsWith("l-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderTopLeftRadius=s,e.borderBottomLeftRadius=s,!0}if(r.startsWith("r-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderTopRightRadius=s,e.borderBottomRightRadius=s,!0}let o=w[r];if(o!==void 0)return e.borderRadius=o,!0;return!1}function Be(t,e){if(!t.startsWith("border"))return!1;if(t==="border")return e.borderWidth=1,!0;let r=t.match(/^border-(\d+)$/);if(r)return e.borderWidth=Number.parseInt(r[1]),!0;let i=t.match(/^border-(t|r|b|l)-?(\d*)$/);if(i){let[,o,s]=i,c=s?Number.parseInt(s):1;switch(o){case"t":e.borderTopWidth=c;break;case"r":e.borderRightWidth=c;break;case"b":e.borderBottomWidth=c;break;case"l":e.borderLeftWidth=c;break}return!0}return!1}function Ee(t,e){if(!t.startsWith("border-"))return!1;let r=t.slice(7),i=W(r);if(i)return e.borderColor=i,!0;return!1}function Xe(t,e){if(!t.startsWith("opacity-"))return!1;let r=Number.parseInt(t.slice(8));if(!Number.isNaN(r))return e.opacity=r/100,!0;return!1}function Ie(t,e){if(t.startsWith("tracking-[")){let r=O(t.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(r===void 0)return!1;return e.letterSpacing=r,!0}if(t.startsWith("leading-")){let r=t.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,o={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},s=r.startsWith("[")?/^\[[\d.]+\]$/.test(r)?Number.parseFloat(r.slice(1,-1))*i:O(r,i):o[r]!==void 0?o[r]*i:J[r];if(s===void 0||!Number.isFinite(s))return!1;return e.lineHeight=s,!0}return!1}function De(t,e){let r=/^grid-cols-(\d+)$/.exec(t);if(!r)return!1;return e.gridColumns=Number(r[1]),!0}function Le(t,e){if(!t.startsWith("size-"))return!1;let r=t.slice(5),i=r==="full"?"100%":g(r);if(i===void 0)return!1;return e.width=i,e.height=i,!0}function Oe(t,e){let r=/^(-?)(top|right|bottom|left)-(.+)$/.exec(t);if(!r)return!1;let i=r[3]==="full"?"100%":g(r[3]);if(i===void 0)return!1;return e[r[2]]=typeof i==="number"&&r[1]?-i:i,!0}function Ve(t,e){let r=/^space-(x|y)-(.+)$/.exec(t);if(!r)return!1;let i=g(r[2]);if(i===void 0)return!1;return e.gap=i,!0}function $e(t,e){if(t.startsWith("gap-")){let r=g(t.slice(4));if(r!==void 0)return e.gap=r,!0}if(t.startsWith("gap-x-")){let r=g(t.slice(6));if(r!==void 0)return e.columnGap=r,!0}if(t.startsWith("gap-y-")){let r=g(t.slice(6));if(r!==void 0)return e.rowGap=r,!0}return!1}function Y(t,e){let r={},i=t.split(/\s+/).filter(Boolean);for(let o of i){if(/^i-[a-z0-9]+-/.test(o))continue;let s=ye[o];if(s){s("",r);continue}if(ve(o,r))continue;if(Re(o,r))continue;if(_e(o,r))continue;if(ke(o,r))continue;if(Ce(o,r))continue;if(We(o,r))continue;if(Ne(o,r))continue;if(Be(o,r))continue;if(Ee(o,r))continue;if(Xe(o,r))continue;if($e(o,r))continue;if(Ie(o,r))continue;if(Le(o,r))continue;if(De(o,r))continue;if(Oe(o,r))continue;if(Ve(o,r))continue;if(e?.push(o),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${o}`)}return r}function N(t,e={},r={},i={},o=[]){return{type:t,props:e,style:r,events:i,children:o}}function K(t,e,r={}){return{version:"1.0.0",root:t,script:e,meta:{source:r.source||"unknown",compiledAt:r.compiledAt||Date.now(),headwindConfig:r.headwindConfig}}}var q=new Set(["script","style","head","meta","link","title","base","noscript","svg"]),Z=new Set(["template","body","html","main","fragment"]),B=new Set(["svg"]),Ae={click:"onPress",press:"onPress",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",change:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",close:"onRequestClose"},ze=new Set(["onBlur","onChangeText","onEndReached","onFocus","onLayout","onLongPress","onPress","onRequestClose","onScroll","onValueChange"]),V=new Set(["display","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow"]),je=new Set(["flex","flexGrow","flexShrink","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing"]),Fe=new Set(["top","right","bottom","left","width","height","minWidth","maxWidth","minHeight","maxHeight","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical"]),Q=new Set(["View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Image","ImageBackground","FlatList","SectionList","Switch","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl"]),ee=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Me={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function k(t){return t.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,r)=>{let i=Me[r.toLowerCase()];if(i!==void 0)return i;if(r[0]==="#"){let o=r[1]==="x"||r[1]==="X"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isFinite(o)?String.fromCodePoint(o):e}return e})}function te(t){return t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase())}function ne(t){let e=/^(-?[\d.]+)px$/.exec(t);if(e)return Number.parseFloat(e[1]);let r=/^(-?[\d.]+)r?em$/.exec(t);if(r)return Number.parseFloat(r[1])*16;if(/^-?[\d.]+$/.test(t))return Number.parseFloat(t);return t}function He(t,e,r){let i={},o={},s={},c="",f={};for(let[p,a]of e){let u=p.toLowerCase();if(u==="class"||u==="classname"){c=c?`${c} ${a}`:a;continue}if(u==="style"){f={...f,...Ge(t,a,r)};continue}if(u.startsWith(":")||u.startsWith("x-")&&u!=="x-cloak"){s[u.startsWith(":")?u.slice(1):u.slice(2)]=k(a);continue}if(u==="x-cloak")continue;if(u.startsWith("@")||u.startsWith("v-on:")){let b=u.startsWith("@")?u.slice(1):u.slice(5),[m]=b.split("."),S=Ae[m]??(m.startsWith("on")?m:"");if(!S||!ze.has(S)){r.push({kind:"unread-event",tag:t,name:p});continue}o[S]=k(a);continue}if(u==="key"){i.key=a;continue}let l=k(a);try{i[L(p)]=JSON.parse(l)}catch{i[L(p)]=l}}let d={...c?Y(c):{},...f};return{props:i,style:d,events:o,bindings:s,classes:c}}function re(t,e){if(je.has(t))return!1;if(Fe.has(t))return/^-?[\d.]+%$/.test(e);return!0}function Ge(t,e,r){let i={},o=k(e);try{let s=JSON.parse(o);if(s&&typeof s==="object"&&!Array.isArray(s)){for(let[c,f]of Object.entries(s)){let d=V.has(c)?c:te(c.trim().toLowerCase());if(!V.has(d)){r.push({kind:"unknown-style",tag:t,name:d});continue}if(f===null||f===void 0)continue;let p=typeof f==="string"?ne(f):f;if(typeof p!=="string"&&typeof p!=="number")continue;if(typeof p==="string"&&!re(d,p)){r.push({kind:"non-numeric-style",tag:t,name:d});continue}i[d]=p}return i}}catch{}for(let s of o.split(";")){let c=s.indexOf(":");if(c===-1)continue;let f=te(s.slice(0,c).trim().toLowerCase()),d=s.slice(c+1).trim();if(!f||!d)continue;if(!V.has(f)){r.push({kind:"unknown-style",tag:t,name:f});continue}let p=ne(d);if(typeof p==="string"&&!re(f,p)){r.push({kind:"non-numeric-style",tag:t,name:f});continue}i[f]=p}return i}function ie(t){return t.children.map((e)=>typeof e==="string"?e:ie(e)).join("").replace(/\s+/g," ").trim()}function Ue(t,e){let r=t.node,i=r.children.filter((s)=>typeof s!=="string"),o=r.children.filter((s)=>typeof s==="string").join("").trim();if(ee.has(r.type)&&i.length===0&&o)return r.type="Text",r.children=[o],r;if(r.type==="Text"&&i.length>0){let s=ie(r);return e.push({kind:"flattened-text",tag:t.tag}),r.children=s?[s]:[],r}if(ee.has(r.type)&&i.length>0)r.children=i;return r}async function Je(t,e={}){let r=[],i=[],o=[],s=new Set;function c(a){let u=o[o.length-1];if(!u)i.push(a);else if(!u.dropped)u.node.children.push(a)}function f(a){if(a.node.bindings&&Object.keys(a.node.bindings).length>0){let l=a.node.children,b=l.filter((S)=>typeof S!=="string"),m=b.length===1&&b.length===l.length?b[0]:N("View",{},{},{},l);if(m.bindings={...a.node.bindings,...m.bindings},m.bindingId===void 0&&a.node.bindingId!==void 0)m.bindingId=a.node.bindingId;c(m);return}let u=o[o.length-1];for(let l of a.node.children){if(typeof l==="string"){if(u&&!u.dropped)u.node.children.push(l);continue}if(!u)i.push(l);else if(!u.dropped)u.node.children.push(l)}}function d(a,u){let l=q.has(a)&&!B.has(a),b=o[o.length-1]?.dropped??!1,{props:m,style:S,events:h,bindings:x,classes:v}=l||b?{props:{},style:{},events:{},bindings:{},classes:""}:He(a,u,r),X=m["data-native"],R;if(typeof X==="string"&&Q.has(X))R=X,delete m["data-native"];else R=B.has(a)?"View":G(a);if(R===a&&!Q.has(R)&&!q.has(a)&&!Z.has(a)&&!s.has(a))s.add(a),r.push({kind:"unmapped-tag",tag:a});if((l||B.has(a))&&!s.has(`drop:${a}`))s.add(`drop:${a}`),r.push({kind:"dropped-subtree",tag:a});let _=N(R,m,S,h),I=m["data-stx-b"];if(typeof I==="number"&&Number.isInteger(I))_.bindingId=I;if(delete m["data-stx-b"],v)_._classes=v;if(Object.keys(x).length>0)_.bindings=x;if(typeof m.key==="string")_.key=m.key,delete m.key;return{tag:a,node:_,dropped:l||b||B.has(a),discard:l||b,unwrap:Z.has(a)}}if(await new HTMLRewriter().on("*",{element(a){let u=a.tagName.toLowerCase(),l=d(u,[...a.attributes]),b=!0;try{a.onEndTag(()=>{if(o.pop(),l.discard)return;if(l.unwrap)f(l);else c(Ue(l,r))})}catch{b=!1}if(b)o.push(l);else if(!l.discard)c(l.node)},text(a){let u=o[o.length-1];if(!u||u.dropped)return;let l=k(a.text).replace(/\s+/g," ");if(!l.trim())return;u.node.children.push(l)}}).transform(new Response(t)).text(),i.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);return{root:i.length===1?i[0]:N("View",{},{},{},i),diagnostics:r}}async function oe(t,e={}){let{root:r,diagnostics:i}=await Je(t,e),o=e.script??{exports:{},functions:[],code:""};return{document:K(r,o,{source:e.source??"unknown"}),diagnostics:i}}var se=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Ye=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Ke=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,ae=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function A(t){let e=[];se.lastIndex=0;for(let s of t.matchAll(se)){let c=s[1]??"";if(/\bserver\b/.test(c))continue;e.push(s[2].trim())}let r=e.filter(Boolean).join(`
|
|
2
|
+
import{rr,Ps,To}from"./chunk-1yj3p63h.js";import"./chunk-axydabse.js";import{Ln,n}from"./chunk-9jr7jbgv.js";import"./chunk-b9wpgn7b.js";import"./chunk-ptjqacjd.js";import"./chunk-8bew5svs.js";import"./chunk-721yq8qx.js";import"./chunk-8x47zcfa.js";import"./chunk-pxqs3psa.js";import"./chunk-my3jkpv7.js";import"./chunk-t7x753ga.js";import"./chunk-114zdbnd.js";import{Pe}from"./chunk-w6gyrqjp.js";import"./chunk-8wkja2z2.js";import{existsSync as j,mkdirSync as ot,readFileSync as st}from"fs";import T from"path";import{existsSync as tt,mkdirSync as nt}from"fs";import y from"path";import{existsSync as Ze}from"fs";import C from"path";var de="data-stx-b",F=new Set(Ps),pe=new Set(rr);function ge(t){if(t==="ref"||t==="data-stx-ref")return"ref";if(t.startsWith("::"))return null;if(t.startsWith("@bind:")||t.startsWith("x-bind:"))return"attr";if(t.startsWith("@")||t.startsWith(":")){let e=t.slice(1).split(".")[0];if(F.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(To(e))return"event";if(t.startsWith("@"))return"event";return"attr"}if(t.startsWith("x-")){let e=t.split(".")[0];if(!pe.has(e))return"attr";let r=e.slice(2);if(r==="cloak"||r==="data"||r==="bind")return null;if(r==="tooltip"||r==="tooltip-position")return null;return F.has(r)?r==="if"?"if":r:"attr"}return null}function me(t){let e=[];for(let[r,i]of t){let o=ge(r);if(o)e.push({name:r,value:i,kind:o})}return e}var he=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,D=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function M(t){let e=[],r=0;return{html:t.replace(he,(o,s,c)=>{if(!c||!/[:@]|x-/.test(c))return o;let f=[];D.lastIndex=0;for(let l=D.exec(c);l;l=D.exec(c))f.push([l[1],l[2]??l[3]??l[4]??""]);let d=me(f);if(!d.length)return o;let p={id:r++,bindings:d};if(d.some((l)=>l.kind==="for"))p.template=!0;e.push(p);let a=o.endsWith("/>");return`${o.slice(0,a?-2:-1).trimEnd()} ${de}="${p.id}"${a?"/>":">"}`}),manifest:{entries:e}}}var be=["accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumTrackTintColor","minimumValue","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize"],Se=new Map(be.map((t)=>[H(t),t]));function H(t){return t.replace(/[-_]/g,"").toLowerCase()}function L(t){return Se.get(H(t))??t}var xe={view:"View",text:"Text",button:"Button",image:"Image",img:"Image",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function G(t){return xe[t.toLowerCase()]||t}var we={transparent:"transparent",current:"currentColor",black:"#000000",white:"#ffffff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},J={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},U={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},w={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function W(t){let e=t.lastIndexOf("/");if(e>0&&!t.endsWith("]")){let i=W(t.slice(0,e)),o=t.slice(e+1),s=/^\[(.+)\]$/.test(o)?Number.parseFloat(o.slice(1,-1))*(o.includes("%")?1:100):Number.parseFloat(o);if(!i||!Number.isFinite(s))return;return Te(i,s/100)}if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="black")return"#000000";if(t==="white")return"#ffffff";let r=t.split("-");if(r.length===2){let[i,o]=r,s=we[i];if(s&&typeof s==="object")return s[o]}if(t.startsWith("[")&&t.endsWith("]")){let i=t.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function Te(t,e){if(t==="transparent")return t;let r=t.startsWith("#")?t.slice(1):"";if(r.length===3)r=r.split("").map((o)=>o+o).join("");if(r.length===8)r=r.slice(0,6);if(r.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${r}${i.toString(16).padStart(2,"0")}`}function O(t,e=16){if(!t.startsWith("[")||!t.endsWith("]"))return;let r=t.slice(1,-1),i=Number.parseFloat(r);if(!Number.isFinite(i))return;if(r.endsWith("rem"))return i*16;if(r.endsWith("em"))return i*e;return i}function g(t){if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1),r=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(r)?r:void 0}return J[t]}var ye={flex:(t,e)=>(e.display="flex",!0),hidden:(t,e)=>(e.display="none",!0),grid:(t,e)=>(e.display="grid",!0),"flex-row":(t,e)=>(e.flexDirection="row",!0),"flex-col":(t,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(t,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(t,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(t,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(t,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(t,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(t,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(t,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(t,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(t,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(t,e)=>(e.flexGrow=1,!0),"grow-0":(t,e)=>(e.flexGrow=0,!0),shrink:(t,e)=>(e.flexShrink=1,!0),"shrink-0":(t,e)=>(e.flexShrink=0,!0),"justify-start":(t,e)=>(e.justifyContent="flex-start",!0),"justify-center":(t,e)=>(e.justifyContent="center",!0),"justify-end":(t,e)=>(e.justifyContent="flex-end",!0),"justify-between":(t,e)=>(e.justifyContent="space-between",!0),"justify-around":(t,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(t,e)=>(e.justifyContent="space-evenly",!0),"items-start":(t,e)=>(e.alignItems="flex-start",!0),"items-center":(t,e)=>(e.alignItems="center",!0),"items-end":(t,e)=>(e.alignItems="flex-end",!0),"items-stretch":(t,e)=>(e.alignItems="stretch",!0),"items-baseline":(t,e)=>(e.alignItems="baseline",!0),"self-auto":(t,e)=>(e.alignSelf="auto",!0),"self-start":(t,e)=>(e.alignSelf="flex-start",!0),"self-center":(t,e)=>(e.alignSelf="center",!0),"self-end":(t,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(t,e)=>(e.alignSelf="stretch",!0),"self-baseline":(t,e)=>(e.alignSelf="baseline",!0),"min-w-0":(t,e)=>(e.minWidth=0,!0),"aspect-square":(t,e)=>(e.aspectRatio=1,!0),"inset-0":(t,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(t,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(t,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(t,e)=>(e.letterSpacing=0,!0),"tracking-wide":(t,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(t,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(t,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(t,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(t,e)=>(e.position="relative",!0),absolute:(t,e)=>(e.position="absolute",!0),"overflow-visible":(t,e)=>(e.overflow="visible",!0),"overflow-hidden":(t,e)=>(e.overflow="hidden",!0),"overflow-scroll":(t,e)=>(e.overflow="scroll",!0),"font-thin":(t,e)=>(e.fontWeight="100",!0),"font-extralight":(t,e)=>(e.fontWeight="200",!0),"font-light":(t,e)=>(e.fontWeight="300",!0),"font-normal":(t,e)=>(e.fontWeight="400",!0),"font-medium":(t,e)=>(e.fontWeight="500",!0),"font-semibold":(t,e)=>(e.fontWeight="600",!0),"font-bold":(t,e)=>(e.fontWeight="bold",!0),"font-extrabold":(t,e)=>(e.fontWeight="800",!0),"font-black":(t,e)=>(e.fontWeight="900",!0),italic:(t,e)=>(e.fontStyle="italic",!0),"not-italic":(t,e)=>(e.fontStyle="normal",!0),"text-left":(t,e)=>(e.textAlign="left",!0),"text-center":(t,e)=>(e.textAlign="center",!0),"text-right":(t,e)=>(e.textAlign="right",!0),"text-justify":(t,e)=>(e.textAlign="justify",!0),uppercase:(t,e)=>(e.textTransform="uppercase",!0),lowercase:(t,e)=>(e.textTransform="lowercase",!0),capitalize:(t,e)=>(e.textTransform="capitalize",!0),"normal-case":(t,e)=>(e.textTransform="none",!0),underline:(t,e)=>(e.textDecorationLine="underline",!0),"line-through":(t,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(t,e)=>(e.textDecorationLine="none",!0)};function ve(t,e){if(!t.startsWith("bg-"))return!1;let r=t.slice(3),i=W(r);if(i)return e.backgroundColor=i,!0;return!1}function Re(t,e){if(!t.startsWith("text-"))return!1;let r=t.slice(5);if(U[r])return e.fontSize=U[r],!0;if(r.startsWith("[")&&r.endsWith("]")){let o=r.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(o)){let s=o.endsWith("rem")||o.endsWith("em")?Number.parseFloat(o)*16:Number.parseFloat(o);if(Number.isFinite(s))return e.fontSize=s,!0}}let i=W(r);if(i)return e.color=i,!0;return!1}function _e(t,e){if(t.startsWith("p-")){let r=g(t.slice(2));if(r!==void 0)return e.padding=r,!0}if(t.startsWith("px-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingHorizontal=r,!0}if(t.startsWith("py-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingVertical=r,!0}if(t.startsWith("pt-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingTop=r,!0}if(t.startsWith("pr-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingRight=r,!0}if(t.startsWith("pb-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingBottom=r,!0}if(t.startsWith("pl-")){let r=g(t.slice(3));if(r!==void 0)return e.paddingLeft=r,!0}return!1}function ke(t,e){if(t.startsWith("m-")){let r=g(t.slice(2));if(r!==void 0)return e.margin=r,!0}if(t.startsWith("mx-")){let r=g(t.slice(3));if(r!==void 0)return e.marginHorizontal=r,!0}if(t.startsWith("my-")){let r=g(t.slice(3));if(r!==void 0)return e.marginVertical=r,!0}if(t.startsWith("mt-")){let r=g(t.slice(3));if(r!==void 0)return e.marginTop=r,!0}if(t.startsWith("mr-")){let r=g(t.slice(3));if(r!==void 0)return e.marginRight=r,!0}if(t.startsWith("mb-")){let r=g(t.slice(3));if(r!==void 0)return e.marginBottom=r,!0}if(t.startsWith("ml-")){let r=g(t.slice(3));if(r!==void 0)return e.marginLeft=r,!0}return!1}function Ce(t,e){if(!t.startsWith("w-"))return!1;let r=t.slice(2);if(r==="full")return e.width="100%",!0;if(r==="screen")return e.width="100%",!0;if(r==="auto")return e.width="auto",!0;if(r.includes("/")){let[o,s]=r.split("/"),c=Number.parseInt(o)/Number.parseInt(s)*100;return e.width=`${c}%`,!0}let i=g(r);if(i!==void 0)return e.width=i,!0;return!1}function We(t,e){if(!t.startsWith("h-"))return!1;let r=t.slice(2);if(r==="full")return e.height="100%",!0;if(r==="screen")return e.height="100%",!0;if(r==="auto")return e.height="auto",!0;let i=g(r);if(i!==void 0)return e.height=i,!0;return!1}function Ne(t,e){if(!t.startsWith("rounded"))return!1;if(t==="rounded")return e.borderRadius=w.DEFAULT,!0;let r=t.slice(8);if(r==="")return!1;let i=/^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(r);if(i){let s=O(i[2]);if(s===void 0)return!1;let c={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"]};for(let f of i[1]?c[i[1]]:["borderRadius"])e[f]=s;return!0}if(r.startsWith("t-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderTopLeftRadius=s,e.borderTopRightRadius=s,!0}if(r.startsWith("b-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderBottomLeftRadius=s,e.borderBottomRightRadius=s,!0}if(r.startsWith("l-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderTopLeftRadius=s,e.borderBottomLeftRadius=s,!0}if(r.startsWith("r-")){let s=w[r.slice(2)]??w.DEFAULT;return e.borderTopRightRadius=s,e.borderBottomRightRadius=s,!0}let o=w[r];if(o!==void 0)return e.borderRadius=o,!0;return!1}function Be(t,e){if(!t.startsWith("border"))return!1;if(t==="border")return e.borderWidth=1,!0;let r=t.match(/^border-(\d+)$/);if(r)return e.borderWidth=Number.parseInt(r[1]),!0;let i=t.match(/^border-(t|r|b|l)-?(\d*)$/);if(i){let[,o,s]=i,c=s?Number.parseInt(s):1;switch(o){case"t":e.borderTopWidth=c;break;case"r":e.borderRightWidth=c;break;case"b":e.borderBottomWidth=c;break;case"l":e.borderLeftWidth=c;break}return!0}return!1}function Ee(t,e){if(!t.startsWith("border-"))return!1;let r=t.slice(7),i=W(r);if(i)return e.borderColor=i,!0;return!1}function Xe(t,e){if(!t.startsWith("opacity-"))return!1;let r=Number.parseInt(t.slice(8));if(!Number.isNaN(r))return e.opacity=r/100,!0;return!1}function Ie(t,e){if(t.startsWith("tracking-[")){let r=O(t.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(r===void 0)return!1;return e.letterSpacing=r,!0}if(t.startsWith("leading-")){let r=t.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,o={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},s=r.startsWith("[")?/^\[[\d.]+\]$/.test(r)?Number.parseFloat(r.slice(1,-1))*i:O(r,i):o[r]!==void 0?o[r]*i:J[r];if(s===void 0||!Number.isFinite(s))return!1;return e.lineHeight=s,!0}return!1}function De(t,e){let r=/^grid-cols-(\d+)$/.exec(t);if(!r)return!1;return e.gridColumns=Number(r[1]),!0}function Le(t,e){if(!t.startsWith("size-"))return!1;let r=t.slice(5),i=r==="full"?"100%":g(r);if(i===void 0)return!1;return e.width=i,e.height=i,!0}function Oe(t,e){let r=/^(-?)(top|right|bottom|left)-(.+)$/.exec(t);if(!r)return!1;let i=r[3]==="full"?"100%":g(r[3]);if(i===void 0)return!1;return e[r[2]]=typeof i==="number"&&r[1]?-i:i,!0}function Ve(t,e){let r=/^space-(x|y)-(.+)$/.exec(t);if(!r)return!1;let i=g(r[2]);if(i===void 0)return!1;return e.gap=i,!0}function $e(t,e){if(t.startsWith("gap-")){let r=g(t.slice(4));if(r!==void 0)return e.gap=r,!0}if(t.startsWith("gap-x-")){let r=g(t.slice(6));if(r!==void 0)return e.columnGap=r,!0}if(t.startsWith("gap-y-")){let r=g(t.slice(6));if(r!==void 0)return e.rowGap=r,!0}return!1}function Y(t,e){let r={},i=t.split(/\s+/).filter(Boolean);for(let o of i){if(/^i-[a-z0-9]+-/.test(o))continue;let s=ye[o];if(s){s("",r);continue}if(ve(o,r))continue;if(Re(o,r))continue;if(_e(o,r))continue;if(ke(o,r))continue;if(Ce(o,r))continue;if(We(o,r))continue;if(Ne(o,r))continue;if(Be(o,r))continue;if(Ee(o,r))continue;if(Xe(o,r))continue;if($e(o,r))continue;if(Ie(o,r))continue;if(Le(o,r))continue;if(De(o,r))continue;if(Oe(o,r))continue;if(Ve(o,r))continue;if(e?.push(o),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${o}`)}return r}function N(t,e={},r={},i={},o=[]){return{type:t,props:e,style:r,events:i,children:o}}function K(t,e,r={}){return{version:"1.0.0",root:t,script:e,meta:{source:r.source||"unknown",compiledAt:r.compiledAt||Date.now(),headwindConfig:r.headwindConfig}}}var q=new Set(["script","style","head","meta","link","title","base","noscript","svg"]),Z=new Set(["template","body","html","main","fragment"]),B=new Set(["svg"]),Ae={click:"onPress",press:"onPress",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",change:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",refresh:"onRefresh",close:"onRequestClose"},ze=new Set(["onBlur","onChangeText","onEndReached","onFocus","onLayout","onLongPress","onPress","onRequestClose","onRefresh","onScroll","onValueChange"]),V=new Set(["display","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow"]),je=new Set(["flex","flexGrow","flexShrink","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing"]),Fe=new Set(["top","right","bottom","left","width","height","minWidth","maxWidth","minHeight","maxHeight","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical"]),Q=new Set(["View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Image","ImageBackground","FlatList","SectionList","Switch","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl"]),ee=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Me={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function k(t){return t.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,r)=>{let i=Me[r.toLowerCase()];if(i!==void 0)return i;if(r[0]==="#"){let o=r[1]==="x"||r[1]==="X"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isFinite(o)?String.fromCodePoint(o):e}return e})}function te(t){return t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase())}function ne(t){let e=/^(-?[\d.]+)px$/.exec(t);if(e)return Number.parseFloat(e[1]);let r=/^(-?[\d.]+)r?em$/.exec(t);if(r)return Number.parseFloat(r[1])*16;if(/^-?[\d.]+$/.test(t))return Number.parseFloat(t);return t}function He(t,e,r){let i={},o={},s={},c="",f={};for(let[p,a]of e){let u=p.toLowerCase();if(u==="class"||u==="classname"){c=c?`${c} ${a}`:a;continue}if(u==="style"){f={...f,...Ge(t,a,r)};continue}if(u.startsWith(":")||u.startsWith("x-")&&u!=="x-cloak"){s[u.startsWith(":")?u.slice(1):u.slice(2)]=k(a);continue}if(u==="x-cloak")continue;if(u.startsWith("@")||u.startsWith("v-on:")){let b=u.startsWith("@")?u.slice(1):u.slice(5),[m]=b.split("."),S=Ae[m]??(m.startsWith("on")?m:"");if(!S||!ze.has(S)){r.push({kind:"unread-event",tag:t,name:p});continue}o[S]=k(a);continue}if(u==="key"){i.key=a;continue}let l=k(a);try{i[L(p)]=JSON.parse(l)}catch{i[L(p)]=l}}let d={...c?Y(c):{},...f};return{props:i,style:d,events:o,bindings:s,classes:c}}function re(t,e){if(je.has(t))return!1;if(Fe.has(t))return/^-?[\d.]+%$/.test(e);return!0}function Ge(t,e,r){let i={},o=k(e);try{let s=JSON.parse(o);if(s&&typeof s==="object"&&!Array.isArray(s)){for(let[c,f]of Object.entries(s)){let d=V.has(c)?c:te(c.trim().toLowerCase());if(!V.has(d)){r.push({kind:"unknown-style",tag:t,name:d});continue}if(f===null||f===void 0)continue;let p=typeof f==="string"?ne(f):f;if(typeof p!=="string"&&typeof p!=="number")continue;if(typeof p==="string"&&!re(d,p)){r.push({kind:"non-numeric-style",tag:t,name:d});continue}i[d]=p}return i}}catch{}for(let s of o.split(";")){let c=s.indexOf(":");if(c===-1)continue;let f=te(s.slice(0,c).trim().toLowerCase()),d=s.slice(c+1).trim();if(!f||!d)continue;if(!V.has(f)){r.push({kind:"unknown-style",tag:t,name:f});continue}let p=ne(d);if(typeof p==="string"&&!re(f,p)){r.push({kind:"non-numeric-style",tag:t,name:f});continue}i[f]=p}return i}function ie(t){return t.children.map((e)=>typeof e==="string"?e:ie(e)).join("").replace(/\s+/g," ").trim()}function Ue(t,e){let r=t.node,i=r.children.filter((s)=>typeof s!=="string"),o=r.children.filter((s)=>typeof s==="string").join("").trim();if(ee.has(r.type)&&i.length===0&&o)return r.type="Text",r.children=[o],r;if(r.type==="Text"&&i.length>0){let s=ie(r);return e.push({kind:"flattened-text",tag:t.tag}),r.children=s?[s]:[],r}if(ee.has(r.type)&&i.length>0)r.children=i;return r}async function Je(t,e={}){let r=[],i=[],o=[],s=new Set;function c(a){let u=o[o.length-1];if(!u)i.push(a);else if(!u.dropped)u.node.children.push(a)}function f(a){if(a.node.bindings&&Object.keys(a.node.bindings).length>0){let l=a.node.children,b=l.filter((S)=>typeof S!=="string"),m=b.length===1&&b.length===l.length?b[0]:N("View",{},{},{},l);if(m.bindings={...a.node.bindings,...m.bindings},m.bindingId===void 0&&a.node.bindingId!==void 0)m.bindingId=a.node.bindingId;c(m);return}let u=o[o.length-1];for(let l of a.node.children){if(typeof l==="string"){if(u&&!u.dropped)u.node.children.push(l);continue}if(!u)i.push(l);else if(!u.dropped)u.node.children.push(l)}}function d(a,u){let l=q.has(a)&&!B.has(a),b=o[o.length-1]?.dropped??!1,{props:m,style:S,events:h,bindings:x,classes:v}=l||b?{props:{},style:{},events:{},bindings:{},classes:""}:He(a,u,r),X=m["data-native"],R;if(typeof X==="string"&&Q.has(X))R=X,delete m["data-native"];else R=B.has(a)?"View":G(a);if(R===a&&!Q.has(R)&&!q.has(a)&&!Z.has(a)&&!s.has(a))s.add(a),r.push({kind:"unmapped-tag",tag:a});if((l||B.has(a))&&!s.has(`drop:${a}`))s.add(`drop:${a}`),r.push({kind:"dropped-subtree",tag:a});let _=N(R,m,S,h),I=m["data-stx-b"];if(typeof I==="number"&&Number.isInteger(I))_.bindingId=I;if(delete m["data-stx-b"],v)_._classes=v;if(Object.keys(x).length>0)_.bindings=x;if(typeof m.key==="string")_.key=m.key,delete m.key;return{tag:a,node:_,dropped:l||b||B.has(a),discard:l||b,unwrap:Z.has(a)}}if(await new HTMLRewriter().on("*",{element(a){let u=a.tagName.toLowerCase(),l=d(u,[...a.attributes]),b=!0;try{a.onEndTag(()=>{if(o.pop(),l.discard)return;if(l.unwrap)f(l);else c(Ue(l,r))})}catch{b=!1}if(b)o.push(l);else if(!l.discard)c(l.node)},text(a){let u=o[o.length-1];if(!u||u.dropped)return;let l=k(a.text).replace(/\s+/g," ");if(!l.trim())return;u.node.children.push(l)}}).transform(new Response(t)).text(),i.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);return{root:i.length===1?i[0]:N("View",{},{},{},i),diagnostics:r}}async function oe(t,e={}){let{root:r,diagnostics:i}=await Je(t,e),o=e.script??{exports:{},functions:[],code:""};return{document:K(r,o,{source:e.source??"unknown"}),diagnostics:i}}var se=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Ye=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Ke=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,ae=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function A(t){let e=[];se.lastIndex=0;for(let s of t.matchAll(se)){let c=s[1]??"";if(/\bserver\b/.test(c))continue;e.push(s[2].trim())}let r=e.filter(Boolean).join(`
|
|
3
3
|
|
|
4
4
|
`),i=[];for(let s of[Ye,Ke]){s.lastIndex=0;for(let c of r.matchAll(s))if(!i.includes(c[1]))i.push(c[1])}let o={};ae.lastIndex=0;for(let s of r.matchAll(ae)){let c=s[2];try{o[s[1]]=JSON.parse(c.replace(/^'(.*)'$/,'"$1"'))}catch{o[s[1]]=c}}return{exports:o,functions:i,code:r}}var ce=/<script\b[^>]*\bdata-stx-scoped\b[^>]*>([\s\S]*?)<\/script>/gi,qe=/function\s+(__stx_setup_[\w$]+)\s*\(/;function P(t){ce.lastIndex=0;for(let e of t.matchAll(ce)){let r=e[1].trim(),i=qe.exec(r)?.[1];if(i)return{name:i,code:r}}return null}function Qe(){let t=[C.join(import.meta.dir,"..","primitives"),C.join(import.meta.dir,"native","primitives")];for(let e of t)if(Ze(C.join(e,"View.stx")))return e;return t[0]}async function et(t,e,r={}){let i=r.root??C.dirname(e),o={root:i,componentsDir:r.componentsDir??C.join(i,"components"),buildMode:"serve",cache:!1,_pluginComponentDirs:[Qe()]},s={...r.context??{},__stx_inject_css:!1},c=await n(t,s,e,o,new Set),{html:f,manifest:d}=M(c),{document:p,diagnostics:a}=await oe(f,{source:e,script:A(t)}),u=P(f);if(A(t).code.trim()){let l=await Ln(t,e,r.context,{forceClientSetup:!0});u=P(l.setupCode??"")??u}return{document:p,manifest:d,setup:u,diagnostics:a,html:f}}async function E(t,e={}){return et(await Bun.file(t).text(),t,e)}function ue(t){let r=[y.join(import.meta.dir,"..","runtime",`${t}.ts`),y.join(import.meta.dir,"..","runtime",`${t}.js`),y.join(import.meta.dir,"native","runtime",`${t}.js`)].find((i)=>tt(i));if(!r)throw Error(`Native runtime module ${t} is missing`);return r}async function rt(t,e,r){let i=await Bun.build({entrypoints:[t],target:"browser",format:"iife",minify:r,plugins:e,define:{"process.env.NODE_ENV":JSON.stringify(r?"production":"development")}});if(!i.success){let o=i.logs.map((s)=>String(s.message??s)).join(`
|
|
5
5
|
`);throw Error(`Could not bundle ${t}:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{yt,Fr,zr,Hr,mu,Vr}from"./chunk-
|
|
2
|
+
import{yt,Fr,zr,Hr,mu,Vr}from"./chunk-d2z6tmzw.js";import"./chunk-t7x753ga.js";import"./chunk-ptjqacjd.js";import"./chunk-pxqs3psa.js";export{zr as buildServerApi,mu as createServerApi,yt as discoverServerApi,Fr as generateApiTypes,Vr as isServerApiSource,Hr as productionApiDispatcher};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{an,ws}from"./chunk-
|
|
2
|
+
import{an,ws}from"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";export{ws as generateRuntimeConfigTypes,an as prepareRuntimeConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{tn,tc,Qr}from"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import{ve}from"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{ve as freeIdentifiers,Qr as processComponents,tc as processESImports,tn as rendersAsElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Go,cl,Jo,Yo,ll,ul}from"./chunk-
|
|
2
|
+
import{Go,cl,Jo,Yo,ll,ul}from"./chunk-basztgd4.js";import"./chunk-9jr7jbgv.js";import"./chunk-8wkja2z2.js";import"./chunk-8x47zcfa.js";import"./chunk-t7x753ga.js";import"./chunk-8bew5svs.js";import"./chunk-ptjqacjd.js";import"./chunk-my3jkpv7.js";import"./chunk-721yq8qx.js";import"./chunk-b9wpgn7b.js";import"./chunk-axydabse.js";import"./chunk-1yj3p63h.js";import"./chunk-pxqs3psa.js";import"./chunk-114zdbnd.js";export{ul as applySlots,ll as extractSlotContent,cl as parseSlotElement,Go as parseSlots,Yo as processSlots,Jo as renderSlot};
|