@stacksjs/stx 0.2.679 → 0.2.682
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-01ks1244.js +2 -0
- package/dist/{chunk-qr7a378v.js → chunk-03xn8244.js} +3 -3
- package/dist/{chunk-ccmc5rqj.js → chunk-0527ytat.js} +2 -2
- package/dist/chunk-0gmwqhs0.js +2 -0
- package/dist/chunk-18jfkg1q.js +2 -0
- package/dist/chunk-1gw26g89.js +31 -0
- package/dist/chunk-1t6dg4s8.js +2 -0
- package/dist/{chunk-n8wvqnfc.js → chunk-1y50gat7.js} +2 -2
- package/dist/chunk-23efje42.js +2 -0
- package/dist/chunk-247fg189.js +2 -0
- package/dist/{chunk-xnx06qqt.js → chunk-2a1eeywj.js} +2 -2
- package/dist/{chunk-hh58k0nh.js → chunk-2ajbhefk.js} +2 -2
- package/dist/{chunk-p9az13b2.js → chunk-2ar5g9pa.js} +2 -2
- package/dist/{chunk-7j7h1eg3.js → chunk-2hh6g3y1.js} +1 -1
- package/dist/chunk-2zepd4ps.js +2 -0
- package/dist/chunk-34ps2w1z.js +2 -0
- package/dist/chunk-3tkag58v.js +2 -0
- package/dist/{chunk-ga5kjf9b.js → chunk-3zbege39.js} +6 -6
- package/dist/{chunk-2933mvwr.js → chunk-42qtadka.js} +10 -10
- package/dist/chunk-47fwr1z7.js +2 -0
- package/dist/{chunk-fzc98qgn.js → chunk-49c5v5fh.js} +6 -6
- package/dist/chunk-4g9wrxkm.js +2 -0
- package/dist/chunk-4m5g3f2b.js +2 -0
- package/dist/{chunk-tx4wfk5v.js → chunk-4z4sqc8q.js} +5 -5
- package/dist/{chunk-6ycyaf5g.js → chunk-58dv14c3.js} +2 -2
- package/dist/{chunk-87em5xdg.js → chunk-5nfb4gxk.js} +82 -82
- package/dist/chunk-5nrqc6v4.js +20 -0
- package/dist/chunk-5rdfcpfe.js +2 -0
- package/dist/{chunk-xyk2zxkk.js → chunk-65jb75vz.js} +2 -2
- package/dist/{chunk-5z8mq37c.js → chunk-6e60jp4a.js} +4 -4
- package/dist/chunk-7jxj6cv1.js +2 -0
- package/dist/{chunk-dnjbzwwn.js → chunk-7yree929.js} +1 -1
- package/dist/chunk-8bwa63m3.js +2 -0
- package/dist/chunk-8d0rqqyx.js +2 -0
- package/dist/chunk-8j0zcyd7.js +2 -0
- package/dist/chunk-8jxqg7kb.js +2 -0
- package/dist/chunk-8nk56cs2.js +2 -0
- package/dist/chunk-8y7tpjfs.js +2 -0
- package/dist/{chunk-q3gactm1.js → chunk-912r15hr.js} +4 -4
- package/dist/chunk-96hkch4q.js +2 -0
- package/dist/{chunk-4fhbh04h.js → chunk-974prn41.js} +4 -4
- package/dist/{chunk-078qg8r5.js → chunk-9bgb9n12.js} +2 -2
- package/dist/chunk-9qx6ansy.js +2 -0
- package/dist/{chunk-tst8p27s.js → chunk-9tg4995v.js} +3 -3
- package/dist/{chunk-sr3hmrah.js → chunk-9wa3t87n.js} +1 -1
- package/dist/{chunk-k06n5bjp.js → chunk-ae12wgc5.js} +3 -3
- package/dist/chunk-b375wt1n.js +2 -0
- package/dist/chunk-b5vqp3b2.js +2 -0
- package/dist/{chunk-vg1pg6yt.js → chunk-b7z6rqfg.js} +1 -1
- package/dist/{chunk-wt7rp7wc.js → chunk-bmqker64.js} +6 -6
- package/dist/{chunk-53e9ta3g.js → chunk-bmv6spcd.js} +4 -4
- package/dist/chunk-bpf3xxng.js +3 -0
- package/dist/{chunk-chy90834.js → chunk-brcj3953.js} +5 -5
- package/dist/chunk-brftzqzj.js +3 -0
- package/dist/chunk-bv43s0gx.js +2 -0
- package/dist/chunk-c9jnkbdb.js +2 -0
- package/dist/{chunk-x7wr720m.js → chunk-d1ssvg9k.js} +5 -5
- package/dist/{chunk-5z0q3qv3.js → chunk-d7js6v1m.js} +5 -5
- package/dist/{chunk-vd5w1jaz.js → chunk-drabexxq.js} +3 -3
- package/dist/{chunk-k72jqz6a.js → chunk-e26pxzjj.js} +2 -2
- package/dist/{chunk-2pvcp0y6.js → chunk-e97xj3rf.js} +6 -6
- package/dist/chunk-ev1tnd36.js +2 -0
- package/dist/{chunk-j388n7v2.js → chunk-f1hxrs7b.js} +17 -17
- package/dist/{chunk-wr1gm35v.js → chunk-f4z9w4kc.js} +1 -1
- package/dist/chunk-f80aqbwm.js +2 -0
- package/dist/chunk-fbbp8j97.js +2 -0
- package/dist/{chunk-26ps9djm.js → chunk-fqts9wvd.js} +5 -5
- package/dist/chunk-fy1waxy0.js +2 -0
- package/dist/chunk-g2v6c7kf.js +2 -0
- package/dist/chunk-g5ep75vp.js +2 -0
- package/dist/{chunk-wejabf6y.js → chunk-g83qeh2x.js} +5 -5
- package/dist/chunk-g9a56wwk.js +2 -0
- package/dist/chunk-gkmh0xys.js +2 -0
- package/dist/{chunk-78yjmbbs.js → chunk-gtktv6nn.js} +2 -2
- package/dist/{chunk-f26n6y9p.js → chunk-gymmbbzc.js} +4 -4
- package/dist/{chunk-48ma0qcr.js → chunk-h3bdqqzy.js} +2 -2
- package/dist/chunk-h5r4c9v5.js +2 -0
- package/dist/{chunk-3xyv2fec.js → chunk-hg7ys8rn.js} +3 -3
- package/dist/{chunk-kxj8e1gd.js → chunk-hm69jxmh.js} +6 -6
- package/dist/{chunk-y4ncmvf2.js → chunk-hwaqwrc2.js} +3 -3
- package/dist/chunk-jecmxby7.js +2 -0
- package/dist/{chunk-a2zb5fgg.js → chunk-jkywbfb0.js} +2 -2
- package/dist/{chunk-haz2ezyk.js → chunk-k3e0hcv7.js} +2 -2
- package/dist/{chunk-drmgwjnb.js → chunk-ka3xmbrd.js} +76 -76
- package/dist/chunk-kerxevf9.js +2 -0
- package/dist/chunk-km37yrk4.js +43 -0
- package/dist/chunk-mdmwgthz.js +2 -0
- package/dist/chunk-myc60z74.js +2 -0
- package/dist/chunk-mzkyw4yx.js +2 -0
- package/dist/{chunk-nb3kkvet.js → chunk-n8jq9yjy.js} +11 -11
- package/dist/{chunk-y34tyrpb.js → chunk-nbjyed3q.js} +7 -7
- package/dist/{chunk-d40zjm6k.js → chunk-np3zdjhr.js} +6 -6
- package/dist/{chunk-wav0xbnb.js → chunk-pfn70zdr.js} +2 -2
- package/dist/{chunk-tbb4en1q.js → chunk-pmma4f1x.js} +4 -4
- package/dist/chunk-pqg3ghvh.js +2 -0
- package/dist/chunk-pvn0fc7j.js +2 -0
- package/dist/{chunk-q4rejyd2.js → chunk-pzxy40a2.js} +2 -2
- package/dist/chunk-q7mpearc.js +2 -0
- package/dist/{chunk-7z7zp8xq.js → chunk-qb806pks.js} +5 -5
- package/dist/{chunk-wscnjtss.js → chunk-qh7fvr2z.js} +2 -2
- package/dist/chunk-r8hszntk.js +2 -0
- package/dist/{chunk-wc5tt6da.js → chunk-remsyfdx.js} +2 -2
- package/dist/chunk-rk8kmshp.js +2 -0
- package/dist/chunk-rs67af2x.js +1592 -0
- package/dist/{chunk-97h9ga3b.js → chunk-rspe6qa5.js} +3 -3
- package/dist/{chunk-78x52gz3.js → chunk-ry501z40.js} +5 -5
- package/dist/chunk-s0wa7zjr.js +2 -0
- package/dist/{chunk-qvefcnyb.js → chunk-se4n8tth.js} +2 -2
- package/dist/chunk-sncp7jhv.js +2 -0
- package/dist/{chunk-jv021x8e.js → chunk-sq4w1e1g.js} +2 -2
- package/dist/chunk-sqvdrk81.js +2 -0
- package/dist/{chunk-9wdd7eq6.js → chunk-t6m5d64b.js} +2 -2
- package/dist/chunk-tdwqwxhf.js +25 -0
- package/dist/{chunk-dera8fmc.js → chunk-tenbwcts.js} +2 -2
- package/dist/chunk-th45zgbz.js +54 -0
- package/dist/{chunk-cxgremn0.js → chunk-tpdvgb3d.js} +1 -1
- package/dist/chunk-tq2m6m3j.js +2 -0
- package/dist/{chunk-aw3jfdca.js → chunk-veh25cv5.js} +1 -1
- package/dist/chunk-vqv5w6gs.js +2 -0
- package/dist/chunk-vt5e25xg.js +2 -0
- package/dist/{chunk-028e9fty.js → chunk-vxnf3xab.js} +2 -2
- package/dist/{chunk-mabja59q.js → chunk-vxrhvrr9.js} +2 -2
- package/dist/{chunk-tmqrbs98.js → chunk-w1wzydvp.js} +8 -5
- package/dist/{chunk-qwdcts9w.js → chunk-w28wc7mv.js} +13 -13
- package/dist/{chunk-yxw8gbnh.js → chunk-wfg5379k.js} +4 -4
- package/dist/chunk-wvz7rp5p.js +2 -0
- package/dist/{chunk-k4x8v39k.js → chunk-xfdfk4g4.js} +2 -2
- package/dist/chunk-xjx1xbey.js +2 -0
- package/dist/{chunk-mn47s2ef.js → chunk-xr9a0hcr.js} +5 -5
- package/dist/{chunk-1b9thkg5.js → chunk-xvnrm5c3.js} +2 -2
- package/dist/{chunk-mf19qxgv.js → chunk-xvs84gas.js} +2 -2
- package/dist/{chunk-8aq07a1j.js → chunk-y55pcfaj.js} +3 -3
- package/dist/{chunk-2hmyj5wh.js → chunk-yhfm939b.js} +2 -2
- package/dist/chunk-ykjzhfyf.js +2 -0
- package/dist/chunk-ypwetty7.js +21 -0
- package/dist/chunk-z4khbpx0.js +2 -0
- package/dist/{chunk-9rs12v0r.js → chunk-z5av310q.js} +9 -9
- package/dist/chunk-zr16mga0.js +2 -0
- package/dist/{chunk-dxh45gve.js → chunk-zt5hp5w5.js} +1 -1
- package/dist/chunk-zwawqx5q.js +2 -0
- package/dist/cli.js +20 -20
- package/dist/client/signals-manifest-hydration-runtime.js +4 -1
- package/dist/component-client-factories.js +14 -3
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/serve-app.js +10 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +6 -6
- package/dist/utils.js +13 -1
- package/package.json +5 -5
- package/dist/chunk-0fjwqs9h.js +0 -2
- package/dist/chunk-0gk78x3r.js +0 -2
- package/dist/chunk-0v35wpm7.js +0 -2
- package/dist/chunk-1dkcakve.js +0 -25
- package/dist/chunk-1gg5vxe8.js +0 -2
- package/dist/chunk-1j0sarne.js +0 -21
- package/dist/chunk-248a88mc.js +0 -2
- package/dist/chunk-2nqtmp8c.js +0 -2
- package/dist/chunk-2yzwrvq1.js +0 -2
- package/dist/chunk-3bfegbpw.js +0 -2
- package/dist/chunk-3wsm9g9c.js +0 -2
- package/dist/chunk-3xx9d934.js +0 -2
- package/dist/chunk-52x079ax.js +0 -2
- package/dist/chunk-54zkkxmb.js +0 -2
- package/dist/chunk-5fmxn52y.js +0 -2
- package/dist/chunk-61ww9d2z.js +0 -2
- package/dist/chunk-75zc8w68.js +0 -2
- package/dist/chunk-7b3phzx4.js +0 -2
- package/dist/chunk-8p92r2sc.js +0 -2
- package/dist/chunk-8xr8y9sq.js +0 -2
- package/dist/chunk-909ymsjz.js +0 -2
- package/dist/chunk-ac75vk0w.js +0 -2
- package/dist/chunk-arh1qgmp.js +0 -2
- package/dist/chunk-b0th3d8q.js +0 -888
- package/dist/chunk-bh19ezq0.js +0 -43
- package/dist/chunk-bm42rsaa.js +0 -2
- package/dist/chunk-cfm6a679.js +0 -2
- package/dist/chunk-cwmazy7y.js +0 -2
- package/dist/chunk-e492je6q.js +0 -2
- package/dist/chunk-ft1ht0b3.js +0 -2
- package/dist/chunk-ft3f9nj0.js +0 -2
- package/dist/chunk-ggwvnpwj.js +0 -2
- package/dist/chunk-gx6wxmbv.js +0 -2
- package/dist/chunk-hamk3dky.js +0 -2
- package/dist/chunk-hqj28381.js +0 -3
- package/dist/chunk-k093pr2w.js +0 -2
- package/dist/chunk-kcp392wy.js +0 -2
- package/dist/chunk-kejrhccx.js +0 -2
- package/dist/chunk-kmj127rm.js +0 -2
- package/dist/chunk-kqbpkg8n.js +0 -2
- package/dist/chunk-m0f3strn.js +0 -2
- package/dist/chunk-mjsebtg6.js +0 -2
- package/dist/chunk-n8f0zw1y.js +0 -31
- package/dist/chunk-nadgej53.js +0 -2
- package/dist/chunk-nh3kd03f.js +0 -2
- package/dist/chunk-nw2zh40z.js +0 -2
- package/dist/chunk-p01b07se.js +0 -54
- package/dist/chunk-p99an8rj.js +0 -2
- package/dist/chunk-pgvwysxq.js +0 -2
- package/dist/chunk-pz3mg7hr.js +0 -2
- package/dist/chunk-qyf3jcy1.js +0 -2
- package/dist/chunk-rc79yyqx.js +0 -2
- package/dist/chunk-s8qe247r.js +0 -2
- package/dist/chunk-sswy3tfc.js +0 -2
- package/dist/chunk-swxznm5v.js +0 -2
- package/dist/chunk-t3gmm1ja.js +0 -2
- package/dist/chunk-tsrf4zzy.js +0 -2
- package/dist/chunk-tz09earb.js +0 -2
- package/dist/chunk-vct8a1qf.js +0 -20
- package/dist/chunk-x4q4bx3q.js +0 -3
- package/dist/chunk-xna6b7km.js +0 -2
- package/dist/chunk-xw4rm5zj.js +0 -2
- package/dist/chunk-yar7fwrb.js +0 -2
- package/dist/chunk-yt33wzqk.js +0 -2
- package/dist/chunk-zcbp27x1.js +0 -2
- package/dist/chunk-zq7xbc1k.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Ue(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function
|
|
3
|
-
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function
|
|
4
|
-
export{Ue,
|
|
2
|
+
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Ue(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function ne(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
|
|
3
|
+
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Qi(e,n){let r=Ue(e);try{return await n(r)}finally{ne(r)}}
|
|
4
|
+
export{Ue,ne,Qi};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ze}from"./chunk-
|
|
2
|
+
import{Ze}from"./chunk-gymmbbzc.js";import{ft,Dn}from"./chunk-w1wzydvp.js";import{Oe,un,Qa,ec}from"./chunk-5nfb4gxk.js";import{mr,hr,yr,vr,Se}from"./chunk-w28wc7mv.js";import{A}from"./chunk-t6m5d64b.js";import{Vo}from"./chunk-remsyfdx.js";import{h}from"./chunk-bmqker64.js";import{o}from"./chunk-rs67af2x.js";import{N,i}from"./chunk-42qtadka.js";import{_a}from"./chunk-912r15hr.js";import{Ve,_e,Ii,Oi,Cn}from"./chunk-1gw26g89.js";import{en,Zs}from"./chunk-qb806pks.js";import{En}from"./chunk-pfn70zdr.js";import{Gt,Fn,zn}from"./chunk-bpf3xxng.js";import{q}from"./chunk-e97xj3rf.js";import m from"fs";import c from"path";import{createHash as Q}from"crypto";function W(n){return Q("sha256").update(n).digest("hex").slice(0,8)}function J(n=!1){let l=n?Dn():ft(),a=W(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function U(){let n=Ze(),l=W(n);return{content:n,filename:`router.${l}.js`,hash:l}}import V from"path";import{createHash as ee}from"crypto";function te(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(n,l,a={}){let r=V.resolve(n),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);Qa();let _={};try{_=await i(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,f;while((f=d.exec(e))!==null){let R=f[1];if(/\bserver\b/.test(R))y.push(f[2])}let u=new Set(y.flatMap((R)=>Oe(R))),{context:D}=te({__filename:r,__dirname:V.dirname(r),__stx_serverDeclared:u}),w=new Set,j={...N,..._,...a,buildMode:"compile",strict:!1},b=await o(e,D,r,j,w),C=Ve(b),P=ec();return{route:l,sourceFile:n,html:b,fragment:C,placeholders:P,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:un(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(n,l){let a=0,r=0;if(!m.existsSync(n))return{copied:a,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(re.has(d.name))continue;let f=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(f,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(f,u),a++,r+=m.statSync(u).size}}}return e(n,l),{copied:a,bytes:r}}async function zu(n={}){let l=Date.now(),a=c.resolve(n.root||process.cwd()),r=c.resolve(a,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await i(a),S=c.resolve(a,n.componentsDir??e.componentsDir??"components"),_=c.resolve(a,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",f=Se(e.app?.head,{known:vr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",w=n.routeRules??e.routeRules??{},j=En(w),b=n.serverApi??e.serverApi,C=typeof b==="object"?b:{};if(b)en(a,C);if(e.runtimeConfig)A(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let P=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of P)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=q(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],B=R.filter((s)=>!Y.some((g)=>s.pattern.startsWith(`/${g}/`)||s.pattern===`/${g}`));console.log(`[stx build] Found ${B.length} page routes (${R.length-B.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=J(n.debug),x=U();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let M=[],k=[];for(let s of B){let g=j(s.pattern),O=g.rendering==="prerender";if(O&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(s.filePath,s.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:n.debug});if(M.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=yr(t.html,f,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=mr(t.html,u);if(f.htmlAttrs)t.html=hr(t.html,f.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let I=p[1];t.html=t.html.replace(" "+I,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${I}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await h(t.html),O){let p=await Cn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=_e(t.html,D);let L=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),z=c.join("server","pages",`${L}.compiled.json`),G=c.join("server","fragments",`${L}.html`);await Bun.write(c.join(r,z),JSON.stringify(t,null,2)),await Bun.write(c.join(r,G),t.fragment),k.push({pattern:s.pattern,compiledPath:z,fragmentPath:G,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(g).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let E=c.resolve(a,d);if(m.existsSync(E)){let{copied:s,bytes:g}=Z(E,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${d}/`)}let H=zn(a);if(H){let{copied:s,bytes:g}=Z(H,c.join(r,"public",Fn));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(g/1024).toFixed(1)}KB) from ${Gt}/`)}let F={runtime:v.filename,router:x.filename},T=Ii(k,F,r);if(T.routeRules=w,T.routerContainer=D,b)T.apiRoutes=await Zs(a,r,C);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Vo(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(_a(e._layerGraph),null,2));Oi(T,r);let K=Date.now()-l;return console.log(`
|
|
3
3
|
[stx build] Done in ${K}ms \u2014 ${M.length} pages compiled`),{pageCount:M.length,assets:F,outputDir:r,duration:K}}
|
|
4
|
-
export{
|
|
4
|
+
export{zu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Iu}from"./chunk-4z4sqc8q.js";import"./chunk-rs67af2x.js";import"./chunk-bmqker64.js";import"./chunk-9bgb9n12.js";import"./chunk-tdwqwxhf.js";import"./chunk-th45zgbz.js";import"./chunk-brcj3953.js";import"./chunk-2a1eeywj.js";import"./chunk-ypwetty7.js";import"./chunk-e97xj3rf.js";import"./chunk-zt5hp5w5.js";import"./chunk-yhfm939b.js";import"./chunk-42qtadka.js";import"./chunk-hg7ys8rn.js";import"./chunk-tenbwcts.js";import"./chunk-912r15hr.js";import"./chunk-nbjyed3q.js";import"./chunk-gymmbbzc.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{Iu as startInteractive};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pl,vp,wp,xp,Sp,Il,Ol,kp,_p,ho,Cp,Zn,Qn,Xr}from"./chunk-yhfm939b.js";import{Qe}from"./chunk-yn9kvsk1.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{Sp as __setSignalsGeneratorsForTest,Qe as cacheEngineFingerprint,Qn as cacheTemplate,Zn as checkCache,Cp as clearDevCaches,Ol as getCachedRouterScript,Il as getCachedSignalsRuntime,kp as getServeClientAsset,ho as getServeModuleBundle,Xr as hashFilePath,wp as invalidateFileCache,xp as invalidateFileCacheByDir,vp as readFileCached,_p as registerServeModuleBundle,Pl as templateCache};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{vn}from"./chunk-w28wc7mv.js";import{F,z,At,Pt,dr,g,tc,zo,V,_}from"./chunk-5nfb4gxk.js";import{Kt}from"./chunk-h3bdqqzy.js";import{W}from"./chunk-2ajbhefk.js";var H=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function B(e){let n=[],t=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=t.exec(e))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(e,n){return n.some((t)=>e>=t.start&&e<t.end)}function q(e){let n=(e||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let t={},r=n,s=r.match(/^[a-z][\w-]*/i);if(s)t.tag=s[0].toLowerCase(),r=r.slice(s[0].length);while(r.length>0){let o=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(t.attr=o[1],o[3]!==void 0&&o[3]!=="")t.attrValue=o[3];r=r.slice(o[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){t.id=a[1],r=r.slice(a[0].length);continue}let i=r.match(/^\.([\w-]+)/);if(i){t.className=i[1],r=r.slice(i[0].length);continue}return null}if(!t.tag&&!t.attr&&!t.id&&!t.className)return null;return t}function U(e,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(e))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(e))return!1}if(n.className){let t=e.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!t)return!1;if(!t[2].split(/\s+/).includes(n.className))return!1}return!0}function T(e,n="main"){let t=q(n);if(!t)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,s=B(e),o;while((o=r.exec(e))!==null){if(P(o.index,s))continue;let a=o[1].toLowerCase(),i=o[2]||"";if(i.trimEnd().endsWith("/")||H.has(a))continue;if(t.tag&&t.tag!==a)continue;if(!U(i,t))continue;let c=o[0],u=o.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,m;while((m=l.exec(e))!==null){if(P(m.index,s))continue;let x=m[1]==="/";if(!x&&(m[2]||"").trimEnd().endsWith("/"))continue;if(f+=x?-1:1,f===0)return{openTag:c,openIndex:o.index,start:u,end:m.index,tagName:a}}return null}return null}var ut="private, no-store";function Ri(e){return e.replace(/&#(\d+);/g,(n,t)=>M(Number(t),n)).replace(/&#x([0-9a-f]+);/gi,(n,t)=>M(Number.parseInt(t,16),n)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function M(e,n){if(!Number.isInteger(e)||e<0||e>1114111)return n;try{return String.fromCodePoint(e)}catch{return n}}function ke(e){return e.headers.get("X-STX-Router")==="true"}function G(e,n){if(!e)return n;return e.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?e:`${e}, ${n}`}function O(e){return{Vary:G(e,"X-STX-Router")}}import E from"path";var X="stx-page-head:",J=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,C={dev:null,prod:null};function K(){let e=W()?"dev":"prod",n=C[e];if(n!==null)return n;try{let t=import.meta.require("./chunk-pvn0fc7j.js"),r=e==="dev"&&typeof t.getRouterScriptDev==="function"?t.getRouterScriptDev:t.getRouterScript;C[e]=`<script>${r()}</script>`}catch{C[e]=""}return C[e]}async function Ai(e,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(e,n);if(await Bun.file(r).exists())return r;return null}let t=E.join(e,"app.stx");if(await Bun.file(t).exists())return t;return null}async function Hs(e,n){try{let t=await Bun.file(e).text(),r=t,s=t.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(s)r=s[1].trim();let o=Kt(t),a=[...o.client.map((d)=>d.fullTag),...o.signals.map((d)=>d.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(t))!==null)i.push(u[0]);let l=r;for(let d of o.server)l=l.replace(d.fullTag,"");for(let d of o.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let f="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,f).replace(/<slot\s*>\s*<\/slot>/gi,f),!l.includes(f))return console.warn(`[stx] Shell ${e} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:x,defaultConfig:y,loadStxConfig:R}=await import("./chunk-fbbp8j97.js"),S=await R(),p={__filename:e,__dirname:E.dirname(e)};for(let d of a){let w=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(w&&!d.includes("client")&&!d.includes('type="module"'))await x(w[1],p,e)}let b=await m(l,p,e,{...y,...S,...n},new Set),h=b.indexOf(f);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:b.substring(0,h),afterSlot:b.substring(h+f.length),filePath:e,shellScripts:a,shellStyles:i}}catch(t){return console.error(`[stx] Error processing shell ${e}:`,t),null}}function Pr(e,n,t){let r,s="",o=n.match(J);if(o){n=n.replace(o[0],"");try{let l=Buffer.from(o[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();s=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=t||r||"stx App",i=K(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>${a}</title>
|
|
8
|
+
${s?` ${s}
|
|
9
|
+
`:""} ${e.shellStyles.join(`
|
|
10
|
+
`)}
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
${e.beforeSlot}
|
|
14
|
+
<div data-stx-content>${n}</div>
|
|
15
|
+
${e.afterSlot}
|
|
16
|
+
${e.shellScripts.filter((l)=>!l.includes("server")).join(`
|
|
17
|
+
`)}
|
|
18
|
+
${c}
|
|
19
|
+
${i}
|
|
20
|
+
</body>
|
|
21
|
+
</html>`}function Ve(e,n={}){let t=e.trim();if(!vn(t))return e;let r=[],s=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let c=s[1],u=/<style\b[^>]*>[\s\S]*?<\/style>/gi,l;while((l=u.exec(c))!==null)r.push(l[0]);let f=c.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(f)r.push(f[0]);let m=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(m)r.push(m[0])}if(n.preserveHead&&s){let c=[],u=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=u.exec(s[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${X}${Buffer.from(c.join(`
|
|
22
|
+
`),"utf8").toString("base64")}-->`)}let o=t.match(/<body\b[^>]*>/i),a=t.lastIndexOf("</body>");if(o&&a!==-1){let c=o.index+o[0].length,u=t.slice(c,a).trim();if(r.length>0)return r.join(`
|
|
23
|
+
`)+`
|
|
24
|
+
`+u;return u}let i=t;if(i=i.replace(/<!DOCTYPE\b[^>]*>/i,""),i=i.replace(/<html\b[^>]*>/i,""),i=i.replace(/<\/html\s*>/i,""),s)i=i.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
|
|
25
|
+
`));return i=i.replace(/<body\b[^>]*>/i,""),i=i.replace(/<\/body\s*>/i,""),i.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function N(e,n,t,r){if(!j.test(n))return!1;let s=n.slice(0,n.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(s)?.[1];if(!o)return!0;let a=`data-stx-scope="${o}"`;for(let i=e.indexOf(a);i!==-1;i=e.indexOf(a,i+a.length))if(i>=t&&i<r)return!1;return!0}function Pi(e){return ke(e)}function Y(e,n){let t=[],r=new Set;for(let s of z(e,F)){if(s.start>=n.start&&s.start<n.end)continue;let o=s.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",a=new Map;for(let u of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))a.set(u[1].toLowerCase(),u[2]??u[3]??u[4]??"");let i=a.get("src")?.trim(),c=a.get("type")?.trim().toLowerCase();if(!i||a.has("server")||c&&!["module","text/javascript","application/javascript"].includes(c))continue;if(a.has("data-stx-runtime")||a.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(i))continue;if(N(e,s.token,n.start,n.end)||r.has(s.token))continue;r.add(s.token),t.push(s.token)}return t}function _e(e,n="main"){let t=e.trim(),r=[],s=[],o=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(o){let p=o[1],b=/<style\b[^>]*>[\s\S]*?<\/style>/gi,h;while((h=b.exec(p))!==null)r.push(h[0]);let d=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((h=d.exec(p))!==null){if(j.test(h[0])||h[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(h[0]))continue;s.push(h[0])}}let a=T(t,n);if(!a)return Ve(e);let i=Y(t,a),c=new Set(i),{tagName:u,start:l,end:f}=a,m=t.slice(l,f).trim(),x=[],y=t.match(/<body\b[^>]*>/i),R=t.lastIndexOf("</body>");if(y&&y.index!==void 0&&R!==-1){let b=[[y.index+y[0].length,a.openIndex],[f+`</${u}>`.length,R]],h=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[d,w]of b){if(d>=w)continue;let L=t.slice(d,w),A;h.lastIndex=0;while((A=h.exec(L))!==null){if(N(t,A[0],l,f))continue;x.push(A[0])}}}let S=[];if(r.length>0)S.push(r.join(`
|
|
26
|
+
`));if(i.length>0)S.push(i.join(`
|
|
27
|
+
`));if(s.length>0)S.push(s.filter((p)=>!c.has(p)).join(`
|
|
28
|
+
`));if(x.length>0)S.push(x.filter((p)=>!c.has(p)).join(`
|
|
29
|
+
`));return S.push(m),S.join(`
|
|
30
|
+
`)}import v from"fs";import I from"path";function Ii(e,n,t){return{version:1,buildTime:new Date().toISOString(),routes:e,assets:n,outputDir:t}}function Oi(e,n){let t=I.join(n,"manifest.json");v.writeFileSync(t,JSON.stringify(e,null,2))}function Ni(e){let n=I.join(e,"manifest.json");if(!v.existsSync(n))return null;try{let t=v.readFileSync(n,"utf-8"),r=JSON.parse(t);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(t){return console.warn("[stx] Failed to load manifest:",t),null}}function k(e,n,t={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`;if(t.maxAge!==void 0)r+=`; Max-Age=${t.maxAge}`;if(t.expires)r+=`; Expires=${t.expires.toUTCString()}`;if(t.path)r+=`; Path=${t.path}`;if(t.domain)r+=`; Domain=${t.domain}`;if(t.secure)r+="; Secure";if(t.httpOnly)r+="; HttpOnly";if(t.sameSite)r+=`; SameSite=${t.sameSite}`;return r}async function Z(e){let n=e.headers.get("content-type")||"",t={},r=(s,o)=>{let a=t[s];if(a===void 0)t[s]=o;else if(Array.isArray(a))a.push(o);else t[s]=[a,o]};if(n.includes("multipart/form-data")){let s=await e.formData();for(let[o,a]of s.entries())if(typeof a==="string")r(o,a);return t}if(n.includes("application/x-www-form-urlencoded")){for(let[s,o]of new URLSearchParams(await e.text()).entries())r(s,o);return t}return t}function Vs(e){if(!e)return!1;let n=e.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function D(e,n={}){let t=n.request,r=n.method??t?.method;if(!t||!Vs(r))return{ran:!1};if(typeof e.action!=="function")return{ran:!1};let s={};try{s=await Z(t)}catch{}let o=await e.action({request:t,form:s,params:n.params??{},query:e.query??{},cookies:n.cookies??{}});if(o&&typeof o==="object"){let a=o,i=Q(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(e,f),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function Q(e){if(!e||typeof e!=="object"||Array.isArray(e))return[];let n=[];for(let[t,r]of Object.entries(e)){if(!t)continue;if(typeof r==="string"){n.push(k(t,r));continue}if(r&&typeof r==="object"){let s=r;if(typeof s.value!=="string")continue;n.push(k(t,s.value,s))}}return n}function Di(e,n=[],t){let r=new Headers({Location:e,"Cache-Control":"no-store"});for(let s of n)r.append("Set-Cookie",s);for(let[s,o]of Object.entries(t??{}))if(s.toLowerCase()!=="location")r.set(s,o);return new Response(null,{status:303,headers:r})}async function Cn(e,n={}){let{html:t,context:r,redirect:s,cookies:o}=await tt(e,n),a=At(r),i=Pt(r);if(s)return{html:t,redirect:s,cookies:o,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-9qx6ansy.js"),u=c(r),l=e.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-jecmxby7.js"),{defaultConfig:m}=await import("./chunk-5rdfcpfe.js"),x=r.streamBoundaries||{},y={...m,autoShell:!1},R=Object.keys(l).map((p)=>({id:p,render:async()=>{let b=typeof x[p]==="function"?await x[p]():void 0;return f(l[p],{...r,$boundary:b},e.sourceFile,y,new Set)}})),S=new Set(R.map((p)=>p.id));u=[...(u||[]).filter((p)=>!S.has(p.id)),...R]}return{html:t,boundaries:u&&u.length>0?u:void 0,cookies:o,status:a,headers:i}}async function tt(e,n){let t={__filename:e.sourceFile,__dirname:e.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!e.hasServerScripts&&!zo(e.html))return{html:e.html,context:t};for(let a of e.serverScriptContent)try{await g(a,t,e.sourceFile)}catch(i){if(n.__stx_strict_hydration)throw i;console.warn(`[stx] Server script error in ${e.sourceFile}:`,i)}let r=await D(t,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),s=(a)=>{let i=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=dr(t);if(!c)return i;let u=i.indexOf("</head>");return u<0?c+i:i.slice(0,u)+c+i.slice(u)};if(r.redirect)return{html:e.html,context:t,redirect:r.redirect,cookies:r.cookies};if(!zo(e.html))return{html:s(e.html),context:t,cookies:r.cookies};let o=new Map;for(let[a,i]of Object.entries(e.placeholders))if(i.expression)try{let c=_(i.expression,t);if(i.type==="raw")o.set(a,c!==void 0&&c!==null?String(c):"");else o.set(a,c!==void 0&&c!==null?V(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;o.set(a,"")}return{html:s(tc(e.html,o)),context:t,cookies:r.cookies}}
|
|
31
|
+
export{ut,Ri,ke,O,Ai,Hs,Pr,Ve,Pi,_e,Ii,Oi,Ni,Vs,Di,Cn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{gl,ml,Ee,hl,ra,Xt,Jt,cp,sa,Yt,Hn,yl,bl,vl,Js,Zt,wl,Qt,xl}from"./chunk-5nrqc6v4.js";import"./chunk-qb806pks.js";import"./chunk-374nhgyf.js";import"./chunk-42qtadka.js";import"./chunk-hg7ys8rn.js";import"./chunk-tenbwcts.js";import"./chunk-912r15hr.js";import"./chunk-nbjyed3q.js";import"./chunk-gymmbbzc.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{Hn as MODULE_SPECIFIER_PREFIX,gl as bundleCacheDir,ml as bundleCacheEntryLimit,Qt as bundleClientScript,Jt as clearBundleFailures,Ee as clientBundleDependencies,Xt as getBundleFailures,Yt as hasUserImports,Zt as moduleSubstitutionKey,bl as normalizeRegistrySpecifiers,wl as queueClientBundleBuild,ra as recordBundleFailure,yl as registryIdForPath,sa as resolveBundlerFallback,vl as rewriteRegistryImports,cp as setBundlerFallbackMode,hl as shouldLogBundlerDiagnostics,xl as tempBuildName,Js as withModuleSubstitutes};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as
|
|
3
|
-
export{
|
|
2
|
+
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Ju}from"ts-broadcasting";import{Broadcast as Yu,BroadcastServer as Zu}from"ts-broadcasting";var e=null,u=[];function Hu(){return e}async function Vu(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Uu(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Wu(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Fc(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Fc(n,t,r){if(!i())return;s.send(n,t,r)}function qu(n,t,r){if(!i())return;s.toUser(n,t,r)}function Gu(n,t,r){if(!i())return;s.toUsers(n,t,r)}function Ku(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function Xu(n,t,r){if(!i())return;s.presence(n,t,r)}
|
|
3
|
+
export{Hu,Vu,Uu,Wu,Fc,qu,Gu,Ku,Xu,Ju,Yu,Zu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Z,Q,ee,Tn,ge,Ce,Ir,Wc,dt,Wt,$n,Rn,An,te,Pn,In,Or}from"./chunk-brftzqzj.js";import"./chunk-03xn8244.js";export{Q as DEFAULT_FORMATS,ee as DEFAULT_QUALITY,Z as DEFAULT_WIDTHS,Or as ImageProcessingError,In as formatSize,Wt as generateSizes,dt as generateSrcSet,$n as getFallbackVariant,Ir as getImageMetadata,te as getMimeType,Pn as getTotalSize,Rn as groupVariantsByFormat,ge as isImageBackendAvailable,An as isImageFile,Tn as isSharpAvailable,Ce as processImage,Wc as resizeAndConvert};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l,p,tc,u,t,a}from"./chunk-qwdcts9w.js";import{Xe,yt,rn,fo}from"./chunk-dxh45gve.js";function L(w,e){try{let f=w.trim();if(p(f))return u(f,Object.keys(e))(...Object.values(e));else return l(f,e)}catch{return!1}}function Q(w,e,f){let n=w,v=!0;while(v){v=!1;let h=n.match(/@switch\s*\(/);if(!h||h.index===void 0)break;let b=h.index,s=fo(n,b);if(!s)break;try{let o;if(p(s.expression))o=u(s.expression,Object.keys(e))(...Object.values(e));else o=l(s.expression,e);let r="",g=!1;for(let i of s.cases)if(i.type==="default"){if(!g)r=i.content.trim()}else try{let y;if(i.value&&p(i.value))y=u(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=l(i.value,e);if(o===y){r=i.content.trim(),g=!0;break}}catch{continue}n=n.substring(0,b)+r+n.substring(s.end),v=!0}catch(o){let r=o instanceof Error?o.message:String(o),g=a("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+g+n.substring(s.end);break}}return n}function H(w){let e=[];return{masked:w.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(n)=>(e.push(n),`\x00stx-script-${e.length-1}\x00`)),scripts:e}}function J(w,e){if(e.length===0)return w;return w.replace(/\u0000stx-script-(\d+)\u0000/g,(f,n)=>e[Number(n)]??f)}function ne(w,e,f){let{masked:n,scripts:v}=H(w);return J(K(n,e,f),v)}function K(w,e,f){let n=w;n=Q(n,e,f);{let h=!0;while(h){h=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Xe(n,s+7);if(!o)break;let r=o.endPos,g=yt(n,"unless","endunless",r);if(g===-1){console.warn(`[stx] @unless directive at position ${s} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let i=n.slice(r,g),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,d=/@(?:endif|endunless)(?![a-z])/g,E=/@else(?![a-z])/g,S=[],C;while((C=k.exec(i))!==null)S.push({pos:C.index,type:"open"});while((C=d.exec(i))!==null)S.push({pos:C.index,type:"close"});while((C=E.exec(i))!==null)S.push({pos:C.index,type:"else"});S.sort((P,R)=>P.pos-R.pos);for(let P of S)if(P.type==="open")x++;else if(P.type==="close")x--;else if(P.type==="else"&&x===0){m=P.pos;break}}let c;if(m!==-1){let x=i.slice(0,m),k=i.slice(m+5);c=`@if (${y})${k}@else ${x}@endif`}else c=`@if (!(${y}))${i}@endif`;n=n.substring(0,s)+c+n.substring(g+10),h=!0}}n=io(n,e,f),n=ao(n,e,f),n=oo(n,e);let v=()=>{let h=rn(n);if(h.length===0)return!1;let b=Array(h.length);for(let r=h.length-1;r>=0;r--){let g=h[r];try{let i="",y=!1;for(let m of g.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?tc(m.condition,e):!1)i=m.content,y=!0}catch(c){i=a(m.type==="if"?"If":"Elseif",`Error in @${m.type}(${m.condition}): ${c instanceof Error?c.message:String(c)}`,t.EVALUATION_ERROR),y=!0}}b[r]=i}catch(i){let y=i instanceof Error?i.message:String(i);b[r]=a("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(h.length*2+1),o=0;for(let r=0;r<h.length;r++){let g=h[r];s[r*2]=n.slice(o,g.start),s[r*2+1]=b[r],o=g.end}return s[h.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let h=n;if(!v())break;if(n===h)break}return n}function q(w){let e=0;while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!=="(")return null;e++;while(e<w.length&&/\s/.test(w[e]))e++;let f=w[e];if(f!=="'"&&f!=='"')return null;e++;let n=[];while(e<w.length){let v=w[e];if(v==="\\"&&e+1<w.length){n.push(w[e+1]),e+=2;continue}if(v===f){e++;break}n.push(v),e++}while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!==")")return null;return e++,{value:n.join(""),consumed:e}}function oo(w,e){let f=w;function n(s,o,r,g){let i=1,y=g,m=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),c=new RegExp(`@${r}(?![a-z])`,"g");while(y<s.length&&i>0){m.lastIndex=y,c.lastIndex=y;let x=m.exec(s),k=c.exec(s),d=x?x.index:1/0,E=k?k.index:1/0;if(d<E)i++,y=d+x[0].length;else if(E<1/0){if(i--,i===0)return E;y=E+k[0].length}else break}return-1}function v(s,o,r){let g=0,i=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),y=new RegExp(`@${r}(?![a-z])`,"g"),m=/@else(?![a-z])/g,c=[],x;while((x=i.exec(s))!==null)c.push({pos:x.index,type:"open"});while((x=y.exec(s))!==null)c.push({pos:x.index,type:"close"});while((x=m.exec(s))!==null)c.push({pos:x.index,type:"else"});c.sort((k,d)=>k.pos-d.pos);for(let k of c)if(k.type==="open")g++;else if(k.type==="close")g--;else if(k.type==="else"&&g===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=f.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+5),m=q(y);if(m)g=m.value,i=r+5+m.consumed;else i=r+5;let c=n(f,"auth","endauth",i);if(c===-1){console.warn(`[stx] @auth directive at position ${r} has no matching @endauth \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"auth","endauth"),d;if(!e.auth)d=!1;else d=g?L(`auth?.check && auth?.user?.[${g}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=f.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+6),m=q(y);if(m)g=m.value,i=r+6+m.consumed;else i=r+6;let c=n(f,"guest","endguest",i);if(c===-1){console.warn(`[stx] @guest directive at position ${r} has no matching @endguest \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"guest","endguest"),d;if(!e.auth)d=!0;else d=g?L(`!auth?.check || !auth?.user?.[${g}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+9),s=!0}}function h(s,o,r){if(e.userCan&&typeof e.userCan[s]==="boolean")return e.userCan[s];if(e.permissions?.check&&typeof e.permissions.check==="function")try{let g=[s];if(o)g.push(o);if(r){let i=L(r,e);g.push(i)}return e.permissions.check(...g)}catch{return!1}return!1}function b(s){let o=s.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!o)return null;return{ability:o[1],type:o[2],id:o[3]?.trim(),paramsEnd:o[0].length}}for(let s of["can","cannot"]){let o=`end${s}`,r=s==="can"?"elsecan":"elsecannot",g=!0;while(g){g=!1;let i=f.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=f.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(f,s,o,x);if(k===-1){console.warn(`[stx] @${s} directive at position ${y} has no matching @${o} \u2014 the block was skipped.`);break}let d=f.slice(x,k),E=[],S=0,C=new RegExp(`@${s}\\s*\\(`,"g"),P=new RegExp(`@${o}(?![a-z])`,"g"),R=new RegExp(`@${r}\\s*\\(`,"g"),T=/@else(?![a-z])/g,_=[],M;while((M=C.exec(d))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(d))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(d))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(d))!==null)_.push({pos:M.index,type:"else"});_.sort((A,z)=>A.pos-z.pos);for(let A of _){if(A.type==="open"){S++;continue}if(A.type==="close"){S--;continue}if(S===0)E.push(A)}let I=[],F=0;for(let A=0;A<E.length;A++){let z=E[A];if(I.push({content:d.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=d.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:d.slice(F,z.pos)},F=z.pos+`@${r}`.length+B.paramsEnd,I.push({content:"",ability:B.ability,type:B.type,id:B.id}),I.pop();let G=E[A+1],U=G?G.pos:d.length;I.push({content:d.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<d.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:d.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:d.slice(F)})}let O=h(c.ability,c.type,c.id),j=s==="can"?O:!O,V="";if(j)V=I[0]?.content||"";else{let A=!1;for(let z=1;z<I.length;z++){let D=I[z];if(D.isFinalElse){V=D.content,A=!0;break}if(D.ability){let B=h(D.ability,D.type,D.id);if(s==="can"?B:!B){V=D.content,A=!0;break}}}if(!A&&I.length>0){let z=I[I.length-1];if(z.isFinalElse)V=z.content}}f=f.substring(0,y)+V+f.substring(k+`@${o}`.length),g=!0}}return f}function io(w,e,f){let n=w;function v(h,b,s,o,r){let g=!0;while(g){g=!1;let i=new RegExp(`@${b}\\s*\\(`),y=h.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Xe(h,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=yt(h,b,s,x);if(k===-1){console.warn(`[stx] @${b} directive at position ${m} has no matching @${s} \u2014 the block was skipped.`);break}let d=h.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<d.length){let R=d.indexOf("@",P);if(R===-1)break;let T=d.substring(R);if(/^@(?:if|unless|isset|empty)\s*\(/.test(T)){C++,P=R+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(T)){C--,P=R+1;continue}if(C===0&&/^@else(?![a-z])/.test(T)){S=R;break}P=R+1}try{let R=o(E.trim()),T;if(S!==-1){let _=d.slice(0,S),M=d.slice(S+5);T=R?_:M}else T=R?d:"";h=h.substring(0,m)+T+h.substring(k+`@${s}`.length),g=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=a(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);h=h.substring(0,m)+_+h.substring(k+`@${s}`.length);break}}return h}return n=v(n,"isset","endisset",(h)=>{let b=L(h,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(h)=>{let b=L(h,e);return b===void 0||b===null||b===""||b===0||b===!1||Array.isArray(b)&&b.length===0||typeof b==="object"&&b!==null&&Object.keys(b).length===0},"Empty"),n}function ao(w,e,f){let n=w,v="development";function h(b,s,o,r){let g=new RegExp(`@${s}(?![a-z])`,"g"),i=new RegExp(`@${o}(?![a-z])`,"g"),y=new RegExp(`^@${s}(?![a-z])`),m=new RegExp(`^@${o}(?![a-z])`),c=b,x=!0;while(x){x=!1,g.lastIndex=0;let k=g.exec(c);if(!k)break;let d=k.index,E=d+k[0].length;if(s==="env"){let O=c.substring(E).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!O)break;E+=O[0].length,r=v===O[2]}let S=1,C=E,P=-1;while(S>0&&C<c.length){g.lastIndex=C,i.lastIndex=C;let O=g.exec(c),j=i.exec(c),V=O?O.index:1/0,A=j?j.index:1/0;if(V<A)S++,C=V+O[0].length;else if(A<1/0){if(S--,S===0){P=A;break}C=A+j[0].length}else break}if(P===-1){console.warn(`[stx] @${s} directive at position ${d} has no matching @${o} \u2014 the block was skipped.`);break}let R=c.substring(E,P),T=-1,_=0,M=0;while(M<R.length){let O=R.indexOf("@",M);if(O===-1)break;let j=R.substring(O);if(y.test(j)){_++,M=O+1;continue}if(m.test(j)){_--,M=O+1;continue}if(_===0&&/^@else(?![a-z])/.test(j)){T=O;break}M=O+1}let I;if(T!==-1){let O=R.slice(0,T),j=R.slice(T+5);I=r?O:j}else I=r?R:"";let F=`@${o}`.length;c=c.substring(0,d)+I+c.substring(P+F),x=!0}return c}return n=h(n,"env","endenv",!1),n=h(n,"production","endproduction",v==="production"),n=h(n,"development","enddevelopment",v==="development"),n=h(n,"staging","endstaging",v==="staging"),n=h(n,"testing","endtesting",v==="testing"),n}
|
|
3
|
-
export{
|
|
2
|
+
import{l,p,rc,u,t,a}from"./chunk-w28wc7mv.js";import{Xe,yt,rn,mo}from"./chunk-zt5hp5w5.js";function L(w,e){try{let f=w.trim();if(p(f))return u(f,Object.keys(e))(...Object.values(e));else return l(f,e)}catch{return!1}}function Q(w,e,f){let n=w,v=!0;while(v){v=!1;let h=n.match(/@switch\s*\(/);if(!h||h.index===void 0)break;let b=h.index,s=mo(n,b);if(!s)break;try{let o;if(p(s.expression))o=u(s.expression,Object.keys(e))(...Object.values(e));else o=l(s.expression,e);let r="",g=!1;for(let i of s.cases)if(i.type==="default"){if(!g)r=i.content.trim()}else try{let y;if(i.value&&p(i.value))y=u(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=l(i.value,e);if(o===y){r=i.content.trim(),g=!0;break}}catch{continue}n=n.substring(0,b)+r+n.substring(s.end),v=!0}catch(o){let r=o instanceof Error?o.message:String(o),g=a("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+g+n.substring(s.end);break}}return n}function H(w){let e=[];return{masked:w.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(n)=>(e.push(n),`\x00stx-script-${e.length-1}\x00`)),scripts:e}}function J(w,e){if(e.length===0)return w;return w.replace(/\u0000stx-script-(\d+)\u0000/g,(f,n)=>e[Number(n)]??f)}function re(w,e,f){let{masked:n,scripts:v}=H(w);return J(K(n,e,f),v)}function K(w,e,f){let n=w;n=Q(n,e,f);{let h=!0;while(h){h=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Xe(n,s+7);if(!o)break;let r=o.endPos,g=yt(n,"unless","endunless",r);if(g===-1){console.warn(`[stx] @unless directive at position ${s} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let i=n.slice(r,g),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,d=/@(?:endif|endunless)(?![a-z])/g,E=/@else(?![a-z])/g,S=[],C;while((C=k.exec(i))!==null)S.push({pos:C.index,type:"open"});while((C=d.exec(i))!==null)S.push({pos:C.index,type:"close"});while((C=E.exec(i))!==null)S.push({pos:C.index,type:"else"});S.sort((P,R)=>P.pos-R.pos);for(let P of S)if(P.type==="open")x++;else if(P.type==="close")x--;else if(P.type==="else"&&x===0){m=P.pos;break}}let c;if(m!==-1){let x=i.slice(0,m),k=i.slice(m+5);c=`@if (${y})${k}@else ${x}@endif`}else c=`@if (!(${y}))${i}@endif`;n=n.substring(0,s)+c+n.substring(g+10),h=!0}}n=co(n,e,f),n=lo(n,e,f),n=ao(n,e);let v=()=>{let h=rn(n);if(h.length===0)return!1;let b=Array(h.length);for(let r=h.length-1;r>=0;r--){let g=h[r];try{let i="",y=!1;for(let m of g.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?rc(m.condition,e):!1)i=m.content,y=!0}catch(c){i=a(m.type==="if"?"If":"Elseif",`Error in @${m.type}(${m.condition}): ${c instanceof Error?c.message:String(c)}`,t.EVALUATION_ERROR),y=!0}}b[r]=i}catch(i){let y=i instanceof Error?i.message:String(i);b[r]=a("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(h.length*2+1),o=0;for(let r=0;r<h.length;r++){let g=h[r];s[r*2]=n.slice(o,g.start),s[r*2+1]=b[r],o=g.end}return s[h.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let h=n;if(!v())break;if(n===h)break}return n}function q(w){let e=0;while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!=="(")return null;e++;while(e<w.length&&/\s/.test(w[e]))e++;let f=w[e];if(f!=="'"&&f!=='"')return null;e++;let n=[];while(e<w.length){let v=w[e];if(v==="\\"&&e+1<w.length){n.push(w[e+1]),e+=2;continue}if(v===f){e++;break}n.push(v),e++}while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!==")")return null;return e++,{value:n.join(""),consumed:e}}function ao(w,e){let f=w;function n(s,o,r,g){let i=1,y=g,m=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),c=new RegExp(`@${r}(?![a-z])`,"g");while(y<s.length&&i>0){m.lastIndex=y,c.lastIndex=y;let x=m.exec(s),k=c.exec(s),d=x?x.index:1/0,E=k?k.index:1/0;if(d<E)i++,y=d+x[0].length;else if(E<1/0){if(i--,i===0)return E;y=E+k[0].length}else break}return-1}function v(s,o,r){let g=0,i=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),y=new RegExp(`@${r}(?![a-z])`,"g"),m=/@else(?![a-z])/g,c=[],x;while((x=i.exec(s))!==null)c.push({pos:x.index,type:"open"});while((x=y.exec(s))!==null)c.push({pos:x.index,type:"close"});while((x=m.exec(s))!==null)c.push({pos:x.index,type:"else"});c.sort((k,d)=>k.pos-d.pos);for(let k of c)if(k.type==="open")g++;else if(k.type==="close")g--;else if(k.type==="else"&&g===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=f.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+5),m=q(y);if(m)g=m.value,i=r+5+m.consumed;else i=r+5;let c=n(f,"auth","endauth",i);if(c===-1){console.warn(`[stx] @auth directive at position ${r} has no matching @endauth \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"auth","endauth"),d;if(!e.auth)d=!1;else d=g?L(`auth?.check && auth?.user?.[${g}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=f.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,g,i,y=f.slice(r+6),m=q(y);if(m)g=m.value,i=r+6+m.consumed;else i=r+6;let c=n(f,"guest","endguest",i);if(c===-1){console.warn(`[stx] @guest directive at position ${r} has no matching @endguest \u2014 the block was skipped.`);break}let x=f.slice(i,c),k=v(x,"guest","endguest"),d;if(!e.auth)d=!0;else d=g?L(`!auth?.check || !auth?.user?.[${g}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=d?S:C}else E=d?x:"";f=f.substring(0,r)+E+f.substring(c+9),s=!0}}function h(s,o,r){if(e.userCan&&typeof e.userCan[s]==="boolean")return e.userCan[s];if(e.permissions?.check&&typeof e.permissions.check==="function")try{let g=[s];if(o)g.push(o);if(r){let i=L(r,e);g.push(i)}return e.permissions.check(...g)}catch{return!1}return!1}function b(s){let o=s.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!o)return null;return{ability:o[1],type:o[2],id:o[3]?.trim(),paramsEnd:o[0].length}}for(let s of["can","cannot"]){let o=`end${s}`,r=s==="can"?"elsecan":"elsecannot",g=!0;while(g){g=!1;let i=f.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=f.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(f,s,o,x);if(k===-1){console.warn(`[stx] @${s} directive at position ${y} has no matching @${o} \u2014 the block was skipped.`);break}let d=f.slice(x,k),E=[],S=0,C=new RegExp(`@${s}\\s*\\(`,"g"),P=new RegExp(`@${o}(?![a-z])`,"g"),R=new RegExp(`@${r}\\s*\\(`,"g"),T=/@else(?![a-z])/g,_=[],M;while((M=C.exec(d))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(d))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(d))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(d))!==null)_.push({pos:M.index,type:"else"});_.sort((A,z)=>A.pos-z.pos);for(let A of _){if(A.type==="open"){S++;continue}if(A.type==="close"){S--;continue}if(S===0)E.push(A)}let I=[],F=0;for(let A=0;A<E.length;A++){let z=E[A];if(I.push({content:d.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=d.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:d.slice(F,z.pos)},F=z.pos+`@${r}`.length+B.paramsEnd,I.push({content:"",ability:B.ability,type:B.type,id:B.id}),I.pop();let G=E[A+1],U=G?G.pos:d.length;I.push({content:d.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<d.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:d.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:d.slice(F)})}let O=h(c.ability,c.type,c.id),j=s==="can"?O:!O,V="";if(j)V=I[0]?.content||"";else{let A=!1;for(let z=1;z<I.length;z++){let D=I[z];if(D.isFinalElse){V=D.content,A=!0;break}if(D.ability){let B=h(D.ability,D.type,D.id);if(s==="can"?B:!B){V=D.content,A=!0;break}}}if(!A&&I.length>0){let z=I[I.length-1];if(z.isFinalElse)V=z.content}}f=f.substring(0,y)+V+f.substring(k+`@${o}`.length),g=!0}}return f}function co(w,e,f){let n=w;function v(h,b,s,o,r){let g=!0;while(g){g=!1;let i=new RegExp(`@${b}\\s*\\(`),y=h.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Xe(h,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=yt(h,b,s,x);if(k===-1){console.warn(`[stx] @${b} directive at position ${m} has no matching @${s} \u2014 the block was skipped.`);break}let d=h.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<d.length){let R=d.indexOf("@",P);if(R===-1)break;let T=d.substring(R);if(/^@(?:if|unless|isset|empty)\s*\(/.test(T)){C++,P=R+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(T)){C--,P=R+1;continue}if(C===0&&/^@else(?![a-z])/.test(T)){S=R;break}P=R+1}try{let R=o(E.trim()),T;if(S!==-1){let _=d.slice(0,S),M=d.slice(S+5);T=R?_:M}else T=R?d:"";h=h.substring(0,m)+T+h.substring(k+`@${s}`.length),g=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=a(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);h=h.substring(0,m)+_+h.substring(k+`@${s}`.length);break}}return h}return n=v(n,"isset","endisset",(h)=>{let b=L(h,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(h)=>{let b=L(h,e);return b===void 0||b===null||b===""||b===0||b===!1||Array.isArray(b)&&b.length===0||typeof b==="object"&&b!==null&&Object.keys(b).length===0},"Empty"),n}function lo(w,e,f){let n=w,v="development";function h(b,s,o,r){let g=new RegExp(`@${s}(?![a-z])`,"g"),i=new RegExp(`@${o}(?![a-z])`,"g"),y=new RegExp(`^@${s}(?![a-z])`),m=new RegExp(`^@${o}(?![a-z])`),c=b,x=!0;while(x){x=!1,g.lastIndex=0;let k=g.exec(c);if(!k)break;let d=k.index,E=d+k[0].length;if(s==="env"){let O=c.substring(E).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!O)break;E+=O[0].length,r=v===O[2]}let S=1,C=E,P=-1;while(S>0&&C<c.length){g.lastIndex=C,i.lastIndex=C;let O=g.exec(c),j=i.exec(c),V=O?O.index:1/0,A=j?j.index:1/0;if(V<A)S++,C=V+O[0].length;else if(A<1/0){if(S--,S===0){P=A;break}C=A+j[0].length}else break}if(P===-1){console.warn(`[stx] @${s} directive at position ${d} has no matching @${o} \u2014 the block was skipped.`);break}let R=c.substring(E,P),T=-1,_=0,M=0;while(M<R.length){let O=R.indexOf("@",M);if(O===-1)break;let j=R.substring(O);if(y.test(j)){_++,M=O+1;continue}if(m.test(j)){_--,M=O+1;continue}if(_===0&&/^@else(?![a-z])/.test(j)){T=O;break}M=O+1}let I;if(T!==-1){let O=R.slice(0,T),j=R.slice(T+5);I=r?O:j}else I=r?R:"";let F=`@${o}`.length;c=c.substring(0,d)+I+c.substring(P+F),x=!0}return c}return n=h(n,"env","endenv",!1),n=h(n,"production","endproduction",v==="production"),n=h(n,"development","enddevelopment",v==="development"),n=h(n,"staging","endstaging",v==="staging"),n=h(n,"testing","endtesting",v==="testing"),n}
|
|
3
|
+
export{re,ao,co,lo};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function C(){let{NODE_ENV:n}=process.env;return n==="production"}function
|
|
3
|
-
export{C,
|
|
2
|
+
function C(){let{NODE_ENV:n}=process.env;return n==="production"}function W(){let{STX_DEBUG:n}=process.env;return!C()||n==="true"}function wn(){let{NODE_ENV:n}=process.env;return n==="test"}function Yo(n){return n==="compile"||C()}function wr(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
|
|
3
|
+
export{C,W,wn,Yo,wr};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function ce(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Mn(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function
|
|
3
|
-
export{ce,Mn,
|
|
2
|
+
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function ce(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Mn(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function Xd(e,n=Object.is){return Mn(e,{equals:n})}function Ln(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function qs(e){C(e)}function Nr(e){k.push(e)}function Dr(e){T.push(e)}function Jd(){O(k,"onMount",T)}function Yd(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function Zd(){return{mount:k.length,destroy:T.length}}function jn(e){return typeof e==="function"&&e._isSignal===!0}function Bn(e){return typeof e==="function"&&e._isDerived===!0}function Gs(e){if(jn(e)||Bn(e))return m(()=>e());return e}function Mr(e){return m(e)}function Qd(e,n){let r=typeof e==="function"?e:()=>e,i=ce([]),o=Mn(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return Ln(()=>{if(r(),!t){t=!0;return}if(Mr(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
|
|
3
|
+
export{ce,Mn,Xd,Ln,qs,Nr,Dr,Jd,Yd,Zd,jn,Bn,Gs,Mr,Qd};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{it,at,ct}from"./chunk-tp4eqfxq.js";import{Ft,zt,ot,
|
|
2
|
+
import{it,at,ct}from"./chunk-tp4eqfxq.js";import{Ft,zt,ot,gi,Ht,Vt}from"./chunk-vxnf3xab.js";import o from"fs";import i from"path";var c=[];function m(a){c=[];for(let e of a.storyFiles)if(c.push({text:e.fileName.toLowerCase(),original:e.fileName,type:"story",storyId:e.id}),c.push({text:e.relativePath.toLowerCase(),original:e.relativePath,type:"story",storyId:e.id}),e.story)for(let t of e.story.variants)c.push({text:t.title.toLowerCase(),original:t.title,type:"story",storyId:e.id,variantId:t.id})}function f(){return JSON.stringify(c)}async function F(a={}){let e=Date.now();Ft();let t=await it({mode:"build"});if(!t.config.enabled){ot("Story feature is disabled in config.");return}let n=await Ht(t);at(t,n);let l=Vt(t.config,n);ct(t,l),zt(n.length);let d=a.outDir??t.config.outDir,s=i.resolve(t.root,d);await o.promises.mkdir(s,{recursive:!0}),console.log(` Building to ${d}...`);let g=v(t);await o.promises.writeFile(i.join(s,"index.html"),g);let y={files:n.map((r)=>({id:r.id,fileName:r.fileName,relativePath:r.relativePath,treePath:r.treePath})),tree:l};await o.promises.writeFile(i.join(s,"stories.json"),JSON.stringify(y,null,2));let u={theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets};await o.promises.writeFile(i.join(s,"config.json"),JSON.stringify(u,null,2));let p=i.join(s,"stories");await o.promises.mkdir(p,{recursive:!0});for(let r of n){let b=await o.promises.readFile(r.path,"utf-8");await o.promises.writeFile(i.join(p,`${r.id}.stx`),b)}m(t);let h=f();await o.promises.writeFile(i.join(s,"search-index.json"),h);let x=Date.now()-e;gi(n.length,d,x)}function v(a){let{theme:e}=a.config,t=e.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ls,ki,$r,js,Bs,_n,Ut,_i,Rr,Ar,Fs,zs,Nu,Du,lt}from"./chunk-xr9a0hcr.js";export{lt as DeployError,ki as calculateSha1,$r as collectDeployFiles,Ar as createDefaultNetlifyConfig,js as createFileManifest,Ls as createNetlifyClient,Nu as deploy,Rr as detectProjectConfig,Bs as filterRequiredFiles,_n as formatSize,_i as generateNetlifyToml,Ut as getTotalSize,zs as hasNetlifyConfig,Du as initNetlify,Fs as writeNetlifyConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{qi,Gi,Ki,Xi,ip}from"./chunk-f1hxrs7b.js";import"./chunk-wfg5379k.js";import"./chunk-03xn8244.js";import"./chunk-rs67af2x.js";import"./chunk-bmqker64.js";import"./chunk-9bgb9n12.js";import"./chunk-tdwqwxhf.js";import"./chunk-th45zgbz.js";import"./chunk-brcj3953.js";import"./chunk-2a1eeywj.js";import"./chunk-ypwetty7.js";import"./chunk-e97xj3rf.js";import"./chunk-zt5hp5w5.js";import"./chunk-yhfm939b.js";import"./chunk-42qtadka.js";import"./chunk-hg7ys8rn.js";import"./chunk-tenbwcts.js";import"./chunk-912r15hr.js";import"./chunk-nbjyed3q.js";import"./chunk-gymmbbzc.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{qi as buildNative,ip as default,Gi as findCraftBinary,Xi as getAvailableFormats,Ki as getAvailableTargets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Hc,td,Vc,Uc,nd,rd}from"./chunk-65jb75vz.js";import"./chunk-5nfb4gxk.js";import"./chunk-remsyfdx.js";import"./chunk-t6m5d64b.js";import"./chunk-w28wc7mv.js";import"./chunk-6beg47t4.js";import"./chunk-gtktv6nn.js";export{rd as applySlots,nd as extractSlotContent,td as parseSlotElement,Hc as parseSlots,Uc as processSlots,Vc as renderSlot};
|
|
@@ -159,7 +159,7 @@ else {
|
|
|
159
159
|
stxIslands.initIslands();
|
|
160
160
|
}
|
|
161
161
|
})();
|
|
162
|
-
</script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function
|
|
162
|
+
</script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function Jc(){let e=new Map;return{islands:e,register(t){e.set(t.id,t)},get(t){return e.get(t)},async hydrate(t){let n=e.get(t);if(!n||n.hydrated)return;if(n.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:t,component:n.component}}))},async hydrateAll(){let t=Array.from(e.values()).filter((n)=>!n.hydrated).map((n)=>this.hydrate(n.id));await Promise.all(t)}}}function I(e){return`
|
|
163
163
|
<script data-hydrate="${e}">
|
|
164
164
|
(function() {
|
|
165
165
|
const island = document.querySelector('[data-island="${e}"]');
|
|
@@ -311,7 +311,7 @@ else {
|
|
|
311
311
|
});
|
|
312
312
|
})();
|
|
313
313
|
</script>
|
|
314
|
-
`}function
|
|
314
|
+
`}function Yc(e,t={},n){let r=e,i=!1,d=/@client:(load|idle|visible|media|only|hover|event)/i.test(e);if(r=u(r,"load",t),r=u(r,"idle",t),r=u(r,"visible",t),r=u(r,"media",t),r=M(r),r=u(r,"hover",t),r=u(r,"event",t),i=d&&r!==e,i)r+=`
|
|
315
315
|
`+v();return r}function u(e,t,n){let r=new RegExp(`@client:${t}(?:\\s*\\(([^)]*)\\))?\\s*([\\s\\S]*?)@endclient`,"gi");return e.replace(r,(i,d,o)=>{let a={strategy:t};if(d)try{let E=d.split(",").map((h)=>h.trim());for(let h of E){let[m,g]=h.split(":").map((p)=>p.trim());if(m&&g){let p=g.replace(/^['"]|['"]$/g,"");a[m]=p}}}catch{}let s=`island-${Math.random().toString(36).substring(2,9)}`,y=b(o.trim()),f=w(o.trim(),n),c=[];if(a.rootMargin)c.push(`data-root-margin="${a.rootMargin}"`);if(a.threshold!==void 0)c.push(`data-threshold="${a.threshold}"`);if(a.media)c.push(`data-media="${a.media}"`);if(a.event)c.push(`data-event="${a.event}"`);if(y)c.push(`data-component="${y}"`);let x=Object.keys(f).length>0?`
|
|
316
316
|
<script type="application/json" data-island-props="${s}">${JSON.stringify(f)}</script>`:"",l="";switch(t){case"load":l=I(s);break;case"idle":l=L(s,a);break;case"visible":l=C(s,a);break;case"media":l=S(s,a);break;case"hover":l=k(s);break;case"event":l=H(s,a);break}return`
|
|
317
317
|
<div data-island="${s}"
|
|
@@ -342,7 +342,7 @@ else {
|
|
|
342
342
|
}
|
|
343
343
|
})();
|
|
344
344
|
</script>
|
|
345
|
-
`})}function
|
|
345
|
+
`})}function Zc(){return`
|
|
346
346
|
/* Island base styles */
|
|
347
347
|
.stx-island {
|
|
348
348
|
display: contents;
|
|
@@ -383,9 +383,9 @@ else {
|
|
|
383
383
|
.stx-island.hydrated {
|
|
384
384
|
opacity: 1;
|
|
385
385
|
}
|
|
386
|
-
`}function
|
|
386
|
+
`}function Qc(e){if(typeof window>"u")return;let t=document.querySelector(`[data-island="${e}"]`);if(!t||t.classList.contains("hydrated"))return;t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function el(e){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${e}"]:not(.hydrated)`).forEach((n)=>{n.classList.add("hydrated"),n.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function tl(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((t)=>{t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function nl(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function rl(e){return new Promise((t)=>{if(typeof window>"u"){t();return}let n=document.querySelector(`[data-island="${e}"]`);if(!n){t();return}if(n.classList.contains("hydrated")){t();return}n.addEventListener("stx:hydrated",()=>t(),{once:!0})})}function sl(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function ol(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
|
|
387
387
|
<script type="application/json" id="stx-island-manifest">
|
|
388
388
|
${JSON.stringify(t)}
|
|
389
389
|
</script>
|
|
390
|
-
`}var
|
|
391
|
-
export{
|
|
390
|
+
`}var od={processPartialHydrationDirectives:Yc,processStaticDirectives:sl,generatePartialHydrationCSS:Zc,generateIslandManifest:ol,createIslandRegistry:Jc,hydrateIsland:Qc,hydrateByStrategy:el,hydrateAll:tl,isHydrated:nl,onHydrated:rl};
|
|
391
|
+
export{Jc,Yc,Zc,Qc,el,tl,nl,rl,sl,ol,od};
|