@stacksjs/stx 0.2.880 → 0.2.882
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-ec5q4nnw.js → chunk-0k7khseq.js} +2 -2
- package/dist/{chunk-h2tq6cbr.js → chunk-0rdh8bw3.js} +1 -1
- package/dist/{chunk-0m4c42qt.js → chunk-22mdphq2.js} +2 -2
- package/dist/{chunk-86nsbxep.js → chunk-295bykzd.js} +26 -26
- package/dist/{chunk-3wb82rxw.js → chunk-30z4s1n3.js} +2 -2
- package/dist/{chunk-pm4rpc4a.js → chunk-3869n9nd.js} +1 -1
- package/dist/chunk-3abd3gw8.js +2 -0
- package/dist/{chunk-p55a910x.js → chunk-3jndqseh.js} +6 -6
- package/dist/{chunk-v3747589.js → chunk-47bsv8xy.js} +1 -1
- package/dist/{chunk-qd9v1v8z.js → chunk-4adb8bmp.js} +1 -1
- package/dist/{chunk-7dq6ebvp.js → chunk-4hfsbdqa.js} +1 -1
- package/dist/chunk-5508z01x.js +2 -0
- package/dist/chunk-5v93fj91.js +2 -0
- package/dist/{chunk-ew3vs3jq.js → chunk-5yga68j4.js} +1 -1
- package/dist/chunk-65899mj8.js +2 -0
- package/dist/{chunk-5p3825qw.js → chunk-678nhepd.js} +1 -1
- package/dist/{chunk-a5gnxdfe.js → chunk-6vr0yfbt.js} +1 -1
- package/dist/{chunk-7bsrnpmh.js → chunk-75yst7df.js} +3 -3
- package/dist/{chunk-w2kdhm7k.js → chunk-7z94thkd.js} +1 -1
- package/dist/chunk-8s365b62.js +2 -0
- package/dist/{chunk-nysbdr4r.js → chunk-8vb1m3t3.js} +1 -1
- package/dist/{chunk-9cbf0seq.js → chunk-93b6syb0.js} +1 -1
- package/dist/chunk-93fvjs6g.js +2 -0
- package/dist/{chunk-cjv89tnb.js → chunk-99spzsmw.js} +1 -1
- package/dist/{chunk-3zds0gmd.js → chunk-9zc1cnw8.js} +1 -1
- package/dist/{chunk-qfwk93fk.js → chunk-9zqggj7t.js} +1 -1
- package/dist/{chunk-y7e61pz3.js → chunk-a81bwn7b.js} +1 -1
- package/dist/{chunk-kn9tqjgv.js → chunk-a852vdv3.js} +1 -1
- package/dist/{chunk-awp8a3t4.js → chunk-bgddx531.js} +1 -1
- package/dist/{chunk-19k15mfc.js → chunk-c3413bgh.js} +1 -1
- package/dist/{chunk-v1s838fe.js → chunk-cb0c6959.js} +1 -1
- package/dist/{chunk-k6c5t9we.js → chunk-cekzqze8.js} +1 -1
- package/dist/{chunk-5eftxrvv.js → chunk-cn2bgt0w.js} +1 -1
- package/dist/chunk-cn6dqyfh.js +2 -0
- package/dist/{chunk-93jhfbeg.js → chunk-d0c5q7b7.js} +1 -1
- package/dist/{chunk-t94y8g35.js → chunk-d2pexm3z.js} +1 -1
- package/dist/chunk-ddws4zp2.js +3 -0
- package/dist/{chunk-az8b0726.js → chunk-e44br2vs.js} +2 -2
- package/dist/{chunk-z9ffr9gy.js → chunk-e9hm254p.js} +4 -4
- package/dist/{chunk-1avy0p8v.js → chunk-h0nsb8b0.js} +1 -1
- package/dist/{chunk-qxcc0aar.js → chunk-j58b7xen.js} +1 -1
- package/dist/{chunk-tgzs1kbj.js → chunk-j7bkrvey.js} +1 -1
- package/dist/{chunk-kna1bdm2.js → chunk-kjz7g83q.js} +4 -4
- package/dist/chunk-ktk4eg8c.js +2 -0
- package/dist/{chunk-ce0zbpr5.js → chunk-kx4svden.js} +1 -1
- package/dist/chunk-kzagptvq.js +2 -0
- package/dist/{chunk-rdxph1tp.js → chunk-mhdkk9a4.js} +1 -1
- package/dist/{chunk-k206d3pn.js → chunk-n163nwke.js} +1 -1
- package/dist/{chunk-1r612xxs.js → chunk-nghybhas.js} +1 -1
- package/dist/{chunk-t9hxyvvc.js → chunk-nmz9j39s.js} +2 -2
- package/dist/{chunk-1jk46ve0.js → chunk-p5qac909.js} +1 -1
- package/dist/{chunk-2d68p12e.js → chunk-pxemb9dg.js} +1 -1
- package/dist/{chunk-f7znj9xg.js → chunk-qjqvhke7.js} +1 -1
- package/dist/{chunk-egjmb32c.js → chunk-qpybh7ss.js} +5 -5
- package/dist/{chunk-mygsektn.js → chunk-qxthb2a1.js} +1 -1
- package/dist/chunk-radvtjwt.js +16 -0
- package/dist/{chunk-4r2rfdmr.js → chunk-rn2kk4r8.js} +1 -1
- package/dist/{chunk-cad7e5q1.js → chunk-s9xavhdb.js} +1 -1
- package/dist/chunk-sb93fb2w.js +2 -0
- package/dist/chunk-twewtvyt.js +2 -0
- package/dist/{chunk-vm42j29z.js → chunk-v65efeh1.js} +1 -1
- package/dist/{chunk-g83ph305.js → chunk-v99zjh93.js} +1 -1
- package/dist/{chunk-k40e0ete.js → chunk-vtgqgx8t.js} +1 -1
- package/dist/{chunk-hmntqqyd.js → chunk-whmk0m8x.js} +4 -4
- package/dist/{chunk-rzcdwybt.js → chunk-x5608pnk.js} +1 -1
- package/dist/chunk-x7asbgvc.js +2 -0
- package/dist/chunk-xc6w4x0w.js +2 -0
- package/dist/{chunk-xf0xacc9.js → chunk-yfphz58r.js} +5 -5
- package/dist/{chunk-78zgmqhd.js → chunk-ywnqjqns.js} +1 -1
- package/dist/chunk-zen0ef4k.js +2 -0
- package/dist/cli.js +7 -7
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/dev-server/ts-css.js +3 -3
- package/dist/pwa.js +1 -1
- package/dist/safe-evaluator.d.ts +0 -8
- package/dist/safe-evaluator.js +14 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-2haf7t5h.js +0 -2
- package/dist/chunk-3jp5z1qj.js +0 -2
- package/dist/chunk-3q0w0bzd.js +0 -16
- package/dist/chunk-83b9k17j.js +0 -2
- package/dist/chunk-b7d3n4aw.js +0 -2
- package/dist/chunk-gm67jt8p.js +0 -2
- package/dist/chunk-hkx51atf.js +0 -2
- package/dist/chunk-p746twww.js +0 -2
- package/dist/chunk-qn6y5ttj.js +0 -2
- package/dist/chunk-rnrdngnn.js +0 -2
- package/dist/chunk-swz0xprw.js +0 -2
- package/dist/chunk-tka73egx.js +0 -2
- package/dist/chunk-v9h2bbhf.js +0 -2
- package/dist/chunk-v9mxhch2.js +0 -2
- package/dist/chunk-ws9kr80x.js +0 -2
- package/dist/chunk-xz4v9tg1.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{xt,St,kt}from"./chunk-zek9t5za.js";import"./chunk-00tq7ghn.js";import"./chunk-hxhmhw23.js";import"./chunk-s29hp1qw.js";import"./chunk-a60ztvnp.js";import{h}from"./chunk-
|
|
2
|
+
import{xt,St,kt}from"./chunk-zek9t5za.js";import"./chunk-00tq7ghn.js";import"./chunk-hxhmhw23.js";import"./chunk-s29hp1qw.js";import"./chunk-a60ztvnp.js";import{h}from"./chunk-3jndqseh.js";import"./chunk-295bykzd.js";import"./chunk-6t04tqvh.js";import"./chunk-c3413bgh.js";import{tn,vo,nn,ga,vt,ma,xo,rn,ya,sn}from"./chunk-g2xy0z0e.js";import M from"fs";import x from"path";function E(t,e){let r=[x.join(t.root,"stx.config.ts"),x.join(t.root,"stx.config.js"),x.join(t.root,"stx.config.mjs")],s=e.debounceMs??300,o=null,a=[];for(let c of r)try{if(!M.existsSync(c))continue;let n=M.watch(c,(d)=>{if(d==="change"){if(o)clearTimeout(o);o=setTimeout(async()=>{ma("Config file changed, restarting...");try{await e.onChange()}catch(p){vt(`Failed to restart: ${p}`)}},s)}});a.push(n)}catch{}return{stop(){if(o)clearTimeout(o);for(let c of a)c.close()}}}import w from"fs";import j from"path";var nt=".stx/story/analytics.json",st=1,A=1e4;class k{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(t){this.storagePath=j.join(t,nt),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let t=w.readFileSync(this.storagePath,"utf-8");return JSON.parse(t)}catch{return{version:st,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let t=j.dirname(this.storagePath);if(await w.promises.mkdir(t,{recursive:!0}),this.storage.events.length>A)this.storage.events=this.storage.events.slice(-A);await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:at(),startTime:Date.now(),componentViews:[]},this.storage.sessions.push(this.currentSession),this.dirty=!0}endSession(){if(this.currentSession)this.currentSession.endTime=Date.now(),this.currentSession=null}track(t){this.storage.events.push({...t,timestamp:Date.now()}),this.dirty=!0}trackView(t,e){if(this.endViewTiming(t),this.viewStartTimes.set(t,Date.now()),this.track({type:"view",componentId:t,variantId:e}),this.currentSession&&!this.currentSession.componentViews.includes(t))this.currentSession.componentViews.push(t)}endViewTiming(t){let e=this.viewStartTimes.get(t);if(e){let r=Date.now()-e;this.track({type:"view",componentId:t,metadata:{duration:r,endView:!0}}),this.viewStartTimes.delete(t)}}trackPropChange(t,e,r){this.track({type:"prop_change",componentId:t,propName:e,metadata:{value:r}})}trackVariantSwitch(t,e){this.track({type:"variant_switch",componentId:t,variantId:e})}trackSearch(t,e){this.track({type:"search",query:t,metadata:{resultCount:e}})}getComponentAnalytics(t,e){let r=this.storage.events.filter((i)=>i.componentId===t),s=r.filter((i)=>i.type==="view"&&!i.metadata?.endView),o=r.filter((i)=>i.type==="prop_change"),a=r.filter((i)=>i.type==="variant_switch"),c={};for(let i of o)if(i.propName)c[i.propName]=(c[i.propName]||0)+1;let n={};for(let i of a)if(i.variantId)n[i.variantId]=(n[i.variantId]||0)+1;let d=new Set(this.storage.sessions.filter((i)=>i.componentViews.includes(t)).map((i)=>i.id)),p=r.filter((i)=>i.metadata?.duration).map((i)=>i.metadata.duration),u=p.length>0?p.reduce((i,l)=>i+l,0)/p.length:0,f=Object.entries(c).sort((i,l)=>l[1]-i[1]).slice(0,5).map(([i])=>i);return{componentId:t,componentName:e,viewCount:s.length,uniqueViews:d.size,lastViewed:s[s.length-1]?.timestamp,propChanges:c,topChangedProps:f,variantViews:n,avgTimeSpent:u}}getMostViewedComponents(t=10){let e=new Map;for(let r of this.storage.events)if(r.type==="view"&&r.componentId&&!r.metadata?.endView)e.set(r.componentId,(e.get(r.componentId)||0)+1);return Array.from(e.entries()).map(([r,s])=>({componentId:r,viewCount:s})).sort((r,s)=>s.viewCount-r.viewCount).slice(0,t)}getMostChangedProps(t=10){let e=new Map;for(let r of this.storage.events)if(r.type==="prop_change"&&r.propName)e.set(r.propName,(e.get(r.propName)||0)+1);return Array.from(e.entries()).map(([r,s])=>({propName:r,changeCount:s})).sort((r,s)=>s.changeCount-r.changeCount).slice(0,t)}getSearchAnalytics(){let t=this.storage.events.filter((o)=>o.type==="search"),e=new Map,r=0;for(let o of t){if(o.query)e.set(o.query,(e.get(o.query)||0)+1);if(o.metadata?.resultCount!==void 0)r+=o.metadata.resultCount}let s=Array.from(e.entries()).map(([o,a])=>({query:o,count:a})).sort((o,a)=>a.count-o.count).slice(0,10);return{totalSearches:t.length,topQueries:s,avgResultCount:t.length>0?r/t.length:0}}clear(){this.storage.events=[],this.storage.sessions=[],this.dirty=!0,this.startSession()}exportAnalytics(){return JSON.stringify({exportedAt:Date.now(),...this.storage},null,2)}}function at(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";import B from"path";var it=".stx/story/bookmarks.json",ct=1;class P{storage;storagePath;dirty=!1;constructor(t){this.storagePath=B.join(t,it),this.storage=this.loadStorage()}loadStorage(){try{let t=S.readFileSync(this.storagePath,"utf-8");return JSON.parse(t)}catch{return{version:ct,bookmarks:[]}}}async save(){if(!this.dirty)return;let t=B.dirname(this.storagePath);await S.promises.mkdir(t,{recursive:!0}),await S.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(t,e,r,s={}){let o={id:dt(),name:s.name||`${t}/${e}`,storyId:t,variantId:e,props:r,created:Date.now(),notes:s.notes,color:s.color};return this.storage.bookmarks.push(o),this.dirty=!0,o}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(t){return this.storage.bookmarks.filter((e)=>e.storyId===t)}getBookmark(t){return this.storage.bookmarks.find((e)=>e.id===t)}isBookmarked(t,e){return this.storage.bookmarks.some((r)=>r.storyId===t&&r.variantId===e)}updateBookmark(t,e){let r=this.getBookmark(t);if(!r)return;return Object.assign(r,e),this.dirty=!0,r}deleteBookmark(t){let e=this.storage.bookmarks.findIndex((r)=>r.id===t);if(e===-1)return!1;return this.storage.bookmarks.splice(e,1),this.dirty=!0,!0}toggleBookmark(t,e,r){let s=this.storage.bookmarks.find((a)=>a.storyId===t&&a.variantId===e);if(s)return this.deleteBookmark(s.id),{added:!1};return{added:!0,bookmark:this.addBookmark(t,e,r)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(t,e=!0){let r=JSON.parse(t),s=0;for(let o of r.bookmarks){if(e){let a=this.storage.bookmarks.find((c)=>c.id===o.id);if(a)Object.assign(a,o);else this.storage.bookmarks.push(o)}else this.storage.bookmarks.push(o);s++}if(s>0)this.dirty=!0;return s}}function dt(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var v=new Set;function N(){return{open(t){v.add(t),t.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(t){v.delete(t)},message(t,e){}}}function C(t){let e=JSON.stringify({...t,timestamp:t.timestamp||Date.now()});for(let r of v)try{r.send(e)}catch{v.delete(r)}}function V(t,e){C({type:"story-update",data:{storyId:t,...e}})}function H(t,e){C({type:"story-add",data:{storyId:t,...e}})}function O(t){C({type:"story-remove",data:{storyId:t}})}function F(t){return`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
const ws = new WebSocket('${t}');
|
|
@@ -556,7 +556,7 @@ window.__stxPerformance = {
|
|
|
556
556
|
|
|
557
557
|
window.clearPerformanceMetrics = () => window.__stxPerformance.clear();
|
|
558
558
|
</script>
|
|
559
|
-
`}import T from"fs";import K from"path";var lt=".stx/story/presets.json",R=1,mt=10;class I{storage;storagePath;dirty=!1;constructor(t){this.storagePath=K.join(t,lt),this.storage=this.loadStorage()}loadStorage(){try{let t=T.readFileSync(this.storagePath,"utf-8"),e=JSON.parse(t);if(e.version!==R)return this.migrateStorage(e);return e}catch{return{version:R,presets:[],recentIds:[]}}}migrateStorage(t){return{version:R,presets:t.presets||[],recentIds:t.recentIds||[]}}async save(){if(!this.dirty)return;let t=K.dirname(this.storagePath);await T.promises.mkdir(t,{recursive:!0}),await T.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(t,e,r={}){let s={id:ut(),name:t,description:r.description,props:e,componentId:r.componentId,created:Date.now(),usageCount:0,tags:r.tags};return this.storage.presets.push(s),this.dirty=!0,s}getPreset(t){return this.storage.presets.find((e)=>e.id===t)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(t){return this.storage.presets.filter((e)=>!e.componentId||e.componentId===t)}getRecentPresets(){return this.storage.recentIds.map((t)=>this.getPreset(t)).filter((t)=>t!==void 0)}usePreset(t){let e=this.getPreset(t);if(!e)return;return e.lastUsed=Date.now(),e.usageCount++,this.storage.recentIds=[t,...this.storage.recentIds.filter((r)=>r!==t)].slice(0,mt),this.dirty=!0,e}updatePreset(t,e){let r=this.getPreset(t);if(!r)return;return Object.assign(r,e),this.dirty=!0,r}deletePreset(t){let e=this.storage.presets.findIndex((r)=>r.id===t);if(e===-1)return!1;return this.storage.presets.splice(e,1),this.storage.recentIds=this.storage.recentIds.filter((r)=>r!==t),this.dirty=!0,!0}searchPresets(t){let e=t.toLowerCase();return this.storage.presets.filter((r)=>{if(r.name.toLowerCase().includes(e))return!0;if(r.description?.toLowerCase().includes(e))return!0;if(r.tags?.some((s)=>s.toLowerCase().includes(e)))return!0;return!1})}getMostUsedPresets(t=5){return[...this.storage.presets].sort((e,r)=>r.usageCount-e.usageCount).slice(0,t)}exportPresets(t){let e=t?this.storage.presets.filter((r)=>t.includes(r.id)):this.storage.presets;return JSON.stringify({presets:e},null,2)}importPresets(t,e=!1){let r=JSON.parse(t),s=0;for(let o of r.presets){let a=this.storage.presets.find((c)=>c.id===o.id);if(a&&!e)continue;if(a)Object.assign(a,o);else this.storage.presets.push(o);s++}if(s>0)this.dirty=!0;return s}}function ut(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import _ from"fs";var q=new Map;async function b(t,e,r={}){let s=performance.now(),o=[];try{let a=await _.promises.stat(e),c=q.get(e),n;if(c&&c.mtime===a.mtimeMs)n=c.content;else n=await _.promises.readFile(e,"utf-8"),q.set(e,{content:n,mtime:a.mtimeMs,analyzed:null});let{processDirectives:d}=await import("./chunk-
|
|
559
|
+
`}import T from"fs";import K from"path";var lt=".stx/story/presets.json",R=1,mt=10;class I{storage;storagePath;dirty=!1;constructor(t){this.storagePath=K.join(t,lt),this.storage=this.loadStorage()}loadStorage(){try{let t=T.readFileSync(this.storagePath,"utf-8"),e=JSON.parse(t);if(e.version!==R)return this.migrateStorage(e);return e}catch{return{version:R,presets:[],recentIds:[]}}}migrateStorage(t){return{version:R,presets:t.presets||[],recentIds:t.recentIds||[]}}async save(){if(!this.dirty)return;let t=K.dirname(this.storagePath);await T.promises.mkdir(t,{recursive:!0}),await T.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(t,e,r={}){let s={id:ut(),name:t,description:r.description,props:e,componentId:r.componentId,created:Date.now(),usageCount:0,tags:r.tags};return this.storage.presets.push(s),this.dirty=!0,s}getPreset(t){return this.storage.presets.find((e)=>e.id===t)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(t){return this.storage.presets.filter((e)=>!e.componentId||e.componentId===t)}getRecentPresets(){return this.storage.recentIds.map((t)=>this.getPreset(t)).filter((t)=>t!==void 0)}usePreset(t){let e=this.getPreset(t);if(!e)return;return e.lastUsed=Date.now(),e.usageCount++,this.storage.recentIds=[t,...this.storage.recentIds.filter((r)=>r!==t)].slice(0,mt),this.dirty=!0,e}updatePreset(t,e){let r=this.getPreset(t);if(!r)return;return Object.assign(r,e),this.dirty=!0,r}deletePreset(t){let e=this.storage.presets.findIndex((r)=>r.id===t);if(e===-1)return!1;return this.storage.presets.splice(e,1),this.storage.recentIds=this.storage.recentIds.filter((r)=>r!==t),this.dirty=!0,!0}searchPresets(t){let e=t.toLowerCase();return this.storage.presets.filter((r)=>{if(r.name.toLowerCase().includes(e))return!0;if(r.description?.toLowerCase().includes(e))return!0;if(r.tags?.some((s)=>s.toLowerCase().includes(e)))return!0;return!1})}getMostUsedPresets(t=5){return[...this.storage.presets].sort((e,r)=>r.usageCount-e.usageCount).slice(0,t)}exportPresets(t){let e=t?this.storage.presets.filter((r)=>t.includes(r.id)):this.storage.presets;return JSON.stringify({presets:e},null,2)}importPresets(t,e=!1){let r=JSON.parse(t),s=0;for(let o of r.presets){let a=this.storage.presets.find((c)=>c.id===o.id);if(a&&!e)continue;if(a)Object.assign(a,o);else this.storage.presets.push(o);s++}if(s>0)this.dirty=!0;return s}}function ut(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import _ from"fs";var q=new Map;async function b(t,e,r={}){let s=performance.now(),o=[];try{let a=await _.promises.stat(e),c=q.get(e),n;if(c&&c.mtime===a.mtimeMs)n=c.content;else n=await _.promises.readFile(e,"utf-8"),q.set(e,{content:n,mtime:a.mtimeMs,analyzed:null});let{processDirectives:d}=await import("./chunk-twewtvyt.js"),p={},u=y(n);if(u)try{await h(u,p,e)}catch(g){o.push(`Warning: Could not extract script variables: ${g instanceof Error?g.message:String(g)}`)}if(r.props)Object.assign(p,r.props);let i=await d(n,p,e,{},new Set),l=Z(n),m=y(n);return i=Q(i),i=tt(i,p),{html:i,css:l,js:m,errors:o,duration:performance.now()-s}}catch(a){return o.push(a instanceof Error?a.message:String(a)),{html:`<div class="stx-render-error">${et(o[0])}</div>`,css:"",js:"",errors:o,duration:performance.now()-s}}}async function gt(t){try{let e=await _.promises.readFile(t,"utf-8"),r=y(e);if(!r)return null;let s={};if(await h(r,s,t),Array.isArray(s.variants))return s.variants;return null}catch{return null}}async function Y(t,e,r,s){let o=e.story?.variants;if(!o){let n=await gt(e.path);if(n)o=n}if(!o&&r==="default")return b(t,e.path,{props:s||{}});if(!o)return b(t,e.path,{props:s||{}});let a=o.find((n)=>n.id===r);if(!a&&r==="default")return b(t,e.path,{props:s||{}});if(!a)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${r}' not found`],duration:0};let c={...a.state,...s};if(a.source)return ft(t,a.source,c);return b(t,e.path,{props:c})}async function ft(t,e,r={}){let s=performance.now(),o=[];try{let{processDirectives:a}=await import("./chunk-twewtvyt.js"),c={...r},n=y(e);if(n)try{await h(n,c,"inline-template.stx")}catch{}let p=await a(e,c,"inline-template.stx",{},new Set);return p=Q(p),p=tt(p,c),{html:p,css:Z(e),js:y(e),errors:o,duration:performance.now()-s}}catch(a){return o.push(a instanceof Error?a.message:String(a)),{html:`<div class="stx-render-error">${et(o[0])}</div>`,css:"",js:"",errors:o,duration:performance.now()-s}}}function Z(t){let e=[],r=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,s=r.exec(t);while(s!==null)e.push(s[1].trim()),s=r.exec(t);return e.join(`
|
|
560
560
|
`)}function Q(t){return t.replace(/<!--[\s\S]*?-->/g,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/^\s*\n/gm,"").trim()}function y(t){let e=[],r=/<script\b[^>]*>([\s\S]*?)<\/script>/gi,s=r.exec(t);while(s!==null)e.push(s[1].trim()),s=r.exec(t);return e.join(`
|
|
561
561
|
`)}function tt(t,e){let r=`<script>window.__stxProps = ${JSON.stringify(e)};</script>`;return t+r}function et(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}async function rt(t,e){let r=await rn(t);St(t,r);let s=sn(t.config,r);kt(t,s),console.log(` Found ${r.length} story files`);let o=typeof e.host==="string"?e.host:e.host===!0?"0.0.0.0":"localhost",a=new I(t.root),c=new P(t.root),n=new k(t.root),d=N(),p=Bun.serve({port:e.port,hostname:o,fetch:async(i,l)=>{let g=new URL(i.url).pathname;if(g==="/__hmr"){if(l.upgrade(i,{data:{isHmr:!0}}))return;return new Response("WebSocket upgrade failed",{status:400})}if(g.startsWith("/api/"))return yt(t,g,i,{presetsManager:a,bookmarksManager:c,analyticsTracker:n});return ht(t,g,e.port)},websocket:{open(i){d.open(i)},close(i){d.close(i)},message(i,l){d.message(i,l)}}}),u=`http://${o}:${e.port}`,f=ya(t,async(i,l)=>{console.log(` [${i}] ${l.relativePath}`);let m=await rn(t);St(t,m);let g=sn(t.config,m);if(kt(t,g),i==="add")H(l.id,{fileName:l.fileName});else if(i==="unlink")O(l.id);else V(l.id,{fileName:l.fileName})});if(e.open){let i=u;try{let{exec:l}=await import("child_process"),m=process.platform;l(`${m==="darwin"?"open":m==="win32"?"start":"xdg-open"} ${i}`)}catch{}}return{server:p,url:u,close:async()=>{f(),p.stop()}}}async function yt(t,e,r,s){let{presetsManager:o,bookmarksManager:a,analyticsTracker:c}=s;if(e==="/api/stories")return Response.json({files:t.storyFiles.map((n)=>({id:n.id,fileName:n.fileName,relativePath:n.relativePath,treePath:n.treePath})),tree:t.tree});if(e.startsWith("/api/story/")){let n=e.slice(11),d=t.storyFiles.find((p)=>p.id===n);if(!d)return new Response("Story not found",{status:404});try{let p=await Bun.file(d.path).text();return Response.json({id:d.id,fileName:d.fileName,relativePath:d.relativePath,content:p})}catch{return new Response("Error reading story",{status:500})}}if(e==="/api/config")return Response.json({theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets});if(e.startsWith("/api/render/")){let n=new URL(r.url),d=e.slice(12).split("/"),p=d[0],u=d[1]||"default",f,i=n.searchParams.get("props");if(i)try{f=JSON.parse(i)}catch{}let l=t.storyFiles.find((m)=>m.id===p);if(!l)return new Response("Story not found",{status:404});try{let m=await Y(t,l,u,f);return Response.json({html:m.html,css:m.css,js:m.js,errors:m.errors,duration:m.duration})}catch(m){return Response.json({html:"",css:"",js:"",errors:[m instanceof Error?m.message:String(m)],duration:0},{status:500})}}if(e==="/api/presets"&&r.method==="GET")return Response.json({presets:o.getAllPresets()});if(e==="/api/presets"&&r.method==="POST")try{let n=await r.json(),d=o.createPreset(n.name,n.props,{componentId:n.componentId,description:n.description});return await o.save(),Response.json(d)}catch(n){return Response.json({error:String(n)},{status:400})}if(e.startsWith("/api/presets/")&&!e.includes("/use")&&r.method==="GET"){let n=e.slice(13),d=o.getPreset(n);if(!d)return new Response("Preset not found",{status:404});return Response.json(d)}if(e.endsWith("/use")&&r.method==="POST"){let n=e.slice(13,-4),d=o.usePreset(n);if(!d)return new Response("Preset not found",{status:404});return await o.save(),Response.json(d)}if(e.startsWith("/api/presets/")&&r.method==="DELETE"){let n=e.slice(13);if(!o.deletePreset(n))return new Response("Preset not found",{status:404});return await o.save(),Response.json({success:!0})}if(e==="/api/bookmarks"&&r.method==="GET")return Response.json({bookmarks:a.getAllBookmarks()});if(e==="/api/bookmarks"&&r.method==="POST")try{let n=await r.json(),d=a.addBookmark(n.storyId,n.variantId,n.props,{name:n.name,notes:n.notes,color:n.color});return await a.save(),Response.json(d)}catch(n){return Response.json({error:String(n)},{status:400})}if(e==="/api/bookmarks/toggle"&&r.method==="POST")try{let n=await r.json(),d=a.toggleBookmark(n.storyId,n.variantId,n.props);return await a.save(),Response.json(d)}catch(n){return Response.json({error:String(n)},{status:400})}if(e.startsWith("/api/bookmarks/")&&e!=="/api/bookmarks/toggle"&&r.method==="GET"){let n=e.slice(15),d=a.getBookmark(n);if(!d)return new Response("Bookmark not found",{status:404});return Response.json(d)}if(e.startsWith("/api/bookmarks/")&&r.method==="DELETE"){let n=e.slice(15);if(!a.deleteBookmark(n))return new Response("Bookmark not found",{status:404});return await a.save(),Response.json({success:!0})}if(e==="/api/analytics/track"&&r.method==="POST")try{let n=await r.json();if(n.type==="view"&&n.componentId)c.trackView(n.componentId,n.variantId);else if(n.type==="prop_change"&&n.componentId&&n.propName)c.trackPropChange(n.componentId,n.propName,null);else if(n.type==="variant_switch"&&n.componentId&&n.variantId)c.trackVariantSwitch(n.componentId,n.variantId);else if(n.type==="search"&&n.query)c.trackSearch(n.query,0);return await c.save(),Response.json({success:!0})}catch(n){return Response.json({error:String(n)},{status:400})}if(e==="/api/analytics/summary"&&r.method==="GET")return Response.json({mostViewed:c.getMostViewedComponents(10),mostChangedProps:c.getMostChangedProps(10),searchAnalytics:c.getSearchAnalytics()});if(e.startsWith("/api/analytics/component/")&&r.method==="GET"){let n=e.slice(25),d=t.storyFiles.find((u)=>u.id===n),p=c.getComponentAnalytics(n,d?.fileName||n);return Response.json(p)}return new Response("Not found",{status:404})}function ht(t,e,r){let s=bt(t,r);return new Response(s,{headers:{"Content-Type":"text/html; charset=utf-8"}})}function bt(t,e){let{theme:r}=t.config,s=r.title||"STX Story",o=`ws://localhost:${e}/__hmr`,a=F(o);return`<!DOCTYPE html>
|
|
562
562
|
<html lang="en" class="${r.darkClass||"dark"}">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{gs,ms}from"./chunk-e362e615.js";import{w}from"./chunk-
|
|
2
|
+
import{gs,ms}from"./chunk-e362e615.js";import{w}from"./chunk-3jndqseh.js";import{a}from"./chunk-0k7khseq.js";import{st,pe}from"./chunk-kee5a3ce.js";import{bc}from"./chunk-nmz9j39s.js";import{U}from"./chunk-care745q.js";import{b}from"./chunk-94mpe1ny.js";import{f}from"./chunk-xpbakn6t.js";import{existsSync as z,mkdirSync as C,copyFileSync as I,chmodSync as B,rmSync as xe}from"fs";import{join as c,basename as ye,resolve as K}from"path";import{spawn as _}from"child_process";import{platform as Se}from"os";function O(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=w(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var Fu=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{lh,za,Lu,uh,dh,ph,fh,gh,ju,Bu,mh,hh,yh,bh}from"./chunk-d0c5q7b7.js";import"./chunk-qpybh7ss.js";import"./chunk-radvtjwt.js";import"./chunk-kjz7g83q.js";import"./chunk-c0g30cjs.js";import"./chunk-s9xavhdb.js";import"./chunk-ddws4zp2.js";import"./chunk-a852vdv3.js";import"./chunk-d2pexm3z.js";import"./chunk-22mdphq2.js";import"./chunk-whmk0m8x.js";import"./chunk-cb0c6959.js";import"./chunk-cn2bgt0w.js";import"./chunk-nb6erf75.js";import"./chunk-0k7khseq.js";import"./chunk-qxthb2a1.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{Lu as SUSPENSE_RESOLVER_RUNTIME,za as buildSuspenseResolveScript,gh as createStreamRenderer,ph as extractStreamBoundaries,bh as generateHydrationRuntime,Bu as islandDirective,hh as processSectionDirectives,dh as processStreamDirectives,mh as registerStreamingDirectives,uh as renderStreamingPage,lh as streamTemplate,fh as streamTemplateSimple,yh as streamToResponse,ju as streamingSuspenseDirective};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ye,Nn,ao,Ui,F}from"./chunk-6t04tqvh.js";import{On}from"./chunk-19k15mfc.js";import{Kr,E,Ll,wt,Qi,jl}from"./chunk-00tq7ghn.js";import{M}from"./chunk-hxhmhw23.js";import{T,R}from"./chunk-s29hp1qw.js";import{qr,mo,Zi,Nl,De}from"./chunk-a60ztvnp.js";import{co,d,m,Xt,p,ee,q,k,fo,Me,Qe,go}from"./chunk-86nsbxep.js";import{b}from"./chunk-94mpe1ny.js";import{te}from"./chunk-ws2h92mm.js";import{t,C}from"./chunk-yh2hnt3m.js";import{c}from"./chunk-xpbakn6t.js";import St from"path";import on from"process";import{AsyncLocalStorage as Ua}from"async_hooks";var Jr=new Ua;function $n(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function Xr(e,n){return Jr.run($n(e),n)}async function Gr(e,n){let r=Jr.getStore();if(!r)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(x,v)=>{if(v===void 0||typeof v==="function"||typeof v==="symbol"||typeof v==="bigint"||typeof v==="number"&&!Number.isFinite(v))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(v&&typeof v==="object"&&!Array.isArray(v)&&Object.getPrototypeOf(v)!==Object.prototype&&Object.getPrototypeOf(v)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return v}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Lr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function G(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,x=()=>{if(l!==0)return;let v=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(v){if(n&&v[1]==="const")return;let z=v[2];if(!a.has(z))i.push(z),a.add(z);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((z)=>{let N=z.trim();if(!N)return;let H=N.indexOf(":"),U=(H>=0?N.slice(H+1).trim():N).split(/[\s=]/)[0];if(U&&!a.has(U))i.push(U),a.add(U)});return}let D=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(D){if(n&&r.slice(u).startsWith("const"))return;D[1].split(",").forEach((z)=>{let N=z.trim().replace(/^\.\.\./,"");if(!N)return;let H=N.split(/[\s=]/)[0];if(H&&!a.has(H))i.push(H),a.add(H)});return}if(n)return;let W=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let z=W[1];if(!a.has(z))i.push(z),a.add(z);return}let L=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let z=L[1];if(!a.has(z))i.push(z),a.add(z)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))x();u++}return i.join(", ")}function Ws(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Ha(e,n=G(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(G(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function qs(e,n){let r=`{ ${Ha(e,n)} }`;return G(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import en from"fs";import ze from"path";function X(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var Yr=new Map;function Ar(e,n=!0){let r=Yr.get(e);if(n&&r)return r;let i=new Map,a=[ze.join(e,"src"),ze.join(e,"dist"),e];function l(u,f){if(f>6)return;let x;try{x=en.readdirSync(u,{withFileTypes:!0})}catch{return}for(let v of x){let I=ze.join(u,v.name);if(v.isDirectory()){if(v.name==="node_modules"||v.name.startsWith("."))continue;l(I,f+1)}else if(v.isFile()&&v.name.endsWith(".stx")){let D=v.name.slice(0,-4);if(!i.has(D))i.set(D,I);let W=D.toLowerCase();if(!i.has(W))i.set(W,I);let L=X(D);if(!i.has(L))i.set(L,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)Yr.set(e,i);return i}function Ks(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=ze.join(r,"node_modules",e);try{if(en.statSync(i).isDirectory())return i}catch{}let a=ze.dirname(r);if(a===r)return null;r=a}}function Gs(e,n,r={}){return[ze.resolve(ze.dirname(n),`${e}.stx`),ze.resolve(ze.dirname(n),e),ze.resolve(r.componentsDir||"components",`${e}.stx`),ze.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function Qr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=X(n);return[n,r,i]}function _i(e,n){let[r,i,a]=Qr(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Ci(e,n){let r=n?ze.resolve(n):void 0,i=ze.dirname(ze.resolve(e));for(;;){if(en.existsSync(ze.join(i,"package.json")))return r&&i===r?void 0:i;let a=ze.dirname(i);if(a===i)return;i=a}}var Ka=["src/ui","src/components","components","dist"];function Qn(e,n){let r=ze.resolve(e);if(!n&&!r.split(ze.sep).includes("node_modules"))return[];let i=Ci(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(en.readFileSync(ze.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((x)=>typeof x==="string")}catch{}let l=a.length?a:Ka;return[ze.dirname(ze.resolve(e)),...l.map((u)=>ze.resolve(i,u))]}function*Ei(e,n,r={},i){let a=Qr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield ze.resolve(ze.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((x)=>`${x}.stx`))],u=r.projectRoot||process.cwd(),f=[...Qn(n,r.projectRoot),...i?.__originalFilePath?[ze.join(ze.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],ze.join(ze.dirname(n),"components"),ze.resolve(u,"src/components"),ze.resolve(u,"components"),...import.meta.dir?[ze.resolve(import.meta.dir,"components")]:[]];for(let x of new Set(f)){for(let v of l)yield ze.join(x,v);try{for(let v of en.readdirSync(x,{withFileTypes:!0}))if(v.isDirectory())for(let I of l)yield ze.join(x,v.name,I)}catch{}}}function ei(e,n,r={},i){let a=_i(e,i);if(a!==void 0)return a;for(let l of Ei(e,n,r,i))try{if(en.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Xs(e,n=[],r={}){let i=new Set([...e].map((v)=>v.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([v,I])=>[v.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),x=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!x)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((v)=>i.has(v)))return!1;if([...n].some((v)=>!["load","error"].includes(v.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((v)=>i.has(v))}import Ss from"fs";import fe from"path";import Dt from"path";import hn from"fs";var qa=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Ms(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return qa.has(e.toLowerCase())}var ti=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),ni={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},Za=new Set(["ctrl","alt","shift","meta"]),ii={left:0,middle:1,right:2};function si(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(Za.has(i))n.systemKeys.push(i);else if(i in ii)n.mouse=i;else if(i in ni||/^[a-z]$/.test(i))n.keys.push(ni[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function oi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,x]=l,v=l.index,I=v+u.length,D=`__stx_evt_${n}${i++}`,W=[],L=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,z;while((z=L.exec(x))!==null){let[,H,Z]=z,U=H.split("."),V=U[0];if(!ti.has(V))continue;W.push({attribute:`@${H}`,event:V,handler:Z,modifiers:si(U.slice(1)),elementId:D})}let N=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((z=N.exec(x))!==null){let[,H,Z]=z,U=H.split("."),V=U[0];if(!ti.has(V))continue;W.push({attribute:`@${H}`,event:V,handler:Z,modifiers:si(U.slice(1)),elementId:D})}if(W.length>0)r.push({originalTag:u,elementId:D,events:W,startIndex:v,endIndex:I})}return r}function Ja(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=ii[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function Xa(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Ds(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Ga(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Ja(e),a=Xa(Ds(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Ms(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
2
|
+
import{Ye,Nn,ao,Ui,F}from"./chunk-6t04tqvh.js";import{On}from"./chunk-c3413bgh.js";import{Kr,E,Ll,wt,Qi,jl}from"./chunk-00tq7ghn.js";import{M}from"./chunk-hxhmhw23.js";import{T,R}from"./chunk-s29hp1qw.js";import{qr,mo,Zi,Nl,De}from"./chunk-a60ztvnp.js";import{co,d,m,Xt,p,ee,q,k,fo,Me,Qe,go}from"./chunk-295bykzd.js";import{b}from"./chunk-94mpe1ny.js";import{te}from"./chunk-ws2h92mm.js";import{t,C}from"./chunk-yh2hnt3m.js";import{c}from"./chunk-xpbakn6t.js";import St from"path";import on from"process";import{AsyncLocalStorage as Ua}from"async_hooks";var Jr=new Ua;function $n(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function Xr(e,n){return Jr.run($n(e),n)}async function Gr(e,n){let r=Jr.getStore();if(!r)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(x,v)=>{if(v===void 0||typeof v==="function"||typeof v==="symbol"||typeof v==="bigint"||typeof v==="number"&&!Number.isFinite(v))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(v&&typeof v==="object"&&!Array.isArray(v)&&Object.getPrototypeOf(v)!==Object.prototype&&Object.getPrototypeOf(v)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return v}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Lr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function G(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,x=()=>{if(l!==0)return;let v=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(v){if(n&&v[1]==="const")return;let z=v[2];if(!a.has(z))i.push(z),a.add(z);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((z)=>{let N=z.trim();if(!N)return;let H=N.indexOf(":"),U=(H>=0?N.slice(H+1).trim():N).split(/[\s=]/)[0];if(U&&!a.has(U))i.push(U),a.add(U)});return}let D=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(D){if(n&&r.slice(u).startsWith("const"))return;D[1].split(",").forEach((z)=>{let N=z.trim().replace(/^\.\.\./,"");if(!N)return;let H=N.split(/[\s=]/)[0];if(H&&!a.has(H))i.push(H),a.add(H)});return}if(n)return;let W=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let z=W[1];if(!a.has(z))i.push(z),a.add(z);return}let L=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let z=L[1];if(!a.has(z))i.push(z),a.add(z)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))x();u++}return i.join(", ")}function Ws(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Ha(e,n=G(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(G(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function qs(e,n){let r=`{ ${Ha(e,n)} }`;return G(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import en from"fs";import ze from"path";function X(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var Yr=new Map;function Ar(e,n=!0){let r=Yr.get(e);if(n&&r)return r;let i=new Map,a=[ze.join(e,"src"),ze.join(e,"dist"),e];function l(u,f){if(f>6)return;let x;try{x=en.readdirSync(u,{withFileTypes:!0})}catch{return}for(let v of x){let I=ze.join(u,v.name);if(v.isDirectory()){if(v.name==="node_modules"||v.name.startsWith("."))continue;l(I,f+1)}else if(v.isFile()&&v.name.endsWith(".stx")){let D=v.name.slice(0,-4);if(!i.has(D))i.set(D,I);let W=D.toLowerCase();if(!i.has(W))i.set(W,I);let L=X(D);if(!i.has(L))i.set(L,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)Yr.set(e,i);return i}function Ks(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=ze.join(r,"node_modules",e);try{if(en.statSync(i).isDirectory())return i}catch{}let a=ze.dirname(r);if(a===r)return null;r=a}}function Gs(e,n,r={}){return[ze.resolve(ze.dirname(n),`${e}.stx`),ze.resolve(ze.dirname(n),e),ze.resolve(r.componentsDir||"components",`${e}.stx`),ze.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function Qr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=X(n);return[n,r,i]}function _i(e,n){let[r,i,a]=Qr(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Ci(e,n){let r=n?ze.resolve(n):void 0,i=ze.dirname(ze.resolve(e));for(;;){if(en.existsSync(ze.join(i,"package.json")))return r&&i===r?void 0:i;let a=ze.dirname(i);if(a===i)return;i=a}}var Ka=["src/ui","src/components","components","dist"];function Qn(e,n){let r=ze.resolve(e);if(!n&&!r.split(ze.sep).includes("node_modules"))return[];let i=Ci(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(en.readFileSync(ze.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((x)=>typeof x==="string")}catch{}let l=a.length?a:Ka;return[ze.dirname(ze.resolve(e)),...l.map((u)=>ze.resolve(i,u))]}function*Ei(e,n,r={},i){let a=Qr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield ze.resolve(ze.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((x)=>`${x}.stx`))],u=r.projectRoot||process.cwd(),f=[...Qn(n,r.projectRoot),...i?.__originalFilePath?[ze.join(ze.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],ze.join(ze.dirname(n),"components"),ze.resolve(u,"src/components"),ze.resolve(u,"components"),...import.meta.dir?[ze.resolve(import.meta.dir,"components")]:[]];for(let x of new Set(f)){for(let v of l)yield ze.join(x,v);try{for(let v of en.readdirSync(x,{withFileTypes:!0}))if(v.isDirectory())for(let I of l)yield ze.join(x,v.name,I)}catch{}}}function ei(e,n,r={},i){let a=_i(e,i);if(a!==void 0)return a;for(let l of Ei(e,n,r,i))try{if(en.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Xs(e,n=[],r={}){let i=new Set([...e].map((v)=>v.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([v,I])=>[v.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),x=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!x)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((v)=>i.has(v)))return!1;if([...n].some((v)=>!["load","error"].includes(v.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((v)=>i.has(v))}import Ss from"fs";import fe from"path";import Dt from"path";import hn from"fs";var qa=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Ms(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return qa.has(e.toLowerCase())}var ti=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),ni={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},Za=new Set(["ctrl","alt","shift","meta"]),ii={left:0,middle:1,right:2};function si(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(Za.has(i))n.systemKeys.push(i);else if(i in ii)n.mouse=i;else if(i in ni||/^[a-z]$/.test(i))n.keys.push(ni[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function oi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,x]=l,v=l.index,I=v+u.length,D=`__stx_evt_${n}${i++}`,W=[],L=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,z;while((z=L.exec(x))!==null){let[,H,Z]=z,U=H.split("."),V=U[0];if(!ti.has(V))continue;W.push({attribute:`@${H}`,event:V,handler:Z,modifiers:si(U.slice(1)),elementId:D})}let N=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((z=N.exec(x))!==null){let[,H,Z]=z,U=H.split("."),V=U[0];if(!ti.has(V))continue;W.push({attribute:`@${H}`,event:V,handler:Z,modifiers:si(U.slice(1)),elementId:D})}if(W.length>0)r.push({originalTag:u,elementId:D,events:W,startIndex:v,endIndex:I})}return r}function Ja(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=ii[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function Xa(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Ds(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Ga(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Ja(e),a=Xa(Ds(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Ms(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
3
3
|
(function() {
|
|
4
4
|
var $el = document.getElementById('${r}');
|
|
5
5
|
if (!$el) return;
|
|
@@ -112,7 +112,7 @@ else {
|
|
|
112
112
|
`)}
|
|
113
113
|
})();
|
|
114
114
|
</script>`}function Ya(e,n=""){let r=oi(e,n);if(r.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=r.length-1;l>=0;l--){let u=r[l],f=u.originalTag;if(!f.includes(" id="))f=f.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${u.elementId}"`);else{let x=f.match(/id=["']([^"']+)["']/);if(x)for(let v of u.events)v.elementId=x[1]}for(let x of u.events){let v=x.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),I=new RegExp(`\\s*${v}\\s*=\\s*"[^"]*"`,"g"),D=new RegExp(`\\s*${v}\\s*=\\s*'[^']*'`,"g");f=f.replace(I,""),f=f.replace(D,"")}i=i.slice(0,u.startIndex)+f+i.slice(u.endIndex),a.push(...u.events)}return{template:i,bindings:a}}function ri(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function Qc(e,n,r){if(jl(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:f,bindings:x}=Ya(e,ri(n)),v=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...v,...x],f}let i=oi(e,ri(n));if(i.length===0)return e;let a=e;for(let f=i.length-1;f>=0;f--){let x=i[f],v=x.originalTag;if(!v.includes(" id="))v=v.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${x.elementId}"`);else{let I=v.match(/id=["']([^"']+)["']/);if(I)for(let D of x.events)D.elementId=I[1]}for(let I of x.events){let D=I.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),W=new RegExp(`\\s*${D}\\s*=\\s*"[^"]*"`,"g"),L=new RegExp(`\\s*${D}\\s*=\\s*'[^']*'`,"g");v=v.replace(W,""),v=v.replace(L,"")}a=a.slice(0,x.startIndex)+v+a.slice(x.endIndex)}let l=Ti(i.flatMap((f)=>f.events)),u=c(a);if(u!==-1)a=a.slice(0,u)+l+`
|
|
115
|
-
`+a.slice(u);else a+=l;return a}function ai(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function zt(e,n){let r=t(e),{depths:i,balanced:a}=C(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let x=(f.index??0)+f[0].length-f[1].length;if(l(x))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&ai(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&ai(f[1],!1).has(n))return!0;return!1}var Ve="0.2.
|
|
115
|
+
`+a.slice(u);else a+=l;return a}function ai(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function zt(e,n){let r=t(e),{depths:i,balanced:a}=C(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let x=(f.index??0)+f[0].length-f[1].length;if(l(x))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&ai(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&ai(f[1],!1).has(n))return!0;return!1}var Ve="0.2.882";var ci=Symbol.for(`stx.lazy-module-promises.${Ve}`);function ec(){let e=globalThis;return e[ci]??=new Map,e[ci]}function o(e,n){let r=ec(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var tc=/<\/(script)/gi;function ge(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(tc,"<\\/$1")}import li from"fs";var ui=[];function S(e){let n=new T(e);return ui.push(n),n}function el(){for(let e of ui)e.clear()}function _(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Pr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:li.statSync(r).mtimeMs})}catch{}return n}function Js(e){for(let n of e)try{if(li.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Ae=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var nc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function sc(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function rc(e,n){let r=n;while(!0){let i=Dt.join(r,"node_modules",e,"package.json");if(hn.existsSync(i))return Dt.dirname(i);let a=Dt.dirname(r);if(a===r)return null;r=a}}function ic(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function oc(e,n){let r=sc(e);if(!r||!r.subpath)return null;let i=rc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(hn.readFileSync(Dt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=ic(a.exports,l);if(!u)return null;let f=Dt.resolve(i,u);return hn.existsSync(f)?f:null}function Li(e,n){let r=n.filePath?Dt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(nc,(x,v)=>{let I;try{if(v.startsWith("./")||v.startsWith("../")||v.startsWith("/")){if(I=v.startsWith("/")?v:Dt.resolve(r,v),!hn.existsSync(I))throw Error(`file not found: ${I}`)}else{let D=null;try{D=Bun.resolveSync(v,i)}catch{D=oc(v,i)}if(!D)throw Error(`could not resolve ${v} (Bun.resolveSync + exports fallback both failed)`);I=D}}catch(D){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(v)} (from ${n.filePath||"<unknown>"}): ${D?.message||D}`),u.push(v),""}if(a.has(I))return"";a.add(I);try{let D=hn.readFileSync(I,"utf8");l.push({source:v,resolvedPath:I,contents:D})}catch(D){console.warn(`[stx:vendor-css] could not read ${I}: ${D?.message||D}`),u.push(v)}return""}),styles:l,unresolved:u}}function ac(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function ji(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${ac(n.source)}" data-stx-layer="vendor">
|
|
116
116
|
@layer vendor {
|
|
117
117
|
${n.contents}
|
|
118
118
|
}
|
|
@@ -182,7 +182,7 @@ else {
|
|
|
182
182
|
// STX: auto-generated event bindings
|
|
183
183
|
${e.map((r,i)=>bc(r,i)).join(`
|
|
184
184
|
`)}`}function gi(e){let n=[],r=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,u=0;while(u<l){let f=i[u];if(f==="'"||f==='"'||f==="`"){let x=f;if(u++,x==="`"){let v=0;while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]==="`"&&v===0){u++;break}if(i[u]==="$"&&i[u+1]==="{"){v++,u+=2;continue}if(i[u]==="}"&&v>0){v--,u++;continue}u++}}else while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]===x){u++;break}u++}continue}if(f==="/"&&i[u+1]==="/"){while(u<l&&i[u]!==`
|
|
185
|
-
`)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let x=i.slice(u),v=x.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(v){let W=v[1];if(!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W);u+=v[0].length;continue}let I=x.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((W)=>{let L=W.trim(),z=L.indexOf(":"),N=z>=0?L.slice(z+1).trim().split(/[\s=]/)[0]:L.split(/[\s=]/)[0];if(N&&!N.startsWith("_")&&!r.has(N))n.push(N),r.add(N)}),u+=I[0].length;continue}let D=x.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(D){let W=D[1];if(!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W);u+=D[0].length;continue}}u++}return n}var _c=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function wc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(W){let L;while((L=r.exec(W))!==null){let z=L[0];if(!_c.has(z))n.add(z)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let x=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=x.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=v.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let D=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=D.exec(e))!==null)i(l[1]);return n}async function Ke(e,n={}){let r=e,i="",a=!1,l=[],u=Li(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=ji(u.styles),x=Kt(r);r=x.code,l=[...x.imports,...x.models];let{hasUserImports:v,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
185
|
+
`)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let x=i.slice(u),v=x.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(v){let W=v[1];if(!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W);u+=v[0].length;continue}let I=x.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((W)=>{let L=W.trim(),z=L.indexOf(":"),N=z>=0?L.slice(z+1).trim().split(/[\s=]/)[0]:L.split(/[\s=]/)[0];if(N&&!N.startsWith("_")&&!r.has(N))n.push(N),r.add(N)}),u+=I[0].length;continue}let D=x.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(D){let W=D[1];if(!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W);u+=D[0].length;continue}}u++}return n}var _c=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function wc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(W){let L;while((L=r.exec(W))!==null){let z=L[0];if(!_c.has(z))n.add(z)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let x=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=x.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=v.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let D=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=D.exec(e))!==null)i(l[1]);return n}async function Ke(e,n={}){let r=e,i="",a=!1,l=[],u=Li(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=ji(u.styles),x=Kt(r);r=x.code,l=[...x.imports,...x.models];let{hasUserImports:v,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-9zc1cnw8.js"));if(v(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let V=bl(r);r=V.code,i=wl(V.stxImports,V.browserImports.filter((K)=>!l.includes(K)))}if(i=`${Rn(r,n.serverData)}${i}`,r=M(r),!a&&Ge(n.attrs||""))r=Xe(r);let D=yc(n.eventBindings||[]),W=(n.attrs||"").trim(),L=/\btype\s*=\s*["']module["']/i.test(W),z=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(L){let V=W.replace(/\btype\s*=\s*["']module["']/i,"").trim(),K=`type="module" data-stx-scoped${z}${V?` ${V}`:""}`;return`${f}<script ${K}>
|
|
186
186
|
${ge(`${i}${r}
|
|
187
187
|
${D}`)}
|
|
188
188
|
</script>`}let N=Qi(e),H=/function __stx_setup_/.test(r),Z=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function U(V){let K=V.length>0?`
|
|
@@ -1059,8 +1059,8 @@ ${v.join(`
|
|
|
1059
1059
|
`){let z=e[a];if(z==="\\"){a+=2;continue}if(z==="[")L=!0;else if(z==="]")L=!1;else if(z==="/"&&!L){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},W=()=>{if(i!==0)return;let L=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(L){let Z=L[2].split(",").map((U)=>{let V=U.trim().split(":");return V[V.length-1].trim()});for(let U of Z)if(U&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(U)&&!r.has(U))n.push(U),r.add(U);return}let z=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(z){let Z=z[2];if(!r.has(Z))n.push(Z),r.add(Z);return}let N=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let Z=N[1];if(!r.has(Z))n.push(Z),r.add(Z);return}let H=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let Z=H[1];if(!r.has(Z))n.push(Z),r.add(Z)}};while(a<l){if(x())continue;if(e[a]==="'"||e[a]==='"'){u(e[a]);continue}if(e[a]==="`"){f();continue}if(e[a]==="/"&&I()){D();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))W();a++}return n}function _p(e){let n=[],r=0,i=0,a=null;for(let l=0;l<e.length;l++){let u=e[l];if(a){if(u==="\\"){l++;continue}if(u===a)a=null;continue}if(u==='"'||u==="'"||u==="`"){a=u;continue}if(u==="("||u==="["||u==="{")r++;else if(u===")"||u==="]"||u==="}")r--;else if(u===","&&r===0)n.push(e.slice(i,l)),i=l+1}if(i<e.length)n.push(e.slice(i));return n}function wp(e){let n=0,r=null;for(let i=0;i<e.length;i++){let a=e[i];if(r){if(a==="\\"){i++;continue}if(a===r)r=null;continue}if(a==='"'||a==="'"||a==="`"){r=a;continue}if(a==="("||a==="["||a==="{")n++;else if(a===")"||a==="]"||a==="}")n--;else if(a==="="&&n===0){let l=e[i-1],u=e[i+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(u==="="||u===">")continue;return i}}return-1}function Sp(e,n){try{let r=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!r)return;let i=r.index-1;while(i>=0&&/\s/.test(e[i]))i--;if(e[i]!=="}")return;let a=i,l=0,u=-1;for(;i>=0;i--){let x=e[i];if(x==="}")l++;else if(x==="{"){if(l--,l===0){u=i;break}}}if(u===-1)return;let f=e.slice(u+1,a);for(let x of _p(f)){let v=x.trim();if(!v||v.startsWith("..."))continue;let I=wp(v);if(I===-1)continue;let D=v.slice(0,I).trim();if(!/^[A-Z_$][\w$]*$/i.test(D))continue;if(n[D]!==void 0)continue;let W=v.slice(I+1).trim();if(!W)continue;try{let L=Object.keys(n).filter(Xt),z=Function(...L,`"use strict"; return (${W});`);n[D]=z(...L.map((N)=>n[N]))}catch{}}}catch{}}var vp=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function Hg(e,n){let r=Ht(e),i=e.slice(r).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/);if(!i)return null;let a=i[1].toLowerCase();if(!vp.has(a))return null;let l=new RegExp(`<\\/?${a}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),u=w(e,(I,D)=>(l.lastIndex=D,l.exec(I)?.index===D?l.lastIndex:-1));if(a==="span"&&/\sdata-stx-scope\s*=/.test(u[0]?.token||""))return null;let f=0,x=!1;for(let I of u){if(f+=I.token.startsWith("</")?-1:1,f<0)return null;if(f===0){if(e.slice(I.end).trim())return null;x=!0;break}}if(!x)return null;let v=r+i[0].length;return e.slice(0,v)+n+e.slice(v)}function Ra(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=fe.relative(fe.resolve(i),fe.resolve(e));return!a.startsWith("..")&&!fe.isAbsolute(a)})}async function jr(e,n,r,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,u=(ae)=>ae.split("-").map((de)=>de.charAt(0).toUpperCase()+de.slice(1)).join(""),f=r.__importedComponents;if(f){for(let ae of[l,l.toLowerCase(),u(l),X(l)])if(f.has(ae))return!0}let x=[...new Set([`${l}.stx`,`${u(l)}.stx`,`${X(l)}.stx`])],v=typeof a.root==="string"?fe.resolve(a.root):void 0,I=v??fe.dirname(i),D=[],W=(ae)=>{if(ae&&!D.includes(ae))D.push(ae)};for(let ae of Qn(i,v))W(ae);let L=r.__originalFilePath;if(L)W(fe.join(fe.dirname(L),"components"));if(Ra(n,a))W(a._rootComponentsDir);W(n),W(a._rootComponentsDir),W(fe.join(fe.dirname(i),"components")),W(a.componentsDir);for(let ae of a.additionalComponentsDirs??[])W(ae);let z=a._targetComponentFallbackNames?.some((ae)=>ae.toLowerCase()===l.toLowerCase());if(!z)for(let ae of a._targetComponentDirs??[])W(ae);if(v)W(fe.resolve(v,"resources/views/components")),W(fe.resolve(v,"resources/components")),W(fe.resolve(v,"src/components")),W(fe.resolve(v,"components"));for(let ae of a._layerComponentDirs??[])W(ae);let N=a._pluginComponentDirs;if(Array.isArray(N))for(let ae of N)W(typeof ae==="string"?ae:null);if(W(a.fallbackComponentsDir),z)for(let ae of a._targetComponentDirs??[])W(ae);let H=a._nativePrimitivesFallback;if(H&&!H.except.some((ae)=>ae.toLowerCase()===l.toLowerCase()))W(H.dir);if(l.startsWith("./")||l.startsWith("../"))return s(fe.resolve(fe.dirname(i),`${l}.stx`));let Z=_a(fe.resolve(import.meta.dir,"components")),U=D.map((ae)=>fe.isAbsolute(ae)?ae:fe.resolve(I,ae)),V=`${x.join("\x00")}\x00\x00${U.join("\x00")}`,K=Er.get(V);if(K!==void 0)return K;let ne=!1;e:for(let ae of U){if(_a(ae)===Z)continue;for(let de of x)if(await s(fe.join(ae,de))){ne=!0;break e}}return Er.set(V,ne),ne}function _a(e){let n=kr.get(e);if(n!==void 0)return n;let r=e;try{r=Ss.realpathSync(e)}catch{}return kr.set(e,r),r}function Vg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function vl(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function $p(e,n,r){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let u;try{u=O(a,n)}catch{return l}if(u===void 0||u===null)return"";let f=String(u);if(/<\/style/i.test(f))return console.warn(`[stx] a <style> expression in ${r??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return f};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var wa=new Set;function Sa(e,n,r,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&wa.has(a))return;wa.add(a);let l=n?` used in ${n}`:"",u=i?` Cause: ${i}.`:"",f=r.length>0?`
|
|
1060
1060
|
searched:
|
|
1061
1061
|
${r.map((x)=>` - ${x}`).join(`
|
|
1062
|
-
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function va(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Ep=new Set(["for","if","show","key","ref","class","className","style"]),$a=new Set,Aa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",xl=new RegExp(`\\b(?:${Aa})\\s*(?:<[^>]*>)?\\s*\\(`);function Bi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Aa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Je(e,n,r,i,a,l,u,f=new Set,x,v=gt(a),I,D=e){let{extractVariables:W}=await o("stx/variable-extractor",()=>import("./chunk-vm42j29z.js")),L=f??new Set;if(L.has(e))return`[Circular component reference: ${e}]`;let z=new Set(L);z.add(e);let N=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let H=N&&N!=="load"&&Vg(N)?N:"";try{let Z=(le)=>le.split("-").map((be)=>be.charAt(0).toUpperCase()+be.slice(1)).join(""),U=D.endsWith(".stx")?D.slice(0,-4):D,V=null,K=a.__importedComponents;if(K){let le=[U,U.toLowerCase(),Z(U),X(U)];for(let be of le)if(K.has(be)){V=K.get(be);break}}let ne=[];if(!V){let le=[`${U}.stx`,`${Z(U)}.stx`,`${X(U)}.stx`],be=[...new Set(le)],Ne=a.__originalFilePath,we=[];for(let ve of Qn(l))if(!we.includes(ve))we.push(ve);let ot=we.length;for(let ve of u._layerComponentDirs??[])if(!we.includes(ve))we.push(ve);if(Ne){let ve=fe.join(fe.dirname(Ne),"components");we.push(ve)}let Fe=u._rootComponentsDir;if(typeof Fe==="string"&&Ra(i,u)&&!we.includes(Fe))we.push(Fe);if(i&&!we.includes(i))we.push(i);if(typeof Fe==="string"&&!we.includes(Fe))we.push(Fe);let Ct=fe.join(fe.dirname(l),"components");if(!we.includes(Ct))we.push(Ct);if(u.componentsDir&&u.componentsDir!==i&&!we.includes(u.componentsDir))we.push(u.componentsDir);for(let ve of u.additionalComponentsDirs??[])if(ve&&!we.includes(ve))we.push(ve);let Zt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(U),It=(I?.events??[]).map((ve)=>ve.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Vn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Rs=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),As=!It.includes("valuechange")&&(Vn||It.includes("change")&&!Rs),jt=u._nativeHostAttrs&&/^textinput$/i.test(U),Jt=It.includes("update:value")&&!It.includes("input"),mn=u._nativeHostAttrs&&/^video$/i.test(U),Ts=u._nativeHostAttrs&&/^image$/i.test(U),Un=Xs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),Gt=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Hn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Kn=mn&&(Gt||Hn)&&(I?.events??[]).every((ve)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ve.replace(/^@/,"").split(".")[0])),qn=new Set(["","primary","secondary","outline","ghost","danger"]),Zn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",Jn=u._nativeHostAttrs&&/^button$/i.test(U)&&!qn.has(Zn),Fr=u._targetComponentFallbackNames?.some((ve)=>ve.toLowerCase()===U.toLowerCase())??!1,Is=Fr&&(!Zt||As)&&(!jt||Jt)&&(!mn||Kn)&&(!Ts||Un)&&!Jn;for(let ve of Is?[]:u._targetComponentDirs??[])if(ve&&!we.includes(ve))we.push(ve);let Yt=typeof u.root==="string"?fe.resolve(u.root):void 0,Vr=Yt??fe.dirname(l),Qt=[];if(Yt)Qt.push(fe.resolve(Yt,"resources/views/components")),Qt.push(fe.resolve(Yt,"resources/components")),Qt.push(fe.resolve(Yt,"src/components")),Qt.push(fe.resolve(Yt,"components"));Qt.push(fe.resolve(import.meta.dir,"components"));for(let ve of Qt)if(!we.includes(ve))we.push(ve);if(Fr){let ve=(u._componentPackageDirs??[]).filter((ft)=>typeof ft==="string"&&ft.length>0),Rt=(Is?ve.length?ve:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((ft)=>typeof ft==="string"&&ft.length>0);if(Rt.length){let ft=we.slice(ot).map((lt)=>fe.isAbsolute(lt)?lt:fe.resolve(Vr,lt)).filter((lt)=>!Rt.includes(lt)),Gn=`${U}\x00${ft.join("\x00")}`,_t=$r.get(Gn);if(_t===void 0){_t=!1;for(let lt of ft){for(let Mt of be)if(await s(fe.join(lt,Mt))){_t=!0;break}if(_t)break}$r.set(Gn,_t)}if(!_t){for(let lt of Rt){let Mt=we.indexOf(lt);if(Mt>=0)we.splice(Mt,1)}we.splice(ot,0,...Rt)}}}let Ur=u._pluginComponentDirs;if(Array.isArray(Ur)){for(let ve of Ur)if(typeof ve==="string"&&!we.includes(ve))we.push(ve)}if(u.fallbackComponentsDir&&!we.includes(u.fallbackComponentsDir))we.push(u.fallbackComponentsDir);if(Is){for(let ve of u._targetComponentDirs??[])if(ve&&!we.includes(ve))we.push(ve)}let Xn=u._nativePrimitivesFallback;if(Xn&&!Xn.except.some((ve)=>ve.toLowerCase()===U.toLowerCase())&&!we.includes(Xn.dir))we.push(Xn.dir);let Hr=[...new Set(we.map((ve)=>{if(!ve)return ve;return fe.isAbsolute(ve)?ve:fe.resolve(Vr,ve)}))];we.length=0,we.push(...Hr);let Ps=`${U}\x00${l}\x00${Hr.join("\x00")}`,Os=_s.get(Ps);if(Os)if(await s(Os))V=Os;else _s.delete(Ps);if(!V&&(U.startsWith("./")||U.startsWith("../")))V=fe.resolve(fe.dirname(l),`${U}.stx`),ne.push(V);else if(!V)for(let ve of we){if(!ve)continue;for(let Rt of be){let ft=fe.join(ve,Rt);if(ne.push(ft),await s(ft)){V=ft;break}}if(V)break;if(!V)try{let Rt=await import("fs");if(!Rt.statSync(ve,{throwIfNoEntry:!1})?.isDirectory())continue;let Gn=8,_t=[{path:ve,depth:0}];while(_t.length>0&&!V){let lt=_t.pop();if(lt.depth>=Gn)continue;let Mt;try{Mt=Rt.readdirSync(lt.path,{withFileTypes:!0})}catch{continue}for(let Yn of Mt){if(!Yn.isDirectory())continue;if(Yn.name==="node_modules"||Yn.name.startsWith("."))continue;let Zr=fe.join(lt.path,Yn.name);for(let Va of be){let js=fe.join(Zr,Va);if(ne.push(js),await s(js)){V=js;break}}if(V)break;_t.push({path:Zr,depth:lt.depth+1})}}}catch{}if(V)break}if(V)_s.set(Ps,V)}if(!V||!await s(V))return Sa(e,l,ne),va(e);x.add(V);let ae;if(Dn.has(V)&&vr.get(V)===xa(V))ae=Dn.get(V);else try{let le=xa(V);ae=await Bun.file(V).text(),Dn.set(V,ae),vr.set(V,le)}catch(le){let be=le instanceof Error?le.message:String(le);return Sa(e,l,[V],be),va(e)}if(I)for(let le of new Set([...Object.keys(n),...I.reactiveProps??[]])){let be=le.toLowerCase();if(be.startsWith("aria-")||be.startsWith("data-"))continue;let Ne=le.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Ne}\\b`).test(ae))I.declaredProps.add(le);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Ne}\\b|\\[\\s*['"]${Ne}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Ne}['"]`).test(ae))I.consumedProps?.add(le)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ae))for(let le of I.reactiveProps){if(Ep.has(le)||I.consumedProps?.has(le))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${le.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ae))continue;let be=`${V}\x00${le}`;if($a.has(be))continue;$a.add(be),console.warn(`[stx] ${fe.basename(V)} reads \`${le}\` with defineProps(), which is not live, but ${fe.basename(l)} binds it (:${le}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${le}').`)}let de=new Set(["__originalFilePath","__importedComponents",rs,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),pe={};for(let[le,be]of Object.entries(a))if(!le.startsWith("__")||de.has(le))pe[le]=be;let Ee=v.length>0?{[us]:[...v]}:{},Ce=r;if(r.includes("@include")){let{processIncludes:le}=await o("stx/includes",()=>import("./chunk-2haf7t5h.js"));Ce=await le(r,a,l,u,x)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ce)){let{processComponents:le}=await o("stx/component-renderer",()=>import("./chunk-1r612xxs.js")),be={...a,__processedComponents:L,...Ee};Ce=await le(Ce,be,l,u,x);let Ne=be.__stx_preserved_client_expressions;if(Array.isArray(Ne)&&Ne.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Ne])]}let $e=[];if(vl(Ce)){let{processExpressions:le}=await o("stx/expressions",()=>import("./chunk-qxcc0aar.js")),be=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ee}:v.length>0?{...a,...Ee}:a;Ce=le(Ce,be,l);for(let Ne of Ce.matchAll(/\{\{([\s\S]*?)\}\}/g))$e.push(Ne[1].trim())}let ye=re(Ce),He=[],tt=ye.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(le,be)=>{let Ne=ye.scripts[Number(be)]||"",we=Ne.match(/^<script\b([^>]*)>/i)?.[1]||"",ot=we.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Fe=!ot||["module","text/javascript","application/javascript"].includes(ot),Ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${we}`);if(!/\bserver\b/i.test(we)&&Fe&&!Ct)return He.push(Ne),"";return Ne}),{extractSlotContent:ct}=await o("stx/slots",()=>import("./chunk-a5gnxdfe.js")),nt=ct(tt),ht={};if(nt.defaultSlot?.trim())ht.default=nt.defaultSlot;for(let[le,be]of nt.namedSlots)ht[le]=be.content;let ut=a.__stx_scope_seq??={n:0,key:oo(String(a.__filename??l))},st=Ca(e,process.cwd()),je=`stx_${(st.endsWith(".stx")?st.slice(0,-4):st).replace(/[^a-zA-Z0-9]/g,"_")}_${++ut.n}_${ut.key}`,Te={...pe,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:tt,$slots:ht,__processedComponents:z,__sections:{},__stx_signals_gate:Oe(ae)||vl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...$e]};if(/import\s/.test(ae)){Te.__importedComponents=new Map(Te.__importedComponents);let{processESImports:le}=await o("stx/component-renderer",()=>import("./chunk-1r612xxs.js"));ae=await le(ae,Te,V,u,x)}Sp(ae,Te);let pt=ae,et=j(pt);if(et)pt=et.content.trim();let an=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,At=[...ae.matchAll(an)];for(let[,le,be]of At)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(le))Ue(be,V,u.strict);let xt=[],cn=null,$s=At.some((le)=>/\bserver\b/.test(le[1]||"")&&/\bcache\b/.test(le[1]||"")),Ft=null,vt=null,ln=null,zn=0,un=null;if(mp(u),$s&&Cr>0){let le=hp({props:n,slot:Ce,slotContext:r.trim()?xp(pe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...v].sort(),layers:u._layerGraph?.layers.map((be)=>be.configFile),uid:je});if(le!==null){Ft=`${V}\x00${_(ae)}\x00${le}`;let be=ws.get(Ft);if(be){for(let Ne of be.dependencies)x.add(Ne);if(vi(a,be.clientFactories),ut.n+=be.uidsConsumed,be.preservedClientExpressions.length>0){let Ne=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let we of be.preservedClientExpressions)Ne.add(we);a.__stx_preserved_client_expressions=[...Ne]}return be.output}vt=new Set(x),ln=wi(a),zn=ut.n,un=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let pn=new Set;for(let le of At){let be=le[1]||"",Ne=le[2]||"",we=be.includes("server");if(Ge(be)&&Ne.trim())Ne=Xe(Ne);if(we&&Ne){for(let Fe of he(Ne))pn.add(Fe);try{await W(Ne,Te,V,{onFailure:(Fe)=>{if(Fe.kind!=="unknown")cn=Fe.kind}})}catch(Fe){}}if(!we){let Fe=Ne.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ct=Fe.includes("{{")&&Fe.includes("}}"),Zt=Fe.includes("{!!")&&Fe.includes("!!}");if(Ct||Zt)Fe=zi(Fe,Te,V);let It=be.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");xt.push(`<script${It}>${Fe}</script>`)}}let bt=re(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),fn=bt?bt[1]:"",Es=bt?bt[2]:"",$t="",ce=fn&&/\bscoped\b/i.test(fn);if(bt)$t=`<style${fn}>${$p(Es,Te,V)}</style>`;let ue=pt;if(ue=ue.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),bt)ue=ue.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let le=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,be=[];if(ue=ue.replace(le,(Ne,we)=>{let ot=we.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(ot)be.push(`<style${ot[1]}>${ot[2]}</style>`);return""}),ue=ue.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),be.length>0)$t=`${$t}${be.join(`
|
|
1063
|
-
`)}`}if(r&&ue.includes("{{ text || slot }}"))ue=ue.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:_e}=await o("stx/slots",()=>import("./chunk-
|
|
1062
|
+
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function va(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Ep=new Set(["for","if","show","key","ref","class","className","style"]),$a=new Set,Aa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",xl=new RegExp(`\\b(?:${Aa})\\s*(?:<[^>]*>)?\\s*\\(`);function Bi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Aa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Je(e,n,r,i,a,l,u,f=new Set,x,v=gt(a),I,D=e){let{extractVariables:W}=await o("stx/variable-extractor",()=>import("./chunk-v65efeh1.js")),L=f??new Set;if(L.has(e))return`[Circular component reference: ${e}]`;let z=new Set(L);z.add(e);let N=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let H=N&&N!=="load"&&Vg(N)?N:"";try{let Z=(le)=>le.split("-").map((be)=>be.charAt(0).toUpperCase()+be.slice(1)).join(""),U=D.endsWith(".stx")?D.slice(0,-4):D,V=null,K=a.__importedComponents;if(K){let le=[U,U.toLowerCase(),Z(U),X(U)];for(let be of le)if(K.has(be)){V=K.get(be);break}}let ne=[];if(!V){let le=[`${U}.stx`,`${Z(U)}.stx`,`${X(U)}.stx`],be=[...new Set(le)],Ne=a.__originalFilePath,we=[];for(let ve of Qn(l))if(!we.includes(ve))we.push(ve);let ot=we.length;for(let ve of u._layerComponentDirs??[])if(!we.includes(ve))we.push(ve);if(Ne){let ve=fe.join(fe.dirname(Ne),"components");we.push(ve)}let Fe=u._rootComponentsDir;if(typeof Fe==="string"&&Ra(i,u)&&!we.includes(Fe))we.push(Fe);if(i&&!we.includes(i))we.push(i);if(typeof Fe==="string"&&!we.includes(Fe))we.push(Fe);let Ct=fe.join(fe.dirname(l),"components");if(!we.includes(Ct))we.push(Ct);if(u.componentsDir&&u.componentsDir!==i&&!we.includes(u.componentsDir))we.push(u.componentsDir);for(let ve of u.additionalComponentsDirs??[])if(ve&&!we.includes(ve))we.push(ve);let Zt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(U),It=(I?.events??[]).map((ve)=>ve.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Vn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Rs=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),As=!It.includes("valuechange")&&(Vn||It.includes("change")&&!Rs),jt=u._nativeHostAttrs&&/^textinput$/i.test(U),Jt=It.includes("update:value")&&!It.includes("input"),mn=u._nativeHostAttrs&&/^video$/i.test(U),Ts=u._nativeHostAttrs&&/^image$/i.test(U),Un=Xs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),Gt=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Hn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Kn=mn&&(Gt||Hn)&&(I?.events??[]).every((ve)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ve.replace(/^@/,"").split(".")[0])),qn=new Set(["","primary","secondary","outline","ghost","danger"]),Zn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",Jn=u._nativeHostAttrs&&/^button$/i.test(U)&&!qn.has(Zn),Fr=u._targetComponentFallbackNames?.some((ve)=>ve.toLowerCase()===U.toLowerCase())??!1,Is=Fr&&(!Zt||As)&&(!jt||Jt)&&(!mn||Kn)&&(!Ts||Un)&&!Jn;for(let ve of Is?[]:u._targetComponentDirs??[])if(ve&&!we.includes(ve))we.push(ve);let Yt=typeof u.root==="string"?fe.resolve(u.root):void 0,Vr=Yt??fe.dirname(l),Qt=[];if(Yt)Qt.push(fe.resolve(Yt,"resources/views/components")),Qt.push(fe.resolve(Yt,"resources/components")),Qt.push(fe.resolve(Yt,"src/components")),Qt.push(fe.resolve(Yt,"components"));Qt.push(fe.resolve(import.meta.dir,"components"));for(let ve of Qt)if(!we.includes(ve))we.push(ve);if(Fr){let ve=(u._componentPackageDirs??[]).filter((ft)=>typeof ft==="string"&&ft.length>0),Rt=(Is?ve.length?ve:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((ft)=>typeof ft==="string"&&ft.length>0);if(Rt.length){let ft=we.slice(ot).map((lt)=>fe.isAbsolute(lt)?lt:fe.resolve(Vr,lt)).filter((lt)=>!Rt.includes(lt)),Gn=`${U}\x00${ft.join("\x00")}`,_t=$r.get(Gn);if(_t===void 0){_t=!1;for(let lt of ft){for(let Mt of be)if(await s(fe.join(lt,Mt))){_t=!0;break}if(_t)break}$r.set(Gn,_t)}if(!_t){for(let lt of Rt){let Mt=we.indexOf(lt);if(Mt>=0)we.splice(Mt,1)}we.splice(ot,0,...Rt)}}}let Ur=u._pluginComponentDirs;if(Array.isArray(Ur)){for(let ve of Ur)if(typeof ve==="string"&&!we.includes(ve))we.push(ve)}if(u.fallbackComponentsDir&&!we.includes(u.fallbackComponentsDir))we.push(u.fallbackComponentsDir);if(Is){for(let ve of u._targetComponentDirs??[])if(ve&&!we.includes(ve))we.push(ve)}let Xn=u._nativePrimitivesFallback;if(Xn&&!Xn.except.some((ve)=>ve.toLowerCase()===U.toLowerCase())&&!we.includes(Xn.dir))we.push(Xn.dir);let Hr=[...new Set(we.map((ve)=>{if(!ve)return ve;return fe.isAbsolute(ve)?ve:fe.resolve(Vr,ve)}))];we.length=0,we.push(...Hr);let Ps=`${U}\x00${l}\x00${Hr.join("\x00")}`,Os=_s.get(Ps);if(Os)if(await s(Os))V=Os;else _s.delete(Ps);if(!V&&(U.startsWith("./")||U.startsWith("../")))V=fe.resolve(fe.dirname(l),`${U}.stx`),ne.push(V);else if(!V)for(let ve of we){if(!ve)continue;for(let Rt of be){let ft=fe.join(ve,Rt);if(ne.push(ft),await s(ft)){V=ft;break}}if(V)break;if(!V)try{let Rt=await import("fs");if(!Rt.statSync(ve,{throwIfNoEntry:!1})?.isDirectory())continue;let Gn=8,_t=[{path:ve,depth:0}];while(_t.length>0&&!V){let lt=_t.pop();if(lt.depth>=Gn)continue;let Mt;try{Mt=Rt.readdirSync(lt.path,{withFileTypes:!0})}catch{continue}for(let Yn of Mt){if(!Yn.isDirectory())continue;if(Yn.name==="node_modules"||Yn.name.startsWith("."))continue;let Zr=fe.join(lt.path,Yn.name);for(let Va of be){let js=fe.join(Zr,Va);if(ne.push(js),await s(js)){V=js;break}}if(V)break;_t.push({path:Zr,depth:lt.depth+1})}}}catch{}if(V)break}if(V)_s.set(Ps,V)}if(!V||!await s(V))return Sa(e,l,ne),va(e);x.add(V);let ae;if(Dn.has(V)&&vr.get(V)===xa(V))ae=Dn.get(V);else try{let le=xa(V);ae=await Bun.file(V).text(),Dn.set(V,ae),vr.set(V,le)}catch(le){let be=le instanceof Error?le.message:String(le);return Sa(e,l,[V],be),va(e)}if(I)for(let le of new Set([...Object.keys(n),...I.reactiveProps??[]])){let be=le.toLowerCase();if(be.startsWith("aria-")||be.startsWith("data-"))continue;let Ne=le.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Ne}\\b`).test(ae))I.declaredProps.add(le);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Ne}\\b|\\[\\s*['"]${Ne}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Ne}['"]`).test(ae))I.consumedProps?.add(le)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ae))for(let le of I.reactiveProps){if(Ep.has(le)||I.consumedProps?.has(le))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${le.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ae))continue;let be=`${V}\x00${le}`;if($a.has(be))continue;$a.add(be),console.warn(`[stx] ${fe.basename(V)} reads \`${le}\` with defineProps(), which is not live, but ${fe.basename(l)} binds it (:${le}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${le}').`)}let de=new Set(["__originalFilePath","__importedComponents",rs,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),pe={};for(let[le,be]of Object.entries(a))if(!le.startsWith("__")||de.has(le))pe[le]=be;let Ee=v.length>0?{[us]:[...v]}:{},Ce=r;if(r.includes("@include")){let{processIncludes:le}=await o("stx/includes",()=>import("./chunk-5v93fj91.js"));Ce=await le(r,a,l,u,x)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ce)){let{processComponents:le}=await o("stx/component-renderer",()=>import("./chunk-nghybhas.js")),be={...a,__processedComponents:L,...Ee};Ce=await le(Ce,be,l,u,x);let Ne=be.__stx_preserved_client_expressions;if(Array.isArray(Ne)&&Ne.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Ne])]}let $e=[];if(vl(Ce)){let{processExpressions:le}=await o("stx/expressions",()=>import("./chunk-j58b7xen.js")),be=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ee}:v.length>0?{...a,...Ee}:a;Ce=le(Ce,be,l);for(let Ne of Ce.matchAll(/\{\{([\s\S]*?)\}\}/g))$e.push(Ne[1].trim())}let ye=re(Ce),He=[],tt=ye.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(le,be)=>{let Ne=ye.scripts[Number(be)]||"",we=Ne.match(/^<script\b([^>]*)>/i)?.[1]||"",ot=we.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Fe=!ot||["module","text/javascript","application/javascript"].includes(ot),Ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${we}`);if(!/\bserver\b/i.test(we)&&Fe&&!Ct)return He.push(Ne),"";return Ne}),{extractSlotContent:ct}=await o("stx/slots",()=>import("./chunk-6vr0yfbt.js")),nt=ct(tt),ht={};if(nt.defaultSlot?.trim())ht.default=nt.defaultSlot;for(let[le,be]of nt.namedSlots)ht[le]=be.content;let ut=a.__stx_scope_seq??={n:0,key:oo(String(a.__filename??l))},st=Ca(e,process.cwd()),je=`stx_${(st.endsWith(".stx")?st.slice(0,-4):st).replace(/[^a-zA-Z0-9]/g,"_")}_${++ut.n}_${ut.key}`,Te={...pe,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:tt,$slots:ht,__processedComponents:z,__sections:{},__stx_signals_gate:Oe(ae)||vl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...$e]};if(/import\s/.test(ae)){Te.__importedComponents=new Map(Te.__importedComponents);let{processESImports:le}=await o("stx/component-renderer",()=>import("./chunk-nghybhas.js"));ae=await le(ae,Te,V,u,x)}Sp(ae,Te);let pt=ae,et=j(pt);if(et)pt=et.content.trim();let an=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,At=[...ae.matchAll(an)];for(let[,le,be]of At)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(le))Ue(be,V,u.strict);let xt=[],cn=null,$s=At.some((le)=>/\bserver\b/.test(le[1]||"")&&/\bcache\b/.test(le[1]||"")),Ft=null,vt=null,ln=null,zn=0,un=null;if(mp(u),$s&&Cr>0){let le=hp({props:n,slot:Ce,slotContext:r.trim()?xp(pe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...v].sort(),layers:u._layerGraph?.layers.map((be)=>be.configFile),uid:je});if(le!==null){Ft=`${V}\x00${_(ae)}\x00${le}`;let be=ws.get(Ft);if(be){for(let Ne of be.dependencies)x.add(Ne);if(vi(a,be.clientFactories),ut.n+=be.uidsConsumed,be.preservedClientExpressions.length>0){let Ne=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let we of be.preservedClientExpressions)Ne.add(we);a.__stx_preserved_client_expressions=[...Ne]}return be.output}vt=new Set(x),ln=wi(a),zn=ut.n,un=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let pn=new Set;for(let le of At){let be=le[1]||"",Ne=le[2]||"",we=be.includes("server");if(Ge(be)&&Ne.trim())Ne=Xe(Ne);if(we&&Ne){for(let Fe of he(Ne))pn.add(Fe);try{await W(Ne,Te,V,{onFailure:(Fe)=>{if(Fe.kind!=="unknown")cn=Fe.kind}})}catch(Fe){}}if(!we){let Fe=Ne.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ct=Fe.includes("{{")&&Fe.includes("}}"),Zt=Fe.includes("{!!")&&Fe.includes("!!}");if(Ct||Zt)Fe=zi(Fe,Te,V);let It=be.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");xt.push(`<script${It}>${Fe}</script>`)}}let bt=re(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),fn=bt?bt[1]:"",Es=bt?bt[2]:"",$t="",ce=fn&&/\bscoped\b/i.test(fn);if(bt)$t=`<style${fn}>${$p(Es,Te,V)}</style>`;let ue=pt;if(ue=ue.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),bt)ue=ue.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let le=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,be=[];if(ue=ue.replace(le,(Ne,we)=>{let ot=we.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(ot)be.push(`<style${ot[1]}>${ot[2]}</style>`);return""}),ue=ue.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),be.length>0)$t=`${$t}${be.join(`
|
|
1063
|
+
`)}`}if(r&&ue.includes("{{ text || slot }}"))ue=ue.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:_e}=await o("stx/slots",()=>import("./chunk-6vr0yfbt.js")),{defaultSlot:Le,namedSlots:Ze}=nt,rt=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(tt),yt=xt.length>0&&or(ue)||u._nativeHostAttrs===!0&&xt.length>0||rt&&xt.length>0||xt.some((le)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(le)),ks=(le)=>yt?Mo(le,je):le,Cs=new Map([...Ze].map(([le,be])=>[le,{...be,content:ks(be.content)}]));ue=await _e(ue,yt?jo(ks(Le),je):Le,Cs,Te,yt?je:"");let Bn=Bi(xt),dn=(Array.isArray(Te.__stx_client_signal_names)?Te.__stx_client_signal_names:[]).filter((le)=>!pn.has(le));if(Bn.length>0||dn.length>0)Te.__stx_client_signal_names=[...new Set([...dn,...Bn])];else delete Te.__stx_client_signal_names;let gn=v.filter((le)=>!pn.has(le)&&!(le in n));if(gn.length>0)Te[us]=gn;let Wn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:fe.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||yt||xt.length===0,defaultLayout:void 0};Te.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:Fn}=await o("stx/process",()=>import("./chunk-twewtvyt.js")),Et=await Fn(ue,Te,V,Wn,x),Tt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let le of Et.matchAll(/\{\{([\s\S]*?)\}\}/g))Tt.add(le[1].trim());if(Tt.size>0)a.__stx_preserved_client_expressions=[...Tt];let kt=je,it=Et;if(yt){let le="";if(Object.keys(n).length>0)try{le=` data-stx-props="${wr(JSON.stringify(n))}"`}catch{}let be=H?` stx-hydrate="${wr(H)}"`:"",Ne=Object.fromEntries(Object.entries(ht).map(([jt,Jt])=>[jt,Boolean(Jt)])),we=Object.keys(Ne).length>0?` data-stx-slots="${wr(JSON.stringify(Ne))}"`:"",ot=` data-stx-scope="${kt}"${le}${we}${be}`,Fe=Et.slice(Ht(Et)),Ct=/^<span(?=[\s/>])/i.test(Fe),Zt=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Fe),It=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Fe),Vn=Ct?"span":"div",Rs=Zt&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':It&&u._nativeHostAttrs?' style="width:100%;height:100%"':Ct||Zt?' style="display:contents"':"";it=Hg(Et,ot)??`<${Vn}${ot} data-stx-component-wrapper${Rs}>${Et}</${Vn}>`;let As=await Promise.all(xt.map(async(jt)=>{let Jt=jt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!Jt)return jt;let[,mn,Ts]=Jt,Un=ha(jt,Te,V);if(Un!==null)return Un;let Gt=await Cp(Ts,V,u.buildMode==="compile"),Hn=Rn(Gt.clientCode,qe(Te)),{vendorStyleTags:Kn}=Gt,qn=Hn?`function(__scopeId) {
|
|
1064
1064
|
${Hn}
|
|
1065
1065
|
return (${Gt.factoryBody})(__scopeId);
|
|
1066
1066
|
}`:Gt.factoryBody,Zn=H?null:Hs(a,qn),Jn=Zn?`window.__stxComponentFactories[${JSON.stringify(Zn)}](${JSON.stringify(kt)});`:`(${qn})(${JSON.stringify(kt)});`;if(H)return`${Kn}<script type="stx/island" data-stx-island="${kt}" data-stx-scoped data-stx-owner="${kt}"${mn}>${ge(Jn)}</script>`;return`${Kn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${kt}"${mn}>${ge(Jn)}</script>`}));if(it=it+`
|
|
@@ -1086,7 +1086,7 @@ ${Be.yellow}${Be.bold}Message:${Be.reset} ${n}
|
|
|
1086
1086
|
`,f)I+=`
|
|
1087
1087
|
${Be.blue}${Be.bold}Context:${Be.reset}
|
|
1088
1088
|
${Be.dim}${f}${Be.reset}
|
|
1089
|
-
`;return I}function ke(){Dn.clear(),vr.clear(),_s.clear(),$r.clear(),Er.clear(),kr.clear(),ws.clear()}function Ey(){return{size:Dn.size,maxSize:500}}var Sr=S(128);async function Cp(e,n,r){let i=_(e,n,r),a=Sr.get(i);if(a){if(Js(a.deps))return a;Sr.delete(i)}let l=Li(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=ji(l.styles);u=Kt(u).code;let{hasUserImports:x,bundleClientScript:v}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
1089
|
+
`;return I}function ke(){Dn.clear(),vr.clear(),_s.clear(),$r.clear(),Er.clear(),kr.clear(),ws.clear()}function Ey(){return{size:Dn.size,maxSize:500}}var Sr=S(128);async function Cp(e,n,r){let i=_(e,n,r),a=Sr.get(i);if(a){if(Js(a.deps))return a;Sr.delete(i)}let l=Li(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=ji(l.styles);u=Kt(u).code;let{hasUserImports:x,bundleClientScript:v}=await o("stx/client-script-bundler",()=>import("./chunk-9zc1cnw8.js")),I=[],D=!1;if(x(u)){let U=u;u=await v(U,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),D=u===U}let{stripStxRuntimeImports:W}=await o("stx/signal-processing",()=>import("./chunk-678nhepd.js"));u=W(u);let L=M(u),z=yp(L),N=new Set(G(L,!0).split(",").map((U)=>U.trim())),H=`function(__scopeId) {
|
|
1090
1090
|
${wt("const",[...Ll,...z],L)}
|
|
1091
1091
|
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
1092
1092
|
const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-00tq7ghn.js";import"./chunk-hxhmhw23.js";import"./chunk-s29hp1qw.js";import"./chunk-a60ztvnp.js";import{S,_,A,oe}from"./chunk-
|
|
2
|
+
import"./chunk-00tq7ghn.js";import"./chunk-hxhmhw23.js";import"./chunk-s29hp1qw.js";import"./chunk-a60ztvnp.js";import{S,_,A,oe}from"./chunk-3jndqseh.js";import"./chunk-295bykzd.js";import"./chunk-6t04tqvh.js";import"./chunk-c3413bgh.js";import{br}from"./chunk-7mcs59pr.js";import{existsSync as C}from"fs";import l 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","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","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","useVirtualList","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var u=new Map,h=S(64),w=new Set,v=0,E=new Set(b);function z(){u.clear(),h.clear()}function R(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function P(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function I(s){if(!s)return[];let o=_(s,v),t=h.get(o);if(t)return t.slice();let i=s.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,""),r=[];for(let a of E){if(w.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function M(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(C(l.join(s,`index.${o}`)))return s;let t=br("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=I(s);if(t.length===0)return null;let i=o??M();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=oe({loader:"ts",target:"browser",define:A()}),k=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=R(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.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(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let x=t.filter((n)=>!d.has(n)&&!P(s,n));if(x.length>0)console.warn(`[stx] could not bundle ${x.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 u.set(r,""),null;let O=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
|
|
4
4
|
`),y=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fg,dy,py,fy,gy,gg,mg,my,hy,fi,yy,Sr,kr,Os}from"./chunk-
|
|
2
|
+
import{fg,dy,py,fy,gy,gg,mg,my,hy,fi,yy,Sr,kr,Os}from"./chunk-cn2bgt0w.js";import{ft}from"./chunk-6c1vm6bs.js";import"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{gy as __setSignalsGeneratorsForTest,ft as cacheEngineFingerprint,kr as cacheTemplate,Sr as checkCache,yy as clearDevCaches,mg as getCachedRouterScript,gg as getCachedSignalsRuntime,my as getServeClientAsset,fi as getServeModuleBundle,Os as hashFilePath,py as invalidateFileCache,fy as invalidateFileCacheByDir,dy as readFileCached,hy as registerServeModuleBundle,fg as templateCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{On,Vi}from"./chunk-
|
|
2
|
+
import{On,Vi}from"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";export{Vi as generateRuntimeConfigTypes,On as prepareRuntimeConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ga,Xa,Ja,Ya,Yh}from"./chunk-3869n9nd.js";import"./chunk-e362e615.js";import"./chunk-nmz9j39s.js";import"./chunk-kee5a3ce.js";import"./chunk-qpybh7ss.js";import"./chunk-radvtjwt.js";import"./chunk-kjz7g83q.js";import"./chunk-c0g30cjs.js";import"./chunk-s9xavhdb.js";import"./chunk-ddws4zp2.js";import"./chunk-a852vdv3.js";import"./chunk-d2pexm3z.js";import"./chunk-22mdphq2.js";import"./chunk-whmk0m8x.js";import"./chunk-cb0c6959.js";import"./chunk-cn2bgt0w.js";import"./chunk-nb6erf75.js";import"./chunk-0k7khseq.js";import"./chunk-qxthb2a1.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{Ga as buildNative,Yh as default,Xa as findCraftBinary,Ya as getAvailableFormats,Ja as getAvailableTargets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{sy,ag,at,Ac,oy,xs,Ss,ks}from"./chunk-kjz7g83q.js";import"./chunk-s9xavhdb.js";import"./chunk-ddws4zp2.js";import"./chunk-d2pexm3z.js";import"./chunk-cb0c6959.js";import"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{oy as clearOnceStore,Ac as onceStore,at as partialsCache,xs as processIncludes,Ss as processStackPushDirectives,ks as processStackReplacements,sy as resetUnscopedSignalWarnings,ag as topLevelElements};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{De}from"./chunk-a60ztvnp.js";import{E}from"./chunk-00tq7ghn.js";import{M,jn}from"./chunk-hxhmhw23.js";import{A,oe}from"./chunk-
|
|
2
|
+
import{De}from"./chunk-a60ztvnp.js";import{E}from"./chunk-00tq7ghn.js";import{M,jn}from"./chunk-hxhmhw23.js";import{A,oe}from"./chunk-3jndqseh.js";import{a}from"./chunk-0k7khseq.js";import{Ce,hn,yn,bn}from"./chunk-99spzsmw.js";import{Pt}from"./chunk-22mdphq2.js";import{Tt,er,ln,be}from"./chunk-97kgrevs.js";import{I,et}from"./chunk-ws2h92mm.js";import C from"fs";import b from"path";import x from"process";function B(s,o){for(let e of s.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(e[1])o.add(e[1]);for(let e of s.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let t of(e[1]??"").split(",")){let r=((t.includes(":")?t.split(":").pop():t)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))o.add(r)}for(let e of s.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let t of(e[1]??"").split(",")){let n=t.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(n))o.add(n)}}var h=new Map;async function O(s,o=I()){let e;if(s)e=b.resolve(s);else{let l=await a();e=b.resolve(l.root||x.cwd(),l.storesDir||"stores")}let t=`${e}\x00${yn()}\x00${o?"shared":"inline"}`,n=new Bun.Glob("*.ts"),r=[];try{for await(let l of n.scan({cwd:e,absolute:!0})){let c=b.basename(l,".ts");if(["index","types"].includes(c))continue;if(l.includes(".d.ts"))continue;r.push(l)}}catch{return be(h,t,"",{chunks:[]}),null}let i=()=>[...new Set([...r,...r.flatMap((l)=>Ce(l))])],f=Tt(i()),u=ln(h,t,f);if(u!==void 0)return u.chunks.length>0?u:null;if(r.length===0)return be(h,t,f,{chunks:[]}),null;let m=[];for(let l of r){let c=await Bun.file(l).text();m.push({file:l,hasUseStore:/useStore\s*\(/.test(c)})}m.sort((l,c)=>{if(l.hasUseStore===c.hasUseStore)return 0;return l.hasUseStore?1:-1});let p=m.map((l)=>l.file),g=[],d=oe({loader:"ts",target:"browser",define:A()});for(let l of p)try{let c=await Bun.file(l).text(),k=b.basename(l,".ts"),_=new Set;B(c,_);let y=[...c.matchAll(/\bdefineStore\s*(?:<[^>()]*>)?\(\s*(['"`])([^'"`$\\]+)\1/g)].map((U)=>U[2]),N=c.match(/\bdefineStore\s*(?:<[^>()]*>)?\(/g)?.length??0;if(hn(c))c=await bn(c,l,{projectRoot:x.cwd(),externalizeUserModules:o});c=Pt(c),c=M(c),c=jn(c),c=c.replace(/^export\s+(default\s+)?/gm,""),c=d.transformSync(c),g.push({name:k,ids:y.length===N?y:[],declared:_,code:`// Store: ${k}
|
|
3
3
|
${c.trim()}`})}catch(c){console.warn(`[stx] Failed to load store ${l}:`,c)}if(g.length===0)return be(h,t,f,{chunks:[]}),null;f=Tt(i());let S={chunks:g};return be(h,t,f,S),S}function R(s){let o=new Set;for(let r of s)for(let i of r.declared)o.add(i);let e=s.map((r)=>r.code).join(`
|
|
4
4
|
|
|
5
5
|
`),n=`;(function(){
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ra,Tm,Io,$m,uu,du,Rm,Am}from"./chunk-x5608pnk.js";import"./chunk-cekzqze8.js";import"./chunk-99spzsmw.js";import"./chunk-j7bkrvey.js";import"./chunk-9f31gs4m.js";import"./chunk-22mdphq2.js";import"./chunk-whmk0m8x.js";import"./chunk-cb0c6959.js";import"./chunk-nb6erf75.js";import"./chunk-0k7khseq.js";import"./chunk-qxthb2a1.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import{Se,Qs}from"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{Ra as buildScriptVirtualFile,Tm as buildVirtualSource,Se as extractScriptBlocks,Qs as extractTemplateExpressions,uu as findRuntimeTypeDeclarations,du as findStxModuleDeclarations,Am as formatTypecheckDiagnostics,$m as sourcePathFor,Rm as typecheckStxFiles,Io as virtualPathFor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{uy,Ts,ci,$s,wr,li,ui,dg,Rs,As,Ps,di,Ic,pg,Pt}from"./chunk-
|
|
2
|
+
import{uy,Ts,ci,$s,wr,li,ui,dg,Rs,As,Ps,di,Ic,pg,Pt}from"./chunk-22mdphq2.js";import"./chunk-whmk0m8x.js";import"./chunk-cb0c6959.js";import"./chunk-0k7khseq.js";import"./chunk-qxthb2a1.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import{G}from"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{dg as bindLoopInterpolations,uy as clearScriptScanCache,Rs as convertServerLoopAttributesToDirectives,li as convertSignalDirectivesToAttributes,As as convertSignalLoopsToAttributes,wr as extractClientSignalNames,G as extractExports,Ic as findMarkupIndexOutsideScripts,$s as hasSignalsSyntax,ci as parseLoopExpression,ui as preEvalLiteralReactiveIfs,Ps as processScriptSetup,di as processSignals,pg as rewriteStxImportSpecifiers,Ts as scanScriptTags,Pt as stripStxRuntimeImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{gu,Um,mu,hu,Wm,qm}from"./chunk-
|
|
2
|
+
import{gu,Um,mu,hu,Wm,qm}from"./chunk-bgddx531.js";import"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{qm as applySlots,Wm as extractSlotContent,Um as parseSlotElement,gu as parseSlots,hu as processSlots,mu as renderSlot};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Dn}from"./chunk-
|
|
2
|
+
import{Dn}from"./chunk-295bykzd.js";import{j,Q,w,Wt,qt,Lr,h,Cl,Fi,Y,O}from"./chunk-3jndqseh.js";import{fn}from"./chunk-93b6syb0.js";import{r}from"./chunk-ddws4zp2.js";import{te}from"./chunk-ws2h92mm.js";import{D,c}from"./chunk-xpbakn6t.js";var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function F(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Z(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=n.exec(t))!==null){if(F(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||X.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!Z(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,x;while((x=f.exec(t))!==null){if(F(x.index,i))continue;let y=x[1]==="/";if(!y&&(x[2]||"").trimEnd().endsWith("/"))continue;if(d+=y?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:x.index,tagName:l}}return null}return null}var Ct="private, no-store";function an(t){return t.replace(/&#(\d+);/g,(s,e)=>L(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>L(Number.parseInt(e,16),s)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function L(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Le(t){return t.headers.get("X-STX-Router")==="true"}function tt(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function V(t){return{Vary:tt(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function H(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return w(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function B(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function Vn(t){let s=[];for(let e of H(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=B(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=an(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${E(n.content??"")}">`)}else{let i=an(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${E(n.href??"")}"${i==="alternate"?` hreflang="${E(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
|
|
3
3
|
`}var et=["media","crossorigin","integrity"];function Un(t){let s=[];for(let e of H(t)){if(!/^<link\b/i.test(e))continue;let n=B(e);if(an(n.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!n.href||"data-css"in n||"disabled"in n)continue;let i=et.filter((o)=>(o in n)).map((o)=>` ${o}="${E(n[o])}"`).join("");s.push(`<link rel="stylesheet" href="${E(n.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
|
|
4
|
-
`:""}import T from"path";var st="stx-page-head:",it=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function ot(){let t=te()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-1z6rrqvm.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Aa(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=T.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Oo(t,s){try{let e=await Bun.file(t).text(),n=e,i=j(e);if(i)n=i.content.trim();let o=fn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:x,extractVariables:y,defaultConfig:R,loadStxConfig:b}=await import("./chunk-
|
|
4
|
+
`:""}import T from"path";var st="stx-page-head:",it=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function ot(){let t=te()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-1z6rrqvm.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Aa(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=T.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Oo(t,s){try{let e=await Bun.file(t).text(),n=e,i=j(e);if(i)n=i.content.trim();let o=fn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:x,extractVariables:y,defaultConfig:R,loadStxConfig:b}=await import("./chunk-sb93fb2w.js"),k=await b(),m={__filename:t,__dirname:T.dirname(t)};for(let p of l){let A=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!p.includes("client")&&!p.includes('type="module"'))await y(A[1],m,t)}let S=await x(f,m,t,{...R,...k,...s},new Set),C=S.indexOf(d);if(C===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,C),afterSlot:S.substring(C+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function is(t,s,e){let n,i="",o=s.match(it);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=ot(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
6
6
|
<head>
|
|
7
7
|
<meta charset="UTF-8">
|
|
@@ -29,5 +29,5 @@ ${a}
|
|
|
29
29
|
`));if(o.length>0)m.push(o.filter((S)=>!g.has(S)).join(`
|
|
30
30
|
`));if(R.length>0)m.push(R.filter((S)=>!g.has(S)).join(`
|
|
31
31
|
`));return m.push(y),m.join(`
|
|
32
|
-
`)}import M from"fs";import z from"path";function Ia(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Oa(t,s){let e=z.join(s,"manifest.json");M.writeFileSync(e,JSON.stringify(t,null,2))}function Na(t){let s=z.join(t,"manifest.json");if(!M.existsSync(s))return null;try{let e=M.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function I(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function ct(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function No(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function G(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!No(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await ct(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=lt(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function lt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(I(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(I(e,i.value,i))}}return s}function Ma(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Wn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await ut(t,s),l=Wt(n),a=qt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-
|
|
32
|
+
`)}import M from"fs";import z from"path";function Ia(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Oa(t,s){let e=z.join(s,"manifest.json");M.writeFileSync(e,JSON.stringify(t,null,2))}function Na(t){let s=z.join(t,"manifest.json");if(!M.existsSync(s))return null;try{let e=M.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function I(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function ct(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function No(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function G(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!No(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await ct(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=lt(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function lt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(I(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(I(e,i.value,i))}}return s}function Ma(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Wn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await ut(t,s),l=Wt(n),a=qt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-3abd3gw8.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-twewtvyt.js"),{defaultConfig:x}=await import("./chunk-8s365b62.js"),y=n.streamBoundaries||{},R={...x,autoShell:!1},b=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof y[m]==="function"?await y[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,R,new Set)}})),k=new Set(b.map((m)=>m.id));g=[...(g||[]).filter((m)=>!k.has(m.id)),...b]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function ut(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Fi(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await h(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await G(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=Lr(e);if(!u)return a;let g=D(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Fi(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=O(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i(Cl(t.html,o)),context:e,cookies:n.cookies}}
|
|
33
33
|
export{Ct,an,Le,V,Vn,Un,Aa,Oo,is,nt,Pa,rt,je,Ia,Oa,Na,No,Ma,Wn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h,Di,hl,yl,Dg,Lg,jg,Bg,Fg,oo,zg,Ge,oe,Xe,Hg,jr,Vg,vl,xl,Bi,Je,s,An,Sl,y,ke,Ey}from"./chunk-
|
|
2
|
+
import{h,Di,hl,yl,Dg,Lg,jg,Bg,Fg,oo,zg,Ge,oe,Xe,Hg,jr,Vg,vl,xl,Bi,Je,s,An,Sl,y,ke,Ey}from"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{xl as SIGNAL_COMPOSABLE_CALL,ke as clearComponentCache,Bi as componentClientSignalNames,Di as convertToCommonJS,y as createDetailedErrorMessage,Fg as extractDirectiveNames,hl as extractScriptFromTemplate,h as extractVariables,s as fileExists,Ey as getComponentCacheStats,Lg as getPositionInfo,oe as getSharedTranspiler,Sl as getSourceLineInfo,Bg as hasDirectives,yl as hasVariables,Vg as isHydrateTrigger,zg as isJavaScriptScript,Je as renderComponentWithSlot,An as resolveTemplatePath,Hg as scopeOnRootElement,oo as scopeSequenceKey,Ge as shouldTranspileTypeScript,vl as slotContentHasExpressions,Xe as transpileTypeScript,jr as userComponentFileExists,jg as validateDirective,Dg as validateTemplate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{W,hg,gi,Bc,a,L,by,wy}from"./chunk-0k7khseq.js";import"./chunk-qxthb2a1.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-0rdh8bw3.js";import"./chunk-agd2b928.js";import"./chunk-3jndqseh.js";import"./chunk-c3413bgh.js";import"./chunk-6t04tqvh.js";import"./chunk-295bykzd.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{L as config,W as defaultConfig,by as defineStxConfig,gi as discoverConfig,a as loadStxConfig,Bc as resolveInstalledPackage,hg as resolveStxDirectories,wy as validateConfig};
|