@stacksjs/stx 0.2.268 → 0.2.270
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/builtins/image-delivery.d.ts +16 -0
- package/dist/builtins/image-delivery.js +73 -0
- package/dist/builtins/stx-image.js +27 -11
- package/dist/{chunk-2x9s5z8x.js → chunk-0an022xa.js} +1 -1
- package/dist/{chunk-6746wmsf.js → chunk-0gpkptex.js} +1 -1
- package/dist/{chunk-278yw67q.js → chunk-0ye9aj3r.js} +1 -1
- package/dist/chunk-11x9r23q.js +2 -0
- package/dist/{chunk-0athjw48.js → chunk-1bwwtctk.js} +2 -2
- package/dist/{chunk-shtemwbq.js → chunk-1fgbwc7a.js} +1 -1
- package/dist/chunk-1mr82303.js +2 -0
- package/dist/{chunk-bby4emay.js → chunk-1spzqjve.js} +1 -1
- package/dist/chunk-2a689vdq.js +2 -0
- package/dist/{chunk-krgth3gf.js → chunk-2c2z8n54.js} +1 -1
- package/dist/chunk-2qddseth.js +2 -0
- package/dist/chunk-2y22cbx8.js +2 -0
- package/dist/{chunk-q4n8a7sf.js → chunk-3445kmwm.js} +1 -1
- package/dist/{chunk-wrg838f0.js → chunk-3w45v2rv.js} +1 -1
- package/dist/chunk-3zd2f5qr.js +2 -0
- package/dist/chunk-4r06061f.js +2 -0
- package/dist/{chunk-987kjtg8.js → chunk-4we8yzyx.js} +1 -1
- package/dist/{chunk-5k1bec90.js → chunk-578te43w.js} +12 -12
- package/dist/chunk-5a07gxnz.js +2 -0
- package/dist/chunk-5arv7j0q.js +2 -0
- package/dist/{chunk-zr2rkgag.js → chunk-5n2g2z63.js} +2 -2
- package/dist/{chunk-9rdg7x9h.js → chunk-5xj9t4wa.js} +1 -1
- package/dist/chunk-6nar1v2y.js +2 -0
- package/dist/{chunk-8n89zhmq.js → chunk-6sha41vn.js} +2 -2
- package/dist/{chunk-f8wjdg40.js → chunk-71gwef4q.js} +1 -1
- package/dist/{chunk-chte720d.js → chunk-7fs8qzdd.js} +1 -1
- package/dist/{chunk-wnt3yvxv.js → chunk-7x4xbgp7.js} +1 -1
- package/dist/{chunk-9y175wxc.js → chunk-89wwrrpk.js} +2 -2
- package/dist/{chunk-rzdar1x9.js → chunk-8ee6xtdz.js} +3 -3
- package/dist/{chunk-95bfzrx2.js → chunk-8hpqcwwc.js} +2 -2
- package/dist/chunk-8v09eehd.js +2 -0
- package/dist/chunk-9ej520sb.js +2 -0
- package/dist/{chunk-1hhxj2r5.js → chunk-a53v7hcy.js} +1 -1
- package/dist/{chunk-f3m0q482.js → chunk-a6a9djpq.js} +1 -1
- package/dist/{chunk-khfszwjy.js → chunk-ae5tb4zm.js} +1 -1
- package/dist/{chunk-rwb4nztb.js → chunk-b63wkbvt.js} +1 -1
- package/dist/chunk-b70jwwhd.js +2 -0
- package/dist/{chunk-sfha6xsd.js → chunk-bab9k1e8.js} +1 -1
- package/dist/{chunk-hzwvszyg.js → chunk-bkavpp75.js} +2 -2
- package/dist/{chunk-8jvmjzmr.js → chunk-brahft3h.js} +1 -1
- package/dist/{chunk-m87wfz2b.js → chunk-bxv3k5w8.js} +2 -2
- package/dist/{chunk-f5v2qf95.js → chunk-bz820epz.js} +1 -1
- package/dist/chunk-cvkjsa0m.js +2 -0
- package/dist/{chunk-tv6ds16a.js → chunk-d204cw1f.js} +1 -1
- package/dist/chunk-d8np0m39.js +2 -0
- package/dist/{chunk-yax48zgv.js → chunk-dtnfedg1.js} +1 -1
- package/dist/chunk-dyqh15py.js +11 -0
- package/dist/chunk-e4ty7vfv.js +2 -0
- package/dist/{chunk-rc4zrsw3.js → chunk-e5z100yg.js} +1 -1
- package/dist/{chunk-1j77d7fw.js → chunk-e7svf8zh.js} +1 -1
- package/dist/chunk-eb17vwke.js +2 -0
- package/dist/chunk-ertf9176.js +2 -0
- package/dist/{chunk-yhtq662h.js → chunk-f0m82977.js} +1 -1
- package/dist/chunk-f0z8dy89.js +2 -0
- package/dist/{chunk-h6xxqg0h.js → chunk-f9decgn9.js} +1 -1
- package/dist/{chunk-wacr03x4.js → chunk-fk5y786g.js} +1 -1
- package/dist/chunk-g7gr6pvb.js +2 -0
- package/dist/{chunk-455pgdzh.js → chunk-g8xanqdg.js} +1 -1
- package/dist/{chunk-a3drgebc.js → chunk-ggem4nm2.js} +2 -2
- package/dist/{chunk-5k0j7bjy.js → chunk-gyrpe6m3.js} +1 -1
- package/dist/{chunk-n2r83qwt.js → chunk-ht4r7d1p.js} +1 -1
- package/dist/{chunk-w7gpyx2k.js → chunk-jqm0hfx2.js} +1 -1
- package/dist/{chunk-fvh9ca47.js → chunk-jr3jp3ev.js} +1 -1
- package/dist/{chunk-vnrhn6b0.js → chunk-k2nej4y6.js} +1 -1
- package/dist/{chunk-73yr54sg.js → chunk-kdg7g76f.js} +1 -1
- package/dist/{chunk-50gk2vsn.js → chunk-kerjvqz9.js} +2 -2
- package/dist/{chunk-477zvh3f.js → chunk-kkrg94ay.js} +2 -2
- package/dist/{chunk-f8g0zbm3.js → chunk-kms7q66w.js} +1 -1
- package/dist/{chunk-mync09v4.js → chunk-kzj42dav.js} +1 -1
- package/dist/chunk-man5awsh.js +2 -0
- package/dist/chunk-mjmm6wts.js +2 -0
- package/dist/{chunk-15x3b9tp.js → chunk-mw1szffx.js} +2 -2
- package/dist/{chunk-5d4csjhx.js → chunk-n3ggrhb3.js} +1 -1
- package/dist/{chunk-z8btarwy.js → chunk-nsf6d5dq.js} +1 -1
- package/dist/{chunk-dhe8sp1a.js → chunk-nsn7gfew.js} +1 -1
- package/dist/{chunk-fpkgcpey.js → chunk-ntfmdx5n.js} +416 -416
- package/dist/{chunk-jcped0kt.js → chunk-nx5qkm8k.js} +1 -1
- package/dist/{chunk-gej3rmfy.js → chunk-ph0q97r5.js} +1 -1
- package/dist/{chunk-135mme4g.js → chunk-q9zsjgpf.js} +1 -1
- package/dist/chunk-qhd9ctad.js +2 -0
- package/dist/{chunk-qmpsyysd.js → chunk-qkhw6tdx.js} +1 -1
- package/dist/{chunk-vrskjx64.js → chunk-qyfh6mf4.js} +1 -1
- package/dist/{chunk-5wkwhjjn.js → chunk-rhbq1var.js} +2 -2
- package/dist/{chunk-k7n88ess.js → chunk-s5r7hwsw.js} +1 -1
- package/dist/{chunk-6kcz7bg6.js → chunk-s9z3d94k.js} +2 -2
- package/dist/{chunk-4cr21p7m.js → chunk-sbppctqw.js} +1 -1
- package/dist/{chunk-p557qcrk.js → chunk-sqcpcnyf.js} +1 -1
- package/dist/{chunk-qkbrbys7.js → chunk-t1xzgpdm.js} +1 -1
- package/dist/{chunk-52wr95ps.js → chunk-t7b39wwk.js} +1 -1
- package/dist/{chunk-4ay1ymgp.js → chunk-tvtnf09q.js} +2 -2
- package/dist/{chunk-f1jd5qjb.js → chunk-txys90mf.js} +1 -1
- package/dist/{chunk-t35x61f5.js → chunk-v2rx1rey.js} +2 -2
- package/dist/chunk-v413wmmr.js +2 -0
- package/dist/chunk-v5vqxa3e.js +2 -0
- package/dist/{chunk-9gzmcxzg.js → chunk-vesr13aj.js} +1 -1
- package/dist/{chunk-1m4sa11y.js → chunk-vf4tde50.js} +1 -1
- package/dist/{chunk-e6tvnnnz.js → chunk-vqxmxgaj.js} +1 -1
- package/dist/{chunk-j24k071e.js → chunk-w18t3nmy.js} +1 -1
- package/dist/{chunk-868ep3pm.js → chunk-wyhp2hnm.js} +2 -2
- package/dist/chunk-x9s335jt.js +3 -0
- package/dist/chunk-xn65rbw3.js +2 -0
- package/dist/chunk-xtw5sm29.js +2 -0
- package/dist/{chunk-sde45gh3.js → chunk-yvpagchj.js} +1 -1
- package/dist/{chunk-erjf0z2d.js → chunk-yw1yt8b1.js} +1 -1
- package/dist/{chunk-hhyf0s7s.js → chunk-yy6m9kgm.js} +1 -1
- package/dist/chunk-zvygp42b.js +2 -0
- package/dist/cli.js +14 -14
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/pwa.js +2 -2
- package/dist/ssg.js +17 -17
- package/dist/store-loader.js +2 -0
- package/dist/visual-testing.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-0a2dq7g9.js +0 -2
- package/dist/chunk-1c0yy9rs.js +0 -2
- package/dist/chunk-2b4g32yv.js +0 -2
- package/dist/chunk-4mvpapjz.js +0 -2
- package/dist/chunk-5htqgzbb.js +0 -2
- package/dist/chunk-7jpq01y1.js +0 -2
- package/dist/chunk-7kkc13rc.js +0 -2
- package/dist/chunk-9asehtpb.js +0 -2
- package/dist/chunk-9th0hyk5.js +0 -2
- package/dist/chunk-bn1e010c.js +0 -2
- package/dist/chunk-bwf0xaqc.js +0 -2
- package/dist/chunk-c17r76es.js +0 -2
- package/dist/chunk-cg8dd896.js +0 -2
- package/dist/chunk-d867gwtk.js +0 -2
- package/dist/chunk-e1a1c5b9.js +0 -2
- package/dist/chunk-ea5ab7zt.js +0 -2
- package/dist/chunk-eszybcp6.js +0 -2
- package/dist/chunk-fwgqz5vv.js +0 -2
- package/dist/chunk-gaqvk74x.js +0 -11
- package/dist/chunk-j135b7xt.js +0 -2
- package/dist/chunk-jhfmkke9.js +0 -2
- package/dist/chunk-jnbhyzkv.js +0 -3
- package/dist/chunk-kcwa9cxw.js +0 -2
- package/dist/chunk-ng1wyd2v.js +0 -2
- package/dist/chunk-qh6223a0.js +0 -2
- package/dist/chunk-r4nkpr60.js +0 -2
- package/dist/chunk-ref9c9hn.js +0 -2
- package/dist/chunk-rgh4njyv.js +0 -2
- package/dist/chunk-tc01rmwh.js +0 -2
- package/dist/chunk-v5qv7q0y.js +0 -2
- package/dist/chunk-v9xkrwxt.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$h as n,Th as x,Yh as B,Zh as c,_h as u}from"./chunk-74cv4ta1.js";import{
|
|
2
|
+
import{$h as n,Th as x,Yh as B,Zh as c,_h as u}from"./chunk-74cv4ta1.js";import{Zu as v}from"./chunk-71gwef4q.js";import{resolve as JJ,basename as WJ,extname as _J,join as LJ}from"path";import{mkdir as QJ}from"fs/promises";var ZJ={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class V{config;constructor(K={}){this.config={...ZJ,...K}}async get(K,J){return c(K,J,"video",this.config)}async set(K,J,X){return u(K,J,X,"video",this.config)}async clear(){return n("video",this.config)}updateConfig(K){this.config={...this.config,...K}}}var S=null;function D(K){if(!S)S=new V(K);else if(K)S.updateConfig(K);return S}async function q(K,J,X){let N=X?{directory:`${X.outputDir}/../.cache`}:{};return D(N).get(K,J)}async function b(K,J,X,N){let Z=N?{directory:`${N.outputDir}/../.cache`}:{};return D(Z).set(K,J,X)}async function $J(){return D().clear()}import{resolve as y,basename as P,extname as f,join as U}from"path";import{mkdir as g}from"fs/promises";async function m(){try{return await import("ts-videos")}catch{return null}}async function h(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",M=J.timestamp||0,E=`${z}-poster-${Y}.${G}`,W=U(X,E),Q=await Z.extractThumbnails($,{timestamps:[M],width:J.width||1280,height:J.height,format:G,quality:J.quality||85,outputDir:X,outputPattern:E.replace(`.${G}`,"")});if(Q&&Q.length>0){let _=Q[0];return{path:W,url:`${N}/${E}`,width:_.width||J.width||1280,height:_.height||720,timestamp:M,size:_.size||0}}return null}catch($){return console.warn(`[stx-media] Failed to generate poster: ${$}`),null}}async function d(K,J,X,N){let Z=await m();if(!Z)return[];try{let $=y(K);if(!await B($))return[];await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",W=(await new Z.Input($).getInfo()).duration||60,Q=J.count||10,_=J.interval||W/Q,O=[];for(let w=0;w<Q&&w*_<W;w++)O.push(w*_);let L=await Z.extractThumbnails($,{timestamps:O,width:J.width||320,format:G,quality:J.quality||80,outputDir:X,outputPattern:`${z}-thumb-${Y}`});if(L&&L.length>0)return L.map((w,j)=>({path:w.path||U(X,`${z}-thumb-${Y}-${j}.${G}`),url:`${N}/${z}-thumb-${Y}-${j}.${G}`,width:w.width||J.width||320,height:w.height||180,timestamp:O[j],size:w.size||0}));return[]}catch($){return console.warn(`[stx-media] Failed to generate thumbnails: ${$}`),[]}}async function zJ(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),E=(await new Z.Input($).getInfo()).duration||60,W=J.columns||10,Q=J.interval||5,_=J.thumbnailWidth||160,O=J.thumbnailHeight||90,L=J.format||"jpeg",w=Math.ceil(E/Q),j=Math.ceil(w/W),F=`${z}-sprite-${Y}.${L}`,k=U(X,F),T=[];for(let I=0;I<w;I++)T.push(I*Q);let A=await Z.extractThumbnails($,{timestamps:T,width:_,height:O,format:L,quality:J.quality||70,outputDir:U(X,".temp")});if(!A||A.length===0)return null;try{let I=await import("ts-images"),H=W*_,kJ=j*O,jJ=await I.createSprite({images:A.map((YJ)=>YJ.path),columns:W,padding:0,outputPath:k,format:L,quality:J.quality||70});return{url:`${N}/${F}`,path:k,columns:W,rows:j,thumbnailWidth:_,thumbnailHeight:O,interval:Q,totalFrames:w}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch($){return console.warn(`[stx-media] Failed to generate sprite sheet: ${$}`),null}}import{resolve as r,basename as e,extname as i,join as C}from"path";import{mkdir as R,writeFile as o}from"fs/promises";async function t(){try{return await import("ts-videos")}catch{return null}}var s=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function p(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-hls`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||6,O=(await new $.Input(Y).getInfo()).duration||0,L=[],w=0;for(let k of E){let T=C(M,k.label);await R(T,{recursive:!0});let A=`${k.label}.m3u8`,I=C(T,A);try{let H=await $.generateHLS(Y,{outputDir:T,segmentDuration:W,width:k.width,height:k.height,videoBitrate:k.bitrate,audioBitrate:k.audioBitrate,playlistName:k.label});if(H)L.push({quality:k,url:`${N}/${G}-${z}-hls/${k.label}/${A}`,path:I}),w+=H.segmentCount||Math.ceil(O/W)}catch(H){console.warn(`[stx-media] Failed to generate HLS for ${k.label}: ${H}`)}}if(L.length===0)return null;let j=C(M,"master.m3u8"),F=GJ(L,N,G,z);return await o(j,F),{manifestUrl:`${N}/${G}-${z}-hls/master.m3u8`,manifestPath:j,playlists:L,segmentCount:w,duration:O}}catch(Y){return console.warn(`[stx-media] Failed to generate HLS manifest: ${Y}`),null}}function GJ(K,J,X,N){let Z=["#EXTM3U","#EXT-X-VERSION:3"];for(let $ of K){let{quality:Y}=$,z=Y.bitrate+(Y.audioBitrate||128000),G=`${Y.width}x${Y.height||Math.round(Y.width*9/16)}`;Z.push(`#EXT-X-STREAM-INF:BANDWIDTH=${z},RESOLUTION=${G},NAME="${Y.label}"`,`${Y.label}/${Y.label}.m3u8`)}return Z.join(`
|
|
3
3
|
`)}async function l(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate DASH manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-dash`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||4,Q=Z?.minBufferTime||2,L=(await new $.Input(Y).getInfo()).duration||0,w=[],j=[];for(let A of E){let I=C(M,A.label);await R(I,{recursive:!0});try{if(await $.generateDASH(Y,{outputDir:I,segmentDuration:W,width:A.width,height:A.height,videoBitrate:A.bitrate,audioBitrate:A.audioBitrate})){if(w.push({bandwidth:A.bitrate,width:A.width,height:A.height||Math.round(A.width*9/16),url:`${N}/${G}-${z}-dash/${A.label}/video`}),A.audioBitrate)j.push({bandwidth:A.audioBitrate,url:`${N}/${G}-${z}-dash/${A.label}/audio`})}}catch(H){console.warn(`[stx-media] Failed to generate DASH for ${A.label}: ${H}`)}}if(w.length===0)return null;let F=C(M,"manifest.mpd"),k=NJ(w,j,L,W,Q);await o(F,k);let T=[{type:"video",representations:w}];if(j.length>0)T.push({type:"audio",representations:j});return{manifestUrl:`${N}/${G}-${z}-dash/manifest.mpd`,manifestPath:F,adaptationSets:T,duration:L}}catch(Y){return console.warn(`[stx-media] Failed to generate DASH manifest: ${Y}`),null}}function NJ(K,J,X,N,Z){let $=a(X),Y=a(Z),z=`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
4
|
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011"
|
|
5
5
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
@@ -26,4 +26,4 @@ import{$h as n,Th as x,Yh as B,Zh as c,_h as u}from"./chunk-74cv4ta1.js";import{
|
|
|
26
26
|
</Representation>
|
|
27
27
|
`}z+=` </AdaptationSet>
|
|
28
28
|
`}return z+=` </Period>
|
|
29
|
-
</MPD>`,z}function a(K){let J=Math.floor(K/3600),X=Math.floor(K%3600/60),N=Math.floor(K%60),Z="PT";if(J>0)Z+=`${J}H`;if(X>0)Z+=`${X}M`;return Z+=`${N}S`,Z}async function KJ(){try{return await import("ts-videos")}catch{return null}}function MJ(K){switch(K){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function OJ(K){switch(K){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function XJ(K){let J=await KJ();if(!J)return null;try{let X=JJ(K),Z=await new J.Input(X).getInfo();return{duration:Z.duration||0,width:Z.width||0,height:Z.height||0,frameRate:Z.frameRate||0,bitrate:Z.bitrate||0,codec:Z.videoCodec||"",audioCodec:Z.audioCodec}}catch(X){return console.warn(`[stx-media] Failed to analyze video: ${X}`),null}}async function wJ(K,J,X,N){let Z=await KJ();if(!Z)return console.warn("[stx-media] ts-videos not installed, skipping processing"),{src:K,processed:!1};let $=await q(K,J,X);if($)return $;try{let Y=JJ(K);if(!await B(Y))return{src:K,processed:!1,errors:[`Source file not found: ${K}`]};let z=X.outputDir||"dist/videos",G=X.baseUrl||"/videos";await QJ(z,{recursive:!0});let M=await x(Y),E=WJ(K,_J(K)),W={src:K,processed:!0,hash:M};N?.({percentage:5,stage:"analyzing"}),W.metadata=await XJ(Y)||void 0;let Q={};if(J.quality)Q.bitrate=MJ(J.quality);if(J.platform)Object.assign(Q,OJ(J.platform));if(J.transcode)Object.assign(Q,J.transcode);if(Object.keys(Q).length>0||J.process){N?.({percentage:10,stage:"transcoding"});let _=`${E}-${M}.mp4`,O=LJ(z,_);try{let L=await AJ(Y,O,Q,Z,(w)=>N?.({percentage:10+w*0.5,stage:"transcoding"}));if(L)W.transcoded={path:O,url:`${G}/${_}`,duration:L.duration,size:L.size,video:{codec:Q.codec||"h264",width:L.width,height:L.height,bitrate:L.bitrate,frameRate:L.frameRate},audio:L.audioCodec?{codec:Q.audioCodec||"aac",bitrate:Q.audioBitrate||128000,sampleRate:Q.sampleRate||48000,channels:Q.channels||2}:void 0}}catch(L){W.errors=W.errors||[],W.errors.push(`Transcoding failed: ${L}`)}}if(J.generatePoster){N?.({percentage:65,stage:"generating-poster"});let _=typeof J.generatePoster==="object"?J.generatePoster:{timestamp:0},O=await h(Y,_,z,G);if(O)W.poster=O}if(X.thumbnails?.enabled){N?.({percentage:70,stage:"generating-thumbnails"});let _=await d(Y,X.thumbnails,z,G);if(_.length>0)W.thumbnails=_}if(J.streaming){N?.({percentage:80,stage:"generating-manifests"});let _=typeof J.streaming==="object"?J.streaming:X.streaming||{format:"hls"};if(_.format==="hls"||_.format===void 0){let O=await p(Y,_.qualities||X.streaming?.defaultQualities||[],z,G);if(O)W.streaming={...W.streaming,hls:O}}if(_.format==="dash"){let O=await l(Y,_.qualities||X.streaming?.defaultQualities||[],z,G);if(O)W.streaming={...W.streaming,dash:O}}}if(J.spriteSheet)N?.({percentage:90,stage:"generating-sprite-sheet"});return N?.({percentage:100,stage:"complete"}),await b(K,J,W,X),W}catch(Y){return{src:K,processed:!1,errors:[`Processing failed: ${Y}`]}}}async function AJ(K,J,X,N,Z){try{let Y=await new N.Conversion(K,J,{videoCodec:X.codec,videoBitrate:X.bitrate,width:X.maxWidth,height:X.maxHeight,frameRate:X.frameRate,audioCodec:X.audioCodec,audioBitrate:X.audioBitrate,sampleRate:X.sampleRate,channels:X.channels}).run((z)=>{Z?.(z.percentage/100)});return{duration:Y.duration||0,size:Y.size||0,width:Y.width||X.maxWidth||0,height:Y.height||X.maxHeight||0,bitrate:Y.bitrate||X.bitrate||0,frameRate:Y.frameRate||X.frameRate||30,audioCodec:Y.audioCodec}}catch($){return console.error(`[stx-media] Transcoding failed: ${$}`),null}}export{V as
|
|
29
|
+
</MPD>`,z}function a(K){let J=Math.floor(K/3600),X=Math.floor(K%3600/60),N=Math.floor(K%60),Z="PT";if(J>0)Z+=`${J}H`;if(X>0)Z+=`${X}M`;return Z+=`${N}S`,Z}async function KJ(){try{return await import("ts-videos")}catch{return null}}function MJ(K){switch(K){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function OJ(K){switch(K){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function XJ(K){let J=await KJ();if(!J)return null;try{let X=JJ(K),Z=await new J.Input(X).getInfo();return{duration:Z.duration||0,width:Z.width||0,height:Z.height||0,frameRate:Z.frameRate||0,bitrate:Z.bitrate||0,codec:Z.videoCodec||"",audioCodec:Z.audioCodec}}catch(X){return console.warn(`[stx-media] Failed to analyze video: ${X}`),null}}async function wJ(K,J,X,N){let Z=await KJ();if(!Z)return console.warn("[stx-media] ts-videos not installed, skipping processing"),{src:K,processed:!1};let $=await q(K,J,X);if($)return $;try{let Y=JJ(K);if(!await B(Y))return{src:K,processed:!1,errors:[`Source file not found: ${K}`]};let z=X.outputDir||"dist/videos",G=X.baseUrl||"/videos";await QJ(z,{recursive:!0});let M=await x(Y),E=WJ(K,_J(K)),W={src:K,processed:!0,hash:M};N?.({percentage:5,stage:"analyzing"}),W.metadata=await XJ(Y)||void 0;let Q={};if(J.quality)Q.bitrate=MJ(J.quality);if(J.platform)Object.assign(Q,OJ(J.platform));if(J.transcode)Object.assign(Q,J.transcode);if(Object.keys(Q).length>0||J.process){N?.({percentage:10,stage:"transcoding"});let _=`${E}-${M}.mp4`,O=LJ(z,_);try{let L=await AJ(Y,O,Q,Z,(w)=>N?.({percentage:10+w*0.5,stage:"transcoding"}));if(L)W.transcoded={path:O,url:`${G}/${_}`,duration:L.duration,size:L.size,video:{codec:Q.codec||"h264",width:L.width,height:L.height,bitrate:L.bitrate,frameRate:L.frameRate},audio:L.audioCodec?{codec:Q.audioCodec||"aac",bitrate:Q.audioBitrate||128000,sampleRate:Q.sampleRate||48000,channels:Q.channels||2}:void 0}}catch(L){W.errors=W.errors||[],W.errors.push(`Transcoding failed: ${L}`)}}if(J.generatePoster){N?.({percentage:65,stage:"generating-poster"});let _=typeof J.generatePoster==="object"?J.generatePoster:{timestamp:0},O=await h(Y,_,z,G);if(O)W.poster=O}if(X.thumbnails?.enabled){N?.({percentage:70,stage:"generating-thumbnails"});let _=await d(Y,X.thumbnails,z,G);if(_.length>0)W.thumbnails=_}if(J.streaming){N?.({percentage:80,stage:"generating-manifests"});let _=typeof J.streaming==="object"?J.streaming:X.streaming||{format:"hls"};if(_.format==="hls"||_.format===void 0){let O=await p(Y,_.qualities||X.streaming?.defaultQualities||[],z,G);if(O)W.streaming={...W.streaming,hls:O}}if(_.format==="dash"){let O=await l(Y,_.qualities||X.streaming?.defaultQualities||[],z,G);if(O)W.streaming={...W.streaming,dash:O}}}if(J.spriteSheet)N?.({percentage:90,stage:"generating-sprite-sheet"});return N?.({percentage:100,stage:"complete"}),await b(K,J,W,X),W}catch(Y){return{src:K,processed:!1,errors:[`Processing failed: ${Y}`]}}}async function AJ(K,J,X,N,Z){try{let Y=await new N.Conversion(K,J,{videoCodec:X.codec,videoBitrate:X.bitrate,width:X.maxWidth,height:X.maxHeight,frameRate:X.frameRate,audioCodec:X.audioCodec,audioBitrate:X.audioBitrate,sampleRate:X.sampleRate,channels:X.channels}).run((z)=>{Z?.(z.percentage/100)});return{duration:Y.duration||0,size:Y.size||0,width:Y.width||X.maxWidth||0,height:Y.height||X.maxHeight||0,bitrate:Y.bitrate||X.bitrate||0,frameRate:Y.frameRate||X.frameRate||30,audioCodec:Y.audioCodec}}catch($){return console.error(`[stx-media] Transcoding failed: ${$}`),null}}export{V as eg,q as fg,b as gg,$J as hg,h as ig,d as jg,zJ as kg,p as lg,l as mg,XJ as ng,wJ as og};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{qt as jJ}from"./chunk-1spzqjve.js";import{Zu as NJ}from"./chunk-71gwef4q.js";import O from"path";import{hasLocalConfig as AJ}from"bunfig";var JJ={fg:{light:"gray-900",dark:"gray-100",description:"Primary text"},"fg-strong":{light:"gray-700",dark:"gray-300",description:"Labels, secondary headings"},"fg-muted":{light:"gray-600",dark:"gray-400",description:"Supporting text"},"fg-soft":{light:"gray-500",dark:"gray-400",description:"De-emphasised text"},"fg-subtle":{light:"gray-400",dark:"gray-500",description:"Placeholders, disabled text"},surface:{light:"gray-50",dark:"gray-800",description:"Page and panel background"},"surface-raised":{light:"gray-100",dark:"gray-700",description:"Cards, popovers"},"surface-sunken":{light:"gray-200",dark:"gray-700",description:"Wells, track backgrounds"},line:{light:"gray-200",dark:"gray-700",description:"Default border, divider"},"line-strong":{light:"gray-300",dark:"gray-600",description:"Input border, focus ring track"},accent:{light:"indigo-600",dark:"indigo-400",description:"Primary action, selected state"},info:{light:"blue-600",dark:"blue-400",description:"Informational emphasis, links"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-500",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"indigo-600",dark:"indigo-500",description:"Primary button fill"},"info-solid":{light:"blue-600",dark:"blue-500",description:"Informational fill"},"danger-solid":{light:"red-600",dark:"red-500",description:"Destructive button fill"},"success-solid":{light:"green-600",dark:"green-500",description:"Confirmation fill"}};function m(Q){return`--stx-${Q}`}function u(Q,J){let Y=J.lastIndexOf("-");if(Y===-1)return typeof Q[J]==="string"?Q[J]:void 0;let $=Q[J.slice(0,Y)];if(!$||typeof $!=="object")return;let Z=$[J.slice(Y+1)];return typeof Z==="string"?Z:void 0}function QJ(Q){let J={};for(let[Y,$]of Object.entries(JJ)){let Z=u(Q,$.light);if(Z===void 0)continue;J[Y]=`var(${m(Y)}, ${Z})`}return J}function YJ(Q){let J=[],Y=[];for(let[$,Z]of Object.entries(JJ)){let q=u(Q,Z.light),U=u(Q,Z.dark);if(q===void 0)continue;if(J.push(` ${m($)}: ${q};`),U!==void 0)Y.push(` ${m($)}: ${U};`)}if(J.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...J,"}",".dark {",...Y,"}",""].join(`
|
|
3
3
|
`)}function $J(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function d(Q,J){let Y={...Q};for(let[$,Z]of Object.entries(J))Y[$]=$J(Z)&&$J(Y[$])?d(Y[$],Z):Z;return Y}function ZJ(Q={},J={}){let Y=Q.theme||{},$=J.theme||{},{extend:Z,...q}=$,{extend:U,...W}=Y,G=W.colors||{};W.colors={...G,...QJ(G)};let X=d(W,q),V=d(U||{},Z||{});if(Object.keys(V).length>0)X.extend=V;let A=[...Q.safelist||[],...J.safelist||[]],T={...Q.shortcuts||{},...J.shortcuts||{}},R=[...Q.preflights||[],...J.preflights||[]];return{config:{...Q,...J,theme:X,safelist:A,shortcuts:T,...R.length>0?{preflights:R}:{},content:[],output:""},safelist:A,shortcuts:T,includePreflight:J.preflight!==!1,minify:J.minify===!0,tokenCSS:YJ(G)}}var F={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import OJ from"fs";class c{cache=new Map;maxSize;options;sizes;bytes=0;constructor(Q=100,J){this.maxSize=Q,this.options=J??null,this.sizes=J?new Map:null}get byteSize(){return this.bytes}get(Q){if(!this.cache.has(Q))return;let J=this.cache.get(Q);return this.cache.delete(Q),this.cache.set(Q,J),J}set(Q,J){if(this.cache.has(Q))this.delete(Q);let Y=this.options?this.options.sizeOf(J):0;if(this.options&&Y>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+Y>this.options.maxBytes)){let $=this.cache.keys().next().value;if($===void 0)break;this.delete($)}if(this.cache.set(Q,J),this.sizes)this.sizes.set(Q,Y),this.bytes+=Y}has(Q){return this.cache.has(Q)}delete(Q){if(this.sizes){let J=this.sizes.get(Q);if(J!==void 0)this.bytes-=J,this.sizes.delete(Q)}return this.cache.delete(Q)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var B=new Map,_J=500;function CJ(Q,J){if(J?.includes("g"))return new RegExp(Q,J);let Y=`${Q}:${J||""}`;if(!B.has(Y)){if(B.size>=_J){let $=B.keys().next().value;if($)B.delete($)}B.set(Y,new RegExp(Q,J))}return B.get(Y)}class qJ{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(Q){let J=Array.from(new Set(Q)),Y=J.sort().join(","),$=this.pool.find((W)=>W.context.join(",")===Y);if($)return $.func;let Z=this.fnCache,q=this.fnCacheMaxSize,U=(...W)=>{return(G)=>{try{let X=`${Y}:${G}`,V=Z.get(X);if(!V){if(Z.size>=q){let A=Z.keys().next().value;if(A)Z.delete(A)}V=Function(...J,`
|
|
4
4
|
'use strict';
|
|
5
5
|
try {
|
|
@@ -11,7 +11,7 @@ catch (e) {
|
|
|
11
11
|
}
|
|
12
12
|
throw e;
|
|
13
13
|
}
|
|
14
|
-
`),Z.set(X,V)}return V(...W)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:U,context:J.slice()});return U}clear(){this.pool.length=0,this.fnCache.clear()}}var pJ=new qJ;class UJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(Q){this.enabled=Q}isEnabled(){return this.enabled}setBudget(Q,J){this.budgets.set(Q,{warnThreshold:0.8,action:"warn",...J})}setBudgets(Q){for(let[J,Y]of Object.entries(Q))this.setBudget(J,Y)}removeBudget(Q){this.budgets.delete(Q)}getBudgets(){let Q={};for(let[J,Y]of this.budgets.entries())Q[J]=Y;return Q}onViolation(Q){this.violationHandlers.push(Q)}offViolation(Q){let J=this.violationHandlers.indexOf(Q);if(J!==-1)this.violationHandlers.splice(J,1)}time(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}async timeAsync(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=await J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}checkBudget(Q,J){let Y=this.budgets.get(Q);if(!Y)return;let $=J/Y.maxTime*100,Z=Y.warnThreshold!==void 0?J>=Y.maxTime*Y.warnThreshold&&J<Y.maxTime:!1,q=J>=Y.maxTime;if(!Z&&!q)return;let U={label:Q,actualTime:J,budgetTime:Y.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:Z};this.violations.push(U);while(this.violations.length>this.maxViolations)this.violations.shift();for(let G of this.violationHandlers)try{G(U)}catch{}let W=Z?`[Performance Warning] "${Q}" took ${J.toFixed(2)}ms (${$.toFixed(1)}% of ${Y.maxTime}ms budget)`:`[Performance Budget Exceeded] "${Q}" took ${J.toFixed(2)}ms (exceeded ${Y.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Y.action){case"log":console.log(W);break;case"warn":console.warn(W);break;case"error":console.error(W);break;case"throw":if(q)throw Error(W);else console.warn(W);break}}recordTime(Q,J){let Y=this.metrics.get(Q);if(Y)Y.count++,Y.totalTime+=J,Y.maxTime=Math.max(Y.maxTime,J),Y.minTime=Math.min(Y.minTime,J);else this.metrics.set(Q,{count:1,totalTime:J,maxTime:J,minTime:J})}getStats(Q){if(Q){let Y=this.metrics.get(Q);if(!Y)return{};let $=this.budgets.get(Q);return{count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:$?.maxTime,budgetUtilization:$?Y.totalTime/Y.count/$.maxTime*100:void 0}}let J={};for(let[Y,$]of this.metrics.entries()){let Z=this.budgets.get(Y);J[Y]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:Z?.maxTime,budgetUtilization:Z?$.totalTime/$.count/Z.maxTime*100:void 0}}return J}getViolations(Q){if(Q)return this.violations.filter((J)=>J.label===Q);return[...this.violations]}getViolationStats(){let Q={},J=0,Y=0;for(let $ of this.violations)if(Q[$.label]=(Q[$.label]||0)+1,$.isWarning)J++;else Y++;return{total:this.violations.length,byLabel:Q,warnings:J,errors:Y}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var h=null;function zJ(){if(!h)h=new UJ;return h}var gJ=new Proxy({},{get(Q,J){return zJ()[J]}});var WJ=[];function FJ(Q){let J=new c(Q);return WJ.push(J),J}function hJ(){for(let Q of WJ)Q.clear()}function i(Q,...J){return`${J.map((Y)=>String(Y??"")).join("\x00")}\x00${Q.length}\x00${Bun.hash(Q)}`}function cJ(Q){let J=[];for(let Y of new Set(Q))try{J.push({path:Y,mtimeMs:OJ.statSync(Y).mtimeMs})}catch{}return J}function iJ(Q){for(let J of Q)try{if(OJ.statSync(J.path).mtimeMs!==J.mtimeMs)return!1}catch{return!1}return!0}var L=null,n=!1,I=null,M="",K=!1,IJ=256,z=new Map,j=new Map,H=null,w=null;function k(Q){return Bun.hash(Q).toString(16).padStart(16,"0").slice(0,16)}function l(Q,J){if(z.has(Q))z.delete(Q);else if(z.size>=IJ)z.delete(z.keys().next().value);z.set(Q,J)}function HJ(Q){let J=k(Q);if(j.has(J))j.delete(J);else if(j.size>=IJ)j.delete(j.keys().next().value);return j.set(J,Q),J}function eJ(Q){let J=j.get(Q);if(J===void 0)return;return j.delete(Q),j.set(Q,J),J}async function TJ(Q){if(!H)return null;try{let J=Bun.file(O.join(H,`cw-${k(Q)}.css`));if(!await J.exists())return null;return await J.text()}catch{return null}}async function BJ(Q,J){if(!H)return;try{if(!fs.existsSync(H))fs.mkdirSync(H,{recursive:!0});await Bun.write(O.join(H,`cw-${k(Q)}.css`),J)}catch{}}async function GJ(Q){try{let J=await import(Q);if(J&&J.CSSGenerator)return{CSSGenerator:J.CSSGenerator,config:J.config,build:J.build,defaultConfig:J.defaultConfig,extractClasses:J.extractClasses}}catch{}return null}function KJ(){let Q=[],J=process.cwd();while(J!==O.dirname(J))Q.push(O.join(J,"node_modules","@cwcss","crosswind","dist","index.js")),Q.push(O.join(J,"node_modules","@cwcss","crosswind","src","index.ts")),Q.push(O.join(J,"pantry","@cwcss","crosswind","dist","index.js")),Q.push(O.join(J,"pantry","@cwcss","crosswind","src","index.ts")),Q.push(O.join(J,"node_modules","@stacksjs","crosswind","dist","index.js")),Q.push(O.join(J,"pantry","@stacksjs","crosswind","dist","index.js")),J=O.dirname(J);return Q}function RJ(){let Q=[],J=process.env.HOME||process.env.USERPROFILE||"";if(J){let Y=[O.join(J,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),O.join(J,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),O.join(J,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),O.join(J,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),O.join(J,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),O.join(J,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];Q.push(...Y)}return Q.push(O.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),Q.push(O.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),Q}async function XJ(){if(n)return L;n=!0;try{let Q=async(Z)=>{for(let q of Z){if(!await Bun.file(q).exists())continue;let U=await GJ(q);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} CSS engine loaded from ${O.dirname(O.dirname(q))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Z=O.resolve(process.env.CROSSWIND_SRC),q=await Q([Z]);if(!q)throw Error(`CROSSWIND_SRC did not resolve to a Crosswind module: ${Z}`);return L=q,L}let J=await Q(KJ());if(J)return L=J,L;let Y=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let Z of Y){let q=await GJ(Z);if(q){if(L=q,!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} CSS engine loaded`);return L}}let $=await Q(RJ());if($)return L=$,L;throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${F.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${F.reset}`),console.warn(`${F.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${F.reset}`),null}}function JQ(){x.clear(),z.clear(),j.clear()}function QQ(){x.clear(),L=null,n=!1,I=null,M="",z.clear(),j.clear(),w=null}async function VJ(Q){try{if(!AJ({name:"crosswind",cwd:Q}))return null;let{loadConfigWithResult:J}=await import("bunfig"),Y=await J({name:"crosswind",cwd:Q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!Y?.path||!Y.config||Object.keys(Y.config).length===0)return null;let $=O.relative(Q,Y.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} Loaded config from ${$||Y.path}`);return Y.config}catch(J){if(J instanceof Error&&J.name==="ConfigNotFoundError")return null;return console.warn(`${F.yellow}[Crosswind]${F.reset} Failed to load crosswind config:`,J instanceof Error?J.message:J),null}}async function PJ(Q){let J=null;try{let{loadStxConfig:Y}=await import("./chunk-cg8dd896.js"),$=await Y(Q);if($.css)if(typeof $.css==="string"){let Z=O.isAbsolute($.css)?$.css:O.resolve(Q,$.css);if(await Bun.file(Z).exists()){let q=await import(Z);J=q.default||q,console.log(`${F.green}[Crosswind]${F.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(J={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let Z=O.isAbsolute($.css.config)?$.css.config:O.resolve(Q,$.css.config);if(await Bun.file(Z).exists()){let q=await import(Z);J={...q.default||q,...J}}}console.log(`${F.green}[Crosswind]${F.reset} Using inline CSS config from stx.config.ts`)}}catch{}return J||await VJ(Q)}function EJ(Q){try{let J=new WeakSet;return k(JSON.stringify(Q??{},(Y,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(J.has($))return"[circular]";J.add($)}return $})??"")}catch{return"unhashable"}}async function DJ(Q){if(K)return M;K=!0;try{let J=await XJ();if(!J||!J.build)return K=!1,"";if(!I)I=await VJ(Q);if(!I)return K=!1,"";let Y=J.defaultConfig?.theme||{},$=I.theme||{},Z={...J.defaultConfig,...I,theme:{...Y,...$,extend:{...Y.extend||{},...$.extend||{}}}},q=performance.now(),U=await J.build(Z),W=performance.now()-q;if(M=U.css,console.log(`${F.cyan}[Crosswind]${F.reset} Built ${U.classes.size} classes in ${W.toFixed(1)}ms`),Z.output){let G=O.isAbsolute(Z.output)?Z.output:O.join(Q,Z.output),X=O.dirname(G);if(!fs.existsSync(X))fs.mkdirSync(X,{recursive:!0});await Bun.write(G,U.css)}return K=!1,U.css}catch(J){return console.error(`${F.red}[Crosswind]${F.reset} Build error:`,J),K=!1,M}}async function YQ(Q){I=null,await DJ(Q)}function $Q(){return M}function MJ(Q){let J=new Set,Y=/class\s*=\s*["']([^"']+)["']/gi,$=Y.exec(Q);while($!==null){for(let U of $[1].split(/\s+/))if(U.trim())J.add(U.trim());$=Y.exec(Q)}let Z=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,q=Z.exec(Q);while(q!==null){let U=q[1].match(/'([^']+)'/g);if(U){for(let W of U)for(let G of W.slice(1,-1).split(/\s+/))if(G.trim())J.add(G.trim())}q=Z.exec(Q)}return J}var x=FJ(64);async function wJ(Q,J){let Y=x.get(i(Q,J,w));if(Y!==void 0)return Y;let $=await SJ(Q,J);if($)x.set(i(Q,J,w),$);return $}async function SJ(Q,J){try{let Y=await XJ();if(!Y)return"";let $=typeof Y.extractClasses==="function"?Y.extractClasses(Q):MJ(Q);if($.size===0)return"";let Z=J?O.resolve(J):process.cwd();if(!H)H=jJ(Z,"cache");let q=[...$].sort().join(" "),U=`${w||"default"}::${q}`,W=z.get(U);if(W!==void 0)return l(U,W),W;let G=await TJ(U);if(G!==null)return l(U,G),G;if(!I)I=await PJ(Z),w=EJ(I);let X=Y.defaultConfig||Y.config,V=I||{},A=ZJ(X,V),{safelist:T,includePreflight:R,minify:b,tokenCSS:LJ}=A,o=A.config,P=new Y.CSSGenerator(o);for(let N of T)P.generate(N);for(let N of $)P.generate(N);let _=P.toCSS(R,b),r=o.shortcuts||V.shortcuts||{};for(let[N,y]of Object.entries(r)){if(!$.has(N)&&!T.includes(N))continue;let f=y.split(/\s+/).filter(Boolean);for(let D of f)P.generate(D)}_=P.toCSS(R,b);let E=_.split(`
|
|
14
|
+
`),Z.set(X,V)}return V(...W)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:U,context:J.slice()});return U}clear(){this.pool.length=0,this.fnCache.clear()}}var pJ=new qJ;class UJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(Q){this.enabled=Q}isEnabled(){return this.enabled}setBudget(Q,J){this.budgets.set(Q,{warnThreshold:0.8,action:"warn",...J})}setBudgets(Q){for(let[J,Y]of Object.entries(Q))this.setBudget(J,Y)}removeBudget(Q){this.budgets.delete(Q)}getBudgets(){let Q={};for(let[J,Y]of this.budgets.entries())Q[J]=Y;return Q}onViolation(Q){this.violationHandlers.push(Q)}offViolation(Q){let J=this.violationHandlers.indexOf(Q);if(J!==-1)this.violationHandlers.splice(J,1)}time(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}async timeAsync(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=await J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}checkBudget(Q,J){let Y=this.budgets.get(Q);if(!Y)return;let $=J/Y.maxTime*100,Z=Y.warnThreshold!==void 0?J>=Y.maxTime*Y.warnThreshold&&J<Y.maxTime:!1,q=J>=Y.maxTime;if(!Z&&!q)return;let U={label:Q,actualTime:J,budgetTime:Y.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:Z};this.violations.push(U);while(this.violations.length>this.maxViolations)this.violations.shift();for(let G of this.violationHandlers)try{G(U)}catch{}let W=Z?`[Performance Warning] "${Q}" took ${J.toFixed(2)}ms (${$.toFixed(1)}% of ${Y.maxTime}ms budget)`:`[Performance Budget Exceeded] "${Q}" took ${J.toFixed(2)}ms (exceeded ${Y.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Y.action){case"log":console.log(W);break;case"warn":console.warn(W);break;case"error":console.error(W);break;case"throw":if(q)throw Error(W);else console.warn(W);break}}recordTime(Q,J){let Y=this.metrics.get(Q);if(Y)Y.count++,Y.totalTime+=J,Y.maxTime=Math.max(Y.maxTime,J),Y.minTime=Math.min(Y.minTime,J);else this.metrics.set(Q,{count:1,totalTime:J,maxTime:J,minTime:J})}getStats(Q){if(Q){let Y=this.metrics.get(Q);if(!Y)return{};let $=this.budgets.get(Q);return{count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:$?.maxTime,budgetUtilization:$?Y.totalTime/Y.count/$.maxTime*100:void 0}}let J={};for(let[Y,$]of this.metrics.entries()){let Z=this.budgets.get(Y);J[Y]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:Z?.maxTime,budgetUtilization:Z?$.totalTime/$.count/Z.maxTime*100:void 0}}return J}getViolations(Q){if(Q)return this.violations.filter((J)=>J.label===Q);return[...this.violations]}getViolationStats(){let Q={},J=0,Y=0;for(let $ of this.violations)if(Q[$.label]=(Q[$.label]||0)+1,$.isWarning)J++;else Y++;return{total:this.violations.length,byLabel:Q,warnings:J,errors:Y}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var h=null;function zJ(){if(!h)h=new UJ;return h}var gJ=new Proxy({},{get(Q,J){return zJ()[J]}});var WJ=[];function FJ(Q){let J=new c(Q);return WJ.push(J),J}function hJ(){for(let Q of WJ)Q.clear()}function i(Q,...J){return`${J.map((Y)=>String(Y??"")).join("\x00")}\x00${Q.length}\x00${Bun.hash(Q)}`}function cJ(Q){let J=[];for(let Y of new Set(Q))try{J.push({path:Y,mtimeMs:OJ.statSync(Y).mtimeMs})}catch{}return J}function iJ(Q){for(let J of Q)try{if(OJ.statSync(J.path).mtimeMs!==J.mtimeMs)return!1}catch{return!1}return!0}var L=null,n=!1,I=null,M="",K=!1,IJ=256,z=new Map,j=new Map,H=null,w=null;function k(Q){return Bun.hash(Q).toString(16).padStart(16,"0").slice(0,16)}function l(Q,J){if(z.has(Q))z.delete(Q);else if(z.size>=IJ)z.delete(z.keys().next().value);z.set(Q,J)}function HJ(Q){let J=k(Q);if(j.has(J))j.delete(J);else if(j.size>=IJ)j.delete(j.keys().next().value);return j.set(J,Q),J}function eJ(Q){let J=j.get(Q);if(J===void 0)return;return j.delete(Q),j.set(Q,J),J}async function TJ(Q){if(!H)return null;try{let J=Bun.file(O.join(H,`cw-${k(Q)}.css`));if(!await J.exists())return null;return await J.text()}catch{return null}}async function BJ(Q,J){if(!H)return;try{if(!fs.existsSync(H))fs.mkdirSync(H,{recursive:!0});await Bun.write(O.join(H,`cw-${k(Q)}.css`),J)}catch{}}async function GJ(Q){try{let J=await import(Q);if(J&&J.CSSGenerator)return{CSSGenerator:J.CSSGenerator,config:J.config,build:J.build,defaultConfig:J.defaultConfig,extractClasses:J.extractClasses}}catch{}return null}function KJ(){let Q=[],J=process.cwd();while(J!==O.dirname(J))Q.push(O.join(J,"node_modules","@cwcss","crosswind","dist","index.js")),Q.push(O.join(J,"node_modules","@cwcss","crosswind","src","index.ts")),Q.push(O.join(J,"pantry","@cwcss","crosswind","dist","index.js")),Q.push(O.join(J,"pantry","@cwcss","crosswind","src","index.ts")),Q.push(O.join(J,"node_modules","@stacksjs","crosswind","dist","index.js")),Q.push(O.join(J,"pantry","@stacksjs","crosswind","dist","index.js")),J=O.dirname(J);return Q}function RJ(){let Q=[],J=process.env.HOME||process.env.USERPROFILE||"";if(J){let Y=[O.join(J,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),O.join(J,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),O.join(J,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),O.join(J,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),O.join(J,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),O.join(J,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];Q.push(...Y)}return Q.push(O.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),Q.push(O.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),Q}async function XJ(){if(n)return L;n=!0;try{let Q=async(Z)=>{for(let q of Z){if(!await Bun.file(q).exists())continue;let U=await GJ(q);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} CSS engine loaded from ${O.dirname(O.dirname(q))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Z=O.resolve(process.env.CROSSWIND_SRC),q=await Q([Z]);if(!q)throw Error(`CROSSWIND_SRC did not resolve to a Crosswind module: ${Z}`);return L=q,L}let J=await Q(KJ());if(J)return L=J,L;let Y=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let Z of Y){let q=await GJ(Z);if(q){if(L=q,!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} CSS engine loaded`);return L}}let $=await Q(RJ());if($)return L=$,L;throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${F.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${F.reset}`),console.warn(`${F.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${F.reset}`),null}}function JQ(){x.clear(),z.clear(),j.clear()}function QQ(){x.clear(),L=null,n=!1,I=null,M="",z.clear(),j.clear(),w=null}async function VJ(Q){try{if(!AJ({name:"crosswind",cwd:Q}))return null;let{loadConfigWithResult:J}=await import("bunfig"),Y=await J({name:"crosswind",cwd:Q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!Y?.path||!Y.config||Object.keys(Y.config).length===0)return null;let $=O.relative(Q,Y.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} Loaded config from ${$||Y.path}`);return Y.config}catch(J){if(J instanceof Error&&J.name==="ConfigNotFoundError")return null;return console.warn(`${F.yellow}[Crosswind]${F.reset} Failed to load crosswind config:`,J instanceof Error?J.message:J),null}}async function PJ(Q){let J=null;try{let{loadStxConfig:Y}=await import("./chunk-4r06061f.js"),$=await Y(Q);if($.css)if(typeof $.css==="string"){let Z=O.isAbsolute($.css)?$.css:O.resolve(Q,$.css);if(await Bun.file(Z).exists()){let q=await import(Z);J=q.default||q,console.log(`${F.green}[Crosswind]${F.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(J={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let Z=O.isAbsolute($.css.config)?$.css.config:O.resolve(Q,$.css.config);if(await Bun.file(Z).exists()){let q=await import(Z);J={...q.default||q,...J}}}console.log(`${F.green}[Crosswind]${F.reset} Using inline CSS config from stx.config.ts`)}}catch{}return J||await VJ(Q)}function EJ(Q){try{let J=new WeakSet;return k(JSON.stringify(Q??{},(Y,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(J.has($))return"[circular]";J.add($)}return $})??"")}catch{return"unhashable"}}async function DJ(Q){if(K)return M;K=!0;try{let J=await XJ();if(!J||!J.build)return K=!1,"";if(!I)I=await VJ(Q);if(!I)return K=!1,"";let Y=J.defaultConfig?.theme||{},$=I.theme||{},Z={...J.defaultConfig,...I,theme:{...Y,...$,extend:{...Y.extend||{},...$.extend||{}}}},q=performance.now(),U=await J.build(Z),W=performance.now()-q;if(M=U.css,console.log(`${F.cyan}[Crosswind]${F.reset} Built ${U.classes.size} classes in ${W.toFixed(1)}ms`),Z.output){let G=O.isAbsolute(Z.output)?Z.output:O.join(Q,Z.output),X=O.dirname(G);if(!fs.existsSync(X))fs.mkdirSync(X,{recursive:!0});await Bun.write(G,U.css)}return K=!1,U.css}catch(J){return console.error(`${F.red}[Crosswind]${F.reset} Build error:`,J),K=!1,M}}async function YQ(Q){I=null,await DJ(Q)}function $Q(){return M}function MJ(Q){let J=new Set,Y=/class\s*=\s*["']([^"']+)["']/gi,$=Y.exec(Q);while($!==null){for(let U of $[1].split(/\s+/))if(U.trim())J.add(U.trim());$=Y.exec(Q)}let Z=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,q=Z.exec(Q);while(q!==null){let U=q[1].match(/'([^']+)'/g);if(U){for(let W of U)for(let G of W.slice(1,-1).split(/\s+/))if(G.trim())J.add(G.trim())}q=Z.exec(Q)}return J}var x=FJ(64);async function wJ(Q,J){let Y=x.get(i(Q,J,w));if(Y!==void 0)return Y;let $=await SJ(Q,J);if($)x.set(i(Q,J,w),$);return $}async function SJ(Q,J){try{let Y=await XJ();if(!Y)return"";let $=typeof Y.extractClasses==="function"?Y.extractClasses(Q):MJ(Q);if($.size===0)return"";let Z=J?O.resolve(J):process.cwd();if(!H)H=jJ(Z,"cache");let q=[...$].sort().join(" "),U=`${w||"default"}::${q}`,W=z.get(U);if(W!==void 0)return l(U,W),W;let G=await TJ(U);if(G!==null)return l(U,G),G;if(!I)I=await PJ(Z),w=EJ(I);let X=Y.defaultConfig||Y.config,V=I||{},A=ZJ(X,V),{safelist:T,includePreflight:R,minify:b,tokenCSS:LJ}=A,o=A.config,P=new Y.CSSGenerator(o);for(let N of T)P.generate(N);for(let N of $)P.generate(N);let _=P.toCSS(R,b),r=o.shortcuts||V.shortcuts||{};for(let[N,y]of Object.entries(r)){if(!$.has(N)&&!T.includes(N))continue;let f=y.split(/\s+/).filter(Boolean);for(let D of f)P.generate(D)}_=P.toCSS(R,b);let E=_.split(`
|
|
15
15
|
`);for(let[N,y]of Object.entries(r)){if(!$.has(N)&&!T.includes(N))continue;let f=y.split(/\s+/).filter(Boolean),D=[],C=[];for(let p of f){let a=p.startsWith("dark:"),s=`.${(a?p.slice(5):p).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let S=0;S<E.length;S++){let t=E[S].trim();if(t===`${s} {`||t.startsWith(`${s} {`)){let v=S,e="";while(v<E.length){if(e+=E[v],E[v].includes("}"))break;v++}let g=e.match(/\{([^}]+)\}/);if(g)if(a)C.push(g[1].trim());else D.push(g[1].trim());break}}}if(D.length)_+=`
|
|
16
16
|
.${N} { ${D.join(" ")} }`;if(C.length)_+=`
|
|
17
17
|
@media (prefers-color-scheme: dark) { .dark .${N} { ${C.join(" ")} } }`}return _=LJ+_,l(U,_),BJ(U,_),_}catch(Y){return console.warn("Failed to generate Crosswind CSS:",Y),""}}async function ZQ(Q,J,Y=!1){let $=await wJ(Q,J);if(!$)return Q;let Z=Y?`<link data-crosswind="generated" rel="stylesheet" href="/_stx/crosswind.${HJ($)}.css">`:`<style data-crosswind="generated">
|
|
@@ -19,4 +19,4 @@ ${$}
|
|
|
19
19
|
</style>`,q=/(?:<style\b[^>]*\bdata-crosswind=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-crosswind=(?:"generated"|'generated')[^>]*>)/g;if(q.test(Q)){let U=!1;return Q.replace(q,()=>{if(U)return"";return U=!0,Z})}if(Q.includes("</head>"))return Q.replace("</head>",`${Z}
|
|
20
20
|
</head>`);if(Q.includes("<body"))return Q.replace(/<body([^>]*)>/,`<body$1>
|
|
21
21
|
${Z}`);return Z+Q}
|
|
22
|
-
export{c as
|
|
22
|
+
export{c as Qs,CJ as Rs,gJ as Ss,FJ as Ts,hJ as Us,i as Vs,cJ as Ws,iJ as Xs,d as Ys,ZJ as Zs,F as _s,eJ as $s,XJ as at,JQ as bt,QQ as ct,VJ as dt,PJ as et,EJ as ft,DJ as gt,YQ as ht,$Q as it,MJ as jt,wJ as kt,ZQ as lt};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as x,b as u,c as b,d as Az,e as G,f as d,h as y,i as I,j as Uz,k as v}from"./chunk-0y46fbkx.js";import{l as h,m as f,n as g}from"./chunk-q9n5swx7.js";import{
|
|
2
|
+
import{a as x,b as u,c as b,d as Az,e as G,f as d,h as y,i as I,j as Uz,k as v}from"./chunk-0y46fbkx.js";import{l as h,m as f,n as g}from"./chunk-q9n5swx7.js";import{yp as V}from"./chunk-ntfmdx5n.js";import"./chunk-1bwwtctk.js";import"./chunk-q9zsjgpf.js";import"./chunk-a6a9djpq.js";import"./chunk-txys90mf.js";import"./chunk-8ee6xtdz.js";import"./chunk-1spzqjve.js";import"./chunk-x9s335jt.js";import"./chunk-t7b39wwk.js";import"./chunk-w18t3nmy.js";import"./chunk-yvpagchj.js";import"./chunk-rhbq1var.js";import"./chunk-2c2z8n54.js";import{Zu as F}from"./chunk-71gwef4q.js";import l from"fs";import R from"path";function m(z,J){let Z=[R.join(z.root,"stx.config.ts"),R.join(z.root,"stx.config.js"),R.join(z.root,"stx.config.mjs")],K=J.debounceMs??300,$=null,X=[];for(let B of Z)try{if(!l.existsSync(B))continue;let Y=l.watch(B,(W)=>{if(W==="change"){if($)clearTimeout($);$=setTimeout(async()=>{d("Config file changed, restarting...");try{await J.onChange()}catch(j){G(`Failed to restart: ${j}`)}},K)}});X.push(Y)}catch{}return{stop(){if($)clearTimeout($);for(let B of X)B.close()}}}import E from"fs";import i from"path";var Gz=".stx/story/analytics.json",Nz=1,c=1e4;class M{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(z){this.storagePath=i.join(z,Gz),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let z=E.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Nz,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let z=i.dirname(this.storagePath);if(await E.promises.mkdir(z,{recursive:!0}),this.storage.events.length>c)this.storage.events=this.storage.events.slice(-c);await E.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:Hz(),startTime:Date.now(),componentViews:[]},this.storage.sessions.push(this.currentSession),this.dirty=!0}endSession(){if(this.currentSession)this.currentSession.endTime=Date.now(),this.currentSession=null}track(z){this.storage.events.push({...z,timestamp:Date.now()}),this.dirty=!0}trackView(z,J){if(this.endViewTiming(z),this.viewStartTimes.set(z,Date.now()),this.track({type:"view",componentId:z,variantId:J}),this.currentSession&&!this.currentSession.componentViews.includes(z))this.currentSession.componentViews.push(z)}endViewTiming(z){let J=this.viewStartTimes.get(z);if(J){let Z=Date.now()-J;this.track({type:"view",componentId:z,metadata:{duration:Z,endView:!0}}),this.viewStartTimes.delete(z)}}trackPropChange(z,J,Z){this.track({type:"prop_change",componentId:z,propName:J,metadata:{value:Z}})}trackVariantSwitch(z,J){this.track({type:"variant_switch",componentId:z,variantId:J})}trackSearch(z,J){this.track({type:"search",query:z,metadata:{resultCount:J}})}getComponentAnalytics(z,J){let Z=this.storage.events.filter((Q)=>Q.componentId===z),K=Z.filter((Q)=>Q.type==="view"&&!Q.metadata?.endView),$=Z.filter((Q)=>Q.type==="prop_change"),X=Z.filter((Q)=>Q.type==="variant_switch"),B={};for(let Q of $)if(Q.propName)B[Q.propName]=(B[Q.propName]||0)+1;let Y={};for(let Q of X)if(Q.variantId)Y[Q.variantId]=(Y[Q.variantId]||0)+1;let W=new Set(this.storage.sessions.filter((Q)=>Q.componentViews.includes(z)).map((Q)=>Q.id)),j=Z.filter((Q)=>Q.metadata?.duration).map((Q)=>Q.metadata.duration),U=j.length>0?j.reduce((Q,D)=>Q+D,0)/j.length:0,_=Object.entries(B).sort((Q,D)=>D[1]-Q[1]).slice(0,5).map(([Q])=>Q);return{componentId:z,componentName:J,viewCount:K.length,uniqueViews:W.size,lastViewed:K[K.length-1]?.timestamp,propChanges:B,topChangedProps:_,variantViews:Y,avgTimeSpent:U}}getMostViewedComponents(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="view"&&Z.componentId&&!Z.metadata?.endView)J.set(Z.componentId,(J.get(Z.componentId)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({componentId:Z,viewCount:K})).sort((Z,K)=>K.viewCount-Z.viewCount).slice(0,z)}getMostChangedProps(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="prop_change"&&Z.propName)J.set(Z.propName,(J.get(Z.propName)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({propName:Z,changeCount:K})).sort((Z,K)=>K.changeCount-Z.changeCount).slice(0,z)}getSearchAnalytics(){let z=this.storage.events.filter(($)=>$.type==="search"),J=new Map,Z=0;for(let $ of z){if($.query)J.set($.query,(J.get($.query)||0)+1);if($.metadata?.resultCount!==void 0)Z+=$.metadata.resultCount}let K=Array.from(J.entries()).map(([$,X])=>({query:$,count:X})).sort(($,X)=>X.count-$.count).slice(0,10);return{totalSearches:z.length,topQueries:K,avgResultCount:z.length>0?Z/z.length:0}}clear(){this.storage.events=[],this.storage.sessions=[],this.dirty=!0,this.startSession()}exportAnalytics(){return JSON.stringify({exportedAt:Date.now(),...this.storage},null,2)}}function Hz(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import P from"fs";import p from"path";var Fz=".stx/story/bookmarks.json",Vz=1;class T{storage;storagePath;dirty=!1;constructor(z){this.storagePath=p.join(z,Fz),this.storage=this.loadStorage()}loadStorage(){try{let z=P.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Vz,bookmarks:[]}}}async save(){if(!this.dirty)return;let z=p.dirname(this.storagePath);await P.promises.mkdir(z,{recursive:!0}),await P.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(z,J,Z,K={}){let $={id:Rz(),name:K.name||`${z}/${J}`,storyId:z,variantId:J,props:Z,created:Date.now(),notes:K.notes,color:K.color};return this.storage.bookmarks.push($),this.dirty=!0,$}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(z){return this.storage.bookmarks.filter((J)=>J.storyId===z)}getBookmark(z){return this.storage.bookmarks.find((J)=>J.id===z)}isBookmarked(z,J){return this.storage.bookmarks.some((Z)=>Z.storyId===z&&Z.variantId===J)}updateBookmark(z,J){let Z=this.getBookmark(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deleteBookmark(z){let J=this.storage.bookmarks.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.bookmarks.splice(J,1),this.dirty=!0,!0}toggleBookmark(z,J,Z){let K=this.storage.bookmarks.find((X)=>X.storyId===z&&X.variantId===J);if(K)return this.deleteBookmark(K.id),{added:!1};return{added:!0,bookmark:this.addBookmark(z,J,Z)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(z,J=!0){let Z=JSON.parse(z),K=0;for(let $ of Z.bookmarks){if(J){let X=this.storage.bookmarks.find((B)=>B.id===$.id);if(X)Object.assign(X,$);else this.storage.bookmarks.push($)}else this.storage.bookmarks.push($);K++}if(K>0)this.dirty=!0;return K}}function Rz(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var N=new Set;function s(){return{open(z){N.add(z),z.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(z){N.delete(z)},message(z,J){}}}function q(z){let J=JSON.stringify({...z,timestamp:z.timestamp||Date.now()});for(let Z of N)try{Z.send(J)}catch{N.delete(Z)}}function n(z,J){q({type:"story-update",data:{storyId:z,...J}})}function a(z,J){q({type:"story-add",data:{storyId:z,...J}})}function o(z){q({type:"story-remove",data:{storyId:z}})}function r(z){return`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
const ws = new WebSocket('${z}');
|
|
@@ -556,7 +556,7 @@ window.__stxPerformance = {
|
|
|
556
556
|
|
|
557
557
|
window.clearPerformanceMetrics = () => window.__stxPerformance.clear();
|
|
558
558
|
</script>
|
|
559
|
-
`}import w from"fs";import Xz from"path";var Mz=".stx/story/presets.json",C=1,Pz=10;class k{storage;storagePath;dirty=!1;constructor(z){this.storagePath=Xz.join(z,Mz),this.storage=this.loadStorage()}loadStorage(){try{let z=w.readFileSync(this.storagePath,"utf-8"),J=JSON.parse(z);if(J.version!==C)return this.migrateStorage(J);return J}catch{return{version:C,presets:[],recentIds:[]}}}migrateStorage(z){return{version:C,presets:z.presets||[],recentIds:z.recentIds||[]}}async save(){if(!this.dirty)return;let z=Xz.dirname(this.storagePath);await w.promises.mkdir(z,{recursive:!0}),await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(z,J,Z={}){let K={id:Tz(),name:z,description:Z.description,props:J,componentId:Z.componentId,created:Date.now(),usageCount:0,tags:Z.tags};return this.storage.presets.push(K),this.dirty=!0,K}getPreset(z){return this.storage.presets.find((J)=>J.id===z)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(z){return this.storage.presets.filter((J)=>!J.componentId||J.componentId===z)}getRecentPresets(){return this.storage.recentIds.map((z)=>this.getPreset(z)).filter((z)=>z!==void 0)}usePreset(z){let J=this.getPreset(z);if(!J)return;return J.lastUsed=Date.now(),J.usageCount++,this.storage.recentIds=[z,...this.storage.recentIds.filter((Z)=>Z!==z)].slice(0,Pz),this.dirty=!0,J}updatePreset(z,J){let Z=this.getPreset(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deletePreset(z){let J=this.storage.presets.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.presets.splice(J,1),this.storage.recentIds=this.storage.recentIds.filter((Z)=>Z!==z),this.dirty=!0,!0}searchPresets(z){let J=z.toLowerCase();return this.storage.presets.filter((Z)=>{if(Z.name.toLowerCase().includes(J))return!0;if(Z.description?.toLowerCase().includes(J))return!0;if(Z.tags?.some((K)=>K.toLowerCase().includes(J)))return!0;return!1})}getMostUsedPresets(z=5){return[...this.storage.presets].sort((J,Z)=>Z.usageCount-J.usageCount).slice(0,z)}exportPresets(z){let J=z?this.storage.presets.filter((Z)=>z.includes(Z.id)):this.storage.presets;return JSON.stringify({presets:J},null,2)}importPresets(z,J=!1){let Z=JSON.parse(z),K=0;for(let $ of Z.presets){let X=this.storage.presets.find((B)=>B.id===$.id);if(X&&!J)continue;if(X)Object.assign(X,$);else this.storage.presets.push($);K++}if(K>0)this.dirty=!0;return K}}function Tz(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";var Qz=new Map;async function H(z,J,Z={}){let K=performance.now(),$=[];try{let X=await S.promises.stat(J),B=Qz.get(J),Y;if(B&&B.mtime===X.mtimeMs)Y=B.content;else Y=await S.promises.readFile(J,"utf-8"),Qz.set(J,{content:Y,mtime:X.mtimeMs,analyzed:null});let{processDirectives:W}=await import("./chunk-
|
|
559
|
+
`}import w from"fs";import Xz from"path";var Mz=".stx/story/presets.json",C=1,Pz=10;class k{storage;storagePath;dirty=!1;constructor(z){this.storagePath=Xz.join(z,Mz),this.storage=this.loadStorage()}loadStorage(){try{let z=w.readFileSync(this.storagePath,"utf-8"),J=JSON.parse(z);if(J.version!==C)return this.migrateStorage(J);return J}catch{return{version:C,presets:[],recentIds:[]}}}migrateStorage(z){return{version:C,presets:z.presets||[],recentIds:z.recentIds||[]}}async save(){if(!this.dirty)return;let z=Xz.dirname(this.storagePath);await w.promises.mkdir(z,{recursive:!0}),await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(z,J,Z={}){let K={id:Tz(),name:z,description:Z.description,props:J,componentId:Z.componentId,created:Date.now(),usageCount:0,tags:Z.tags};return this.storage.presets.push(K),this.dirty=!0,K}getPreset(z){return this.storage.presets.find((J)=>J.id===z)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(z){return this.storage.presets.filter((J)=>!J.componentId||J.componentId===z)}getRecentPresets(){return this.storage.recentIds.map((z)=>this.getPreset(z)).filter((z)=>z!==void 0)}usePreset(z){let J=this.getPreset(z);if(!J)return;return J.lastUsed=Date.now(),J.usageCount++,this.storage.recentIds=[z,...this.storage.recentIds.filter((Z)=>Z!==z)].slice(0,Pz),this.dirty=!0,J}updatePreset(z,J){let Z=this.getPreset(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deletePreset(z){let J=this.storage.presets.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.presets.splice(J,1),this.storage.recentIds=this.storage.recentIds.filter((Z)=>Z!==z),this.dirty=!0,!0}searchPresets(z){let J=z.toLowerCase();return this.storage.presets.filter((Z)=>{if(Z.name.toLowerCase().includes(J))return!0;if(Z.description?.toLowerCase().includes(J))return!0;if(Z.tags?.some((K)=>K.toLowerCase().includes(J)))return!0;return!1})}getMostUsedPresets(z=5){return[...this.storage.presets].sort((J,Z)=>Z.usageCount-J.usageCount).slice(0,z)}exportPresets(z){let J=z?this.storage.presets.filter((Z)=>z.includes(Z.id)):this.storage.presets;return JSON.stringify({presets:J},null,2)}importPresets(z,J=!1){let Z=JSON.parse(z),K=0;for(let $ of Z.presets){let X=this.storage.presets.find((B)=>B.id===$.id);if(X&&!J)continue;if(X)Object.assign(X,$);else this.storage.presets.push($);K++}if(K>0)this.dirty=!0;return K}}function Tz(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";var Qz=new Map;async function H(z,J,Z={}){let K=performance.now(),$=[];try{let X=await S.promises.stat(J),B=Qz.get(J),Y;if(B&&B.mtime===X.mtimeMs)Y=B.content;else Y=await S.promises.readFile(J,"utf-8"),Qz.set(J,{content:Y,mtime:X.mtimeMs,analyzed:null});let{processDirectives:W}=await import("./chunk-v5vqxa3e.js"),j={},U=A(Y);if(U)try{await V(U,j,J)}catch(O){$.push(`Warning: Could not extract script variables: ${O instanceof Error?O.message:String(O)}`)}if(Z.props)Object.assign(j,Z.props);let Q=await W(Y,j,J,{},new Set),D=Wz(Y),L=A(Y);return Q=jz(Q),Q=Dz(Q,j),{html:Q,css:D,js:L,errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}async function qz(z){try{let J=await S.promises.readFile(z,"utf-8"),Z=A(J);if(!Z)return null;let K={};if(await V(Z,K,z),Array.isArray(K.variants))return K.variants;return null}catch{return null}}async function Bz(z,J,Z,K){let $=J.story?.variants;if(!$){let Y=await qz(J.path);if(Y)$=Y}if(!$&&Z==="default")return H(z,J.path,{props:K||{}});if(!$)return H(z,J.path,{props:K||{}});let X=$.find((Y)=>Y.id===Z);if(!X&&Z==="default")return H(z,J.path,{props:K||{}});if(!X)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${Z}' not found`],duration:0};let B={...X.state,...K};if(X.source)return wz(z,X.source,B);return H(z,J.path,{props:B})}async function wz(z,J,Z={}){let K=performance.now(),$=[];try{let{processDirectives:X}=await import("./chunk-v5vqxa3e.js"),B={...Z},Y=A(J);if(Y)try{await V(Y,B,"inline-template.stx")}catch{}let j=await X(J,B,"inline-template.stx",{},new Set);return j=jz(j),j=Dz(j,B),{html:j,css:Wz(J),js:A(J),errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}function Wz(z){let J=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
|
|
560
560
|
`)}function jz(z){return z.replace(/<!--[\s\S]*?-->/g,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/^\s*\n/gm,"").trim()}function A(z){let J=[],Z=/<script\b[^>]*>([\s\S]*?)<\/script>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
|
|
561
561
|
`)}function Dz(z,J){let Z=`<script>window.__stxProps = ${JSON.stringify(J)};</script>`;return z+Z}function Lz(z){return z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}async function Oz(z,J){let Z=await I(z);f(z,Z);let K=v(z.config,Z);g(z,K),console.log(` Found ${Z.length} story files`);let $=typeof J.host==="string"?J.host:J.host===!0?"0.0.0.0":"localhost",X=new k(z.root),B=new T(z.root),Y=new M(z.root),W=s(),j=Bun.serve({port:J.port,hostname:$,fetch:async(Q,D)=>{let O=new URL(Q.url).pathname;if(O==="/__hmr"){if(D.upgrade(Q,{data:{isHmr:!0}}))return;return new Response("WebSocket upgrade failed",{status:400})}if(O.startsWith("/api/"))return Cz(z,O,Q,{presetsManager:X,bookmarksManager:B,analyticsTracker:Y});return kz(z,O,J.port)},websocket:{open(Q){W.open(Q)},close(Q){W.close(Q)},message(Q,D){W.message(Q,D)}}}),U=`http://${$}:${J.port}`,_=Uz(z,async(Q,D)=>{console.log(` [${Q}] ${D.relativePath}`);let L=await I(z);f(z,L);let O=v(z.config,L);if(g(z,O),Q==="add")a(D.id,{fileName:D.fileName});else if(Q==="unlink")o(D.id);else n(D.id,{fileName:D.fileName})});if(J.open){let Q=U;try{let{exec:D}=await import("child_process"),L=process.platform;D(`${L==="darwin"?"open":L==="win32"?"start":"xdg-open"} ${Q}`)}catch{}}return{server:j,url:U,close:async()=>{_(),j.stop()}}}async function Cz(z,J,Z,K){let{presetsManager:$,bookmarksManager:X,analyticsTracker:B}=K;if(J==="/api/stories")return Response.json({files:z.storyFiles.map((Y)=>({id:Y.id,fileName:Y.fileName,relativePath:Y.relativePath,treePath:Y.treePath})),tree:z.tree});if(J.startsWith("/api/story/")){let Y=J.slice(11),W=z.storyFiles.find((j)=>j.id===Y);if(!W)return new Response("Story not found",{status:404});try{let j=await Bun.file(W.path).text();return Response.json({id:W.id,fileName:W.fileName,relativePath:W.relativePath,content:j})}catch{return new Response("Error reading story",{status:500})}}if(J==="/api/config")return Response.json({theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets});if(J.startsWith("/api/render/")){let Y=new URL(Z.url),W=J.slice(12).split("/"),j=W[0],U=W[1]||"default",_,Q=Y.searchParams.get("props");if(Q)try{_=JSON.parse(Q)}catch{}let D=z.storyFiles.find((L)=>L.id===j);if(!D)return new Response("Story not found",{status:404});try{let L=await Bz(z,D,U,_);return Response.json({html:L.html,css:L.css,js:L.js,errors:L.errors,duration:L.duration})}catch(L){return Response.json({html:"",css:"",js:"",errors:[L instanceof Error?L.message:String(L)],duration:0},{status:500})}}if(J==="/api/presets"&&Z.method==="GET")return Response.json({presets:$.getAllPresets()});if(J==="/api/presets"&&Z.method==="POST")try{let Y=await Z.json(),W=$.createPreset(Y.name,Y.props,{componentId:Y.componentId,description:Y.description});return await $.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J.startsWith("/api/presets/")&&!J.includes("/use")&&Z.method==="GET"){let Y=J.slice(13),W=$.getPreset(Y);if(!W)return new Response("Preset not found",{status:404});return Response.json(W)}if(J.endsWith("/use")&&Z.method==="POST"){let Y=J.slice(13,-4),W=$.usePreset(Y);if(!W)return new Response("Preset not found",{status:404});return await $.save(),Response.json(W)}if(J.startsWith("/api/presets/")&&Z.method==="DELETE"){let Y=J.slice(13);if(!$.deletePreset(Y))return new Response("Preset not found",{status:404});return await $.save(),Response.json({success:!0})}if(J==="/api/bookmarks"&&Z.method==="GET")return Response.json({bookmarks:X.getAllBookmarks()});if(J==="/api/bookmarks"&&Z.method==="POST")try{let Y=await Z.json(),W=X.addBookmark(Y.storyId,Y.variantId,Y.props,{name:Y.name,notes:Y.notes,color:Y.color});return await X.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J==="/api/bookmarks/toggle"&&Z.method==="POST")try{let Y=await Z.json(),W=X.toggleBookmark(Y.storyId,Y.variantId,Y.props);return await X.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J.startsWith("/api/bookmarks/")&&J!=="/api/bookmarks/toggle"&&Z.method==="GET"){let Y=J.slice(15),W=X.getBookmark(Y);if(!W)return new Response("Bookmark not found",{status:404});return Response.json(W)}if(J.startsWith("/api/bookmarks/")&&Z.method==="DELETE"){let Y=J.slice(15);if(!X.deleteBookmark(Y))return new Response("Bookmark not found",{status:404});return await X.save(),Response.json({success:!0})}if(J==="/api/analytics/track"&&Z.method==="POST")try{let Y=await Z.json();if(Y.type==="view"&&Y.componentId)B.trackView(Y.componentId,Y.variantId);else if(Y.type==="prop_change"&&Y.componentId&&Y.propName)B.trackPropChange(Y.componentId,Y.propName,null);else if(Y.type==="variant_switch"&&Y.componentId&&Y.variantId)B.trackVariantSwitch(Y.componentId,Y.variantId);else if(Y.type==="search"&&Y.query)B.trackSearch(Y.query,0);return await B.save(),Response.json({success:!0})}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J==="/api/analytics/summary"&&Z.method==="GET")return Response.json({mostViewed:B.getMostViewedComponents(10),mostChangedProps:B.getMostChangedProps(10),searchAnalytics:B.getSearchAnalytics()});if(J.startsWith("/api/analytics/component/")&&Z.method==="GET"){let Y=J.slice(25),W=z.storyFiles.find((U)=>U.id===Y),j=B.getComponentAnalytics(Y,W?.fileName||Y);return Response.json(j)}return new Response("Not found",{status:404})}function kz(z,J,Z){let K=Sz(z,Z);return new Response(K,{headers:{"Content-Type":"text/html; charset=utf-8"}})}function Sz(z,J){let{theme:Z}=z.config,K=Z.title||"STX Story",$=`ws://localhost:${J}/__hmr`,X=r($);return`<!DOCTYPE html>
|
|
562
562
|
<html lang="en" class="${Z.darkClass||"dark"}">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ai as b,Bi as c,Ci as d,Di as e,Ei as f,Fi as g,zi as a}from"./chunk-xttsqmkm.js";import"./chunk-
|
|
2
|
+
import{Ai as b,Bi as c,Ci as d,Di as e,Ei as f,Fi as g,zi as a}from"./chunk-xttsqmkm.js";import"./chunk-71gwef4q.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{existsSync as U,statSync as V}from"fs";import z from"path";var W=/[*?[\]{}]/;function X(D){return W.test(D)}async function $(D,E={}){let H=E.cwd??process.cwd(),N=E.recursive!==!1,Q=E.ignorePaths??[],J=globalThis.Bun.Glob,K=new Set,F=(j)=>{if(j.includes(`${z.sep}node_modules${z.sep}`)||j.includes(`${z.sep}dist${z.sep}`))return;if(Q.some((q)=>q&&j.includes(z.normalize(q))))return;K.add(j)},R=async(j)=>{try{for await(let q of new J(j).scan({cwd:H,absolute:!0}))F(q)}catch{}};for(let j of D){if(!j)continue;if(X(j)){await R(j);continue}let q=z.resolve(H,j);if(!U(q))continue;if(V(q).isDirectory()){for await(let T of new J(N?"**/*.stx":"*.stx").scan({cwd:q,absolute:!0}))F(T);continue}F(q)}return[...K].sort()}
|
|
3
|
-
export{X as
|
|
3
|
+
export{X as Ms,$ as Ns};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Af as k,Bf as l,qf as a,rf as b,sf as c,tf as d,uf as e,vf as f,wf as g,xf as h,yf as i,zf as j}from"./chunk-vqxmxgaj.js";import"./chunk-71gwef4q.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Au as
|
|
2
|
+
import{Au as y,Bu as z,Cu as A,Du as B,Eu as C,Fu as D,Gu as E,Hu as F,Iu as G,Ju as H,Ku as I,Lu as J,Nu as K,Pu as L,cu as a,du as b,eu as c,fu as d,gu as e,hu as f,iu as g,ju as h,ku as i,lu as j,mu as k,nu as l,ou as m,pu as n,qu as o,ru as p,su as q,tu as r,uu as s,vu as t,wu as u,xu as v,yu as w,zu as x}from"./chunk-rhbq1var.js";import"./chunk-71gwef4q.js";L();export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$ as pl,$a as jn,$b as Bo,$c as Bp,$d as Bq,A as $j,Aa as tm,Ab as Vn,Ac as ap,Ad as aq,Ae as gr,B as ak,Ba as um,Bb as Wn,Bc as bp,Bd as bq,Be as hr,C as bk,Ca as Hm,Cb as Xn,Cc as cp,Cd as cq,Ce as ir,D as ck,Da as Im,Db as Yn,Dc as dp,Dd as dq,De as jr,E as Uk,Ea as Jm,Eb as Zn,Ec as ep,Ed as eq,Ee as kr,F as Vk,Fa as Km,Fb as _n,Fc as fp,Fd as fq,Fe as lr,G as Wk,Ga as Lm,Gb as $n,Gc as gp,Gd as gq,Ge as mr,H as Xk,Ha as Mm,Hb as ao,Hc as hp,Hd as hq,He as nr,I as Yk,Ia as Qm,Ib as bo,Ic as ip,Id as iq,Ie as or,J as Zk,Ja as Rm,Jb as co,Jc as jp,Jd as jq,Je as pr,K as _k,Ka as Sm,Kb as eo,Kc as kp,Kd as kq,Ke as qr,L as $k,La as Tm,Lb as fo,Lc as lp,Ld as lq,Le as rr,M as al,Ma as Um,Mb as mo,Mc as mp,Md as mq,Me as sr,N as bl,Na as Vm,Nb as no,Nc as np,Nd as nq,Ne as tr,O as cl,Oa as Wm,Ob as oo,Oc as op,Od as oq,Oe as ur,P as dl,Pa as Xm,Pb as po,Pc as pp,Pd as pq,Pe as vr,Q as el,Qa as Ym,Qb as qo,Qc as qp,Qd as qq,Qe as wr,R as fl,Ra as Zm,Rb as ro,Rc as rp,Rd as rq,Re as xr,S as gl,Sa as _m,Sb as so,Sc as sp,Sd as sq,Se as yr,T as hl,Ta as $m,Tb as to,Tc as tp,Td as tq,Te as zr,U as il,Ua as an,Ub as uo,Uc as up,Ud as uq,Ue as Ar,V as jl,Va as bn,Vb as vo,Vc as vp,Vd as vq,Ve as Br,W as kl,Wa as dn,Wb as wo,Wc as wp,Wd as wq,We as Cr,X as ll,Xa as en,Xb as xo,Xc as xp,Xd as xq,Y as ml,Ya as fn,Yb as yo,Yc as yp,Yd as yq,Z as nl,Za as gn,Zb as zo,Zc as zp,Zd as zq,_ as ol,_a as hn,_b as Ao,_c as Ap,_d as Aq,aa as ql,ab as kn,ac as Co,ad as Cp,ae as Cq,ba as rl,bb as ln,bc as Do,bd as Dp,be as Dq,ca as sl,cb as mn,cc as Eo,cd as Ep,ce as Eq,da as tl,db as nn,dc as Fo,dd as Fp,de as Fq,ea as ul,eb as on,ec as Go,ed as Gp,ee as Gq,fa as vl,fb as pn,fc as Ho,fd as Hp,fe as Hq,ga as wl,gb as qn,gc as Io,gd as Ip,ge as Iq,ha as xl,hb as rn,hc as Jo,hd as Jp,he as Jq,ia as yl,ib as sn,ic as Ko,id as Kp,ie as Kq,ja as zl,jb as tn,jc as Lo,jd as Lp,je as Lq,ka as Al,kb as un,kc as Mo,kd as Mp,ke as Mq,la as Bl,lb as vn,lc as No,ld as Np,le as Nq,ma as Cl,mb as wn,mc as Oo,md as Op,me as Oq,na as Dl,nb as zn,nc as Po,nd as Pp,ne as Vq,o as a,oa as El,ob as An,oc as Qo,od as Qp,oe as Wq,p as Mj,pa as im,pb as Bn,pc as Ro,pd as Rp,pe as Xq,q as Nj,qa as jm,qb as Cn,qc as So,qd as Sp,qe as Yq,r as Oj,ra as km,rb as In,rc as To,rd as Tp,re as Zq,s as Pj,sa as lm,sb as Jn,sc as Uo,sd as Up,se as _q,t as Qj,ta as mm,tb as Kn,tc as Vo,td as Vp,te as $q,u as Rj,ua as nm,ub as Ln,uc as Wo,ud as Wp,ue as ar,v as Sj,va as om,vb as Qn,vc as Xo,vd as Xp,ve as br,w as Tj,wa as pm,wb as Rn,wc as Yo,wd as Yp,we as cr,x as Uj,xa as qm,xb as Sn,xc as Zo,xd as Zp,xe as dr,y as Zj,ya as rm,yb as Tn,yc as _o,yd as _p,ye as er,z as _j,za as sm,zb as Un,zc as $o,zd as $p,ze as fr}from"./chunk-578te43w.js";import{$e as Mk,Xe as Ik,Ye as Jk,Ze as Kk,_e as Lk,af as Nk,bf as Ok,cf as Pk,df as Qk,ef as Rk,ff as Sk,gf as Tk}from"./chunk-s9z3d94k.js";import{hf as go,if as ho,jf as io,kf as jo,lf as ko,mf as lo}from"./chunk-ggem4nm2.js";import{nf as xn,of as yn}from"./chunk-n3ggrhb3.js";import{pf as Dn}from"./chunk-mw1szffx.js";import{Af as Fm,Bf as Gm,qf as vm,rf as wm,sf as xm,tf as ym,uf as zm,vf as Am,wf as Bm,xf as Cm,yf as Dm,zf as Em}from"./chunk-vqxmxgaj.js";import{Cf as Gk,Df as Hk}from"./chunk-5n2g2z63.js";import{Ef as hm}from"./chunk-kkrg94ay.js";import{Ff as Nm,Gf as Om,Hf as Pm,If as cn,Jf as En,Kf as Fn,Lf as Gn,Mf as Hn,Nf as Mn,Of as Nn,Pf as On,Qf as Pn}from"./chunk-6sha41vn.js";import{$f as nk,Rf as dk,Sf as ek,Tf as fk,Uf as gk,Vf as hk,Wf as ik,Xf as jk,Yf as kk,Zf as lk,_f as mk,ag as ok,bg as pk,cg as qk,dg as rk}from"./chunk-nx5qkm8k.js";import{eg as $i,fg as aj,gg as bj,hg as cj,ig as dj,jg as ej,kg as fj,lg as gj,mg as hj,ng as ij,og as jj}from"./chunk-89wwrrpk.js";import{pg as Bj,rg as Cj}from"./chunk-bz820epz.js";import{Ag as vk,Bg as wk,Cg as xk,Dg as yk,Fg as zk,Gg as Ak,Hg as Bk,Ig as Ck,Jg as Dk,Kg as Ek,Ng as Fk,xg as sk,yg as tk,zg as uk}from"./chunk-tvtnf09q.js";import{Og as Yl,Pg as Zl,Qg as _l,Rg as $l,Sg as cm,Tg as gm}from"./chunk-wyhp2hnm.js";import{Ug as am,Xg as bm}from"./chunk-kerjvqz9.js";import{dh as Fl,eh as Gl,fh as Hl,gh as Il,hh as Jl,ih as Kl,jh as Ll,kh as Ml,lh as Nl,mh as Ol,nh as Pl,oh as Ql,ph as Rl,qh as Sl,rh as Tl,sh as dm,th as em,uh as fm}from"./chunk-v2rx1rey.js";import{vh as lh,wh as mh,xh as nh,yh as oh}from"./chunk-49kk0s96.js";import{Dh as ph}from"./chunk-w3ycm4na.js";import{Eh as wh,Fh as xh,Gh as yh,Hh as zh,Ih as Ah,Jh as Bh}from"./chunk-dtnfedg1.js";import{Kh as Qi,Lh as Ri,Mh as Si,Qh as Ti,Rh as Ui,Sh as Vi}from"./chunk-brahft3h.js";import{$h as Ni,Th as Gi,Uh as Hi,Vh as Ii,Wh as Ji,Xh as Ki,Zh as Li,_h as Mi,ai as Oi,bi as Pi}from"./chunk-74cv4ta1.js";import{ci as wg,di as xg,ei as yg,fi as zg,gi as Ag,hi as Bg}from"./chunk-wcm80anz.js";import{ii as Cg,ji as Dg,ki as Eg,li as Fg,mi as Gg}from"./chunk-y7m2dpd3.js";import{ni as Hg,oi as Ig,pi as Jg,qi as Kg,ri as Lg}from"./chunk-9y0g8kzt.js";import{si as Mg,ti as Ng,ui as Og,vi as Pg,wi as Qg,xi as Rg,yi as Sg}from"./chunk-t6nseeb9.js";import{Ai as Ug,Bi as Vg,Ci as Wg,Di as Xg,Ei as Yg,zi as Tg}from"./chunk-xttsqmkm.js";import{Gi as Zg,Hi as _g,Ii as $g,Ji as ah,Ki as bh,Li as ch,Mi as dh,Ni as eh,Oi as fh,Pi as gh,Qi as hh,Ri as ih,Si as jh,Ti as kh}from"./chunk-54st8g2j.js";import{Vi as qg,Wi as rg}from"./chunk-dyqh15py.js";import{Zi as sg}from"./chunk-7x4xbgp7.js";import"./chunk-9n0gvfrg.js";import{bj as tg}from"./chunk-7q9mwh4v.js";import{cj as ug,dj as vg}from"./chunk-refwkt87.js";import{ej as ge,fj as he,gj as ie,hj as je,ij as ke,jj as le,kj as me,lj as ne,mj as oe,nj as pe,oj as qe,pj as re,qj as se,rj as te}from"./chunk-kzj42dav.js";import{sj as Te,tj as Ue}from"./chunk-ph0q97r5.js";import{Aj as Fe,Bj as Ge,Cj as He,Dj as Ie,Ej as Je,Fj as Ke,Gj as Le,Hj as Me,Ij as Ne,Jj as Oe,Kj as Pe,Lj as Qe,Mj as Re,Nj as Se}from"./chunk-w95sp0k9.js";import{Oj as Ve,Pj as We,Qj as Xe,Rj as Ye,Sj as Ze,Tj as _e,Uj as $e,Vj as af,Wj as bf,Xj as cf,Yj as df}from"./chunk-nsf6d5dq.js";import{qk as Pq,rk as Qq,sk as Rq,tk as Sq,uk as Tq,vk as Uq}from"./chunk-bxv3k5w8.js";import{Ak as Ul,Bk as Vl,Ck as Wl,Dk as Xl,wk as Vj,xk as Wj,yk as Xj,zk as Yj}from"./chunk-vf4tde50.js";import"./chunk-58f0mthg.js";import"./chunk-sqcpcnyf.js";import{$l as Xa,$m as Wb,$n as Wc,$o as Ae,$p as Hf,$q as Nh,$r as vj,Al as J,Am as qb,An as vc,Ao as Ld,Ap as gf,Aq as gg,Ar as vi,Bl as da,Bm as rb,Bn as wc,Bo as Md,Bq as hg,Br as wi,Cl as ea,Cm as yb,Cn as xc,Co as Nd,Cp as hf,Cq as ig,Cr as xi,Dl as fa,Dm as zb,Dn as yc,Do as Od,Dp as jf,Dq as jg,Dr as yi,El as ga,Em as Ab,En as zc,Eo as Pd,Ep as kf,Eq as kg,Er as zi,Fl as ha,Fm as Bb,Fn as Ac,Fo as Qd,Fp as lf,Fq as lg,Fr as Ai,Gl as ia,Gm as Cb,Gn as Bc,Go as Rd,Gp as mf,Gq as mg,Gr as Bi,Hm as Db,Hn as Cc,Ho as Sd,Hp as nf,Hq as ng,Hr as Ci,Im as Eb,In as Dc,Io as Td,Ip as of,Iq as og,Ir as Di,Jl as za,Jn as Ec,Jo as Ud,Jp as pf,Jq as pg,Jr as Ei,Kl as Aa,Km as Fb,Kn as Fc,Ko as Vd,Kp as qf,Kq as qh,Kr as Fi,Ll as Ba,Lm as Gb,Ln as Gc,Lo as Wd,Lp as rf,Lq as rh,Lr as Wi,Ml as Ca,Mm as Hb,Mn as Hc,Mo as Xd,Mp as sf,Mq as sh,Mr as Xi,Nl as Da,Nm as Ib,Nn as Ic,No as Yd,Np as tf,Nq as th,Nr as Yi,Om as Jb,On as Jc,Oo as Zd,Op as uf,Oq as uh,Or as Zi,Pm as Kb,Pn as Kc,Po as _d,Pp as vf,Pq as vh,Pr as _i,Ql as Ga,Qm as Lb,Qn as Lc,Qo as $d,Qp as wf,Qq as Ch,Qr as kj,Rl as Ha,Rm as Mb,Rn as Mc,Ro as ae,Rp as xf,Rq as Dh,Rr as lj,Sl as Ia,Sm as Nb,Sn as Nc,So as be,Sp as yf,Sq as Eh,Sr as mj,Tl as Pa,Tm as Ob,Tn as Oc,To as ce,Tp as zf,Tq as Fh,Tr as nj,Ul as Qa,Um as Pb,Un as Pc,Uo as de,Up as Af,Uq as Gh,Ur as oj,Vl as Ra,Vm as Qb,Vn as Qc,Vo as ee,Vp as Bf,Vq as Hh,Vr as pj,Wl as Sa,Wm as Rb,Wn as Rc,Wo as fe,Wp as Cf,Wq as Ih,Wr as qj,Xl as Ta,Xm as Sb,Xn as Sc,Xp as Df,Xq as Jh,Xr as rj,Yl as Ua,Ym as Tb,Yn as Tc,Yo as xe,Yp as Ef,Yq as Kh,Yr as sj,Zl as Va,Zm as Ub,Zn as Uc,Zo as ye,Zp as Ff,Zq as Lh,Zr as tj,_l as Wa,_m as Vb,_n as Vc,_o as ze,_p as Gf,_q as Mh,_r as uj,am as Ya,an as Xb,ao as Xc,ap as Be,aq as If,ar as Oh,as as wj,bn as Yb,bo as Yc,bp as Ce,bq as Jf,br as Ph,bs as xj,cn as Zb,co as Zc,cq as Kf,cr as Qh,cs as yj,dn as _b,do as _c,dq as Lf,dr as Rh,ds as zj,en as $b,eo as $c,ep as De,eq as Mf,er as Sh,es as Aj,fm as Za,fn as ac,fo as ad,fp as Ee,fq as Nf,fr as ai,fs as Dj,gm as _a,gn as bc,go as bd,gq as Of,gr as bi,gs as Ej,hm as $a,hn as cc,ho as cd,hp as ef,hq as Pf,hr as ci,hs as Fj,im as ab,in as dc,io as dd,iq as Qf,ir as di,is as Gj,jl as s,jm as bb,jn as ec,jo as ed,jq as Rf,jr as ei,js as Hj,kl as t,km as cb,kn as fc,ko as fd,kq as Sf,kr as fi,ks as Ij,ll as u,ln as gc,lo as gd,lq as Tf,lr as gi,ls as Jj,ml as v,mn as hc,mo as hd,mq as Uf,mr as hi,ms as Kj,nl as w,nm as db,nn as ic,no as id,nq as Vf,nr as ii,ns as Lj,ol as x,om as eb,on as jc,oo as jd,oq as Wf,or as ji,pl as y,pm as fb,pn as kc,po as Ad,pq as Xf,pr as ki,ql as z,qm as gb,qn as lc,qo as Bd,qq as Yf,qr as li,rl as A,rm as hb,rn as mc,ro as Cd,rq as Zf,rr as mi,sl as B,sm as ib,sn as nc,so as Dd,sq as _f,sr as ni,tl as C,tm as jb,tn as oc,to as Ed,tq as $f,tr as oi,ul as D,um as kb,un as pc,uo as Fd,uq as ag,ur as pi,vl as E,vm as lb,vn as qc,vo as Gd,vq as bg,vr as qi,wl as F,wm as mb,wn as rc,wo as Hd,wq as cg,wr as ri,xl as G,xm as nb,xn as sc,xo as Id,xq as dg,xr as si,yl as H,ym as ob,yn as tc,yo as Jd,yp as ff,yq as eg,yr as ti,zl as I,zm as pb,zn as uc,zo as Kd,zq as fg,zr as ui}from"./chunk-ntfmdx5n.js";import{As as p,Bs as q,Cs as r,os as d,ps as e,qs as f,rs as g,ss as h,ts as i,us as j,vs as k,ws as l,xs as m,ys as n,zs as o}from"./chunk-1bwwtctk.js";import{Ds as Th,Es as Uh,Fs as Vh,Gs as Wh,Hs as Xh,Is as Yh,Js as Zh,Ks as _h,Ls as $h}from"./chunk-q9zsjgpf.js";import{Ms as b,Ns as c}from"./chunk-a6a9djpq.js";import{Os as Ea,Ps as Fa}from"./chunk-txys90mf.js";import{$s as ub,Ys as sb,Zs as tb,jt as vb,kt as wb,lt as xb}from"./chunk-8ee6xtdz.js";import{mt as Ja,nt as Ka,ot as La,pt as Ma,qt as Na,rt as Oa}from"./chunk-1spzqjve.js";import{st as ue,tt as ve,ut as we}from"./chunk-x9s335jt.js";import{At as pd,Bt as qd,Ct as rd,Dt as sd,Et as td,Ft as ud,Gt as vd,Ht as wd,It as xd,Jt as yd,Kt as zd,vt as kd,wt as ld,xt as md,yt as nd,zt as od}from"./chunk-t7b39wwk.js";import"./chunk-w18t3nmy.js";import{$t as wa,Ot as ja,Pt as ka,Qt as la,Rt as ma,St as na,Tt as oa,Ut as pa,Vt as qa,Wt as ra,Xt as sa,Yt as ta,Zt as ua,_t as va,au as xa,bu as ya}from"./chunk-yvpagchj.js";import{Au as U,Bu as V,Cu as W,Du as X,Eu as Y,Fu as Z,Gu as _,Hu as $,Iu as aa,Ju as ba,Lu as ca,fu as K,gu as L,ju as M,ou as N,pu as O,vu as P,wu as Q,xu as R,yu as S,zu as T}from"./chunk-rhbq1var.js";import"./chunk-2c2z8n54.js";import"./chunk-71gwef4q.js";export{nk as writeNetlifyConfig,em as writeManifest,Sk as writeImageManifest,vo as wrapComponentForHMR,pr as withDefaults,Aj as webComponentDirectiveHandler,kp as watermark,mq as watchViews,al as watchMultiple,bl as watchEffect,$k as watch,Be as warmImagePlaceholders,ol as waitForStore,Zd as waitForLocale,ho as virtualPathFor,nj as videoDirective,uc as validators,tr as validated,Ld as validateValueEnhanced,rh as validateTemplate,pp as validateParams,Md as validateFormEnhanced,bq as validateFile,Hd as validateFields,Gd as validateField,th as validateDirective,ed as validateCspDirectives,Ij as validateConfig,jm as validateComponentScripts,Hm as validateComponentProps,pg as validateClientScript,oh as v,kb as usesSignalsInScript,pa as usesReactiveRuntime,Gh as userComponentFileExists,Wg as useVirtualList,sd as useTitle,nl as useStoreOrThrow,No as useStore,Zj as useStorage,xq as useSlots,$j as useSessionStorage,pd as useSeoMeta,pl as useRouteParams,rl as useRouteParamOrThrow,ql as useRouteParam,sd as usePageTitle,Se as useOptimistic,tl as useMiddlewareValue,sl as useMiddlewareState,_j as useLocalStorage,oo as useLoadingIndicator,nd as useHead,lh as useForm,zq as useAttrs,dq as uploadFiles,cq as uploadFile,kl as updateInstance,Qe as untrack,Wh as unregisterDirective,ll as unmountInstance,rb as unescapeHtml,ko as typecheckStxFiles,Fh as transpileTypeScript,cr as translate,w as transitionDirective,Ta as transformAutoImports,Bm as toUsers,Am as toUser,Vo as thumbnail,Wp as thumbHashToRGBA,Xp as thumbHashToDataURL,ra as templateNeedsRuntime,qa as templateHasReactiveContext,Ve as templateCache,Nb as syncRecordedResponse,so as stxClientHelpers,Af as structuredDataDirective,fr as stripLocalePrefix,Rl as stripDocumentWrapper,Fa as stripCommentsAndLiterals,nn as stringToStream,Uc as strictCspPreset,oe as streamingSuspenseDirective,se as streamToResponse,me as streamTemplateSimple,ge as streamTemplate,Uj as stopHmrServer,xm as stopBroadcasting,Ma as stateDirName,Na as stateDir,Fe as state,jg as startsDocument,Pn as startProductionServer,Dn as startInteractive,wm as startBroadcasting,hr as stampLocaleLayoutGroup,D as staggerDirective,np as srcsetUrls,E as springDirective,Dc as splitByPipe,Nl as spaNavVaryHeaders,io as sourcePathFor,up as smartBatchSign,Ih as slotContentHasExpressions,sp as signUrl,Dh as shouldTranspileTypeScript,Rj as shouldReloadOnChange,xp as shouldRefreshSignature,Sj as shouldIgnoreFile,Og as shouldCacheComponent,Zo as sharpen,wr as shape,La as setStateDir,xl as setRouteParams,yl as setMiddlewareState,Ae as setImagePlaceholder,rq as setGlobalProvide,Rb as setErrorLocale,Uk as setCurrentInstance,bj as setCachedVideoResult,Si as setCachedImageResult,Mi as setCached,zr as serveStxFile,Br as serveMultipleStxFiles,Mj as serveMarkdownFile,Zn as serveFile,Cr as serveApp,Yn as serve,yo as serializeState,cn as serializeSetCookie,$o as sepia,qd as seoMetaToHeadConfig,x as scrollAnimateDirective,q as screenReaderDirective,rj as scopeHTML,qj as scopeCSS,Df as scanForSitemapEntries,k as scanA11yTargets,l as scanA11yIssues,dp as saturation,qp as sanitizeParams,wc as sanitizeFilePath,xc as sanitizeExpression,yc as sanitizeDirectiveParams,vc as sanitizeDirectiveParam,zc as sanitizeComponentProps,pc as safeExecuteAsync,oc as safeExecute,xa as runtimeHandledXAttrsLiteral,tf as runPreProcessingMiddleware,uf as runPostProcessingMiddleware,Gn as runPageAction,Le as runMountCallbacks,ba as runMiddleware,il as runHooks,Xq as runDoctor,Me as runDestroyCallbacks,If as runComposers,ep as rotate,ph as rewriteImagesWithSiblings,Ob as responseBindings,Mh as resolveTemplatePath,c as resolveStxTargets,Ej as resolveStxDirectories,br as resolveI18n,To as resize,Za as resetPlaceholders,md as resetHead,xo as resetHMRHandler,cc as resetErrorConfig,rr as required,bb as replacePlaceholders,kq as renderView,kj as renderVideoComponent,Qa as renderVendorStyleTags,Gq as renderToString,Hq as renderToStream,Iq as renderToDOM,Vp as renderThumbhashToCanvas,Uq as renderTemplateString,Sq as renderTemplate,Tq as renderString,je as renderStreamingPage,yh as renderSlot,Eg as renderSSRSuspense,Fp as renderProtectedVideo,Ep as renderProtectedImg,rp as renderMediaUpload,Rq as renderMarkdownView,Wl as renderLayoutTypes,Wi as renderImgComponent,Ik as renderImageComponent,ud as renderHtmlAttrs,td as renderHead,nq as renderEmail,Kh as renderComponentWithSlot,vd as renderBodyAttrs,Io as render,Wc as relaxedCspPreset,Fd as registerValidationRule,qe as registerStreamingDirectives,Po as registerStoresClient,vl as registerStore,Bf as registerSeoDirectives,V as registerMiddleware,fb as registerFilters,eb as registerFilter,Tb as registerErrorMessages,Kd as registerEnhancedValidationRule,Th as registerDirective,dd as registerCspDirectives,Km as registerComponentDirectives,J as registerAnimationDirectives,r as registerA11yDirectives,Yk as ref,vn as redirect,Jb as recordResponseStatus,Kb as recordResponseHeader,Oa as rebaseOntoStateDir,Lb as readResponseStatus,Mb as readResponseHeaders,Kj as readMarkdownFile,We as readFileCached,Zk as reactive,ip as quality,Cp as pruneSignatureCache,Pi as pruneCache,pq as provide,Qq as protectCodeBlocks,qr as prop,Mf as processVueTemplate,Ug as processVirtualListDirectives,Yg as processVirtualGridDirectives,jj as processVideo,Id as processValidateDirective,ee as processTranslateDirective,yg as processTransitionDirectives,Bg as processTransitionAttributes,yd as processTitleDirective,Bb as processTemplateBindings,ug as processTeleportDirectives,Cg as processSuspenseDirectives,wf as processStructuredData,ke as processStreamDirectives,Pb as processStatusDirective,jh as processStaticDirectives,rf as processStackReplacements,qf as processStackPushDirectives,zh as processSlots,Pl as processShell,Kf as processServerBindings,xf as processSeoDirective,re as processSectionDirectives,Pf as processScopedStyles,zb as processReactiveBindings,Gp as processProtectedMedia,ch as processPartialHydrationDirectives,og as processOnceDirective,sf as processMiddleware,vf as processMetaDirectives,zd as processMetaDirective,Lj as processMarkdownFileDirectives,Rh as processMarkdownDirectives,lf as processLoops,Mg as processKeepAliveDirectives,ng as processJsonDirective,Xg as processInfiniteListDirectives,pf as processIncludes,Yi as processImgComponents,Kk as processImageComponents,xk as processImage,xd as processHeadDirective,Bd as processForms,Dd as processFormInputDirectives,ob as processExpressions,Ca as processEventDirectives,Ed as processErrorDirective,Nf as processDynamicComponents,qh as processDirectives,$h as processDirectiveAttributes,tg as processDeferDirectives,id as processCustomDirectives,ad as processCspDirectives,xr as processComponentProps,Ya as processClientScript,Cd as processBasicFormDirectives,Hg as processAsyncDirectives,jd as processAppearanceBootstrapDirective,A as processAnimationDirectives,f as processA11yDirectives,we as prepareImageDelivery,Vd as preloadTranslationsBackground,Ud as preloadTranslations,no as preloadIslandHandlers,Ce as preloadIconCollection,sm as poolStrings,Cj as pluginManager,ye as placeholdersWarmed,xg as performLeave,wg as performEnter,Ne as pendingLifecycleCounts,Re as peek,mf as partialsCache,lj as parseVideoDirectiveOptions,Ro as parseUrl,Yp as parseThumbhashString,Jc as parseSwitchBlock,wh as parseSlots,xh as parseSlotElement,Oc as parseScriptDeclarations,yj as parseSFCComponent,Hp as parseProtectedArgs,kf as parseLoopBinding,Xi as parseImgComponent,ni as parseImageUrl,Jk as parseImageComponent,En as parseFormBody,Lc as parseExpressionWithFilters,Lm as parseDefaults,sn as parseCookies,Hl as parseContainerSelector,Gc as parseConditionalBlock,Mc as parseArguments,H as parseAnimationShorthand,sr as optional,tm as optimizeTemplate,Pk as optimizeImage,Qk as optimizeDirectory,ur as oneOf,nf as onceStore,fl as onUpdated,yb as onUpdate,hl as onUnmounted,Cl as onServer,dl as onMounted,Je as onMount,ih as onHydrated,vq as onErrorCaptured,Ke as onDestroy,Sg as onDeactivated,Bl as onClient,el as onBeforeUpdate,gl as onBeforeUnmount,cl as onBeforeMount,Rg as onActivated,Rp as observeElement,wn as notFound,Uf as normalizeCriticalHeadOrder,uq as nextTick,Om as negotiateEncoding,P as navigateTo,jl as mountInstance,z as motionDirective,Vc as moderateCspPreset,rm as minifyHtml,zf as metaDirective,cg as metaDedupKey,So as mergeParams,eg as mergeHtmlAttrs,od as mergeHeadConfigs,Zc as mergeCspDirectives,tb as mergeCrosswindConfig,M as matchRoute,Sh as markdownDirectiveHandler,Jj as markdownCache,b as looksLikeGlob,er as localizePath,Wd as loadTranslationLazy,ae as loadTranslation,Fj as loadStxConfig,_ as loadMiddlewareFromDirectory,fm as loadManifest,Np as loadElement,ym as loadChannels,lr as lintStxStrict,Pp as lazyLoadAll,Op as lazyLoad,C as keyframeDirective,Eq as jsxs,Fq as jsxDEV,Dq as jsx,un as jsonResponse,pe as islandDirective,$b as isTest,Sl as isSpaNavigation,Ll as isSpaNavRequest,vp as isSignatureValid,Oe as isSignal,vk as isSharpAvailable,fn as isServerEnvironment,zl as isServer,ta as isRuntimeOwnedColonAttr,Zb as isProduction,d as isPresentationalRole,Kp as isNativeLazySupported,Pq as isMarkdownPath,Sd as isLoading,Td as isLoaded,Ch as isJavaScriptScript,Lp as isIntersectionObserverSupported,Dk as isImageFile,wk as isImageBackendAvailable,ce as isICUFormat,hh as isHydrated,Hh as isHydrateTrigger,Hb as isHttpStatus,en as isEdgeEnvironment,mr as isDirectiveKind,_b as isDevelopment,Pe as isDerived,Qj as isCssOnlyChange,Nm as isCompressible,Al as isClient,Jg as isAsyncComponent,Fn as isActionableMethod,ap as invert,Ye as invalidateFileCacheByDir,Xe as invalidateFileCache,nb as interpolateScriptsInTemplate,lb as interpolateScriptExpressions,mb as interpolateScriptAttributes,lc as inlineError,ar as injectThemeBootstrap,yf as injectSeoTags,Zq as injectSeo,ef as injectRouterScript,Pj as injectHotReload,fa as injectHeatmap,_c as injectCspMetaTag,xb as injectCrosswindCSS,lg as injectConfigHeadTags,Tf as injectColorModeBootScript,gg as injectCloakStyle,_f as injectBuildId,Sa as injectBrowserCoreAutoImports,Db as injectAnalytics,qq as inject,ul as initStoreRegistry,qk as initNetlify,po as initLoadingIndicator,Mp as initLazyLoading,Cn as initFile,Up as initBlurUp,_p as initAllBlurUp,_i as imgDirective,Nk as imageDirective,Nn as hydrateTemplateStream,Mn as hydrateTemplate,mo as hydrateIslands,eh as hydrateIsland,On as hydrateFragment,fh as hydrateByStrategy,gh as hydrateAll,Fo as hydrate,Xn as htmlResponse,hg as hoistLeadingHeadTags,Vf as hoistColorModeBootScript,ga as heatmapDirective,Ii as hashString,df as hashFilePath,Gi as hashFile,Hi as hashBuffer,Lf as hasVueTemplateSyntax,jf as hasVariables,Ko as hasStore,cb as hasPlaceholders,ok as hasNetlifyConfig,X as hasMiddleware,Da as hasEventDirectives,kg as hasDocumentShell,uh as hasDirectives,h as hasDOMSupport,Gk as handleImageRequest,wq as handleError,Mq as h,Ck as groupVariantsByFormat,_o as grayscale,Qn as gitHash,lm as getUnusedDirectives,Xd as getTranslationSync,Qd as getTranslationCacheStats,Yd as getTranslationAsync,de as getTranslation,jk as getTotalSize,wp as getTimeUntilExpiry,qg as getStoreScript,Lo as getStoreNames,Jo as getStore,ck as getStorageSize,bk as getStorageKeys,Nh as getSourceLineInfo,Eh as getSharedTranspiler,g as getScreenReaderOnlyStyle,sj as getScopeAttribute,Ee as getRouteParams,Ha as getPublicEnvDefine,Ia as getPublicEnv,sh as getPositionInfo,$a as getPlaceholderRegistry,Fi as getPlaceholderCacheStats,ld as getPageMeta,Qc as getNonce,Ek as getMimeType,Z as getMiddlewareNames,W as getMiddleware,Rd as getLoadingState,_d as getLoadingLocales,xe as getImagePlaceholder,yk as getImageMetadata,ue as getImageDelivery,Eo as getHydrationRuntime,wl as getHydratedStoreState,Tj as getHmrServer,kd as getHead,wo as getHMRHandler,ri as getFormatExtension,Ki as getFileMtime,Bk as getFallbackVariant,Vb as getErrorMessage,Sb as getErrorLocale,bc as getErrorConfig,Yb as getErrorCodeName,Vh as getDirectives,Uh as getDirective,Vk as getCurrentInstance,Yc as getCspPreset,fd as getCspHeaderName,ub as getCrosswindServeAsset,Qh as getComponentCacheStats,aj as getCachedVideoResult,Ap as getCachedSignature,_e as getCachedSignalsRuntime,$e as getCachedRouterScript,Di as getCachedPlaceholder,Ri as getCachedImageResult,Li as getCached,Oi as getCacheStats,Yf as getBuildId,vm as getBroadcastServer,qi as getBestVariant,gb as getAllFilters,ei as generateWidthSrcset,Vg as generateVirtualListCSS,fq as generateVideoPreview,Nd as generateValidationScript,gq as generateUploadRuntime,mm as generateTreeShakenBundle,Ag as generateTransitionRuntime,zg as generateTransitionCSS,ej as generateThumbnails,wi as generateThumbhashPlaceholder,Xm as generateTemplatesDocs,Gg as generateSuspenseRuntime,Fg as generateSuspenseCSS,zo as generateStateScript,oi as generateSrcsetData,Vi as generateSrcset,zk as generateSrcSet,fj as generateSpriteSheet,oq as generateSpaShell,pi as generateSourceTags,ki as generateSizesFromBreakpoints,ji as generateSizesAttribute,Ak as generateSizes,Cf as generateSitemapIndex,_q as generateSitemap,Jp as generateSimpleMediaPicker,Dp as generateSignatureRuntime,Ue as generateSignalsRuntimeDev,Te as generateSignalsRuntime,Xa as generateServerDataBridge,pj as generateScopeId,zj as generateSFCWebComponent,Aa as generateRuntimeScript,K as generateRouteTypes,L as generateRouteManifest,Ef as generateRobotsTxt,$q as generateRobots,Ui as generateResponsiveVariants,vj as generateReactiveWebComponentTS,uj as generateReactiveWebComponent,xj as generateReactiveRuntime,wj as generateReactiveMixin,dj as generatePoster,Ci as generatePlaceholderStyle,Bi as generatePlaceholderCSS,vi as generatePlaceholder,dh as generatePartialHydrationCSS,Pc as generateNonce,kk as generateNetlifyToml,iq as generateMinifiedMediaRuntime,hq as generateMediaRuntime,Ip as generateMediaManagerEmbed,dm as generateManifest,ro as generateLoadingIndicatorHtml,Tp as generateLazyLoadRuntime,Xl as generateLayoutTypes,yi as generateLQIP,Qg as generateKeepAliveRuntime,Pg as generateKeepAliveCSS,kh as generateIslandManifest,eq as generateImagePreview,Rk as generateImageManifest,Do as generateHydrationScript,te as generateHydrationRuntime,Go as generateHydrationCSS,Zg as generateHydrationBootstrap,Oj as generateHotReloadScript,ea as generateHeatmapScript,uo as generateHMRClientScript,gj as generateHLSManifest,Ao as generateEventBindings,ii as generateDprSrcsetWithVariableQuality,hi as generateDprSrcset,ig as generateDocumentShell,an as generateDocs,Ym as generateDirectivesDocs,_h as generateDirectiveRuntime,Ff as generateDefaultRobotsTxt,hj as generateDASHManifest,Tc as generateCspMetaTag,Sc as generateCspHeader,wb as generateCrosswindCSS,Bq as generateCompositionRuntime,Wm as generateComponentsDocs,_g as generateComponentManifest,Um as generateComponentDoc,Ai as generateColorPlaceholder,Sf as generateColorModeBootScript,ml as generateClientRuntime,Ji as generateCacheKey,Va as generateBrowserAutoImportDestructuring,$p as generateBlurUpRuntime,aq as generateBlurUpCSS,Ab as generateBindingsRuntime,fi as generateAutoWidthSrcset,Ua as generateAutoImportDestructuring,Lg as generateAsyncComponentRuntime,Kg as generateAsyncComponentCSS,I as generateAnimationRuntime,G as generateAnimationCSS,Cb as generateAnalyticsScript,lo as formatTypecheckDiagnostics,fo as formatTypeErrors,zn as formatStxContent,ik as formatSize,O as formatRoutes,An as formatMarkdownContent,Wb as formatLocalizedError,be as formatICU,dc as formatFilePath,kc as formatError,Yq as formatDoctorReport,Zm as formatDocsAsMarkdown,$m as formatDocsAsJson,_m as formatDocsAsHtml,hp as format,qm as foldConstants,gp as flipVertical,fp as flipHorizontal,Yl as fingerprint,jo as findRuntimeTypeDeclarations,Wq as findPantryPackage,Fc as findMatchingEndTag,Bc as findMatchingDelimiter,Ea as findInterpolationEnd,Hc as findIfBlocks,Kc as findExpressions,N as findErrorPage,Ic as findDirectiveBlocks,nm as findDeadCode,nm as findDeadBranches,Il as findContainerRegion,Vm as findComponentFiles,Ar as findCommonDir,hk as filterRequiredFiles,Lh as fileExists,ff as extractVariables,bm as extractTemplateExpressions,le as extractStreamBoundaries,Bo as extractState,Ah as extractSlotContent,hf as extractScriptFromTemplate,am as extractScriptBlocks,ab as extractPlaceholders,Ec as extractParenthesizedExpression,Ib as extractPageResponseStatus,ca as extractLayoutMetadata,zi as extractDominantColor,Nc as extractDirectiveParams,vh as extractDirectiveNames,Tl as extractContainerContent,Sm as extractComponentProps,$g as extractComponentName,Tm as extractComponentDescription,vb as extractClassNames,Wa as extractBridgeData,ah as extractBoundProps,Cc as extractBalancedExpression,Pa as extractAndStripCssImports,tj as extractAndScopeStyles,Ba as extractAndProcessEvents,Xj as externalizeSharedAssets,Yj as externalizeRepeatedAssets,Wj as externalizeHtml,qb as evaluateExpression,pm as evaluateConstant,Qb as evaluateAuthExpression,jb as escapeHtmlValue,ib as escapeHtml,qc as errorRecovery,sc as errorLogger,vg as ensureTeleportTargets,mg as ensureDocumentShell,Jd as enhancedValidationRules,Qm as enableDevTools,om as eliminateDeadCode,He as effect,op as dprUrls,bn as docsCommand,Vl as discoverLayoutNames,Sp as disconnectObserver,Rm as disableDevTools,tc as devHelpers,Ol as detectShell,dn as detectRuntime,lk as detectProjectConfig,si as detectFormat,im as detectBuildMode,Ge as derived,pk as deploy,Hj as defineStxConfig,Oo as defineStore,yq as defineSlots,kr as defineSiteConfig,or as definePropsWithValidation,nr as defineProps,Bj as definePlugin,rd as definePageMeta,R as defineMiddleware,mh as defineForm,tq as defineExpose,sq as defineEmits,Xh as defineDirective,Oq as defineCustomElement,Ln as defineConfig,Yh as defineClientDirective,Ig as defineAsyncComponent,jq as defaultMediaConfig,Tk as defaultImageConfig,Od as defaultI18nConfig,da as defaultHeatmapConfig,Ad as defaultFormClasses,db as defaultFilters,hd as defaultCspConfig,Dj as defaultConfig,yr as default,sb as deepMergeThemes,Of as dedupeScopedStyles,xi as decodeThumbhash,cd as cspNonceDirective,bd as cspDirective,Zp as crossfadeTransition,Uo as crop,Tg as createVirtualList,mj as createVideoDirective,qn as createVercelHandler,bo as createTypeChecker,fe as createTranslateFilter,mn as createTextEncoderStream,Nq as createStxApp,ln as createStreamingResponse,ne as createStreamRenderer,Mo as createStore,U as createStorageManager,S as createServerCookieManager,Xk as createScope,Dg as createSSRSuspense,De as createRouter,$ as createRouteLocation,$n as createRoute,Yk as createRef,Zk as createReactive,Aq as createProvideContext,Sn as createProject,Kn as createProductionBuild,_a as createPlaceholder,um as createOptimizedBuild,rn as createNetlifyHandler,dk as createNetlifyClient,aa as createMiddlewareContext,_n as createMiddleware,Qp as createLazyObserver,Ng as createKeepAliveCache,hn as createKVNamespace,bh as createIslandRegistry,Zi as createImgDirective,Ok as createImagePlugin,Hk as createImageHandler,Mk as createImageDirective,ia as createHeatmapAggregator,gk as createFileManifest,gn as createEnvAccessor,nc as createEnhancedError,kn as createEdgeHandler,jn as createEdgeCache,Oh as createDetailedErrorMessage,pn as createDenoHandler,mk as createDefaultNetlifyConfig,gd as createCspHeaders,tn as createCookie,_k as createComputed,Wk as createComponentInstance,on as createCloudflareHandler,T as createClientCookieManager,Zh as createBuiltinDirectives,Nq as createApp,F as createAnimationTimeline,Xo as cover,gf as convertToCommonJS,cp as contrast,Wo as contain,mc as consoleError,ac as configureErrorHandling,Gj as config,_k as computed,Pm as compressResponse,Hf as composerPattern,Gf as composer,Ql as composeShellWithPage,Jm as componentDirective,Jh as componentClientSignalNames,cm as compileTemplate,a as collectRepeatedFlag,fk as collectDeployFiles,cj as clearVideoCache,Pd as clearTranslationCache,rg as clearStoreCache,ak as clearStorage,Bp as clearSignatureCache,Ei as clearPlaceholderCache,of as clearOnceStore,Rc as clearNonce,Y as clearMiddleware,ze as clearImagePlaceholders,ve as clearImageDeliveryCatalog,Lk as clearImageCache,Ub as clearErrorMessages,af as clearDevCaches,hb as clearCustomFilters,Jf as clearComposers,sg as clearComposableCache,Ph as clearComponentCache,Ni as clearCache,qo as cleanupLoadingIndicator,Fl as classifyScript,Gl as classifyAllScripts,co as checkTemplateFile,eo as checkTemplate,bf as checkCache,yp as checkAuthAccess,i as checkA11yWithRegex,j as checkA11y,Em as channel,yn as captureScreenshots,xn as captureScreenshot,$d as cancelPendingLoads,ek as calculateSha1,gi as calculateOptimalWidths,cf as cacheTemplate,oj as buildWebComponents,go as buildVirtualSource,lq as buildViews,Qo as buildUrl,he as buildSuspenseResolveScript,jr as buildStaticSite,la as buildRuntimeGlobalsDestructure,Zl as buildRuntimeAsset,_l as buildRouterAsset,ir as buildLangPickerScript,mi as buildImageUrl,dg as buildHtmlAttrs,gm as buildForProduction,Mm as buildComponentLibrary,zp as buildAuthParams,hm as buildApp,gr as buildAlternateLinks,Jn as build,Cm as broadcastPrivate,Dm as broadcastPresence,zm as broadcast,bp as brightness,Yo as blur,ya as blankInertHtmlRegions,tp as batchSignUrls,Ie as batch,n as autoFixA11yFile,o as autoFixA11yDirectory,m as autoFixA11y,jp as auto,e as attributeValue,$l as assetTags,za as asInvocableStatement,vr as arrayOf,dr as applyTranslations,Ti as applyTransformations,Bh as applySlots,Im as applyPropDefaults,mp as applyPreset,fg as applyHtmlAttrs,wd as applyHead,pb as applyFilters,Ml as appendVary,Xc as apiCspPreset,y as animationGroupDirective,ij as analyzeVideo,km as analyzeUsage,Dl as analyzeTemplate,El as analyzeProject,km as analyzeDirectiveUsage,Eb as analyticsDirective,Vn as addStore,Un as addPage,$c as addNonceToInlineContent,Wn as addLayout,Tn as addComponent,Hn as actionRedirectResponse,Q as abortNavigation,p as a11yDirective,Ze as __setSignalsGeneratorsForTest,Zf as __setBuildIdForTest,$i as VideoProcessorCache,nh as Validator,s as TransitionType,u as TransitionEase,t as TransitionDirection,Ac as Tokenizer,ao as TemplateTypeChecker,Bn as TEMPLATE_PRESETS,jc as StxValidationError,fc as StxSyntaxError,hc as StxSecurityError,gc as StxRuntimeError,ic as StxFileError,ec as StxError,Jq as Show,ie as SUSPENSE_RESOLVER_RUNTIME,ja as STX_RUNTIME_GLOBALS,Ra as STX_AUTO_IMPORTS,Ka as STATE_DIR_ENV_VAR,B as SPRING_PRESETS,Jl as SPA_NAV_HEADER,sa as RUNTIME_OWNED_COLON_ATTRS,ua as RUNTIME_HANDLED_X_ATTRS,Fb as RESPONSE_STATUS_KEY,Gb as RESPONSE_HEADERS_KEY,oa as REACTIVE_RUNTIME_GLOBALS,In as ProductionBuild,Lq as Portal,Rn as PROJECT_TEMPLATES,lp as PRESETS,na as NON_CLIENT_PRIMITIVES,Ho as MemorySessionStore,di as MIME_TYPES,ai as MEDIA_DEFAULT_WIDTHS,ci as MEDIA_DEFAULT_FORMATS,Ul as LAYOUT_TYPES_FILE,Qi as ImageProcessorCache,Fk as ImageProcessingError,Co as HydrationRuntime,Nj as HotReloadServer,ha as HeatmapAggregator,bg as HTML_CLASS_MARKER,ag as HTML_ATTRS_MARKER,Cq as Fragment,Kq as For,Kl as FRAGMENT_CACHE_CONTROL,rc as ErrorLogger,Xb as ErrorCodes,Vj as EXTERNALIZED_ASSET_DIR,rk as DeployError,sk as DEFAULT_WIDTHS,v as DEFAULT_TRANSITION_OPTIONS,Ja as DEFAULT_STATE_DIR,uk as DEFAULT_QUALITY,ti as DEFAULT_PLACEHOLDER_OPTIONS,tk as DEFAULT_FORMATS,bi as DEFAULT_DPR_VALUES,to as ComponentHMRHandler,ka as COMPONENT_SCOPE_LOCAL_GLOBALS,wa as COMPONENT_PASSTHROUGH_X_ATTRS,ma as COMPILE_TIME_ONLY_GLOBALS,li as COMMON_SIZES,Qf as COLOR_MODE_BOOT_MARKER,Rf as COLOR_MODE_BOOT_GLOBAL,$f as CLOAK_STYLE,Gm as BroadcastServer,Fm as Broadcast,Wf as BUILD_ID_META,Xf as BUILD_ID_HEADER,Ga as BROWSER_CORE_IMPORTS,ui as BLUR_UP_CSS,va as ALPINE_BRIDGE_X_ATTRS,Vq as $path};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Am as n,Bm as o,nm as a,om as b,pm as c,qm as d,rm as e,sm as f,tm as g,um as h,vm as i,wm as j,xm as k,ym as l,zm as m}from"./chunk-
|
|
2
|
+
import{Am as n,Bm as o,nm as a,om as b,pm as c,qm as d,rm as e,sm as f,tm as g,um as h,vm as i,wm as j,xm as k,ym as l,zm as m}from"./chunk-ntfmdx5n.js";import"./chunk-1bwwtctk.js";import"./chunk-q9zsjgpf.js";import"./chunk-a6a9djpq.js";import"./chunk-txys90mf.js";import"./chunk-8ee6xtdz.js";import"./chunk-1spzqjve.js";import"./chunk-x9s335jt.js";import"./chunk-t7b39wwk.js";import"./chunk-w18t3nmy.js";import"./chunk-yvpagchj.js";import"./chunk-rhbq1var.js";import"./chunk-2c2z8n54.js";import"./chunk-71gwef4q.js";export{h as usesSignalsInScript,o as unescapeHtml,c as registerFilters,b as registerFilter,l as processExpressions,k as interpolateScriptsInTemplate,i as interpolateScriptExpressions,j as interpolateScriptAttributes,d as getAllFilters,n as evaluateExpression,g as escapeHtmlValue,f as escapeHtml,a as defaultFilters,e as clearCustomFilters,m as applyFilters};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tk as m}from"./chunk-
|
|
2
|
+
import{tk as m}from"./chunk-bxv3k5w8.js";import{Zu as z}from"./chunk-71gwef4q.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -3019,4 +3019,4 @@ Terminal=false
|
|
|
3019
3019
|
Categories=Utility;
|
|
3020
3020
|
Icon=${$.toLowerCase()}
|
|
3021
3021
|
`;z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.desktop`),_);let E=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.png`),E),J.icon&&s(J.icon))F(J.icon,Z(Y,`${$.toLowerCase()}.png`));let H=j("appimagetool",[Y,U],{env:{...process.env,ARCH:"x86_64"}});H.on("close",(x)=>{if(z("fs").rmSync(K,{recursive:!0,force:!0}),x===0)A(U,493),W({success:!0});else W({success:!1,error:`appimagetool exited with code ${x}. Install from https://appimage.github.io/appimagetool/`})}),H.on("error",(x)=>{z("fs").rmSync(K,{recursive:!0,force:!0}),W({success:!1,error:`appimagetool not found: ${x.message}`})})}catch(K){W({success:!1,error:K.message})}})}function Vq(){return[I()]}function Fq(q){switch(q){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var Aq={buildNative:Qq,getAvailableTargets:Vq,getAvailableFormats:Fq,detectPlatform:I},cq=Aq;
|
|
3022
|
-
export{Iq as
|
|
3022
|
+
export{Iq as bk,D as ck,Cq as dk,yq as ek,N as fk,b as gk,h as hk,bq as ik,u as jk,Pq as kk,vq as lk,Qq as mk,Vq as nk,Fq as ok,cq as pk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$h as P,Th as x,Yh as M,Zh as C,_h as v}from"./chunk-74cv4ta1.js";import{
|
|
2
|
+
import{$h as P,Th as x,Yh as M,Zh as C,_h as v}from"./chunk-74cv4ta1.js";import{Zu as y}from"./chunk-71gwef4q.js";import{resolve as h,basename as f,extname as u,join as m}from"path";import{mkdir as l}from"fs/promises";var I={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class z{config;constructor(J={}){this.config={...I,...J}}async get(J,Z){return C(J,Z,"image",this.config)}async set(J,Z,Y){return v(J,Z,Y,"image",this.config)}async clear(){return P("image",this.config)}updateConfig(J){this.config={...this.config,...J}}}var H=null;function S(J){if(!H)H=new z(J);else if(J)H.updateConfig(J);return H}async function w(J,Z,Y){let K=Y?{directory:`${Y.outputDir}/../.cache`}:{};return S(K).get(J,Z)}async function Q(J,Z,Y,K){let X=K?{directory:`${K.outputDir}/../.cache`}:{};return S(X).set(J,Z,Y)}async function d(){return S().clear()}async function R(){try{return await import("ts-images")}catch{return null}}function b(J){switch(J){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function p(J,Z){let Y=Z?b(Z):b("web"),K=J.formatQuality||{};return{jpeg:{...Y.jpeg,...K.jpeg},png:{...Y.png,...K.png},webp:{...Y.webp,...K.webp},avif:{...Y.avif,...K.avif}}}async function g(J,Z,Y){let K=await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:J,processed:!1};let X=await w(J,Z,Y);if(X)return X;try{let N=h(J);if(!await M(N))return{src:J,processed:!1,errors:[`Source file not found: ${J}`]};let L=p(Y,Z.preset),V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await l(V,{recursive:!0});let q=await x(N),U=f(J,u(J)),E=Z.outputFormat?[Z.outputFormat]:Y.defaultFormats||["avif","webp","jpeg"],G={src:J,processed:!0,variants:[],hash:q},j=null;if(Z.transformations&&Z.transformations.length>0)j=await D(N,Z.transformations,K);for(let $ of E){let A=L[$]||{},W=`${U}-${q}.${$}`,_=m(V,W);try{let O=await K.optimizeImage({input:j||N,output:_,format:$,quality:A.quality,progressive:A.progressive});if(O){if(G.variants.push({path:_,url:`${F}/${W}`,width:O.width||0,height:O.height||0,format:$,size:O.outputSize||0}),!G.originalWidth&&O.width)G.originalWidth=O.width,G.originalHeight=O.height}}catch(O){G.errors=G.errors||[],G.errors.push(`Failed to optimize ${$}: ${O}`)}}if(Z.embedThumbhash||Z.placeholder==="thumbhash")try{let $=await K.generateThumbHash(N);G.placeholder=$.dataUrl}catch($){G.errors=G.errors||[],G.errors.push(`Failed to generate thumbhash: ${$}`)}if(Z.useDominantColor)try{let $=await K.generatePlaceholder(N,{strategy:"dominant-color"});G.dominantColor=$.dominantColor}catch($){G.errors=G.errors||[],G.errors.push(`Failed to extract dominant color: ${$}`)}return await Q(J,Z,G,Y),G}catch(N){return{src:J,processed:!1,errors:[`Processing failed: ${N}`]}}}async function n(J,Z,Y,K){let X=await R();if(!X)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await X.optimizeImage({input:J,output:K,format:Z,quality:Y}))?.outputSize}}catch(N){return{success:!1,error:String(N)}}}async function D(J,Z,Y){let K=Y||await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let X=await K.decode(J);for(let N of Z){let L=N.options||{};switch(N.type){case"resize":if(L.width||L.height)X=await K.resize(X,{width:L.width,height:L.height,fit:L.fit});break;case"blur":if(L.sigma!==void 0)X=await K.blur(X,L.sigma);break;case"sharpen":if(L.amount!==void 0)X=await K.sharpen(X,L.amount);break;case"grayscale":X=await K.grayscale(X);break;case"rotate":if(L.angle!==void 0)X=await K.rotate(X,L.angle);break;case"flip":X=await K.flip(X);break;case"flop":X=await K.flop(X);break;case"brightness":if(L.value!==void 0)X=await K.brightness(X,L.value);break;case"contrast":if(L.value!==void 0)X=await K.contrast(X,L.value);break;case"saturation":if(L.value!==void 0)X=await K.saturation(X,L.value);break}}return await K.encode(X,"png")}catch(X){return console.error(`[stx-media] Transformation failed: ${X}`),null}}import{resolve as c,basename as i,extname as r,join as o}from"path";import{mkdir as a}from"fs/promises";async function e(){try{return await import("ts-images")}catch{return null}}var s=[320,480,640,768,1024,1280,1536,1920];async function t(J,Z,Y){let K=await e();if(!K)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let X=c(J);if(!await M(X))return console.warn(`[stx-media] Source file not found: ${J}`),null;try{let N=Z.responsiveWidths||Y.breakpoints||s,L=Z.formats||Y.defaultFormats||["avif","webp","jpeg"],V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await a(V,{recursive:!0});let q=await x(X),U=i(J,r(J)),E=Y.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},G={src:J,byFormat:{},srcsets:{}};for(let $ of L){G.byFormat[$]=[];let A=[];for(let W of N){let _=`${U}-${W}w-${q}.${$}`,O=o(V,_),B=`${F}/${_}`;try{let T=E[$]?.quality||80;if(await M(O)){G.byFormat[$].push({path:O,url:B,width:W,height:0,format:$,size:0}),A.push(`${B} ${W}w`);continue}let k=await K.processImage({input:X,output:O,format:$,quality:T,resize:{width:W}});if(k)G.byFormat[$].push({path:O,url:B,width:W,height:k.height||Math.round(W*(k.height||1)/(k.width||1)),format:$,size:k.outputSize||0}),A.push(`${B} ${W}w`)}catch(T){console.warn(`[stx-media] Failed to generate ${$} at ${W}w: ${T}`)}}G.srcsets[$]=A.join(", ")}let j=Z.placeholder||Y.placeholderStrategy||"thumbhash";if(j!=="none")try{if(j==="thumbhash"){let $=await K.generateThumbHash(X);G.placeholder={dataURL:$.dataUrl,width:$.width||32,height:$.height||32,strategy:"thumbhash"}}else{let $=await K.generatePlaceholder(X,{strategy:j,width:20});G.placeholder={dataURL:$.dataURL,width:$.width,height:$.height,strategy:j}}}catch($){console.warn(`[stx-media] Failed to generate placeholder: ${$}`)}return G.sizes=Z.sizes||JJ(N),G}catch(N){return console.error(`[stx-media] Responsive generation failed: ${N}`),null}}function JJ(J){let Z=[...J].sort((K,X)=>K-X),Y=[];for(let K=0;K<Z.length-1;K++){let X=Z[K];Y.push(`(max-width: ${X}px) ${X}px`)}return Y.push(`${Z[Z.length-1]}px`),Y.join(", ")}function KJ(J,Z="width"){if(!J||J.length===0)return"";if(Z==="dpr")return J.filter((Y)=>Y.dpr).map((Y)=>`${Y.url} ${Y.dpr}x`).join(", ");return J.map((Y)=>`${Y.url} ${Y.width}w`).join(", ")}export{z as Kh,w as Lh,Q as Mh,d as Nh,g as Oh,n as Ph,D as Qh,t as Rh,KJ as Sh};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Hl as A,Il as D,Kq as k,Sm as T,Tm as y,Xo as x,_l as B,am as F,fs as w,hp as M,yp as R}from"./chunk-ntfmdx5n.js";import{Zu as P}from"./chunk-71gwef4q.js";function b(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,X){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(X?.some((Y)=>q>=Y.start&&N<=Y.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,X)=>J.start-X.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function j(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>D(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as v,resolve as H}from"path";function f(K){let z=K,G=x(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],X=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],Y=$[2],E=$[0],Z=N.includes("server");if(X(Y))J.push(E);else if(Z)Q.push(Y);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,Y,E=[];while((Y=N.exec(q))!==null){let Z=Y.index+Y[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:Y.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -14,5 +14,5 @@ ${Q.join(`
|
|
|
14
14
|
`)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=X.__stx_event_bindings||[],Y=B(X),Z=(await Promise.all(Q.map(async(V)=>{let W=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return V;return await F(W[1],{eventBindings:N,templateContent:q,serverData:Y,filePath:z})}))).join(`
|
|
15
15
|
`);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
|
|
16
16
|
$1`);else q+=`
|
|
17
|
-
${Z}`}q=await M(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCrosswindCSS:N}=await import("./chunk-
|
|
17
|
+
${Z}`}q=await M(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCrosswindCSS:N}=await import("./chunk-yw1yt8b1.js");q=await N(q)}catch{}return q}
|
|
18
18
|
export{b as qk,C as rk,j as sk,s as tk,i as uk,I as vk};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function D(j){return j}class F{plugins=new Map;sortedPlugins=[];initialized=!1;async register(j,q){if(this.plugins.has(j.name))throw Error(`Plugin "${j.name}" is already registered`);if(j.dependencies){for(let w of j.dependencies)if(!this.plugins.has(w))throw Error(`Plugin "${j.name}" depends on "${w}" which is not registered`)}if(this.plugins.set(j.name,j),j.onRegister)await j.onRegister(q);this.sortPlugins()}async unregister(j){let q=this.plugins.get(j);if(!q)return!1;for(let[w,z]of this.plugins)if(z.dependencies?.includes(j))throw Error(`Cannot unregister "${j}" because "${w}" depends on it`);if(q.onUnregister)await q.onUnregister();return this.plugins.delete(j),this.sortPlugins(),!0}get(j){return this.plugins.get(j)}has(j){return this.plugins.has(j)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let j=[];for(let q of this.sortedPlugins)if(q.registerDirectives)j.push(...q.registerDirectives());return j}getAllFilters(){let j={};for(let q of this.sortedPlugins)if(q.registerFilters)Object.assign(j,q.registerFilters());return j}async runBeforeProcess(j){return this.runHooks("beforeProcess",j)}async runAfterParse(j){return this.runHooks("afterParse",j)}async runBeforeDirective(j,q){return this.runDirectiveHooks("beforeDirective",j,q)}async runAfterDirective(j,q){return this.runDirectiveHooks("afterDirective",j,q)}async runBeforeRender(j){return this.runHooks("beforeRender",j)}async runAfterRender(j){return this.runHooks("afterRender",j)}async runOnError(j){for(let q of this.sortedPlugins)if(q.onError)try{let w=await q.onError(j);if(w){if(w.template!==void 0)j.template=w.template;if(w.context)j.context={...j.context,...w.context};if(w.metadata)j.metadata={...j.metadata,...w.metadata};if(w.skip)return j}}catch(w){console.error(`Error in plugin "${q.name}" onError hook:`,w)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((j,q)=>(j.priority??100)-(q.priority??100))}async runHooks(j,q){let w={...q};for(let z of this.sortedPlugins){let B=z[j];if(B)try{let y=await B(w);if(y){if(y.template!==void 0)w.template=y.template;if(y.context)w.context={...w.context,...y.context};if(y.metadata)w.metadata={...w.metadata,...y.metadata};if(y.skip)break}}catch(y){console.error(`Error in plugin "${z.name}" ${j} hook:`,y)}}return w}async runDirectiveHooks(j,q,w){let z={...w};for(let B of this.sortedPlugins){let y=B[j];if(y)try{let A=await y(q,z);if(A){if(A.template!==void 0)z.template=A.template;if(A.context)z.context={...z.context,...A.context};if(A.metadata)z.metadata={...z.metadata,...A.metadata};if(A.skip)break}}catch(A){console.error(`Error in plugin "${B.name}" ${j} hook:`,A)}}return z}}var G=new F;function H(j,q,w={}){return{name:j,...w,registerDirectives:()=>q}}function I(j,q,w={}){return{name:j,...w,registerFilters:()=>q}}var J=D({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(j){console.log("[stx-debug] beforeProcess:",j.filePath)},afterParse(j){console.log("[stx-debug] afterParse:",j.template.length,"chars")},beforeDirective(j,q){console.log("[stx-debug] beforeDirective:",j)},afterDirective(j,q){console.log("[stx-debug] afterDirective:",j)},beforeRender(j){console.log("[stx-debug] beforeRender")},afterRender(j){console.log("[stx-debug] afterRender:",j.template.length,"chars")},onError(j){console.error("[stx-debug] onError:",j.error.message,"in phase:",j.phase)}}),K=D({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(j){j.metadata.startTime=performance.now()},afterRender(j){let q=j.metadata.startTime;if(q){let w=performance.now()-q;console.log(`[stx-timing] Processing took ${w.toFixed(2)}ms`)}}});function L(j){return D({name:"stx-variables",version:"1.0.0",description:"Adds predefined variables to template context",beforeProcess(q){return{context:{...q.context,...j}}}})}
|
|
3
|
-
export{D as
|
|
3
|
+
export{D as pg,F as qg,G as rg,H as sg,I as tg,J as ug,K as vg,L as wg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Oj as a,Pj as b,Qj as c,Rj as d,Sj as e,Tj as f,Uj as g,Vj as h,Wj as i,Xj as j,Yj as k}from"./chunk-nsf6d5dq.js";import"./chunk-ntfmdx5n.js";import"./chunk-1bwwtctk.js";import"./chunk-q9zsjgpf.js";import"./chunk-a6a9djpq.js";import"./chunk-txys90mf.js";import"./chunk-8ee6xtdz.js";import"./chunk-1spzqjve.js";import"./chunk-x9s335jt.js";import"./chunk-t7b39wwk.js";import"./chunk-w18t3nmy.js";import"./chunk-yvpagchj.js";import"./chunk-rhbq1var.js";import"./chunk-2c2z8n54.js";import"./chunk-71gwef4q.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-71gwef4q.js";import E from"fs";import K from"path";var V=[];function _(U){V=[];for(let A of U.storyFiles)if(V.push({text:A.fileName.toLowerCase(),original:A.fileName,type:"story",storyId:A.id}),V.push({text:A.relativePath.toLowerCase(),original:A.relativePath,type:"story",storyId:A.id}),A.story)for(let z of A.story.variants)V.push({text:z.title.toLowerCase(),original:z.title,type:"story",storyId:A.id,variantId:z.id})}function $(){return JSON.stringify(V)}async function O(U={}){let A=Date.now();N();let z=await k({mode:"build"});if(!z.config.enabled){W("Story feature is disabled in config.");return}let P=await H(z);w(z,P);let Y=J(z.config,P);B(z,Y),R(P.length);let X=U.outDir??z.config.outDir,Q=K.resolve(z.root,X);await E.promises.mkdir(Q,{recursive:!0}),console.log(` Building to ${X}...`);let M=F(z);await E.promises.writeFile(K.join(Q,"index.html"),M);let v={files:P.map((G)=>({id:G.id,fileName:G.fileName,relativePath:G.relativePath,treePath:G.treePath})),tree:Y};await E.promises.writeFile(K.join(Q,"stories.json"),JSON.stringify(v,null,2));let L={theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets};await E.promises.writeFile(K.join(Q,"config.json"),JSON.stringify(L,null,2));let Z=K.join(Q,"stories");await E.promises.mkdir(Z,{recursive:!0});for(let G of P){let g=await E.promises.readFile(G.path,"utf-8");await E.promises.writeFile(K.join(Z,`${G.id}.stx`),g)}_(z);let T=$();await E.promises.writeFile(K.join(Q,"search-index.json"),T);let C=Date.now()-A;j(P.length,X,C)}function F(U){let{theme:A}=U.config,z=A.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{bm as F,em as V,sm as I}from"./chunk-
|
|
2
|
+
import{bm as F,em as V,sm as I}from"./chunk-ntfmdx5n.js";function R(j,W){let U=1,z=W,G="<template",X="</template";while(z<j.length&&U>0){let J=j.indexOf("<",z);if(J===-1)break;if(z=J,j.startsWith(G,z)&&(z+G.length>=j.length||/[\s>\/]/.test(j[z+G.length]))){U++,z+=G.length;continue}if(j.startsWith(X,z)){let Y=j.indexOf(">",z+X.length);if(Y!==-1){if(U--,U===0)return Y+1;z=Y+1;continue}}z++}return U===0?z:-1}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function D(j,W){let U=null;for(let z=W;z<j.length;z++){let G=j[z];if(U){if(G==="\\"){z++;continue}if(G===U)U=null;continue}if(G==='"'||G==="'"){U=G;continue}if(G===">")return z+1}return-1}function b(j){let W=[],U=[],z=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,G=0;while(G<j.length){let X=j.indexOf("<",G);if(X===-1)break;if(j.startsWith("<!--",X)){let $=j.indexOf("-->",X+4);G=$===-1?j.length:$+3;continue}let J=D(j,X+1);if(J===-1)break;let Y=j.slice(X,J),Q=Y.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Q){G=J;continue}let Z=Q[1]==="/",H=Q[2].toLowerCase();if(Z){let $=U.lastIndexOf(H);if($!==-1)U.splice($);G=J;continue}if(H==="template"&&U.length===0){let $=Y.match(z);if($){let K=R(j,J);if(K!==-1){let O=$[1]||$[2]||$[3];W.push({start:X,end:K,slotName:O,content:j.slice(J,K-11).trim(),propsBinding:$[4]||void 0}),G=K;continue}}}if(!/\/\s*>$/.test(Y)&&!P.has(H)){if(U.push(H),H==="script"||H==="style"){let $=j.toLowerCase().indexOf(`</${H}>`,J);if($!==-1){G=$;continue}}}G=J}return W}function w(j){let W={default:"",named:new Map},U=j,z=b(j);for(let Q of z)W.named.set(Q.slotName,{name:Q.slotName,content:Q.content,propsBinding:Q.propsBinding});z.sort((Q,Z)=>Z.start-Q.start);for(let Q of z)U=U.slice(0,Q.start)+U.slice(Q.end);let G=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*)>([\s\S]*?)<\/\1>/gi,J;while((J=X.exec(U))!==null){let[Q,Z,H,_,$,K]=J,O=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),L=(O+B).trim(),q=`<${Z}${L?" "+L:""}>${K}</${Z}>`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:q})}let Y=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*?)\/>/gi;while((J=Y.exec(U))!==null){let[Q,Z,H,_,$]=J,K=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),O=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=(K+O).trim(),L=`<${Z}${B?" "+B:""} />`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:L})}G.sort((Q,Z)=>Z.start-Q.start);for(let Q of G){let Z=W.named.get(Q.slotName);if(Z)Z.content+=Q.element;else W.named.set(Q.slotName,{name:Q.slotName,content:Q.element});U=U.slice(0,Q.start)+U.slice(Q.end)}return W.default=U.trim(),W}function C(j){let W=j.match(/name\s*=\s*["']([^"']+)["']/),U=W?W[1]:"",z={},G=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,X;while((X=G.exec(j))!==null)z[X[1]]=X[2];let J=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),Y=J?J[1].trim():"";return{name:U,props:z,defaultContent:Y}}async function N(j,W,U,z){if(!j)return U;let G=j.content;if(j.propsBinding&&Object.keys(W).length>0){let X=j.propsBinding.trim(),J={...z};if(X.startsWith("{")&&X.endsWith("}")){let Y=X.slice(1,-1).split(",").map((Q)=>Q.trim()).filter(Boolean);for(let Q of Y){let[Z,H]=Q.split(":").map(($)=>$.trim()),_=H||Z;if(W[Z]!==void 0)J[_]=W[Z]}}else J[X]=W;G=k(G,J)}return G}function k(j,W){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(U,z)=>{try{let G=z.trim(),X=y(G,W);return I(String(X??""))}catch{return`{{ ${z} }}`}})}function y(j,W){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let z=j.split("."),G=W;for(let X of z)if(G&&typeof G==="object"&&X in G)G=G[X];else return;return G}let U=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(U){let[,z,G,X]=U,J=W[z],Y=parseInt(X,10);if(typeof J==="number")switch(G){case"+":return J+Y;case"-":return J-Y;case"*":return J*Y;case"/":return J/Y}}try{if(!F(j))return;return V(j,Object.keys(W))(...Object.values(W))}catch{return}}async function A(j,W,U){let z=j;z=await v(z,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(J,Y,Q,Z)=>{let H=W.named.get(Y),_=Z?.trim()||"",$=Q||"",K={},O=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,B;while((B=O.exec($))!==null){let L=B[1],q=B[2];K[L]=y(q,U)}return await N(H,K,_,U)});let X=/<slot\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return z=z.replace(X,(J,Y)=>{if(J.includes("name="))return J;let Q=Y?.trim()||"";return W.default||Q}),z}async function v(j,W,U){let z=[],G=[];j.replace(W,(Y,...Q)=>{let Z=Q[Q.length-2];return G.push({match:Y,index:Z}),z.push(U(Y,...Q.slice(0,-2))),Y});let X=await Promise.all(z),J=j;for(let Y=G.length-1;Y>=0;Y--){let{match:Q,index:Z}=G[Y];J=J.slice(0,Z)+X[Y]+J.slice(Z+Q.length)}return J}function E(j){let W=w(j);return{defaultSlot:W.default,namedSlots:W.named}}async function M(j,W,U,z){return await A(j,{default:W,named:U},z)}
|
|
3
3
|
export{w as Eh,C as Fh,N as Gh,A as Hh,E as Ih,M as Jh};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$i as w,_i as O,aj as Z}from"./chunk-9n0gvfrg.js";import{$k as R,gl as U,il as T}from"./chunk-sqcpcnyf.js";import{Ol as E,Pl as L,Rl as M,Sq as k,hs as C,tp as W}from"./chunk-ntfmdx5n.js";import{Ot as B}from"./chunk-yvpagchj.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd()});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
|
|
3
|
+
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
|
|
4
|
+
|
|
5
|
+
`),x=`;(function(){
|
|
6
|
+
var __stx = window.stx || {};
|
|
7
|
+
${B.filter((q)=>!X.has(q)&&new RegExp(`\\b${q}\\b`).test(j)).map((q)=>`var ${q} = __stx[${JSON.stringify(q)}];`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
${j}
|
|
10
|
+
})();`;return K=O(V()),Z(Y,z,K,x),x}function a(){Y.clear()}
|
|
11
|
+
export{l as Vi,a as Wi};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-71gwef4q.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
|
|
3
3
|
<div class="stx-error-boundary" data-boundary-id="${q}" data-has-error="false">
|
|
4
4
|
<div class="stx-error-boundary-content" data-boundary-content="${q}">
|
|
5
5
|
${z}
|