@stacksjs/stx 0.2.326 → 0.2.327
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-09g87hxr.js +2 -0
- package/dist/{chunk-zsapb653.js → chunk-0dtcw5ca.js} +1 -1
- package/dist/{chunk-a66thbww.js → chunk-0gmn8fwp.js} +1 -1
- package/dist/{chunk-z698hwht.js → chunk-0n90mnpc.js} +1 -1
- package/dist/chunk-0tpfj8yx.js +2 -0
- package/dist/{chunk-y9d560c6.js → chunk-0yvz1800.js} +1 -1
- package/dist/{chunk-f58efcb5.js → chunk-1cjghpw3.js} +2 -2
- package/dist/{chunk-5zqec01h.js → chunk-26w2sdre.js} +1 -1
- package/dist/{chunk-rps8xwna.js → chunk-27fanfef.js} +3 -3
- package/dist/{chunk-0aqtbma7.js → chunk-2gr3wwxa.js} +1 -1
- package/dist/{chunk-70zb3560.js → chunk-2k16wj3k.js} +1 -1
- package/dist/chunk-2mvr9dh8.js +2 -0
- package/dist/{chunk-yms0xgy0.js → chunk-2z9q9weh.js} +1 -1
- package/dist/chunk-4aby62mm.js +17 -0
- package/dist/{chunk-p35gk1kr.js → chunk-4cdex6q9.js} +1 -1
- package/dist/{chunk-m4wwqznv.js → chunk-53xjmjva.js} +1 -1
- package/dist/{chunk-g5k4ceg8.js → chunk-5mnje5wt.js} +1 -1
- package/dist/{chunk-zgbwr604.js → chunk-5vccw7bd.js} +1 -1
- package/dist/{chunk-cmfx1e7m.js → chunk-61y14d8d.js} +1 -1
- package/dist/chunk-63zwsqfd.js +2 -0
- package/dist/{chunk-88kr475r.js → chunk-68e7xdsh.js} +1 -1
- package/dist/chunk-6g5svgmn.js +2 -0
- package/dist/chunk-6pwwxxxk.js +2 -0
- package/dist/{chunk-er95wtgy.js → chunk-7bsr7h63.js} +1 -1
- package/dist/{chunk-dsqcfv2k.js → chunk-832fs45r.js} +1 -1
- package/dist/{chunk-crmy5yhk.js → chunk-881468eg.js} +1 -1
- package/dist/{chunk-e10pfrds.js → chunk-8fved33k.js} +1 -1
- package/dist/{chunk-wf1a28ec.js → chunk-8sb1nv90.js} +10 -10
- package/dist/{chunk-nksce8wc.js → chunk-9r4bsg9f.js} +1 -1
- package/dist/{chunk-b1h7pyhs.js → chunk-9tg2x4eb.js} +1 -1
- package/dist/{chunk-f75yj981.js → chunk-a7a27x3z.js} +1 -1
- package/dist/{chunk-xgrh0461.js → chunk-ap3eff26.js} +1 -1
- package/dist/{chunk-vxt8234h.js → chunk-b3rykphz.js} +1 -1
- package/dist/{chunk-4p05bgqf.js → chunk-bkjzhve2.js} +1 -1
- package/dist/chunk-brhwe7w2.js +2 -0
- package/dist/{chunk-rcvnh2p7.js → chunk-c28ws2ep.js} +1 -1
- package/dist/{chunk-qtm2zgjj.js → chunk-c57dc9p8.js} +1 -1
- package/dist/{chunk-8n0mjaf6.js → chunk-cq386y8q.js} +1 -1
- package/dist/{chunk-mczfzq2y.js → chunk-d28gqewj.js} +1 -1
- package/dist/{chunk-0xw3atfx.js → chunk-dews384p.js} +1 -1
- package/dist/chunk-dy3kfdyy.js +2 -0
- package/dist/{chunk-3yn8ghtz.js → chunk-e0c8k4n1.js} +1 -1
- package/dist/{chunk-ecbqmesm.js → chunk-e59fq6n5.js} +1 -1
- package/dist/{chunk-x95v38pt.js → chunk-eab4mmq0.js} +1 -1
- package/dist/chunk-ef47e7qf.js +2 -0
- package/dist/chunk-ek2m6bq8.js +2 -0
- package/dist/{chunk-ws4kh6et.js → chunk-ex75w96f.js} +1 -1
- package/dist/{chunk-b0wm1c6x.js → chunk-f2xr3mfr.js} +1 -1
- package/dist/chunk-fczvfhac.js +2 -0
- package/dist/{chunk-fm8w5wd7.js → chunk-ft8cjgk8.js} +2 -2
- package/dist/{chunk-02hjbe0p.js → chunk-g2vevtny.js} +1 -1
- package/dist/{chunk-v3taty7e.js → chunk-g4yyd077.js} +1 -1
- package/dist/{chunk-5eqc3f0f.js → chunk-h3by8gsp.js} +1 -1
- package/dist/chunk-h4grn4hr.js +2 -0
- package/dist/{chunk-avpsqyaq.js → chunk-h9h6hna7.js} +1 -1
- package/dist/{chunk-8r0yf1q7.js → chunk-habj6qnb.js} +1 -1
- package/dist/chunk-hy5fyeea.js +2 -0
- package/dist/{chunk-zwkzwymf.js → chunk-ja7q1r6p.js} +1 -1
- package/dist/chunk-jh59wy0w.js +2 -0
- package/dist/{chunk-9ah9f27h.js → chunk-k5gxz3fv.js} +2 -2
- package/dist/chunk-kczw9gx1.js +2 -0
- package/dist/{chunk-qhzvf0nf.js → chunk-kkxzsv3w.js} +1 -1
- package/dist/{chunk-e0369ngw.js → chunk-krjzxnsd.js} +1 -1
- package/dist/chunk-kswt770b.js +2 -0
- package/dist/chunk-kvjc8767.js +2 -0
- package/dist/chunk-m24sv872.js +2 -0
- package/dist/{chunk-gctdc94b.js → chunk-mb2m7f5q.js} +1 -1
- package/dist/{chunk-2hyxkzpc.js → chunk-mhahh2e7.js} +1 -1
- package/dist/{chunk-r1g0bnpv.js → chunk-mk6j4hhx.js} +1 -1
- package/dist/{chunk-4sg3mw9m.js → chunk-my5t5tmx.js} +1 -1
- package/dist/{chunk-v1jcfb07.js → chunk-mykp2dwz.js} +1 -1
- package/dist/chunk-n80vvrf4.js +2 -0
- package/dist/chunk-ngggy0k6.js +2 -0
- package/dist/{chunk-qrkxyb5p.js → chunk-nn4xr784.js} +1 -1
- package/dist/{chunk-2dk3ym1g.js → chunk-nt9y4feq.js} +1 -1
- package/dist/{chunk-9e6pyjwz.js → chunk-p26cry7t.js} +2 -2
- package/dist/{chunk-g2pjef44.js → chunk-pgw0psw1.js} +1 -1
- package/dist/{chunk-embjwebg.js → chunk-pk2nmy11.js} +2 -2
- package/dist/chunk-qde4nq96.js +2 -0
- package/dist/chunk-r90xbmaz.js +2 -0
- package/dist/{chunk-nq19m0ja.js → chunk-raznshc9.js} +1 -1
- package/dist/chunk-sfdqbeva.js +2 -0
- package/dist/{chunk-0fkvezw3.js → chunk-srnrsany.js} +1 -1
- package/dist/{chunk-24r2ctta.js → chunk-sxbp4m27.js} +1 -1
- package/dist/{chunk-qht7be1x.js → chunk-t7w8a52q.js} +1 -1
- package/dist/{chunk-4fck9h56.js → chunk-vhfngds8.js} +22 -22
- package/dist/chunk-vq31pymd.js +2 -0
- package/dist/chunk-vv8yr1a0.js +2 -0
- package/dist/{chunk-tpvs4bzw.js → chunk-vyk3bzxz.js} +1 -1
- package/dist/{chunk-brb3g571.js → chunk-wcc30cjt.js} +1 -1
- package/dist/{chunk-xa17djyz.js → chunk-wdjyn3br.js} +1 -1
- package/dist/chunk-wf9cmyj7.js +2 -0
- package/dist/{chunk-s8rc6rgv.js → chunk-wm3ym3vp.js} +1 -1
- package/dist/{chunk-q1tc5kxy.js → chunk-wrc7fmfa.js} +1 -1
- package/dist/{chunk-308r399e.js → chunk-xptrceyd.js} +1 -1
- package/dist/chunk-xq95p9y3.js +2 -0
- package/dist/{chunk-m64wwy1j.js → chunk-y330ysve.js} +3 -3
- package/dist/{chunk-nq0ec0w1.js → chunk-y38dwb99.js} +1 -1
- package/dist/chunk-y4prkjq0.js +2 -0
- package/dist/{chunk-9jatnvx3.js → chunk-y8f0v4rq.js} +1 -1
- package/dist/chunk-ya97r0kh.js +2 -0
- package/dist/{chunk-7bmqjfft.js → chunk-ye7e8134.js} +1 -1
- package/dist/{chunk-7jqh58k9.js → chunk-yge0y55d.js} +1 -1
- package/dist/{chunk-sn9d9m15.js → chunk-yk9xw83j.js} +1 -1
- package/dist/{chunk-wf3pcr37.js → chunk-yqy9fp4a.js} +1 -1
- package/dist/{chunk-0r4r426f.js → chunk-ytgcvgf8.js} +2 -2
- package/dist/{chunk-wct92198.js → chunk-z1ax712x.js} +2 -2
- package/dist/{chunk-x5xee26w.js → chunk-z1gqmhmp.js} +1 -1
- package/dist/{chunk-akrxtrh1.js → chunk-z6mphydy.js} +1 -1
- package/dist/{chunk-dgrayagx.js → chunk-zam1mxnz.js} +1 -1
- package/dist/chunk-zq912qca.js +2 -0
- package/dist/chunk-zvapw5hj.js +2 -0
- package/dist/cli.js +14 -14
- package/dist/client-script-bundler.d.ts +6 -0
- package/dist/client-script-bundler.js +5 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/pwa.js +2 -2
- package/dist/ssg.js +2 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-0b6rbeb7.js +0 -2
- package/dist/chunk-2qk3qwmp.js +0 -2
- package/dist/chunk-3dr3zphp.js +0 -2
- package/dist/chunk-3eyg7eyq.js +0 -2
- package/dist/chunk-429wf3rd.js +0 -2
- package/dist/chunk-4775jwbk.js +0 -2
- package/dist/chunk-59fcj7ym.js +0 -2
- package/dist/chunk-5n2ps25k.js +0 -2
- package/dist/chunk-63kzeyt9.js +0 -2
- package/dist/chunk-7b1hzv9v.js +0 -2
- package/dist/chunk-8kr2nmn3.js +0 -2
- package/dist/chunk-b39rm1fd.js +0 -2
- package/dist/chunk-bgwcrkg8.js +0 -2
- package/dist/chunk-bvr71dnk.js +0 -2
- package/dist/chunk-ce7d7p08.js +0 -2
- package/dist/chunk-cgqazfj8.js +0 -2
- package/dist/chunk-dnga7h49.js +0 -2
- package/dist/chunk-ex2rweah.js +0 -2
- package/dist/chunk-jws7h3yg.js +0 -2
- package/dist/chunk-k5jyhp8f.js +0 -2
- package/dist/chunk-pc70paa2.js +0 -2
- package/dist/chunk-pgafdv9x.js +0 -2
- package/dist/chunk-pnmb59wv.js +0 -2
- package/dist/chunk-qh638jcb.js +0 -2
- package/dist/chunk-qrbba9jn.js +0 -2
- package/dist/chunk-r073q98g.js +0 -2
- package/dist/chunk-rw93qdw8.js +0 -2
- package/dist/chunk-styqhxk5.js +0 -2
- package/dist/chunk-ydzns231.js +0 -2
- package/dist/chunk-yrcj14c6.js +0 -2
- package/dist/chunk-ysc69wxa.js +0 -2
- package/dist/chunk-zg3tz5g3.js +0 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ah as u,Bh as n,th as x,yh as B,zh as c}from"./chunk-vd5xvsnv.js";import{
|
|
2
|
+
import{Ah as u,Bh as n,th as x,yh as B,zh as c}from"./chunk-vd5xvsnv.js";import{qw as v}from"./chunk-nn4xr784.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"
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Vg as a,Wg as b,Xg as c,Yg as d,Zg as e,_g as f}from"./chunk-b3rykphz.js";import"./chunk-vhfngds8.js";import"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{c as renderSlot,d as processSlots,a as parseSlots,b as parseSlotElement,e as extractSlotContent,f as applySlots};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Em as R,Mm as k,Mo as l,Ro as T,Xp as m,an as d,bn as c,wm as P,xm as D}from"./chunk-vhfngds8.js";import{Ft as S,Ht as v}from"./chunk-27fanfef.js";import{dw as XJ,fw as YJ,gw as ZJ}from"./chunk-z1ax712x.js";import{nw as QJ,qw as q}from"./chunk-nn4xr784.js";var n=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function r(J,Y,Q){let X={fullTag:Q,content:Y,attrs:J};if(/\bserver\b/.test(J))return{...X,type:"server"};if(/\bdata-stx-scoped\b/.test(J))return{...X,type:"client"};if(n.test(Y))return{...X,type:"signals"};if(/\bclient\b/.test(J)||/\btype\s*=\s*["']module["']/.test(J)||/\bsrc\s*=/.test(J))return{...X,type:"client"};return{...X,type:"server"}}var s=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function y(J){let Y=[],Q=[],X=[],$=0;while($<J.length){let Z=J.indexOf("<",$);if(Z===-1)break;let U=v(J,Z);if(U>Z){$=U;continue}let W=S(J,Z);if(W>Z){let j=J.slice(Z,W),F=s.exec(j);if(F){let K=r(F[1],F[2],j);switch(K.type){case"signals":Y.push(K);break;case"client":Q.push(K);break;case"server":X.push(K);break}}$=W;continue}$=Z+(J.startsWith("<!--",Z)?4:1)}return{signals:Y,client:Q,server:X}}var o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function a(J){let Y=[],Q=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Q.exec(J))!==null)Y.push({start:X.index,end:X.index+X[0].length});return Y}function C(J,Y){return Y.some((Q)=>J>=Q.start&&J<Q.end)}function t(J){let Y=(J||"").trim();if(!Y)return null;if(/[\s>+~,:]/.test(Y))return null;let Q={},X=Y,$=X.match(/^[a-z][\w-]*/i);if($)Q.tag=$[0].toLowerCase(),X=X.slice($[0].length);while(X.length>0){let Z=X.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(Z){if(Q.attr=Z[1],Z[3]!==void 0&&Z[3]!=="")Q.attrValue=Z[3];X=X.slice(Z[0].length);continue}let U=X.match(/^#([\w-]+)/);if(U){Q.id=U[1],X=X.slice(U[0].length);continue}let W=X.match(/^\.([\w-]+)/);if(W){Q.className=W[1],X=X.slice(W[0].length);continue}return null}if(!Q.tag&&!Q.attr&&!Q.id&&!Q.className)return null;return Q}function e(J,Y){if(Y.attr){if(!(Y.attrValue===void 0?new RegExp(`\\b${Y.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Y.attr}\\s*=\\s*(["'])\\s*${Y.attrValue}\\s*\\1`,"i")).test(J))return!1}if(Y.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Y.id}\\s*\\1`,"i").test(J))return!1}if(Y.className){let Q=J.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!Q)return!1;if(!Q[2].split(/\s+/).includes(Y.className))return!1}return!0}function x(J,Y="main"){let Q=t(Y);if(!Q)return null;let X=/<([a-z][\w-]*)\b([^>]*)>/gi,$=a(J),Z;while((Z=X.exec(J))!==null){if(C(Z.index,$))continue;let U=Z[1].toLowerCase(),W=Z[2]||"";if(W.trimEnd().endsWith("/")||o.has(U))continue;if(Q.tag&&Q.tag!==U)continue;if(!e(W,Q))continue;let j=Z[0],F=Z.index+j.length,K=new RegExp(`<(/?)${U}\\b([^>]*)>`,"gi");K.lastIndex=F;let G=1,B;while((B=K.exec(J))!==null){if(C(B.index,$))continue;let w=B[1]==="/";if(!w&&(B[2]||"").trimEnd().endsWith("/"))continue;if(G+=w?-1:1,G===0)return{openTag:j,openIndex:Z.index,start:F,end:B.index,tagName:U}}return null}return null}var wJ="X-STX-Router",NJ="private, no-store";function AJ(J){return J.replace(/&#(\d+);/g,(Y,Q)=>f(Number(Q),Y)).replace(/&#x([0-9a-f]+);/gi,(Y,Q)=>f(Number.parseInt(Q,16),Y)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function f(J,Y){if(!Number.isInteger(J)||J<0||J>1114111)return Y;try{return String.fromCodePoint(J)}catch{return Y}}function g(J){return J.headers.get("X-STX-Router")==="true"}function JJ(J,Y){if(!J)return Y;return J.split(",").some((X)=>X.trim().toLowerCase()===Y.toLowerCase())?J:`${J}, ${Y}`}function IJ(J){return{Vary:JJ(J,"X-STX-Router")}}import E from"path";XJ();var $J="stx-page-head:",UJ=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,O=null;function WJ(){if(O!==null)return O;try{let{getRouterScript:J}=(ZJ(),QJ(YJ));O=`<script>${J()}</script>`}catch{O=""}return O}async function MJ(J,Y){if(Y===!1)return null;if(Y&&typeof Y==="string"){let X=E.resolve(J,Y);if(await Bun.file(X).exists())return X;return null}let Q=E.join(J,"app.stx");if(await Bun.file(Q).exists())return Q;return null}async function bJ(J,Y){try{let Q=await Bun.file(J).text(),X=Q,$=Q.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)X=$[1].trim();let Z=y(Q),U=[...Z.client.map((V)=>V.fullTag),...Z.signals.map((V)=>V.fullTag)],W=[],j=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,F;while((F=j.exec(Q))!==null)W.push(F[0]);let K=X;for(let V of Z.server)K=K.replace(V.fullTag,"");for(let V of Z.client)K=K.replace(V.fullTag,"");K=K.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let G="<!--__STX_PAGE_SLOT__-->";if(K=K.replace(/<slot\s*\/>/gi,G).replace(/<slot\s*>\s*<\/slot>/gi,G),!K.includes(G))return console.warn(`[stx] Shell ${J} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:B,extractVariables:w,defaultConfig:N,loadStxConfig:I}=await import("./chunk-wdjyn3br.js"),_=await I(),z={__filename:J,__dirname:E.dirname(J)};for(let V of U){let L=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(L&&!V.includes("client")&&!V.includes('type="module"'))await w(L[1],z,J)}let A=await B(K,z,J,{...N,..._,...Y},new Set),H=A.indexOf(G);if(H===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:A.substring(0,H),afterSlot:A.substring(H+G.length),filePath:J,shellScripts:U,shellStyles:W}}catch(Q){return console.error(`[stx] Error processing shell ${J}:`,Q),null}}function PJ(J,Y,Q){let X,$="",Z=Y.match(UJ);if(Z){Y=Y.replace(Z[0],"");try{let K=Buffer.from(Z[1],"base64").toString("utf8"),G=K.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(G)X=G[1].trim();$=K.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let U=Q||X||"stx App",W=WJ(),j="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -26,5 +26,5 @@ ${W}
|
|
|
26
26
|
`));if($.length>0)N.push($.join(`
|
|
27
27
|
`));if(G.length>0)N.push(G.join(`
|
|
28
28
|
`));return N.push(K),N.join(`
|
|
29
|
-
`)}import M from"fs";import h from"path";function CJ(J,Y,Q){return{version:1,buildTime:new Date().toISOString(),routes:J,assets:Y,outputDir:Q}}function xJ(J,Y){let Q=h.join(Y,"manifest.json");M.writeFileSync(Q,JSON.stringify(J,null,2))}function fJ(J){let Y=h.join(J,"manifest.json");if(!M.existsSync(Y))return null;try{let Q=M.readFileSync(Y,"utf-8"),X=JSON.parse(Q);if(X.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${X.version}`),null;return X}catch(Q){return console.warn("[stx] Failed to load manifest:",Q),null}}function b(J,Y,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(Y)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let Y=J.headers.get("content-type")||"",Q={},X=($,Z)=>{let U=Q[$];if(U===void 0)Q[$]=Z;else if(Array.isArray(U))U.push(Z);else Q[$]=[U,Z]};if(Y.includes("multipart/form-data")){let $=await J.formData();for(let[Z,U]of $.entries())if(typeof U==="string")X(Z,U);return Q}if(Y.includes("application/x-www-form-urlencoded")){for(let[$,Z]of new URLSearchParams(await J.text()).entries())X($,Z);return Q}return Q}function FJ(J){if(!J)return!1;let Y=J.toUpperCase();return Y!=="GET"&&Y!=="HEAD"}async function p(J,Y={}){let Q=Y.request,X=Y.method??Q?.method;if(!Q||!FJ(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let $={};try{$=await KJ(Q)}catch{}let Z=await J.action({request:Q,form:$,params:Y.params??{},query:J.query??{},cookies:Y.cookies??{}});if(Z&&typeof Z==="object"){let U=Z,W=GJ(U.cookies),j=U.redirect;if(typeof j==="string"&&j)return{redirect:j,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:F,redirect:K,...G}=U;if(Object.assign(J,G),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function GJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let Y=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){Y.push(b(Q,X));continue}if(X&&typeof X==="object"){let $=X;if(typeof $.value!=="string")continue;Y.push(b(Q,$.value,$))}}return Y}function hJ(J,Y=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let $ of Y)X.append("Set-Cookie",$);for(let[$,Z]of Object.entries(Q??{}))if($.toLowerCase()!=="location")X.set($,Z);return new Response(null,{status:303,headers:X})}async function sJ(J,Y={}){return(await i(J,Y)).html}async function oJ(J,Y={}){let{html:Q,context:X,redirect:$,cookies:Z}=await i(J,Y),U=d(X),W=c(X);if($)return{html:Q,redirect:$,cookies:Z,status:U,headers:W};let{extractStreamBoundaries:j}=await import("./chunk-
|
|
29
|
+
`)}import M from"fs";import h from"path";function CJ(J,Y,Q){return{version:1,buildTime:new Date().toISOString(),routes:J,assets:Y,outputDir:Q}}function xJ(J,Y){let Q=h.join(Y,"manifest.json");M.writeFileSync(Q,JSON.stringify(J,null,2))}function fJ(J){let Y=h.join(J,"manifest.json");if(!M.existsSync(Y))return null;try{let Q=M.readFileSync(Y,"utf-8"),X=JSON.parse(Q);if(X.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${X.version}`),null;return X}catch(Q){return console.warn("[stx] Failed to load manifest:",Q),null}}function b(J,Y,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(Y)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let Y=J.headers.get("content-type")||"",Q={},X=($,Z)=>{let U=Q[$];if(U===void 0)Q[$]=Z;else if(Array.isArray(U))U.push(Z);else Q[$]=[U,Z]};if(Y.includes("multipart/form-data")){let $=await J.formData();for(let[Z,U]of $.entries())if(typeof U==="string")X(Z,U);return Q}if(Y.includes("application/x-www-form-urlencoded")){for(let[$,Z]of new URLSearchParams(await J.text()).entries())X($,Z);return Q}return Q}function FJ(J){if(!J)return!1;let Y=J.toUpperCase();return Y!=="GET"&&Y!=="HEAD"}async function p(J,Y={}){let Q=Y.request,X=Y.method??Q?.method;if(!Q||!FJ(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let $={};try{$=await KJ(Q)}catch{}let Z=await J.action({request:Q,form:$,params:Y.params??{},query:J.query??{},cookies:Y.cookies??{}});if(Z&&typeof Z==="object"){let U=Z,W=GJ(U.cookies),j=U.redirect;if(typeof j==="string"&&j)return{redirect:j,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:F,redirect:K,...G}=U;if(Object.assign(J,G),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function GJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let Y=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){Y.push(b(Q,X));continue}if(X&&typeof X==="object"){let $=X;if(typeof $.value!=="string")continue;Y.push(b(Q,$.value,$))}}return Y}function hJ(J,Y=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let $ of Y)X.append("Set-Cookie",$);for(let[$,Z]of Object.entries(Q??{}))if($.toLowerCase()!=="location")X.set($,Z);return new Response(null,{status:303,headers:X})}async function sJ(J,Y={}){return(await i(J,Y)).html}async function oJ(J,Y={}){let{html:Q,context:X,redirect:$,cookies:Z}=await i(J,Y),U=d(X),W=c(X);if($)return{html:Q,redirect:$,cookies:Z,status:U,headers:W};let{extractStreamBoundaries:j}=await import("./chunk-n80vvrf4.js"),F=j(X),K=J.streamTemplates;if(K&&Object.keys(K).length>0){let{processDirectives:G}=await import("./chunk-m24sv872.js"),{defaultConfig:B}=await import("./chunk-09g87hxr.js"),w=X.streamBoundaries||{},N={...B,autoShell:!1},I=Object.keys(K).map((z)=>({id:z,render:async()=>{let A=typeof w[z]==="function"?await w[z]():void 0;return G(K[z],{...X,$boundary:A},J.sourceFile,N,new Set)}})),_=new Set(I.map((z)=>z.id));F=[...(F||[]).filter((z)=>!_.has(z.id)),...I]}return{html:Q,boundaries:F&&F.length>0?F:void 0,cookies:Z,status:U,headers:W}}async function i(J,Y){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...Y};if(!J.hasServerScripts&&!D(J.html))return{html:J.html,context:Q};for(let U of J.serverScriptContent)try{await T(U,Q,J.sourceFile)}catch(W){if(Y.__stx_strict_hydration)throw W;console.warn(`[stx] Server script error in ${J.sourceFile}:`,W)}let X=await p(Q,{request:Y.request,method:Y.method,params:Y.params??{},cookies:Y.cookies??{}}),$=(U)=>{let W=U.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),j=l(Q);if(!j)return W;let F=W.indexOf("</head>");return F<0?j+W:W.slice(0,F)+j+W.slice(F)};if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!D(J.html))return{html:$(J.html),context:Q,cookies:X.cookies};let Z=new Map;for(let[U,W]of Object.entries(J.placeholders))if(W.expression)try{let j=k(W.expression,Q);if(W.type==="raw")Z.set(U,j!==void 0&&j!==null?String(j):"");else Z.set(U,j!==void 0&&j!==null?R(String(j)):"")}catch(j){if(Y.__stx_strict_hydration)throw j;Z.set(U,"")}return{html:$(P(J.html,Z)),context:Q,cookies:X.cookies}}async function aJ(J,Y={}){if(!J.hasServerScripts&&!D(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...Y};for(let $ of J.serverScriptContent)try{await T($,Q,J.sourceFile)}catch(Z){console.warn(`[stx] Server script error in ${J.sourceFile}:`,Z)}if(!D(J.fragment))return J.fragment;let X=new Map;for(let[$,Z]of Object.entries(J.placeholders))if(Z.expression)try{let U=k(Z.expression,Q);if(Z.type==="raw")X.set($,U!==void 0&&U!==null?String(U):"");else X.set($,U!==void 0&&U!==null?R(String(U)):"")}catch{X.set($,"")}return P(J.fragment,X)}
|
|
30
30
|
export{r as gg,y as hg,t as ig,x as jg,wJ as kg,NJ as lg,AJ as mg,g as ng,JJ as og,IJ as pg,MJ as qg,bJ as rg,PJ as sg,jJ as tg,RJ as ug,kJ as vg,CJ as wg,xJ as xg,fJ as yg,b as zg,KJ as Ag,FJ as Bg,p as Cg,hJ as Dg,sJ as Eg,oJ as Fg,aJ as Gg};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Nf as T}from"./chunk-
|
|
2
|
+
import{Nf as T}from"./chunk-5vccw7bd.js";import{qw as I}from"./chunk-nn4xr784.js";import E from"fs";import X from"path";import U from"crypto";var _=new Set(["webp","avif","jpeg","png"]),F=new Set(["cover","contain","fill","inside","outside"]),A=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),S=4096,y=80,D="cover";async function g(k,G){let J=G.routePath??"/_stx/img",B=new URL(k.url);if(B.pathname!==J)return null;let $=q(B,G);if(!$.ok)return new Response($.error,{status:$.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:j,srcUrl:K,width:H,height:v,format:Z,quality:Y,fit:z}=$,C;try{C=E.statSync(j)}catch{return new Response(`Source image not found: ${K}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!C.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let N=G.cacheDir??".stx/cache/img";await E.promises.mkdir(N,{recursive:!0});let V=`${j}:${C.mtimeMs}:${C.size}`,O=`${H}x${v}:${Z}:${Y}:${z}`,b=U.createHash("sha256").update(`${V}|${O}`).digest("hex").slice(0,16),Q=X.join(N,`${b}.${Z}`),W={"Content-Type":T(Z),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${b}"`,"X-Stx-Image-Cache":"HIT"};if(k.headers.get("if-none-match")===`"${b}"`)return new Response(null,{status:304,headers:W});let L=Bun.file(Q);if(await L.exists())return new Response(L,{headers:W});try{let R=Buffer.from(await Bun.file(j).arrayBuffer()),{resizeAndConvert:M}=await P(),w=await M(R,{width:H,height:v,format:Z,quality:Y,fit:z});return await Bun.write(Q,w),W["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(w),{headers:W})}catch(R){let M=R.message;return new Response(`Image processing failed: ${M}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function l(k){return async(G)=>{return await g(G,k)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}}function q(k,G){let J=k.searchParams.get("src");if(!J)return{ok:!1,error:"Missing required param: src",status:400};if(!J.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(J.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let B=X.extname(J).toLowerCase();if(!A.has(B))return{ok:!1,error:`Unsupported source extension: ${B}`,status:400};let $=X.resolve(G.publicDir),j=X.resolve($,J.slice(1));if(!j.startsWith(`${$}${X.sep}`)&&j!==$)return{ok:!1,error:"src is outside publicDir",status:400};let K=G.maxWidth??S,H=G.maxHeight??S,v=k.searchParams.get("w"),Z=k.searchParams.get("h"),Y=v?Number.parseInt(v,10):0,z=Z?Number.parseInt(Z,10):0;if(v&&(!Number.isFinite(Y)||Y<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(Z&&(!Number.isFinite(z)||z<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!v&&!Z)return{ok:!1,error:"At least one of w or h is required",status:400};let C=Math.min(Y||K,K),N=Math.min(z||H,H),V=k.searchParams.get("f")||"webp";if(!_.has(V))return{ok:!1,error:`Invalid f (must be one of: ${[..._].join(", ")})`,status:400};let O=V,b=k.searchParams.get("q"),Q=b?Number.parseInt(b,10):G.defaultQuality??y;if(!Number.isFinite(Q)||Q<1||Q>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let x=k.searchParams.get("fit")||G.defaultFit||D;if(!F.has(x))return{ok:!1,error:`Invalid fit (must be one of: ${[...F].join(", ")})`,status:400};return{ok:!0,srcFsPath:j,srcUrl:J,width:C,height:N,format:O,quality:Q,fit:x}}async function P(){return await import("./chunk-e0c8k4n1.js")}
|
|
3
3
|
export{g as yf,l as zf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ii as a,Ji as b,Ki as c,Li as d,Mi as e,Ni as f,Oi as g}from"./chunk-cr8v8k53.js";import"./chunk-
|
|
2
|
+
import{Ii as a,Ji as b,Ki as c,Li as d,Mi as e,Ni as f,Oi as g}from"./chunk-cr8v8k53.js";import"./chunk-nn4xr784.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
|
-
import{Bg as WJ,Dg as YJ,Fg as jJ,lg as ZJ,ng as g,pg as A,vg as n,yg as GJ}from"./chunk-
|
|
2
|
+
import{Bg as WJ,Dg as YJ,Fg as jJ,lg as ZJ,ng as g,pg as A,vg as n,yg as GJ}from"./chunk-ft8cjgk8.js";import{Ig as $J}from"./chunk-dvvx1wny.js";import{zl as XJ}from"./chunk-y330ysve.js";import{vo as h}from"./chunk-vhfngds8.js";import{xt as e}from"./chunk-27fanfef.js";import{Eu as QJ,Iu as i,Ku as p}from"./chunk-zam1mxnz.js";import{Bv as KJ,cw as l,gw as VJ}from"./chunk-z1ax712x.js";import{qw as DJ}from"./chunk-nn4xr784.js";import JJ from"fs";import k from"path";var{serve:wJ}=globalThis.Bun;VJ();import y from"zlib";import{promisify as a}from"util";var IJ=a(y.brotliCompress),OJ=a(y.gzip),UJ=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],BJ=["text/event-stream","multipart/x-mixed-replace"],_J=1024;function zJ(K){if(!K)return!1;let J=K.toLowerCase();if(BJ.some((G)=>J.startsWith(G)))return!1;return UJ.some((G)=>J.startsWith(G))}function FJ(K){let J=new Map;for(let G of K.split(",")){let[Z,...W]=G.trim().split(";"),O=Z.trim().toLowerCase();if(!O)continue;let U=1;for(let B of W){let w=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(B);if(!w)continue;let F=Number.parseFloat(w[1]);if(Number.isFinite(F))U=F}J.set(O,U)}return J}function LJ(K){if(!K)return null;let J=FJ(K),G=J.get("*"),Z=(W)=>J.get(W)??G??0;if(Z("br")>0)return"br";if(Z("gzip")>0)return"gzip";return null}async function t(K,J,G={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!zJ(J.headers.get("content-type")))return J;let Z=LJ(K.headers.get("accept-encoding"));if(!Z)return J;let W;try{W=new Uint8Array(await J.arrayBuffer())}catch{return J}let O=()=>new Response(W,{status:J.status,statusText:J.statusText,headers:s(J.headers)});if(W.length<(G.threshold??_J))return O();try{let U=Z==="br"?await IJ(W,{params:{[y.constants.BROTLI_PARAM_QUALITY]:G.quality??5,[y.constants.BROTLI_PARAM_SIZE_HINT]:W.length}}):await OJ(W);if(U.length>=W.length)return O();let B=s(J.headers);return B.set("Content-Encoding",Z),B.set("Content-Length",String(U.length)),new Response(U,{status:J.status,statusText:J.statusText,headers:B})}catch{return O()}}function s(K){let J=new Headers(K),G=J.get("Vary");if(!G)return J.set("Vary","Accept-Encoding"),J;if(!G.split(",").some((W)=>W.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${G}, Accept-Encoding`);return J}class d{now;entries=new e(1000,{maxBytes:33554432,sizeOf:(K)=>K.body.byteLength+JSON.stringify(K.headers).length*2});pending=new Map;generation=0;constructor(K=Date.now){this.now=K}invalidate(K){this.generation++,this.pending.clear();for(let J of Array.from(this.entries.keys()))if(K===void 0||this.entries.get(J)?.path===K)this.entries.delete(J)}async respond(K,J,G){let Z,W=async()=>{let X=Z??await G();return X.headers.set("Cache-Control","private, no-store"),X.headers.set("Vary",A(X.headers.get("Vary")).Vary),X};if(!J||K.method!=="GET"||K.headers.has("Cookie")||K.headers.has("Authorization")||K.headers.has("Range"))return W();let O=new URL(K.url),U=`${O.origin}${O.pathname}${O.search}|${g(K)?"fragment":"document"}`,B=this.entries.get(U),w=(X)=>{let T=new Headers(X.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-X.created)/1000)))),new Response(X.body.slice(0),{headers:T})},F=B?(this.now()-B.created)/1000:1/0;if(B&&F<J.maxAge)return w(B);let S=this.generation,q=async()=>{let X=await G();Z=X;let T=(X.headers.get("Vary")??"").toLowerCase().split(",").map((L)=>L.trim()).filter(Boolean);if(X.status!==200||X.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(X.headers.get("Cache-Control")??"")||T.some((L)=>L!=="x-stx-router"&&L!=="accept-encoding"))return null;let M=await X.clone().arrayBuffer();if(M.byteLength>1048576)return null;X.headers.set("Vary",A(X.headers.get("Vary")).Vary);let Q={body:M,headers:Array.from(X.headers.entries()),created:this.now(),path:O.pathname};if(this.generation===S)this.entries.set(U,Q);return Q},H=this.pending.get(U);if(!H){if(this.pending.size>=1000)return W();H=q().finally(()=>{if(this.pending.get(U)===H)this.pending.delete(U)}),this.pending.set(U,H)}if(B&&F<J.maxAge+(J.swr??0))return H.catch(()=>{}),w(B);let x=await H;return x?w(x):W()}}var HJ={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function uJ(K={}){let J=k.resolve(K.outputDir||".output"),G=K.port??3000,Z=GJ(J);if(!Z)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Z.routes.length} routes...`);let W=$J(Z.routeRules),O=new d,U=XJ(J,Z.apiRoutes??[]),B=Bun.file(k.join(J,"server/runtime-config.json")),w=K.runtimeConfig??(await B.exists()?await B.json():void 0),F=w?i(w):void 0,S=new Map,q=new Map,H=new Map,x=new Map;for(let Q of Z.routes)try{let L=k.join(J,Q.compiledPath),Y=JSON.parse(await Bun.file(L).text());if(F)Y.html=p(Y.html,F);S.set(Q.pattern,Y),H.set(Q.pattern,l(Y.html)),x.set(Q.pattern,h(Y.html));let C=k.join(J,Q.fragmentPath);if(await Bun.file(C).exists()){let P=await Bun.file(C).text();q.set(Q.pattern,F?p(P,F):P)}}catch(L){console.warn(`[stx] Failed to load route ${Q.pattern}:`,L)}let X=new Map,T=[];for(let Q of Z.routes)if(Q.hasParams){let{regex:L,params:Y}=KJ(Q.pattern);T.push({regex:L,route:Q,paramNames:Y})}else X.set(Q.pattern,Q);let M=wJ({port:G,async fetch(Q){return t(Q,await QJ(F??i(),async()=>{let Y=new URL(Q.url).pathname;if(K.onRequest){let j=await K.onRequest(Q);if(j)return j}if(K.apiRouter){let j=await K.apiRouter.handleRequest(Q);if(j.status!==404)return j}if(K.apiRoutes?.[Y])return K.apiRoutes[Y](Q);let C=await U(Q);if(C)return C;if((Q.method==="GET"||Q.method==="HEAD")&&Y!=="/"){let j=k.resolve(J,"public"),_;try{_=decodeURIComponent(Y)}catch{_=Y}if(!_.includes("\x00")){let I=k.resolve(j,`.${_}`);if(I===j||I.startsWith(`${j}${k.sep}`))try{if(JJ.existsSync(I)&&JJ.statSync(I).isFile()){let z=k.extname(I).toLowerCase(),E=HJ[z]||"application/octet-stream",v=Y.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(Y);return new Response(Bun.file(I),{headers:{"Content-Type":E,"Cache-Control":v?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=g(Q),D=null,o={};if(D=X.get(Y)||null,!D)for(let{regex:j,route:_,paramNames:I}of T){let $=Y.match(j);if($){D=_,I.forEach((z,E)=>{o[z]=$[E+1]});break}}if(!D){let j=X.get("/404")||null;if(j){let _=S.get(j.pattern);if(_)return new Response(_.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let R=W(Y),r=Object.keys(R).length>0;return O.respond(Q,R.cache,async()=>{let j=S.get(D.pattern);if(P&&Q.method==="GET"&&j&&!j.hasServerScripts&&Object.keys(j.placeholders).length===0){let $=q.get(D.pattern);if($){let z=H.get(D.pattern);return new Response($,{status:j.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...x.has(D.pattern)?{"X-STX-Runtime":x.get(D.pattern)?"true":"false"}:{},...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},...A(),...R.cache?{}:{"Cache-Control":ZJ}}})}}let _=WJ(Q.method),I=S.get(D.pattern);if(!I){let $=X.get("/500")||null;if($){let z=S.get($.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(D.prerendered&&_)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!_&&!I.hasServerScripts&&Object.keys(I.placeholders).length===0)return new Response(I.html,{status:I.status??200,headers:{"Content-Type":"text/html",...A(),"Cache-Control":"public, max-age=60"}});try{let{html:$,boundaries:z,redirect:E,cookies:v,status:m,headers:c}=await jJ(I,{params:o,request:Q,method:Q.method,__stx_strict_hydration:r,__stx_runtime_config:F});if(E)return YJ(E,v,c);if(z&&z.length>0){let{renderStreamingPage:N,streamToResponse:u}=await import("./chunk-n80vvrf4.js"),b=new Headers({...A(),...c,"Cache-Control":"private, no-store"});for(let f of v??[])b.append("Set-Cookie",f);if(P&&!_){let f=l($);b.set("X-STX-Fragment","true"),b.set("X-STX-Runtime",h($)?"true":"false"),b.set("X-STX-Layout",f.layout),b.set("X-STX-Layout-Group",f.group)}return u(N(P&&!_?n($,Z.routerContainer||"main"):$,z,{timeoutMs:30000}),{status:m??I.status??200,headers:b})}let V=new Headers({"Content-Type":"text/html",...A(),...R.cache?{}:{"Cache-Control":"private, no-store"}});for(let N of v??[])V.append("Set-Cookie",N);for(let[N,u]of Object.entries(c??{}))V.set(N,u);if(V.set("Vary",A(V.get("Vary")).Vary),P&&!_){let N=l($);return V.set("X-STX-Fragment","true"),V.set("X-STX-Runtime",h($)?"true":"false"),V.set("X-STX-Layout",N.layout),V.set("X-STX-Layout-Group",N.group),new Response(n($,Z.routerContainer||"main"),{status:m??I.status??200,headers:V})}return new Response($,{status:m??I.status??200,headers:V})}catch($){if(console.error(`[stx] Hydration error for ${Y}:`,$),r)return new Response("Internal Server Error",{status:500});return new Response(I.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${M.port}`),console.log(`[stx] Serving ${Z.routes.length} routes (${S.size} pre-loaded)`),{port:M.port,stop:()=>{O.invalidate(),M.stop()},invalidate:(Q)=>O.invalidate(Q)}}
|
|
3
3
|
export{zJ as Ve,LJ as We,t as Xe,uJ as Ye};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{qo as b,ro as c,so as d}from"./chunk-vhfngds8.js";import{ws as a}from"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{b as rendersAsElement,c as processESImports,d as processComponents,a as freeIdentifiers};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-nn4xr784.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
|
|
3
3
|
`)}function l(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push("# Bundle Analysis Report"),Q.push(""),Q.push(`Generated: ${new Date(X.timestamp).toISOString()}`),Q.push(""),Q.push("## Summary"),Q.push(""),Q.push("| Metric | Value |"),Q.push("|--------|-------|"),Q.push(`| Total Size | ${W(X.totalSize)} |`),$)Q.push(`| Gzip Size | ${W(X.totalGzipSize)} |`);Q.push(`| Modules | ${X.moduleCount} |`),Q.push(`| Chunks | ${X.chunks.length} |`),Q.push(`| Duplicates | ${X.duplicates.length} |`),Q.push(""),Q.push("## Size by Type"),Q.push(""),Q.push("| Type | Size | Gzip | % | Files |"),Q.push("|------|------|------|---|-------|");let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0)Q.push(`| ${j} | ${W(q.size)} | ${W(q.gzipSize)} | ${E(q.size,X.totalSize)} | ${q.count} |`)}Q.push(""),Q.push("## Chunks"),Q.push(""),Q.push("| Name | Size | Gzip | Modules | Type |"),Q.push("|------|------|------|---------|------|");for(let j of X.chunks.slice(0,15)){let q=j.isEntry?"Entry":j.isVendor?"Vendor":"-";Q.push(`| ${j.name} | ${W(j.size)} | ${W(j.gzipSize)} | ${j.modules.length} | ${q} |`)}Q.push("");let K=Z.topModules||10;Q.push(`## Largest Modules (Top ${K})`),Q.push(""),Q.push("| # | Path | Size | Gzip |"),Q.push("|---|------|------|------|");for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j];Q.push(`| ${j+1} | \`${q.path}\` | ${W(q.size)} | ${W(q.gzipSize)} |`)}if(Q.push(""),X.duplicates.length>0){Q.push("## Duplicates"),Q.push(""),Q.push("| Path | Copies | Wasted |"),Q.push("|------|--------|--------|");for(let j of X.duplicates.slice(0,10))Q.push(`| \`${j.path}\` | ${j.count} | ${W(j.wastedBytes)} |`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("## Recommendations"),Q.push("");for(let q of j.recommendations)Q.push(`### ${q.title}`),Q.push(""),Q.push(q.description),Q.push(""),Q.push(`- **Impact:** ${q.impact}`),Q.push(`- **Effort:** ${q.effort}`),Q.push("")}}return Q.join(`
|
|
4
4
|
`)}function N(X,Z){let Q=[],$=[];if(Z.threshold&&X.totalSize>Z.threshold)Q.push({severity:"error",message:`Bundle size (${W(X.totalSize)}) exceeds threshold (${W(Z.threshold)})`});if(X.totalSize>1048576)Q.push({severity:"warning",message:`Bundle is over 1MB (${W(X.totalSize)})`,details:"Large bundles can significantly impact load time"});if(X.duplicates.length>0){let q=X.duplicates.reduce((J,F)=>J+F.wastedBytes,0);Q.push({severity:"warning",message:`${X.duplicates.length} duplicate modules found, wasting ${W(q)}`}),$.push({title:"Remove Duplicate Modules",description:"Consider using import aliases or ensuring consistent package versions to eliminate duplicates.",impact:"medium",effort:"low"})}if(X.byType.js.size/X.totalSize>0.8&&X.totalSize>512000)$.push({title:"Code Splitting",description:"Over 80% of your bundle is JavaScript. Consider splitting code by route or feature.",impact:"high",effort:"medium"});let K=X.largestModules.filter((q)=>q.size>102400);if(K.length>0){Q.push({severity:"info",message:`${K.length} modules are over 100KB`});for(let q of K){if(q.path.includes("lodash")&&!q.path.includes("lodash-es"))$.push({title:"Use lodash-es instead of lodash",description:"lodash-es supports tree-shaking and can significantly reduce bundle size.",impact:"high",effort:"low"});if(q.path.includes("moment"))$.push({title:"Replace moment.js",description:"Consider using date-fns or dayjs for smaller date handling libraries.",impact:"high",effort:"medium"})}}if(X.byType.image.size>512000)$.push({title:"Optimize Images",description:`Images account for ${W(X.byType.image.size)}. Consider using WebP/AVIF formats and responsive images.`,impact:"high",effort:"low"});let j=100;if(X.totalSize>1048576)j-=20;else if(X.totalSize>512000)j-=10;if(j-=Math.min(20,X.duplicates.length*2),j-=Math.min(15,K.length*3),Z.threshold&&X.totalSize>Z.threshold)j-=25;return{score:Math.max(0,j),issues:Q,recommendations:$}}var i={lodash:{alternative:"lodash-es or individual imports",savings:"~70%"},moment:{alternative:"date-fns or dayjs",savings:"~90%"},"chart.js":{alternative:"chart.js with tree-shaking",savings:"~50%"},"highlight.js":{alternative:"Selective language imports",savings:"~80%"},fontawesome:{alternative:"Individual icon imports",savings:"~90%"},"material-ui":{alternative:"Named imports from @mui/*",savings:"~60%"}};function n(X){for(let[Z,Q]of Object.entries(i))if(X.includes(Z))return{title:`Optimize ${Z}`,description:`Consider using ${Q.alternative}. Potential savings: ${Q.savings}`,impact:"high",effort:"low"};return null}var o={default:{js:"#f7df1e",css:"#264de4",html:"#e34c26",image:"#4caf50",font:"#9c27b0",other:"#607d8b",vendor:"#ff5722"},pastel:{js:"#fff3b0",css:"#b0d4ff",html:"#ffb0b0",image:"#b0ffb0",font:"#e0b0ff",other:"#d0d0d0",vendor:"#ffcfb0"},monochrome:{js:"#333333",css:"#555555",html:"#777777",image:"#999999",font:"#bbbbbb",other:"#dddddd",vendor:"#444444"}};function x(X,Z={}){let{title:Q="Bundle Analysis",gzip:$=!0,colorScheme:U="default"}=Z,K=o[U],j=a(X),q=JSON.stringify(j);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Jg as a,Kg as b,Lg as c,Mg as d,Ng as e,Og as f,Pg as g,Qg as h,Rg as i,Sg as j,Tg as k,Ug as l}from"./chunk-xz3evxqp.js";import"./chunk-
|
|
2
|
+
import{Jg as a,Kg as b,Lg as c,Mg as d,Ng as e,Og as f,Pg as g,Qg as h,Rg as i,Sg as j,Tg as k,Ug as l}from"./chunk-xz3evxqp.js";import"./chunk-nn4xr784.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{tk as a,uk as b,vk as c,wk as d}from"./chunk-wm3ym3vp.js";import"./chunk-k5gxz3fv.js";import"./chunk-vhfngds8.js";import"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ai as e,wi as a,xi as b,yi as c,zi as d}from"./chunk-c79nfdyj.js";import"./chunk-
|
|
2
|
+
import{Ai as e,wi as a,xi as b,yi as c,zi as d}from"./chunk-c79nfdyj.js";import"./chunk-nn4xr784.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fm as c,im as d,jm as e,km as f,lm as g,mm as h,nm as i,om as j,pm as k,qm as l,rm as m}from"./chunk-vhfngds8.js";import"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import{lt as a,mt as b}from"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,m as processClientScript,g as injectBrowserCoreAutoImports,l as generateServerDataBridge,j as generateBrowserAutoImportDestructuring,i as generateAutoImportDestructuring,a as findInterpolationEnd,k as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$l as b,Ko as x,Ro as k,_l as A,cn as T,cq as w,dn as y,eo as M,pm as B,rm as F,wo as R,zr as P}from"./chunk-vhfngds8.js";import{qw as v}from"./chunk-nn4xr784.js";function j(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,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.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 D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.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=Y.__stx_event_bindings||[],X=B(Y),Z=(await Promise.all(Q.map(async(I)=>{let W=I.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return I;return await F(W[1],{eventBindings:N,templateContent:q,serverData:X,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 R(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{injectCss:N}=await import("./chunk-
|
|
17
|
+
${Z}`}q=await R(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{injectCss:N}=await import("./chunk-my5t5tmx.js");q=await N(q)}catch{}return q}
|
|
18
18
|
export{j as xk,C as yk,D as zk,o as Ak,r as Bk,V as Ck};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ek as a,fk as b,gk as c,hk as d}from"./chunk-pcvayb2f.js";import"./chunk-
|
|
2
|
+
import{ek as a,fk as b,gk as c,hk as d}from"./chunk-pcvayb2f.js";import"./chunk-nn4xr784.js";export{d as default,c as createHotReloadServer,b as compileToNative,a as NATIVE_COMPONENTS};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ri as a,si as b,ti as c,ui as d,vi as e}from"./chunk-7kw3grq5.js";import"./chunk-
|
|
2
|
+
import{ri as a,si as b,ti as c,ui as d,vi as e}from"./chunk-7kw3grq5.js";import"./chunk-nn4xr784.js";export{c as renderSSRSuspense,a as processSuspenseDirectives,e as generateSuspenseRuntime,d as generateSuspenseCSS,b as createSSRSuspense};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ro as a,To as b,Vo as c,Wo as d,dq as e,eq as f,fq as g,gq as h,hq as i,iq as j,jq as k,kq as l,lq as m,mq as n,nq as o,oq as p,pq as q,qq as r,rq as s,sq as t,tq as u,uq as v,vq as w,wq as x}from"./chunk-vhfngds8.js";import"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{e as validateTemplate,g as validateDirective,n as userComponentFileExists,m as transpileTypeScript,p as slotContentHasExpressions,k as shouldTranspileTypeScript,t as resolveTemplatePath,r as renderComponentWithSlot,j as isJavaScriptScript,o as isHydrateTrigger,d as hasVariables,h as hasDirectives,u as getSourceLineInfo,l as getSharedTranspiler,f as getPositionInfo,x as getComponentCacheStats,s as fileExists,a as extractVariables,c as extractScriptFromTemplate,i as extractDirectiveNames,v as createDetailedErrorMessage,b as convertToCommonJS,q as componentClientSignalNames,w as clearComponentCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Xo as a,Yo as b,Zo as c}from"./chunk-vhfngds8.js";import"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{b as reportDeferredLoopWarnings,c as processLoops,a as parseLoopBinding};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$p as b,aq as c,bq as d,cq as e,wo as a}from"./chunk-vhfngds8.js";import"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{d as validateClientScript,c as processOnceDirective,b as processJsonDirective,e as processDirectives,a as injectRouterScript};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$e as c,Ze as a,_e as b,af as d,bf as e,cf as f,df as g,ef as h,ff as i,gf as j,hf as k,if as l,jf as m,kf as n,lf as o}from"./chunk-ym3r8ktq.js";import"./chunk-
|
|
2
|
+
import{$e as c,Ze as a,_e as b,af as d,bf as e,cf as f,df as g,ef as h,ff as i,gf as j,hf as k,if as l,jf as m,kf as n,lf as o}from"./chunk-ym3r8ktq.js";import"./chunk-nn4xr784.js";export{k as writeNetlifyConfig,n as initNetlify,l as hasNetlifyConfig,g as getTotalSize,h as generateNetlifyToml,f as formatSize,e as filterRequiredFiles,i as detectProjectConfig,m as deploy,a as createNetlifyClient,d as createFileManifest,j as createDefaultNetlifyConfig,c as collectDeployFiles,b as calculateSha1,o as DeployError};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var N={},Z=[],Q={};function h(){return N}function D(){return Q}function I(){N={},Z.length=0,Q={}}function W(j){N=R(N,j)}function R(j,z){return{title:z.title??j.title,titleTemplate:z.titleTemplate??j.titleTemplate,base:z.base??j.base,meta:[...j.meta||[],...z.meta||[]],link:[...j.link||[],...z.link||[]],script:[...j.script||[],...z.script||[]],style:[...j.style||[],...z.style||[]],htmlAttrs:{...j.htmlAttrs,...z.htmlAttrs},bodyAttrs:{...j.bodyAttrs,...z.bodyAttrs}}}function _(j){W($(j))}function $(j){let z=[];if(j.description)z.push({name:"description",content:j.description});if(j.keywords){let L=Array.isArray(j.keywords)?j.keywords.join(", "):j.keywords;z.push({name:"keywords",content:L})}if(j.author)z.push({name:"author",content:j.author});if(j.robots)z.push({name:"robots",content:j.robots});let B=j.ogTitle??j.title,E=j.ogDescription??j.description;if(B)z.push({property:"og:title",content:B});if(E)z.push({property:"og:description",content:E});if(j.ogImage){if(z.push({property:"og:image",content:j.ogImage}),j.ogImageType)z.push({property:"og:image:type",content:j.ogImageType});if(j.ogImageWidth)z.push({property:"og:image:width",content:String(j.ogImageWidth)});if(j.ogImageHeight)z.push({property:"og:image:height",content:String(j.ogImageHeight)});if(j.ogImageAlt)z.push({property:"og:image:alt",content:j.ogImageAlt})}if(j.ogUrl)z.push({property:"og:url",content:j.ogUrl});if(j.ogType)z.push({property:"og:type",content:j.ogType});if(j.ogSiteName)z.push({property:"og:site_name",content:j.ogSiteName});if(j.ogLocale)z.push({property:"og:locale",content:j.ogLocale});if(j.profileFirstName)z.push({property:"profile:first_name",content:j.profileFirstName});if(j.profileLastName)z.push({property:"profile:last_name",content:j.profileLastName});if(j.profileUsername)z.push({property:"profile:username",content:j.profileUsername});let F=j.twitterTitle??j.title,G=j.twitterDescription??j.description,K=j.twitterImage??j.ogImage;if(j.twitterCard)z.push({name:"twitter:card",content:j.twitterCard});if(F)z.push({name:"twitter:title",content:F});if(G)z.push({name:"twitter:description",content:G});if(K){z.push({name:"twitter:image",content:K});let L=j.twitterImageAlt??(j.twitterImage?void 0:j.ogImageAlt);if(L)z.push({name:"twitter:image:alt",content:L})}if(j.twitterSite)z.push({name:"twitter:site",content:j.twitterSite});if(j.twitterCreator)z.push({name:"twitter:creator",content:j.twitterCreator});if(j.articleAuthor)z.push({property:"article:author",content:j.articleAuthor});if(j.articlePublishedTime)z.push({property:"article:published_time",content:j.articlePublishedTime});if(j.articleModifiedTime)z.push({property:"article:modified_time",content:j.articleModifiedTime});if(j.articleSection)z.push({property:"article:section",content:j.articleSection});if(j.articleTags)for(let L of j.articleTags)z.push({property:"article:tag",content:L});let J=[];if(j.canonical)J.push({rel:"canonical",href:j.canonical});return{title:j.title,titleTemplate:j.titleTemplate,meta:z,link:J}}function S(j){if(Q={...Q,...j},j.title||j.description)_({title:j.title,description:j.description})}function P(j){let z=typeof j==="function"?j():j;W({title:z})}function C(j=N){let z=[];if(j.title){let B=j.title;if(j.titleTemplate)B=typeof j.titleTemplate==="function"?j.titleTemplate(B):j.titleTemplate.replace("%s",B);z.push(`<title>${O(B)}</title>`)}if(j.base){let B=Object.entries(j.base).map(([E,F])=>`${E}="${O(F)}"`).join(" ");z.push(`<base ${B}>`)}for(let B of j.meta||[]){let E=Object.entries(B).filter(([F,G])=>G!==void 0).map(([F,G])=>{return`${F==="httpEquiv"?"http-equiv":F}="${O(String(G))}"`}).join(" ");z.push(`<meta ${E}>`)}for(let B of j.link||[]){let E=Object.entries(B).filter(([F,G])=>G!==void 0).map(([F,G])=>`${F}="${O(String(G))}"`).join(" ");z.push(`<link ${E}>`)}for(let B of j.script||[]){let{content:E,...F}=B,G=Object.entries(F).filter(([K,J])=>J!==void 0).map(([K,J])=>{if(typeof J==="boolean")return J?K:"";return`${K}="${O(String(J))}"`}).filter(Boolean).join(" ");if(E)z.push(`<script ${G}>${E}</script>`);else z.push(`<script ${G}></script>`)}for(let B of j.style||[]){let E=B.type?` type="${B.type}"`:"";z.push(`<style${E}>${B.content}</style>`)}return z.join(`
|
|
3
3
|
`)}function M(j=N){if(!j.htmlAttrs)return"";return Object.entries(j.htmlAttrs).map(([z,B])=>`${z}="${O(B)}"`).join(" ")}function V(j=N){if(!j.bodyAttrs)return"";return Object.entries(j.bodyAttrs).map(([z,B])=>`${z}="${O(B)}"`).join(" ")}function O(j){return j.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function w(j=N){if(typeof document>"u")return;if(j.title){let z=j.title;if(j.titleTemplate)z=typeof j.titleTemplate==="function"?j.titleTemplate(z):j.titleTemplate.replace("%s",z);document.title=z}for(let z of j.meta||[]){let B=z.name?`meta[name="${z.name}"]`:z.property?`meta[property="${z.property}"]`:null;if(B){let E=document.querySelector(B);if(!E){if(E=document.createElement("meta"),z.name)E.setAttribute("name",z.name);if(z.property)E.setAttribute("property",z.property);document.head.appendChild(E)}E.setAttribute("content",z.content)}}for(let z of j.link||[]){let B=`link[rel="${z.rel}"]${z.href?`[href="${z.href}"]`:""}`,E=document.querySelector(B);if(!E)E=document.createElement("link"),document.head.appendChild(E);for(let[F,G]of Object.entries(z))if(G!==void 0)E.setAttribute(F,String(G))}if(j.htmlAttrs)for(let[z,B]of Object.entries(j.htmlAttrs))if(z==="class")for(let E of String(B).split(/\s+/).filter(Boolean))document.documentElement.classList.add(E);else document.documentElement.setAttribute(z,B);if(j.bodyAttrs)for(let[z,B]of Object.entries(j.bodyAttrs))document.body.setAttribute(z,B)}function y(j){let z="";return{content:j.replace(/@head\s*([\s\S]*?)@endhead/g,(E,F)=>{return z+=F.trim()+`
|
|
4
|
-
`,""}),headContent:z.trim()}}function x(j,z){return j.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(B,E,F,G)=>{let K=E?F:z[(G||"").trim()]??G,J=z.__stx_runtime_head??{};return z.__stx_runtime_head=R(J,{title:K}),""})}function T(j,z){return j.replace(/@meta\s*\(\s*(['"`])(.+?)\1\s*,\s*(?:(['"`])(.+?)\3|([^)]+))\s*\)/g,(B,E,F,G,K,J)=>{let L=G?K:J,U=G?L:z[(L||"").trim()]??L,X=F.includes(":")?{property:F,content:U}:{name:F,content:U},Y=z.__stx_runtime_head??{};return z.__stx_runtime_head=R(Y,{meta:[X]}),""})}export{h as
|
|
4
|
+
`,""}),headContent:z.trim()}}function x(j,z){return j.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(B,E,F,G)=>{let K=E?F:z[(G||"").trim()]??G,J=z.__stx_runtime_head??{};return z.__stx_runtime_head=R(J,{title:K}),""})}function T(j,z){return j.replace(/@meta\s*\(\s*(['"`])(.+?)\1\s*,\s*(?:(['"`])(.+?)\3|([^)]+))\s*\)/g,(B,E,F,G,K,J)=>{let L=G?K:J,U=G?L:z[(L||"").trim()]??L,X=F.includes(":")?{property:F,content:U}:{name:F,content:U},Y=z.__stx_runtime_head??{};return z.__stx_runtime_head=R(Y,{meta:[X]}),""})}export{h as Lu,D as Mu,I as Nu,W as Ou,R as Pu,_ as Qu,$ as Ru,S as Su,P as Tu,C as Uu,M as Vu,V as Wu,w as Xu,y as Yu,x as Zu,T as _u};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
function A(h){let q=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;h=h.replace(q,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
|
|
3
3
|
`});let v=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return h=h.replace(v,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__composables
|
|
4
4
|
`}),h}function B(h){return h.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
|
|
5
|
-
export{A as
|
|
5
|
+
export{A as $u,B as av};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$t as
|
|
2
|
+
import{$t as h,Ut as a,Vt as b,Wt as c,Xt as d,Yt as e,Zt as f,_t as g,au as i,bu as j,cu as k,du as l}from"./chunk-27fanfef.js";import"./chunk-e59fq6n5.js";import"./chunk-nn4xr784.js";export{e as resolveUserCssConfig,c as resetCssCache,h as rebuildCss,d as loadCssEngineConfig,b as loadCssEngine,l as injectCss,a as getCssServeAsset,i as getCachedCSS,k as generateCss,f as fingerprintConfig,j as extractClassNames,g as buildCss};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{mt as _}from"./chunk-2k16wj3k.js";import"./chunk-nn4xr784.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
|
|
3
3
|
`)H++;return H}function P(j,G){let H=j.lastIndexOf(`
|
|
4
4
|
`,G)+1,Q=j.indexOf(`
|
|
5
5
|
`,G);return j.slice(H,Q===-1?j.length:Q).trim().slice(0,120)}function q(j,G){let H=j.slice(0,G),Q=H.lastIndexOf("function"),X=H.lastIndexOf("=>"),M=Math.max(Q,X);if(M===-1)return!1;let z=j.slice(Math.max(0,M-120),M);return/\basync\b[^;{}]*$/.test(z)}function L(j){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(j)||/\b(?:const|let|var)\s+confirm\s*=/.test(j)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(j)}function O(j,G,H){if(L(j))return j;let Q=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,X=F(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let Z=Y.index+Y[1].length,$=N(j,Z),J=P(j,Z);if(/stxConfirm\s*\($/.test(j.slice(0,Z+8)))continue;let D=q(j,Z);if(H.push({file:G,line:$,rule:"confirm",applied:D,snippet:J,reason:D?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),D)M+=j.slice(z,Z)+"await stxConfirm(",z=Z+(Y[0].length-Y[1].length)}return M+j.slice(z)}function w(j,G,H){let Q=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,X=C(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let[Z,$,J,D]=Y,K=N(j,Y.index),B=P(j,Y.index),V=$.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(V)){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:`\`title\` on <${V}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test($)||D.trim()===""){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:/\bx-tooltip[=\s]/.test($)?"already has x-tooltip":"empty title"});continue}H.push({file:G,line:K,rule:"tooltip",applied:!0,snippet:B}),M+=j.slice(z,Y.index)+`${$} x-tooltip=${J}${D}${J} title=${J}${D}${J}`,z=Y.index+Z.length}return M+j.slice(z)}function C(j){return j.replace(/<!--[\s\S]*?-->/g,(G)=>G.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(G)=>G.replace(/[^\n]/g," "))}function E(j){let G=(H)=>H.replace(/[^\n]/g," ");return j.replace(/\/\*[\s\S]*?\*\//g,G).replace(/\/\/[^\n]*/g,G)}function F(j,G=!1){let H=C(j);return(G?E(H):_(H)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(X,M)=>/\bclient\b/i.test(M)?X:X.replace(/[^\n]/g," "))}function S(j,G,H,Q){let X=F(j),M=F(j,!0);for(let z of v){if(!H.includes(z.rule))continue;if(z.requires&&!z.requires(j))continue;z.pattern.lastIndex=0;let Y,Z=/['"]/.test(z.pattern.source)?M:X;z.pattern.lastIndex=0;while((Y=z.pattern.exec(Z))!==null){if(z.reject?.(j,Y.index))continue;Q.push({file:G,line:N(j,Y.index),rule:z.rule,applied:!1,snippet:P(j,Y.index),reason:`${z.primitive} \u2014 ${z.why}`})}}}function k(j,G={}){let H=G.rules??U,Q=G.file??"<source>",X=[];S(j,Q,H,X);let M=j;if(H.includes("confirm"))M=O(M,Q,X);if(H.includes("tooltip"))M=w(M,Q,X);X.sort((Z,$)=>Z.line-$.line);let z=new Set,Y=X.filter((Z)=>{let $=`${Z.rule}:${Z.line}`;if(z.has($))return!1;return z.add($),!0});return{code:M,findings:Y}}var I=new Set(["confirm","tooltip"]);function A(j,G){if(j.length===0)return"No hand-rolled equivalents found.";let H=j.filter((z)=>z.applied),Q=j.filter((z)=>!z.applied&&I.has(z.rule)),X=j.filter((z)=>!z.applied&&!I.has(z.rule)),M=[];if(H.length>0){M.push(G?`Rewrote ${H.length} site(s):`:`Would rewrite ${H.length} site(s) (pass --fix):`);for(let z of H)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}`)}if(Q.length>0){M.push("",`Needs a human \u2014 ${Q.length} site(s):`);for(let z of Q)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$i as e,Xi as a,Yi as b,Zi as c,_i as d,aj as f,bj as g,cj as h,dj as i,ej as j,fj as k,gj as l,hj as m,ij as n}from"./chunk-c57dc9p8.js";import"./chunk-vhfngds8.js";import"./chunk-p26cry7t.js";import"./chunk-0n90mnpc.js";import"./chunk-2k16wj3k.js";import"./chunk-0dtcw5ca.js";import"./chunk-27fanfef.js";import"./chunk-61y14d8d.js";import"./chunk-8fved33k.js";import"./chunk-e59fq6n5.js";import"./chunk-1cjghpw3.js";import"./chunk-zam1mxnz.js";import"./chunk-mhahh2e7.js";import"./chunk-mk6j4hhx.js";import"./chunk-nt9y4feq.js";import"./chunk-cq386y8q.js";import"./chunk-z1ax712x.js";import"./chunk-c28ws2ep.js";import"./chunk-nn4xr784.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function j(a){return this[a]}var m=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:j.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var k=(a)=>a;function l(a,b){this[a]=k.bind(null,b)}var n=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:l.bind(b,c)})};var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=import.meta.require;
|
|
3
|
-
export{m as
|
|
3
|
+
export{m as nw,n as ow,o as pw,p as qw};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var E=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),N=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function X(Q){return Q.replace(/[^\n]/g," ")}function R(Q){let H=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,X).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,X).replace(/<!--[\s\S]*?-->/g,X).replace(/\{\{\{[\s\S]*?\}\}\}/g,X).replace(/\{\{[\s\S]*?\}\}/g,X).replace(/\{!![\s\S]*?!!\}/g,X),F=new Map,J=new Map,Y=/<(\/?)([A-Za-z][\w-]*)\b(?:[^>"']|"[^"]*"|'[^']*')*?(\/?)>/g,z;while((z=Y.exec(H))!==null){let j=z[1]==="/",q=z[2],W=z[3]==="/";if(E.has(q.toLowerCase()))continue;if(W)continue;if(j)J.set(q,(J.get(q)??0)+1);else{let Z=F.get(q);if(Z)Z.count++;else{let B=H.slice(0,z.index).split(`
|
|
3
3
|
`).length;F.set(q,{count:1,firstLine:B})}}}let M=[];for(let j of new Set([...F.keys(),...J.keys()])){if(N.has(j.toLowerCase()))continue;let q=F.get(j)?.count??0,W=J.get(j)??0;if(q!==W)M.push({tag:j,opened:q,closed:W,firstOpenLine:F.get(j)?.firstLine??0})}return M}var $=new Set;function U(Q,H){let F;try{F=R(Q)}catch{return}if(F.length===0)return;let J=`${H}:${Q.length}`;if($.has(J))return;$.add(J);let Y=H?H.split(/[/\\]/).pop()||H:"template";for(let{tag:z,opened:M,closed:j,firstOpenLine:q}of F)if(M>j){let W=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${Y}: <${z}> ${M} opened, ${j} closed \u2014 an unclosed <${z}>${W} may swallow the content that follows it.`)}else console.warn(`[stx] ${Y}: <${z}> ${M} opened, ${j} closed \u2014 ${j-M} stray </${z}>.`)}
|
|
4
|
-
export{R as
|
|
4
|
+
export{R as bv,U as cv};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{kt as bq}from"./chunk-0n90mnpc.js";import{qw as k}from"./chunk-nn4xr784.js";var fq={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},b={},$q="en";function hq(q){$q=q}function uq(){return $q}function dq(q){b={...b,...q}}function pq(){b={}}function Xq(q,Q={}){let J=b[q]||fq[q]||{message:`Unknown error (code: ${q})`},Z=J.message,$=J.help;for(let[Y,G]of Object.entries(Q)){let X=`{{${Y}}}`;if(Z=Z.replace(new RegExp(X,"g"),G),$)$=$.replace(new RegExp(X,"g"),G)}return{message:Z,help:$}}function mq(q,Q={}){let{message:J,help:Z}=Xq(q,Q);return Z?`${J}
|
|
3
3
|
Help: ${Z}`:J}var U={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function u(q){for(let[Q,J]of Object.entries(U))if(J===q)return Q;return}function cq(){return!1}function L(){return!cq()||process.env.STX_DEBUG==="true"}function GQ(){return!1}import lq from"path";var Yq={showRelativePaths:!1,enableAutoRecovery:L(),logRecoveryWarnings:!0},T={...Yq};function iq(q){T={...T,...q}}function E(){return{...T}}function sq(){T={...Yq}}function C(q){if(!T.showRelativePaths||!q)return q;let Q=T.baseDir||process.cwd();try{let J=lq.relative(Q,q);return J.startsWith("..")?q:J}catch{return q}}class N extends Error{code;filePath;line;column;context;numericCode;constructor(q,Q,J,Z,$,Y,G){super(q);this.code=Q;this.filePath=J;this.line=Z;this.column=$;this.context=Y;if(this.name="StxError",this.numericCode=G||U.EVALUATION_ERROR,this.filePath)this.filePath=C(this.filePath)}}class Hq extends N{constructor(q,Q,J,Z,$,Y){super(q,"stx_SYNTAX_ERROR",Q,J,Z,$,Y||U.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class Gq extends N{constructor(q,Q,J,Z,$,Y){super(q,"stx_RUNTIME_ERROR",Q,J,Z,$,Y||U.EVALUATION_ERROR);this.name="StxRuntimeError"}}class Wq extends N{constructor(q,Q,J,Z,$,Y){super(q,"stx_SECURITY_ERROR",Q,J,Z,$,Y||U.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class Bq extends N{constructor(q,Q,J,Z,$,Y){super(q,"stx_FILE_ERROR",Q,J,Z,$,Y||U.FILE_NOT_FOUND);this.name="StxFileError"}}class Vq extends N{isFatal=!0;constructor(q,Q,J,Z,$,Y){super(q,"stx_VALIDATION_ERROR",Q,J,Z,$,Y||U.DOM_API_VIOLATION);this.name="StxValidationError"}}function d(q){let{type:Q,message:J,code:Z,filePath:$,line:Y,column:G,template:X,offset:H,snippet:W,suggestion:B,format:V="text"}=q,w=Y,M=G;if(!w&&X&&H!==void 0){let I=Fq(X,H);w=I.line,M=I.column}let j=$?C($):void 0,D=Z?u(Z):void 0,K={type:Q,code:Z,codeName:D,message:J,filePath:j,line:w,column:M,snippet:W,suggestion:B,timestamp:new Date().toISOString()},F;switch(V){case"html":F=rq(K);break;case"json":F=JSON.stringify(K,null,2);break;case"console":F=oq(K,X,H);break;case"text":default:F=nq(K,X,H);break}return{formatted:F,data:K}}function nq(q,Q,J){let Z=[],$=q.code?` [${q.codeName||q.code}]`:"";if(Z.push(`[${q.type} Error${$}]`),q.filePath){let Y=q.filePath;if(q.line){if(Y+=`:${q.line}`,q.column)Y+=`:${q.column}`}Z.push(`at ${Y}`)}if(Z.push(`
|
|
4
4
|
${q.message}`),Q&&q.line){let Y=aq(Q,q.line,2);if(Y)Z.push(`
|
|
5
5
|
${Y}`)}if(q.snippet)Z.push(`
|
|
@@ -57,4 +57,4 @@ catch (e) {
|
|
|
57
57
|
border-width: 0;
|
|
58
58
|
}
|
|
59
59
|
`.trim()}function aJ(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function Cq(q){let Q=new Map,J=q.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,($,Y,G)=>{let X=Q.get(G);if(!X)X=`stx-a11y-component-${Q.size}`,Q.set(G,X);return`<${Y}${X}`}),Z=new Map([...Q.entries()].map(([$,Y])=>[Y,$]));return{protectedSource:J,restore:($)=>$.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(Y,G,X)=>{let H=Z.get(X);return H?`<${G}${H}`:Y})}}function tJ(q,Q){let J=[],Z=/<img\s+([^>]*)>/gi,$;$=Z.exec(q);while($!==null){let F=$[1];if(!/\balt\s*=/i.test(F))J.push({type:"missing-alt",element:$[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});$=Z.exec(q)}let Y=/<button([^>]*)>\s*<\/button>/gi;$=Y.exec(q);while($!==null){let F=$[1];if(!/\baria-label\s*=/i.test(F)&&!/\btitle\s*=/i.test(F))J.push({type:"missing-accessible-name",element:$[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});$=Y.exec(q)}let G=/<a\s+([^>]*)>\s*<\/a>/gi;$=G.exec(q);while($!==null){let F=$[1];if(!/\baria-label\s*=/i.test(F)&&!/\btitle\s*=/i.test(F))J.push({type:"link-missing-text",element:$[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});$=G.exec(q)}let X=/<(input|select|textarea)\s+([^>]*)>/gi;$=X.exec(q);while($!==null){let F=$[2];if(/\btype\s*=\s*["']hidden["']/i.test(F)){$=X.exec(q);continue}let I=/\baria-label\s*=/i.test(F)||/\baria-labelledby\s*=/i.test(F),R=F.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!I){let yq=R&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${R[1]}["']`,"i").test(q),Qq=$.index,Zq=q.substring(0,Qq),YQ=q.substring(Qq),vq=(Zq.match(/<label\b/gi)||[]).length,xq=(Zq.match(/<\/label>/gi)||[]).length,gq=vq>xq;if(!yq&&!gq)J.push({type:"input-missing-label",element:$[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}$=X.exec(q)}let H=/<h([1-6])[^>]*>/gi,W=[];$=H.exec(q);while($!==null)W.push(Number.parseInt($[1],10)),$=H.exec(q);let B=0;for(let F of W){if(B>0&&F>B+1)J.push({type:"heading-skip",element:`<h${F}>`,message:`Heading level skipped from h${B} to h${F}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});B=F}if(/<html\b/i.test(q)&&!/<html[^>]*\slang\s*=/i.test(q))J.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let V=q.match(/<html\b([^>]*)>/i);if(V&&Jq(S(V[1],"lang"),S(V[1],"dir")))J.push({type:"missing-dir",element:V[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let w=/<table([^>]*)>([\s\S]*?)<\/table>/gi;$=w.exec(q);while($!==null){let F=$[2];if(!Eq(S($[1],"role"))&&!/<th\b/i.test(F))J.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});$=w.exec(q)}let M=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;$=M.exec(q);while($!==null){if(!/\bmuted\b/i.test($[0]))J.push({type:"autoplay-audio",element:`<${$[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});$=M.exec(q)}let j=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;$=j.exec(q);while($!==null)J.push({type:"positive-tabindex",element:`tabindex="${$[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),$=j.exec(q);let D=/<iframe\s+([^>]*)>/gi;$=D.exec(q);while($!==null){let F=$[1];if(!/\btitle\s*=/i.test(F)&&!/\baria-label\s*=/i.test(F))J.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});$=D.exec(q)}let K=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;$=K.exec(q);while($!==null){let F=$[1].toLowerCase(),I=$[2];if(F!=="button"&&!/\btabindex\s*=/i.test(I))J.push({type:"button-not-focusable",element:$[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});$=K.exec(q)}return J}async function eJ(q,Q){let{protectedSource:J}=Cq(q);if(!aJ())return tJ(J,Q);let Z=[];try{let $=globalThis.document.createElement("div");$.innerHTML=J,$.querySelectorAll("img").forEach((H)=>{if(!H.hasAttribute("alt"))Z.push({type:"missing-alt",element:`<${H.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),$.querySelectorAll('button, a, [role="button"]').forEach((H)=>{if(!(H.hasAttribute("aria-label")||H.hasAttribute("aria-labelledby")||H.textContent&&H.textContent.trim().length>0))Z.push({type:"missing-accessible-name",element:`<${H.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),$.querySelectorAll("input, select, textarea").forEach((H)=>{let W=H.getAttribute("id"),B=W&&$.querySelector(`label[for="${W}"]`),V=H.hasAttribute("aria-label")||H.hasAttribute("aria-labelledby"),w=H.closest("label")!==null;if(!B&&!V&&!w)Z.push({type:"input-missing-label",element:`<${H.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let Y=Array.from($.querySelectorAll("h1, h2, h3, h4, h5, h6")),G=0;for(let H of Y){let W=Number.parseInt(H.tagName.charAt(1));if(G>0&&W>G+1)Z.push({type:"heading-skip",element:`<${H.outerHTML}>`,message:`Heading level skipped from h${G} to h${W}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});G=W}let X=$.querySelector("html");if(J.includes("<html")&&X&&!X.hasAttribute("lang"))Z.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(X&&Jq(X.getAttribute("lang"),X.getAttribute("dir")))Z.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if($.querySelectorAll("a").forEach((H)=>{let W=H.textContent&&H.textContent.trim().length>0,B=H.hasAttribute("aria-label")||H.hasAttribute("aria-labelledby"),V=H.hasAttribute("title"),w=H.querySelector("img[alt]");if(!W&&!B&&!V&&!w)Z.push({type:"link-missing-text",element:`<${H.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),J.includes("<nav")||J.includes("<header")){if(!$.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&$.querySelectorAll("a").length>5)Z.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if($.querySelectorAll("table").forEach((H)=>{if(Eq(H.getAttribute("role")))return;let W=H.querySelector("caption");if(!H.querySelector("th"))Z.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!W&&!H.hasAttribute("aria-label")&&!H.hasAttribute("aria-labelledby"))Z.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),$.querySelectorAll('[style*="color"]').forEach((H)=>{let W=H.getAttribute("style")||"";if(W.includes("color:")&&!W.includes("background"))Z.push({type:"potential-contrast-issue",element:`<${H.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),$.querySelectorAll("video[autoplay], audio[autoplay]").forEach((H)=>{if(!H.hasAttribute("muted"))Z.push({type:"autoplay-audio",element:`<${H.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),$.querySelectorAll("[tabindex]").forEach((H)=>{if(Number.parseInt(H.getAttribute("tabindex")||"0")>0)Z.push({type:"positive-tabindex",element:`<${H.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),$.querySelectorAll('[role="button"]').forEach((H)=>{if(!H.hasAttribute("tabindex"))Z.push({type:"button-not-focusable",element:`<${H.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),J.includes("<body")&&!$.querySelector('main, [role="main"]'))Z.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});$.querySelectorAll("iframe").forEach((H)=>{if(!H.hasAttribute("title")&&!H.hasAttribute("aria-label"))Z.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch($){console.error(`Error checking accessibility in ${Q}:`,$)}return Z}async function qQ(q,Q={}){let J={},{recursive:Z=!0,ignorePaths:$=[]}=Q,Y=Array.isArray(q)?q:[q],G=await bq(Y,{recursive:Z,ignorePaths:$}),X=[];for(let H of G)try{let W=await Bun.file(H).text();if(H.endsWith("good-a11y.stx"))continue;let B=await eJ(W,H);if(X.push(H),B.length>0)J[H]=B}catch(W){console.error(`Error scanning ${H}:`,W)}return{results:J,scannedFiles:X}}async function ZZ(q,Q={}){return(await qQ(q,Q)).results}var JQ={fixMissingAlt:!0,fixMissingLabels:!0,fixMissingFormLabels:!0,fixTableHeaders:!0,fixMissingLang:!0,fixMissingDir:!0,fixPositiveTabindex:!0,fixButtonFocusable:!0,defaultLang:"en"};function QQ(q,Q={}){let J={...JQ,...Q},Z=[],{protectedSource:$,restore:Y}=Cq(q),G=$;if(J.fixMissingAlt)G=G.replace(/<img([^>]*?)(?<!\balt\s*=\s*["'][^"']*["'])(\s*\/?>)/gi,(X,H,W)=>{if(/\balt\s*=/i.test(H))return X;let B=X,V=`<img${H} alt=""${W}`;return Z.push({type:"missing-alt",description:"Added empty alt attribute to image",before:B,after:V}),V});if(J.fixMissingLabels)G=G.replace(/<button([^>]*)>\s*<\/button>/gi,(X,H)=>{if(/\baria-label\s*=/i.test(H)||/\btitle\s*=/i.test(H))return X;let W=X,B=`<button${H} aria-label="Button"></button>`;return Z.push({type:"missing-accessible-name",description:"Added aria-label to empty button",before:W,after:B}),B}),G=G.replace(/<a([^>]*)>\s*(<(?:i|span|svg)[^>]*(?:class="[^"]*icon[^"]*")?[^>]*>.*?<\/(?:i|span|svg)>)?\s*<\/a>/gi,(X,H,W)=>{if(/\baria-label\s*=/i.test(H)||/\btitle\s*=/i.test(H))return X;if(!W&&X.replace(/<a[^>]*>|<\/a>/gi,"").trim())return X;let B=X,V=`<a${H} aria-label="Link">${W||""}</a>`;return Z.push({type:"missing-accessible-name",description:"Added aria-label to link without text",before:B,after:V}),V});if(J.fixMissingFormLabels)G=G.replace(/<(input|select|textarea)([^>]*)>/gi,(X,H,W)=>{if(/\baria-label\s*=/i.test(W)||/\baria-labelledby\s*=/i.test(W))return X;if(/\btype\s*=\s*["']hidden["']/i.test(W))return X;let B=W.match(/\bname\s*=\s*["']([^"']+)["']/i),V=W.match(/\bid\s*=\s*["']([^"']+)["']/i),w=B?.[1]||V?.[1]||H,M=X,j=`<${H}${W} aria-label="${w}">`;return Z.push({type:"input-missing-label",description:`Added aria-label to ${H} element`,before:M,after:j}),j});if(J.fixMissingLang)G=G.replace(/<html([^>]*)>/gi,(X,H)=>{if(/\blang\s*=/i.test(H))return X;let W=X,B=`<html${H} lang="${J.defaultLang}">`;return Z.push({type:"missing-lang",description:`Added lang="${J.defaultLang}" to html element`,before:W,after:B}),B});if(J.fixMissingDir)G=G.replace(/<html([^>]*)>/gi,(X,H)=>{let W=S(H,"lang");if(!Jq(W,S(H,"dir")))return X;let B=/\bdir\s*=/i.test(H)?`<html${H.replace(/\bdir\s*=\s*(["'])[^"']*\1/i,'dir="rtl"')}>`:`<html${H} dir="rtl">`;return Z.push({type:"missing-dir",description:`Added dir="rtl" to html element (lang="${W}" is right-to-left)`,before:X,after:B}),B});if(J.fixPositiveTabindex)G=G.replace(/\btabindex\s*=\s*["']([1-9]\d*)["']/gi,(X,H)=>{let W=X,B='tabindex="0"';return Z.push({type:"positive-tabindex",description:`Changed tabindex="${H}" to tabindex="0"`,before:W,after:'tabindex="0"'}),'tabindex="0"'});if(J.fixButtonFocusable)G=G.replace(/<([a-z]+)(\s[^>]*role\s*=\s*["']button["'][^>]*)>/gi,(X,H,W)=>{if(/\btabindex\s*=/i.test(W))return X;if(H.toLowerCase()==="button")return X;let B=X,V=`<${H}${W} tabindex="0">`;return Z.push({type:"button-not-focusable",description:'Added tabindex="0" to element with role="button"',before:B,after:V}),V});if(J.fixTableHeaders)G=G.replace(/<th([^>]*)>/gi,(X,H)=>{if(/\bscope\s*=/i.test(H))return X;let W=X,B=`<th${H} scope="col">`;return Z.push({type:"table-missing-scope",description:'Added scope="col" to table header',before:W,after:B}),B});return{original:q,fixed:Y(G),fixCount:Z.length,fixes:Z}}async function ZQ(q,Q={},J=!1){let Z=await Bun.file(q).text(),$=QQ(Z,Q);if(J&&$.fixCount>0)await Bun.write(q,$.fixed);return $}async function $Z(q,Q={},J={}){let Z={},{recursive:$=!0,ignorePaths:Y=[],writeBack:G=!1,extensions:X=[".stx",".html",".htm"]}=J,H=X.length===1?`*${X[0]}`:`*{${X.join(",")}}`,W=Sq.join(q,$?`**/${H}`:H),B=new Bun.Glob(W);for await(let V of B.scan()){if(Y.some((M)=>V.includes(Sq.normalize(M))))continue;try{let M=await ZQ(V,Q,G);if(M.fixCount>0)Z[V]=M}catch(M){console.error(`Error fixing ${V}:`,M)}}return Z}var $Q={name:"a11y",handler:(q,Q,J,Z)=>{if(!Q.length)return q;let $=Q[0].replace(/['"]/g,""),Y=Q.length>1?Q[1].replace(/['"]/g,""):"",X={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[$]||"Make this element accessible";return`<!-- a11y-hint: ${Y||X} -->${q}`},hasEndTag:!1},XQ={name:"screenReader",handler:(q)=>{return`<span class="sr-only">${q}</span>`},hasEndTag:!0};function XZ(){return[$Q,XQ]}
|
|
60
|
-
export{hq as
|
|
60
|
+
export{hq as Ir,uq as Jr,dq as Kr,pq as Lr,Xq as Mr,mq as Nr,U as Or,u as Pr,cq as Qr,L as Rr,GQ as Sr,iq as Tr,E as Ur,sq as Vr,C as Wr,N as Xr,Hq as Yr,Gq as Zr,Wq as _r,Bq as $r,Vq as as,d as bs,y as cs,eq as ds,qJ as es,JJ as fs,QJ as gs,ZJ as hs,p as is,$J as js,XJ as ks,c as ls,v as ms,HJ as ns,GJ as os,WJ as ps,Mq as qs,SQ as rs,KJ as ss,_J as ts,bQ as us,s as vs,EQ as ws,AJ as xs,NJ as ys,CQ as zs,t as As,fQ as Bs,hQ as Cs,uQ as Ds,dQ as Es,pQ as Fs,LJ as Gs,mQ as Hs,h as Is,PJ as Js,cQ as Ks,lQ as Ls,iQ as Ms,sQ as Ns,vJ as Os,gJ as Ps,rJ as Qs,a as Rs,qq as Ss,nQ as Ts,rQ as Us,oQ as Vs,Eq as Ws,S as Xs,JZ as Ys,QZ as Zs,aJ as _s,tJ as $s,eJ as at,qQ as bt,ZZ as ct,QQ as dt,ZQ as et,$Z as ft,$Q as gt,XQ as ht,XZ as it};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{qw as O}from"./chunk-nn4xr784.js";import{mkdir as b,writeFile as T}from"fs/promises";import{join as q}from"path";var E="https://api.iconify.design";async function k(){let G=await fetch(`${E}/collections`);if(!G.ok)throw Error(`Failed to fetch collections: ${G.statusText}`);return await G.json()}async function P(G,z){try{let Z=O.resolve("@iconify/json"),X=`${`${Z.substring(0,Z.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${G}.json`,Q=Bun.file(X);if(await Q.exists()){let $=await Q.json();if(z&&z.length>0){let B={};for(let S of z)if($.icons[S])B[S]=$.icons[S];return{...$,icons:B}}return $}}catch{}let M=z&&z.length>0?`${E}/${G}.json?icons=${z.join(",")}`:`${E}/${G}.json`,U=await fetch(M);if(!U.ok)throw Error(`Failed to fetch icons for ${G}: ${U.statusText}`);return await U.json()}function j(G,z=24,M=24){return{body:G.body,width:G.width||z,height:G.height||M,viewBox:`0 0 ${G.width||z} ${G.height||M}`}}function F(G,z){let M=V(G);return`import type { IconData } from '@stacksjs/iconify-core'
|
|
3
3
|
|
|
4
4
|
export const ${M}: IconData = ${JSON.stringify(z,null,2)}
|
|
5
5
|
|