@stacksjs/stx 0.2.894 → 0.2.896
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-qn45rk5n.js → chunk-0k437z3q.js} +1 -1
- package/dist/{chunk-4s3ts344.js → chunk-142n73c3.js} +1 -1
- package/dist/{chunk-0waheg6m.js → chunk-18gfzvn5.js} +1 -1
- package/dist/{chunk-pg3yatv3.js → chunk-19v28wj2.js} +2 -2
- package/dist/{chunk-5zs5hrgz.js → chunk-1bft48gk.js} +2 -2
- package/dist/{chunk-s32gsz18.js → chunk-1y4ad3ma.js} +5 -5
- package/dist/{chunk-z8sv926e.js → chunk-2nqmw4dv.js} +1 -1
- package/dist/{chunk-gk0h2hp7.js → chunk-35j7gaj5.js} +1 -1
- package/dist/chunk-38gz54d6.js +182 -0
- package/dist/{chunk-j1mr34da.js → chunk-3jrn01rc.js} +1 -1
- package/dist/{chunk-tc94atxh.js → chunk-3sc1w0dz.js} +1 -1
- package/dist/{chunk-mj0dnha4.js → chunk-3wz8eys3.js} +1 -1
- package/dist/{chunk-90qwzwsm.js → chunk-4akw3bym.js} +1 -1
- package/dist/{chunk-vya7cck4.js → chunk-4d85str1.js} +1 -1
- package/dist/{chunk-hxm31y5q.js → chunk-54dk6rbc.js} +3 -3
- package/dist/chunk-55w7a5tt.js +3 -0
- package/dist/{chunk-8qgcvc9r.js → chunk-5zztnr63.js} +1 -1
- package/dist/{chunk-ae0qvjkz.js → chunk-66qwkxrv.js} +1 -1
- package/dist/{chunk-pjpf21y9.js → chunk-690518hw.js} +1 -1
- package/dist/{chunk-5spnw5zr.js → chunk-6s81gd2p.js} +1 -1
- package/dist/{chunk-ccecyvwf.js → chunk-6shfk0tt.js} +1 -1
- package/dist/{chunk-xdn58ea6.js → chunk-6yqeqesa.js} +4 -4
- package/dist/{chunk-0hfn4cek.js → chunk-7vr7nw7p.js} +1 -1
- package/dist/{chunk-khaem3zq.js → chunk-7xk40zsm.js} +1 -1
- package/dist/{chunk-xvprhdcb.js → chunk-80ky40mm.js} +1 -1
- package/dist/chunk-8abrg1v2.js +2 -0
- package/dist/{chunk-gzc16hs8.js → chunk-8ccgty8s.js} +2 -2
- package/dist/chunk-8e38dzxv.js +2 -0
- package/dist/{chunk-n64zbwzr.js → chunk-9rjgq8k4.js} +1 -1
- package/dist/{chunk-c5q6jdm9.js → chunk-9tngkmry.js} +4 -4
- package/dist/{chunk-s9a9kda4.js → chunk-9v2bpwgb.js} +2 -2
- package/dist/chunk-9vpcsn2f.js +2 -0
- package/dist/{chunk-kd7k31x3.js → chunk-aj5tsksz.js} +4 -4
- package/dist/{chunk-mdrdp6c4.js → chunk-avn3panj.js} +2 -2
- package/dist/chunk-b35t77m0.js +2 -0
- package/dist/chunk-c8hyr9vb.js +2 -0
- package/dist/{chunk-9f8fda1j.js → chunk-ch9028z3.js} +1 -1
- package/dist/{chunk-z012vpdz.js → chunk-cmg9x1ka.js} +3 -3
- package/dist/chunk-cp5x6kx1.js +2 -0
- package/dist/{chunk-x9036mfd.js → chunk-cphc60zw.js} +2 -2
- package/dist/chunk-e8szp5wa.js +2 -0
- package/dist/{chunk-wk36dj2m.js → chunk-er0hgd96.js} +1 -1
- package/dist/{chunk-p06tqhp9.js → chunk-exb4wc0c.js} +1 -1
- package/dist/{chunk-j5m4hy3m.js → chunk-fjpaxmvv.js} +2 -2
- package/dist/{chunk-yrjm6zyh.js → chunk-fnpq78k3.js} +1 -1
- package/dist/{chunk-e9c56r58.js → chunk-g71ppt0e.js} +4 -4
- package/dist/{chunk-3mdg7w2d.js → chunk-gxpcdhr3.js} +1 -1
- package/dist/{chunk-v6ja6a65.js → chunk-h19fp8g8.js} +2 -2
- package/dist/{chunk-d8ptv989.js → chunk-h91ry9p1.js} +4 -4
- package/dist/chunk-hn679t1s.js +2 -0
- package/dist/{chunk-gjqdp0zx.js → chunk-jrbkvptj.js} +1 -1
- package/dist/chunk-jre984qm.js +2 -0
- package/dist/chunk-jyd9trff.js +2 -0
- package/dist/{chunk-8a71xvx1.js → chunk-knhf7dkn.js} +16 -16
- package/dist/{chunk-t79khbtp.js → chunk-m136gh80.js} +2 -2
- package/dist/chunk-n2d0jzyv.js +2 -0
- package/dist/{chunk-y54vpvy0.js → chunk-n8mfvqqz.js} +1 -1
- package/dist/{chunk-cbjvabsa.js → chunk-p1wqyf10.js} +43 -43
- package/dist/{chunk-8n5bjars.js → chunk-q671arjn.js} +1 -1
- package/dist/chunk-qe3z3x39.js +2 -0
- package/dist/{chunk-1a8ev0eh.js → chunk-rr0wvqa3.js} +1 -1
- package/dist/chunk-rspsbhcv.js +2 -0
- package/dist/{chunk-66qt9q6e.js → chunk-rvn63nv2.js} +19 -19
- package/dist/{chunk-c9xg8rc2.js → chunk-s5xfmr87.js} +2 -2
- package/dist/chunk-snbhzrfy.js +2 -0
- package/dist/{chunk-na92k4va.js → chunk-srsb2zvm.js} +1 -1
- package/dist/{chunk-kfbw96c5.js → chunk-t0ttxayz.js} +2 -2
- package/dist/chunk-t31twwh0.js +2 -0
- package/dist/{chunk-qrk535j6.js → chunk-t3zmfh8w.js} +4 -4
- package/dist/{chunk-60z8rka9.js → chunk-t6sdtsf8.js} +5 -5
- package/dist/{chunk-gcjqxvbb.js → chunk-ta07gj66.js} +2 -2
- package/dist/chunk-tbh7r1wh.js +2 -0
- package/dist/chunk-tspz0z7d.js +2 -0
- package/dist/chunk-tznd1egg.js +2 -0
- package/dist/{chunk-hdqy5v4v.js → chunk-w5kq4k7f.js} +1 -1
- package/dist/{chunk-mxf6cfbg.js → chunk-whcrca58.js} +6 -6
- package/dist/chunk-x57p5bay.js +2 -0
- package/dist/{chunk-6yy54yyp.js → chunk-xbqt53jj.js} +1 -1
- package/dist/{chunk-ac3e6nhg.js → chunk-xmg6bmh6.js} +3 -3
- package/dist/{chunk-hxq5tsqa.js → chunk-xtq8swr2.js} +1 -1
- package/dist/chunk-xvmd0aja.js +2 -0
- package/dist/{chunk-2eq3aret.js → chunk-xwrjre34.js} +1 -1
- package/dist/{chunk-h7yme97q.js → chunk-xy8smv5e.js} +2 -2
- package/dist/{chunk-z3ar05m3.js → chunk-xzj4jyhy.js} +5 -5
- package/dist/chunk-ycge4wfk.js +2 -0
- package/dist/chunk-z1dym2re.js +2 -0
- package/dist/{chunk-1csmm3f6.js → chunk-z3kvxk73.js} +1 -1
- package/dist/{chunk-8y39f6z3.js → chunk-zf68afyh.js} +3 -3
- package/dist/{chunk-qv4qwa61.js → chunk-zkq66keq.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/accessibility.d.ts +0 -15
- package/dist/native/accessibility.js +2 -6
- package/dist/native/compiler/html-to-ir.js +1 -27
- package/dist/offline/app-service-worker.d.ts +4 -1
- package/dist/offline/app-service-worker.js +23 -5
- package/dist/process.js +4 -3
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +10 -10
- package/package.json +5 -5
- package/dist/chunk-0d14783x.js +0 -2
- package/dist/chunk-0yw075t7.js +0 -2
- package/dist/chunk-3ngbdap1.js +0 -2
- package/dist/chunk-484x27q5.js +0 -2
- package/dist/chunk-4eyyshsq.js +0 -2
- package/dist/chunk-4fcb8rmm.js +0 -2
- package/dist/chunk-4mmy5pfh.js +0 -2
- package/dist/chunk-4pq32bt3.js +0 -2
- package/dist/chunk-5kfe3smn.js +0 -2
- package/dist/chunk-b4kbj9kq.js +0 -2
- package/dist/chunk-b77t5zy2.js +0 -2
- package/dist/chunk-brmmkfnq.js +0 -2
- package/dist/chunk-btjhb71k.js +0 -2
- package/dist/chunk-dz1mkvdw.js +0 -2
- package/dist/chunk-dz2zehsh.js +0 -2
- package/dist/chunk-eenw264a.js +0 -2
- package/dist/chunk-erka2w6z.js +0 -2
- package/dist/chunk-gd5a11h2.js +0 -2
- package/dist/chunk-jjz64ac2.js +0 -2
- package/dist/chunk-jqnfvdx5.js +0 -182
- package/dist/chunk-nqarmx3w.js +0 -3
- package/dist/chunk-nxjfdtc0.js +0 -2
- package/dist/chunk-vm57848v.js +0 -2
- package/dist/chunk-xv471ek2.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Nm,Mm,Dm,Lm,gu,jm,Bm,Fm,zm,Hm,Um
|
|
2
|
+
import{Nm,Mm,Dm,Lm,gu,jm,Bm,Fm,zm,Hm,Vm,Um}from"./chunk-t0ttxayz.js";export{Vm as Broadcast,Um as BroadcastServer,gu as broadcast,zm as broadcastPresence,Fm as broadcastPrivate,Hm as channel,Nm as getBroadcastServer,Lm as loadChannels,Mm as startBroadcasting,Dm as stopBroadcasting,jm as toUser,Bm as toUsers};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mr,ze}from"./chunk-115bb91s.js";import{X,k,Or,Qs,A}from"./chunk-8a71xvx1.js";import{a,j}from"./chunk-e9c56r58.js";import{ei}from"./chunk-mdrdp6c4.js";import{Z}from"./chunk-n6q1d66k.js";import{gt}from"./chunk-zkwkhesc.js";import{l}from"./chunk-zxjdfgdx.js";import{t,h}from"./chunk-neg6ckjg.js";import d from"path";import E from"fs";import{AsyncLocalStorage as lt}from"async_hooks";import{randomUUID as St}from"crypto";var vt=12;function G(e,n,s){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(e))||ei(e,n,s)}var ct=2;function Xf(e){let n=process.env.STX_BUNDLE_CACHE_DIR?.trim();return n?d.resolve(n):l(e,"bundle-cache")}function rt(e,n){let s=e;for(let i of Bt(n))if(i!==d.sep)s=s.split(i).join("\x00root");return s}var it=new Map;function Bt(e){let n=d.resolve(e),s=it.get(n);if(!s){let i=n;try{i=E.realpathSync(n)}catch{}s=[...new Set([n,i])].sort((c,p)=>p.length-c.length),it.set(n,s)}return s}function jt(e,n){try{let s=E.statSync(e),i=d.resolve(n),c=e.startsWith(`${i}${d.sep}`);return{path:c?d.relative(i,e):e,...c?{inRoot:!0}:{},mtimeMs:s.mtimeMs,size:s.size,hash:Bun.hash(E.readFileSync(e)).toString(36)}}catch{return null}}function ut(e,n){return e.inRoot?d.join(d.resolve(n),e.path):e.path}function Et(e,n){for(let s of e){let i=ut(s,n);try{let c=E.statSync(i);if(c.size!==s.size)return!1;if(c.mtimeMs!==s.mtimeMs&&Bun.hash(E.readFileSync(i)).toString(36)!==s.hash)return!1}catch{return!1}}return!0}var dt=new Map,_t=100;function Jf(e=process.env){let n=Number(e.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(n)&&n>=1?Math.floor(n):2000}var q=new Map;async function Mt(e){let n=q.get(e)??0;if(n>0&&n<_t){q.set(e,n+1);return}q.set(e,1);try{let s=(await E.promises.readdir(e)).filter((o)=>o.endsWith(".js")),i=Jf();if(s.length<=i)return;let p=(await Promise.all(s.map(async(o)=>{try{return{name:o,at:(await E.promises.stat(d.join(e,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);p.sort((o,w)=>w.at-o.at);for(let o of p.slice(i)){let w=o.name.slice(0,-3);await E.promises.rm(d.join(e,`${w}.js`),{force:!0}),await E.promises.rm(d.join(e,`${w}.deps.json`),{force:!0})}T("pruned bundle cache to",i,"entries")}catch{}}function Te(e){return dt.get(e)??[]}function Y(e,n){if(e)dt.set(e,n)}function Yf(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function T(...e){if(Yf())console.log("[stx:bundler]",...e)}var et=[];function Cc(e,n,s){et.push({filePath:e||"<inline>",message:n,details:s})}function mn(){return et.slice()}function hn(){et.length=0}var K;function ey(e){K=e}function Ec(){if(K)return K;try{let e=j.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var tt=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function yn(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,s;while((s=n.exec(e))!==null){let c=s[1];if(!tt.some((o)=>o.test(c)))return T("detected user import:",c),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((s=i.exec(e))!==null){let c=s[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!tt.some((o)=>o.test(c)))return T("detected side-effect import:",c),!0}return!1}var gr="stx-module:",Rt=/\.(?:[cm]?[jt]sx?|json)$/i;function Zf(e,n){return d.relative(e,n).split(d.sep).join("/")}function Qf(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(s,i,c,p)=>{let o=n.get(p);return o&&!p.startsWith(gr)?`${i}${c}${o}${c}`:s})}function eg(e,n){let s=0,i=(p)=>{let o=`__stxMod${s++}`,w=JSON.stringify(p);return n.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},c=(p,o)=>{for(let w of p.split(",")){let C=w.trim();if(!C)continue;let R=C.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!R)continue;let S=R[1].startsWith('"')?JSON.parse(R[1]):R[1],f=R[2]??S;n.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o,w)=>{let C=w.slice(gr.length),R=i(C),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))n.push(`var ${f[1]} = ${R}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)n.push(`var ${v[1]} = ${R};`);else if(S.startsWith("{"))c(S.replace(/^\{|\}$/g,""),R);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o)=>(i(o.slice(gr.length)),"")),e}function ot(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,d.join(e,"index.ts"),d.join(e,"index.tsx"),d.join(e,"index.js"),d.join(e,"index.mjs")];for(let s of n)try{if(E.existsSync(s)&&E.statSync(s,{throwIfNoEntry:!1})?.isFile())return s}catch{}return}var H=new lt;function Ss(e,n){let s=new Bun.CryptoHasher("md5");for(let[i,c]of[...e].sort(([p],[o])=>p<o?-1:p>o?1:0))s.update(`${i}\x00${c}\x00`);return H.run({modules:e,key:s.digest("hex").slice(0,12)},n)}var pt=new lt;function tg(e){return pt.run(!0,e)}function ng(){return pt.getStore()===!0}function Tc(e){if(!ng())return;throw Error(`The client script of ${e} needs bundling, and it is being rendered inside a Bun.build loader, where Bun never finishes a second build. Make the page an entrypoint of the build (bun-plugin-stx renders entrypoints before the bundler starts), or render it once outside the build so its bundle is cached.`)}function bn(){return H.getStore()?.key??""}function ft(e,n,s,i,c,p,o=new Map,w,C,R){let S=new Map([[s,i],...R??[]]),f=(B)=>B!==void 0&&S.has(B),v=(B,r,u)=>{if(G(r,e,w))return null;if(!p||!f(B)||!Rt.test(r))return null;try{if(!E.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(r);let _=`${gr}${Zf(process.cwd(),r)}`;return o.set(u,_),{path:_,external:!0}},b=(B,r)=>{let u=f(B)?n:d.dirname(B),_=d.resolve(u,r);return ot(_)??_};return{name:"stx-client-bundle",setup(B){if(B.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^\//},(r)=>{if(f(r.path))return{path:r.path};let u=ot(r.path);if(u){let _=v(r.importer,u,r.path);if(_)return _;if(!f(u))c.add(u);return{path:u}}return{path:r.path,external:!0}}),B.onResolve({filter:/^\.\.?\//},(r)=>{let u=b(r.importer,r.path),_=v(r.importer,u,r.path);if(_)return _;return c.add(u),{path:u}}),B.onResolve({filter:/^[@~]\//},(r)=>{let u=d.resolve(e,r.path.slice(2)),_=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,d.join(u,"index.ts"),d.join(u,"index.tsx"),d.join(u,"index.js"),d.join(u,"index.mjs")];for(let x of _)if(E.existsSync(x)&&E.statSync(x,{throwIfNoEntry:!1})?.isFile()){let D=v(r.importer,x,r.path);if(D)return D;return T(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",x),c.add(x),{path:x}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:u}}),p)B.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(!f(r.importer))return;let u=`${gr}npm:${r.path}`;return o.set(r.path,u),{path:u,external:!0}});B.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(S.has(r.path))return{contents:S.get(r.path),loader:"ts"};if(G(r.path,e,w))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let u=d.extname(r.path).toLowerCase(),_=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(r.path))c.add(r.path);let x=C?.get(r.path);if(x!==void 0)return{contents:x,loader:"js"};return{contents:E.readFileSync(r.path,"utf8"),loader:_}})}}}var Q=new Map,V=k(64),at=Symbol.for("stx.client-bundle-build-queue");function rg(e){let n=globalThis,i=(n[at]??Promise.resolve()).then(e,e);return n[at]=i.then(()=>{return},()=>{return}),i}async function wn(e,n,s={}){let i=s.projectRoot||process.cwd(),c=(await a(i)).serverApi,p=s.minify??!1,o=s.externalizeUserModules??!0,w=s.expose?.length?[...new Set(s.expose)].sort():void 0,C=s.cacheDir||Xf(i),R=H.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${vt}\x00${gt()}\x00${JSON.stringify(c??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${p?"minified":"readable"}\x00${R?.key??""}\x00${rt(e,i)}\x00${rt(n,i)}`);let f=S.digest("hex").slice(0,12),v=d.join(C,`${f}.js`),b=V.get(v);if(b){if(Qs(b.files)&&b.files.every((x)=>!G(x.path,i,c))){T("memo hit:",f);let x=b.files.map((D)=>D.path);return Y(n,x),s.collectInputs?.push(...x),b.code}V.delete(v),T("memo invalidated by dep change:",f)}let B=d.join(C,`${f}.deps.json`),r=Bun.file(v);if(await r.exists()){let x=Bun.file(B),D=!1,N=null;if(await x.exists())try{let O=JSON.parse(await x.text());if(O.metadataVersion===ct&&Array.isArray(O.files)&&Et(O.files,i))N=Or(O.files.map((g)=>ut(g,i))),D=N.length===O.files.length&&!N.some((g)=>G(g.path,i,c))}catch{D=!1}if(D){if(T("cache hit:",f),N)Y(n,N.map((L)=>L.path)),s.collectInputs?.push(...N.map((L)=>L.path));let O=await r.text(),g=new Date;if(E.promises.utimes(v,g,g).catch(()=>{}),N)V.set(v,{code:O,files:N});return O}T("cache invalidated by dep change:",f)}let u=Q.get(f);if(u){let x=await u;if(s.collectInputs)s.collectInputs.push(...(V.get(v)?.files??[]).map((D)=>D.path));return x}Tc(n);let _=rg(()=>Ft(e,n,{projectRoot:i,minify:p,cacheDir:C,hash:f,cachePath:v,depsPath:B,collectInputs:s.collectInputs,externalizeUserModules:o,serverApi:c,expose:w,throwOnFailure:s.throwOnFailure,substitutes:R?.modules}));Q.set(f,_);try{return await _}finally{Q.delete(f)}}function $c(e){return`${e}-${process.pid}-${St()}`}async function ty(e,n){let{projectRoot:s}=n,i=$c(new Bun.CryptoHasher("md5").update([...e.keys()].join("\x00")).digest("hex").slice(0,12)),c=d.join(l(s,"bundle-tmp"),"out",i);E.mkdirSync(c,{recursive:!0});let p=new Map,o=new Map,w=0;for(let[f,v]of e){let b=d.join(s,`.stx-split-${i}-${w++}.ts`);p.set(b,v),o.set(d.basename(b).replace(/\.ts$/,""),f)}let[C,R]=[...p][0],S=new Set;Tc(n.filePath);try{let f=await Bun.build({entrypoints:[...p.keys()],outdir:c,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ft(s,d.dirname(n.filePath),C,R,S,!1,new Map,void 0,H.getStore()?.modules,p)],define:{"process.env.NODE_ENV":'"development"',...A()},root:s});if(!f.success)throw Error(f.logs.filter((b)=>b.level==="error").map((b)=>b.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let b of f.outputs){let B=d.basename(b.path);if(b.kind==="entry-point"){let r=o.get(B.replace(/\.js$/,""));if(r!==void 0)v.entries.set(r,await b.text())}else if(b.kind==="chunk")v.chunks.set(B.replace(/\.js$/,""),await b.text())}return n.collectInputs?.push(...S),v}finally{try{E.rmSync(c,{recursive:!0,force:!0})}catch{}}}async function Ft(e,n,s){let{projectRoot:i,minify:c,cacheDir:p,hash:o,cachePath:w,depsPath:C,externalizeUserModules:R}=s,S=l(i,"bundle-tmp"),f=$c(o),v=d.join(i,`.stx-client-${f}.ts`),b=d.join(S,"out",f);E.mkdirSync(b,{recursive:!0});let B=d.dirname(n),r=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,_=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,x=t(e),{depths:D,balanced:N}=h(x),O=(F)=>!N||D[F]===0,g;while((g=u.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((F)=>{let m=It(F);if(m)r.add(m)});else if(g[3])r.add(g[3])}while((g=_.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;r.add(g[2])}let L=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=L.exec(x))!==null){if(!O(g.index))continue;let F=/^\s*['"]([^'"]+)['"]/.exec(e.slice(g.index+g[0].length))?.[1];if(F&&tt.some((m)=>m.test(F)))continue;if(g[1])r.add(g[1]);if(g[2])r.add(g[2]);for(let m of(g[3]??"").split(",")){let M=m.trim();if(!M||/^type\s/.test(M))continue;let P=/\bas\s+(\w+)\s*$/.exec(M)?.[1]??/^\w+$/.exec(M)?.[0];if(P)r.add(P)}}for(let F of x.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of F[1].split(",")){let M=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(M)r.delete(M)}let mt=r.size>0?`
|
|
2
|
+
import{mr,ze}from"./chunk-115bb91s.js";import{X,k,Or,Qs,A}from"./chunk-knhf7dkn.js";import{a,j}from"./chunk-g71ppt0e.js";import{ei}from"./chunk-avn3panj.js";import{Z}from"./chunk-n6q1d66k.js";import{gt}from"./chunk-zkwkhesc.js";import{l}from"./chunk-zxjdfgdx.js";import{t,h}from"./chunk-neg6ckjg.js";import d from"path";import E from"fs";import{AsyncLocalStorage as lt}from"async_hooks";import{randomUUID as St}from"crypto";var vt=12;function G(e,n,s){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(e))||ei(e,n,s)}var ct=2;function Xf(e){let n=process.env.STX_BUNDLE_CACHE_DIR?.trim();return n?d.resolve(n):l(e,"bundle-cache")}function rt(e,n){let s=e;for(let i of Bt(n))if(i!==d.sep)s=s.split(i).join("\x00root");return s}var it=new Map;function Bt(e){let n=d.resolve(e),s=it.get(n);if(!s){let i=n;try{i=E.realpathSync(n)}catch{}s=[...new Set([n,i])].sort((c,p)=>p.length-c.length),it.set(n,s)}return s}function jt(e,n){try{let s=E.statSync(e),i=d.resolve(n),c=e.startsWith(`${i}${d.sep}`);return{path:c?d.relative(i,e):e,...c?{inRoot:!0}:{},mtimeMs:s.mtimeMs,size:s.size,hash:Bun.hash(E.readFileSync(e)).toString(36)}}catch{return null}}function ut(e,n){return e.inRoot?d.join(d.resolve(n),e.path):e.path}function Et(e,n){for(let s of e){let i=ut(s,n);try{let c=E.statSync(i);if(c.size!==s.size)return!1;if(c.mtimeMs!==s.mtimeMs&&Bun.hash(E.readFileSync(i)).toString(36)!==s.hash)return!1}catch{return!1}}return!0}var dt=new Map,_t=100;function Jf(e=process.env){let n=Number(e.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(n)&&n>=1?Math.floor(n):2000}var q=new Map;async function Mt(e){let n=q.get(e)??0;if(n>0&&n<_t){q.set(e,n+1);return}q.set(e,1);try{let s=(await E.promises.readdir(e)).filter((o)=>o.endsWith(".js")),i=Jf();if(s.length<=i)return;let p=(await Promise.all(s.map(async(o)=>{try{return{name:o,at:(await E.promises.stat(d.join(e,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);p.sort((o,w)=>w.at-o.at);for(let o of p.slice(i)){let w=o.name.slice(0,-3);await E.promises.rm(d.join(e,`${w}.js`),{force:!0}),await E.promises.rm(d.join(e,`${w}.deps.json`),{force:!0})}T("pruned bundle cache to",i,"entries")}catch{}}function Te(e){return dt.get(e)??[]}function Y(e,n){if(e)dt.set(e,n)}function Yf(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function T(...e){if(Yf())console.log("[stx:bundler]",...e)}var et=[];function Cc(e,n,s){et.push({filePath:e||"<inline>",message:n,details:s})}function mn(){return et.slice()}function hn(){et.length=0}var K;function ey(e){K=e}function Ec(){if(K)return K;try{let e=j.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var tt=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function yn(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,s;while((s=n.exec(e))!==null){let c=s[1];if(!tt.some((o)=>o.test(c)))return T("detected user import:",c),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((s=i.exec(e))!==null){let c=s[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!tt.some((o)=>o.test(c)))return T("detected side-effect import:",c),!0}return!1}var gr="stx-module:",Rt=/\.(?:[cm]?[jt]sx?|json)$/i;function Zf(e,n){return d.relative(e,n).split(d.sep).join("/")}function Qf(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(s,i,c,p)=>{let o=n.get(p);return o&&!p.startsWith(gr)?`${i}${c}${o}${c}`:s})}function eg(e,n){let s=0,i=(p)=>{let o=`__stxMod${s++}`,w=JSON.stringify(p);return n.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},c=(p,o)=>{for(let w of p.split(",")){let C=w.trim();if(!C)continue;let R=C.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!R)continue;let S=R[1].startsWith('"')?JSON.parse(R[1]):R[1],f=R[2]??S;n.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o,w)=>{let C=w.slice(gr.length),R=i(C),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))n.push(`var ${f[1]} = ${R}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)n.push(`var ${v[1]} = ${R};`);else if(S.startsWith("{"))c(S.replace(/^\{|\}$/g,""),R);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o)=>(i(o.slice(gr.length)),"")),e}function ot(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,d.join(e,"index.ts"),d.join(e,"index.tsx"),d.join(e,"index.js"),d.join(e,"index.mjs")];for(let s of n)try{if(E.existsSync(s)&&E.statSync(s,{throwIfNoEntry:!1})?.isFile())return s}catch{}return}var H=new lt;function Ss(e,n){let s=new Bun.CryptoHasher("md5");for(let[i,c]of[...e].sort(([p],[o])=>p<o?-1:p>o?1:0))s.update(`${i}\x00${c}\x00`);return H.run({modules:e,key:s.digest("hex").slice(0,12)},n)}var pt=new lt;function tg(e){return pt.run(!0,e)}function ng(){return pt.getStore()===!0}function Tc(e){if(!ng())return;throw Error(`The client script of ${e} needs bundling, and it is being rendered inside a Bun.build loader, where Bun never finishes a second build. Make the page an entrypoint of the build (bun-plugin-stx renders entrypoints before the bundler starts), or render it once outside the build so its bundle is cached.`)}function bn(){return H.getStore()?.key??""}function ft(e,n,s,i,c,p,o=new Map,w,C,R){let S=new Map([[s,i],...R??[]]),f=(B)=>B!==void 0&&S.has(B),v=(B,r,u)=>{if(G(r,e,w))return null;if(!p||!f(B)||!Rt.test(r))return null;try{if(!E.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(r);let _=`${gr}${Zf(process.cwd(),r)}`;return o.set(u,_),{path:_,external:!0}},b=(B,r)=>{let u=f(B)?n:d.dirname(B),_=d.resolve(u,r);return ot(_)??_};return{name:"stx-client-bundle",setup(B){if(B.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^\//},(r)=>{if(f(r.path))return{path:r.path};let u=ot(r.path);if(u){let _=v(r.importer,u,r.path);if(_)return _;if(!f(u))c.add(u);return{path:u}}return{path:r.path,external:!0}}),B.onResolve({filter:/^\.\.?\//},(r)=>{let u=b(r.importer,r.path),_=v(r.importer,u,r.path);if(_)return _;return c.add(u),{path:u}}),B.onResolve({filter:/^[@~]\//},(r)=>{let u=d.resolve(e,r.path.slice(2)),_=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,d.join(u,"index.ts"),d.join(u,"index.tsx"),d.join(u,"index.js"),d.join(u,"index.mjs")];for(let x of _)if(E.existsSync(x)&&E.statSync(x,{throwIfNoEntry:!1})?.isFile()){let D=v(r.importer,x,r.path);if(D)return D;return T(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",x),c.add(x),{path:x}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:u}}),p)B.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(!f(r.importer))return;let u=`${gr}npm:${r.path}`;return o.set(r.path,u),{path:u,external:!0}});B.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(S.has(r.path))return{contents:S.get(r.path),loader:"ts"};if(G(r.path,e,w))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let u=d.extname(r.path).toLowerCase(),_=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(r.path))c.add(r.path);let x=C?.get(r.path);if(x!==void 0)return{contents:x,loader:"js"};return{contents:E.readFileSync(r.path,"utf8"),loader:_}})}}}var Q=new Map,V=k(64),at=Symbol.for("stx.client-bundle-build-queue");function rg(e){let n=globalThis,i=(n[at]??Promise.resolve()).then(e,e);return n[at]=i.then(()=>{return},()=>{return}),i}async function wn(e,n,s={}){let i=s.projectRoot||process.cwd(),c=(await a(i)).serverApi,p=s.minify??!1,o=s.externalizeUserModules??!0,w=s.expose?.length?[...new Set(s.expose)].sort():void 0,C=s.cacheDir||Xf(i),R=H.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${vt}\x00${gt()}\x00${JSON.stringify(c??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${p?"minified":"readable"}\x00${R?.key??""}\x00${rt(e,i)}\x00${rt(n,i)}`);let f=S.digest("hex").slice(0,12),v=d.join(C,`${f}.js`),b=V.get(v);if(b){if(Qs(b.files)&&b.files.every((x)=>!G(x.path,i,c))){T("memo hit:",f);let x=b.files.map((D)=>D.path);return Y(n,x),s.collectInputs?.push(...x),b.code}V.delete(v),T("memo invalidated by dep change:",f)}let B=d.join(C,`${f}.deps.json`),r=Bun.file(v);if(await r.exists()){let x=Bun.file(B),D=!1,N=null;if(await x.exists())try{let O=JSON.parse(await x.text());if(O.metadataVersion===ct&&Array.isArray(O.files)&&Et(O.files,i))N=Or(O.files.map((g)=>ut(g,i))),D=N.length===O.files.length&&!N.some((g)=>G(g.path,i,c))}catch{D=!1}if(D){if(T("cache hit:",f),N)Y(n,N.map((L)=>L.path)),s.collectInputs?.push(...N.map((L)=>L.path));let O=await r.text(),g=new Date;if(E.promises.utimes(v,g,g).catch(()=>{}),N)V.set(v,{code:O,files:N});return O}T("cache invalidated by dep change:",f)}let u=Q.get(f);if(u){let x=await u;if(s.collectInputs)s.collectInputs.push(...(V.get(v)?.files??[]).map((D)=>D.path));return x}Tc(n);let _=rg(()=>Ft(e,n,{projectRoot:i,minify:p,cacheDir:C,hash:f,cachePath:v,depsPath:B,collectInputs:s.collectInputs,externalizeUserModules:o,serverApi:c,expose:w,throwOnFailure:s.throwOnFailure,substitutes:R?.modules}));Q.set(f,_);try{return await _}finally{Q.delete(f)}}function $c(e){return`${e}-${process.pid}-${St()}`}async function ty(e,n){let{projectRoot:s}=n,i=$c(new Bun.CryptoHasher("md5").update([...e.keys()].join("\x00")).digest("hex").slice(0,12)),c=d.join(l(s,"bundle-tmp"),"out",i);E.mkdirSync(c,{recursive:!0});let p=new Map,o=new Map,w=0;for(let[f,v]of e){let b=d.join(s,`.stx-split-${i}-${w++}.ts`);p.set(b,v),o.set(d.basename(b).replace(/\.ts$/,""),f)}let[C,R]=[...p][0],S=new Set;Tc(n.filePath);try{let f=await Bun.build({entrypoints:[...p.keys()],outdir:c,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ft(s,d.dirname(n.filePath),C,R,S,!1,new Map,void 0,H.getStore()?.modules,p)],define:{"process.env.NODE_ENV":'"development"',...A()},root:s});if(!f.success)throw Error(f.logs.filter((b)=>b.level==="error").map((b)=>b.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let b of f.outputs){let B=d.basename(b.path);if(b.kind==="entry-point"){let r=o.get(B.replace(/\.js$/,""));if(r!==void 0)v.entries.set(r,await b.text())}else if(b.kind==="chunk")v.chunks.set(B.replace(/\.js$/,""),await b.text())}return n.collectInputs?.push(...S),v}finally{try{E.rmSync(c,{recursive:!0,force:!0})}catch{}}}async function Ft(e,n,s){let{projectRoot:i,minify:c,cacheDir:p,hash:o,cachePath:w,depsPath:C,externalizeUserModules:R}=s,S=l(i,"bundle-tmp"),f=$c(o),v=d.join(i,`.stx-client-${f}.ts`),b=d.join(S,"out",f);E.mkdirSync(b,{recursive:!0});let B=d.dirname(n),r=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,_=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,x=t(e),{depths:D,balanced:N}=h(x),O=(F)=>!N||D[F]===0,g;while((g=u.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((F)=>{let m=It(F);if(m)r.add(m)});else if(g[3])r.add(g[3])}while((g=_.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;r.add(g[2])}let L=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=L.exec(x))!==null){if(!O(g.index))continue;let F=/^\s*['"]([^'"]+)['"]/.exec(e.slice(g.index+g[0].length))?.[1];if(F&&tt.some((m)=>m.test(F)))continue;if(g[1])r.add(g[1]);if(g[2])r.add(g[2]);for(let m of(g[3]??"").split(",")){let M=m.trim();if(!M||/^type\s/.test(M))continue;let P=/\bas\s+(\w+)\s*$/.exec(M)?.[1]??/^\w+$/.exec(M)?.[0];if(P)r.add(P)}}for(let F of x.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of F[1].split(",")){let M=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(M)r.delete(M)}let mt=r.size>0?`
|
|
3
3
|
export { ${[...r].join(", ")} }`:"";T("bundling:",o,"from:",d.basename(n));let nt=new Set,st=new Map;try{let F=await Bun.build({entrypoints:[v],outdir:b,target:"browser",format:"esm",minify:c?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ft(i,B,v,e+mt,nt,R,st,s.serverApi,s.substitutes)],define:{"process.env.NODE_ENV":c?'"production"':'"development"',...A()},root:i});if(!F.success){let I=F.logs.filter((U)=>U.level==="error").map((U)=>U.message).join(", ")||`Unable to bundle ${d.basename(n)}`,z=mr(F.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",I),Cc(n||"",I,z),s.throwOnFailure||Ec()==="error")throw Error(I);return e}let m="";for(let y of F.outputs){m=await y.text();break}let M=[];for(let y of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let I of y[1].split(",")){let z=I.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){M.push([z[2],z[1]]);continue}let U=I.trim();if(/^[A-Za-z_$][\w$]*$/.test(U))M.push([U,U])}if(s.expose){let y=new Set(s.expose);for(let I=M.length-1;I>=0;I--)if(!y.has(M[I][0]))M.splice(I,1)}let P=[];m=eg(Qf(m,st),P);let ht=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),c&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let xt=Z(m),W=`__stxBundle_${o}`,yt=new Set(X(e,!0).split(",").map((y)=>y.trim())),$t=M.map(([y,I])=>`get ${JSON.stringify(y)}() { return ${I} }${yt.has(y)?`, set ${JSON.stringify(y)}(__stxValue_${I}) { ${I} = __stxValue_${I} }`:""}`).join(", "),bt=M.map(([y])=>`var ${y} = undefined;`).join(`
|
|
4
4
|
`),wt=M.map(([y])=>`${y} = ${W}[${JSON.stringify(y)}];`).join(`
|
|
5
5
|
`);if(m=`${ht.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{si,oi,ii,cy,Ts,ly}from"./chunk-
|
|
2
|
+
import{si,oi,ii,cy,Ts,ly}from"./chunk-s5xfmr87.js";export{Ts as clearImageDeliveryCatalog,cy as deliveredImage,ii as efficientDeliverySources,si as getImageDelivery,oi as isTransparentImage,ly as prepareImageDelivery};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{B,ul,oo,Rn,y,Ke,Ge}from"./chunk-
|
|
2
|
+
import{B,ul,oo,Rn,y,Ke,Ge}from"./chunk-knhf7dkn.js";import{Er,dt,q}from"./chunk-g71ppt0e.js";import{hr,i}from"./chunk-p1wqyf10.js";import{Ae}from"./chunk-t6sdtsf8.js";import{oa}from"./chunk-hxws025y.js";function h(s){return s.endsWith(".md")||s.endsWith(".markdown")}function C(s){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(n,p){let g;while((g=n.exec(s))!==null){let t=g.index,o=t+g[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function b(s,e={}){let{data:r,content:m}=Er(s),a=await(e.renderer??((n)=>dt(n)))(m);return{html:C(a),frontmatter:r??{}}}import{dirname as k,resolve as R}from"path";function v(s){let e=s,r=B(s);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),g;while((g=m.exec(s))!==null){let o=g[1],l=g[2],d=g[0],u=o.includes("server");if(p(l))n.push(d);else if(u)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let u=l.index+l[0].length,f=t.indexOf("</script>",u);if(f===-1)continue;d.push({start:l.index,end:f+9}),o.lastIndex=f+9}for(let u=d.length-1;u>=0;u--)t=t.substring(0,d[u].start)+t.substring(d[u].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function M(s,e){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -12,5 +12,5 @@ ${s}
|
|
|
12
12
|
</html>`}async function vc(s,e={}){let r=R(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(h(r)){let n=await b(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=R(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:g,injectCSS:t,...o}=e,l={...e.context||{}};Rn(l);let d=await w(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),u=await p.text(),f={...l,content:d},x={...o,context:f,injectCSS:t};return w(u,n,x)}return w(c,r,e)}async function w(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=v(s),n={...q,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...oo(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await y(o,p,e);let g=new Set,t=m;if(t=await i(t,p,e,n,g),ul(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
|
|
13
13
|
${a.join(`
|
|
14
14
|
`)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=Ke(p),d=await Promise.all(a.map(async(x)=>{let _=x.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(_))return x;let S=x.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!S)return x;return await Ge(S[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),f=[await hr(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
|
|
15
|
-
`);t=oa(t,f)}t=await Ae(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-
|
|
15
|
+
`);t=oa(t,f)}t=await Ae(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-hn679t1s.js");t=await o(t)}catch{}return t}
|
|
16
16
|
export{vc};
|
|
@@ -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 xe(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 sr(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{xe,sr,
|
|
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 xe(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 sr(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 Vh(e,n=Object.is){return sr(e,{equals:n})}function or(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 zo(e){C(e)}function ps(e){k.push(e)}function gs(e){T.push(e)}function Uh(){O(k,"onMount",T)}function Wh(){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 qh(){return{mount:k.length,destroy:T.length}}function ir(e){return typeof e==="function"&&e._isSignal===!0}function ar(e){return typeof e==="function"&&e._isDerived===!0}function Ho(e){if(ir(e)||ar(e))return m(()=>e());return e}function ms(e){return m(e)}function Kh(e,n){let r=typeof e==="function"?e:()=>e,i=xe([]),o=sr(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return or(()=>{if(r(),!t){t=!0;return}if(ms(()=>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{xe,sr,Vh,or,zo,ps,gs,Uh,Wh,qh,ir,ar,Ho,ms,Kh};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ys,bs}from"./chunk-
|
|
2
|
+
import{ys,bs}from"./chunk-whcrca58.js";import{x}from"./chunk-knhf7dkn.js";import{a}from"./chunk-g71ppt0e.js";import{ot,fe}from"./chunk-pvm48tse.js";import{vc}from"./chunk-19v28wj2.js";import{W}from"./chunk-a7bqrjm5.js";import{w}from"./chunk-v6gkjg5f.js";import{f}from"./chunk-hxws025y.js";import{existsSync as z,mkdirSync as C,copyFileSync as I,chmodSync as B,rmSync as xe}from"fs";import{join as c,basename as ye,resolve as K}from"path";import{spawn as _}from"child_process";import{platform as Se}from"os";function O(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=x(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var Hu=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -470,7 +470,7 @@ else if (data.type === 'event' && data.method) {
|
|
|
470
470
|
</script>
|
|
471
471
|
`;function qa(e={}){let{debug:r=!1,timeout:i=30000}=e;return Hu.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${i}`)}function Xh(){return!1}function Jh(e,r={}){let i=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(i,(n,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return qa(t)})}function Ka(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let i=qa(r),n=O(e,"head",`${i}
|
|
472
472
|
`);if(n!==null)return n;let s=W(e);if(s){let t=s.index+s.tag.length;return e.slice(0,t)+`
|
|
473
|
-
${i}`+e.slice(t)}return i+e}var
|
|
473
|
+
${i}`+e.slice(t)}return i+e}var Uo={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,r)=>{let i=e.checked?"checked":"",n=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
|
|
474
474
|
<input type="checkbox" class="craft-checkbox" ${i} ${n}>
|
|
475
475
|
<span class="craft-checkbox-label">${r||e.label||""}</span>
|
|
476
476
|
</label>`}},radio:{nativeType:"craft-radio",fallbackTag:"input",fallbackClasses:"craft-radio",nativeProps:["checked","disabled","name","value","label"]},select:{nativeType:"craft-select",fallbackTag:"select",fallbackClasses:"craft-select",nativeProps:["value","disabled","options","placeholder"]},slider:{nativeType:"craft-slider",fallbackTag:"input",fallbackClasses:"craft-slider",nativeProps:["value","min","max","step","disabled"],render:(e,r)=>{let i=e.min??0,n=e.max??100,s=e.step??1,t=e.value??50,o=e.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${i}" max="${n}" step="${s}" value="${t}" ${o}>`}},label:{nativeType:"craft-label",fallbackTag:"span",fallbackClasses:"craft-label",nativeProps:["text","for"]},badge:{nativeType:"craft-badge",fallbackTag:"span",fallbackClasses:"craft-badge",nativeProps:["variant","size"]},avatar:{nativeType:"craft-avatar",fallbackTag:"div",fallbackClasses:"craft-avatar",nativeProps:["src","alt","size","fallback"],render:(e,r)=>{let i=e.size||40,n=e.src,s=String(e.alt||""),t=e.fallback||(s?s.charAt(0).toUpperCase():"?");if(n)return`<img class="craft-avatar" src="${n}" alt="${s}" style="width:${i}px;height:${i}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${i}px;height:${i}px;border-radius:50%;display:flex;align-items:center;justify-content:center">${t}</div>`}},progress:{nativeType:"craft-progress",fallbackTag:"div",fallbackClasses:"craft-progress",nativeProps:["value","max","variant"],render:(e,r)=>{let i=Number(e.value)||0,n=Number(e.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,i/n*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(e,r)=>{let i=e.size||24;return`<div class="craft-spinner" style="width:${i}px;height:${i}px"></div>`}},card:{nativeType:"craft-card",fallbackTag:"div",fallbackClasses:"craft-card",nativeProps:["title","subtitle","variant"]},modal:{nativeType:"craft-modal",fallbackTag:"dialog",fallbackClasses:"craft-modal",nativeProps:["open","title","closable","size"],render:(e,r)=>{let i=e.open?"open":"",n=e.title||"";return`<dialog class="craft-modal" ${i}>
|
|
@@ -1008,7 +1008,7 @@ ${i}`+e.slice(t)}return i+e}var Vo={button:{nativeType:"craft-button",fallbackTa
|
|
|
1008
1008
|
</script>
|
|
1009
1009
|
`;function Xa(e,r={}){let{classPrefix:i="craft"}=r;if(!e.includes("craft-component-styles"))e=O(e,"head",`${hs}
|
|
1010
1010
|
`)??hs+e;if(!e.includes("craft-component-runtime"))e=O(e,"body",`${Ga}
|
|
1011
|
-
`)??e+Ga;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(n,s,t)=>N("sidebar",s,t.trim(),r,i)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(n,s)=>N("sidebar",s,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(n,s,t)=>N(s,t,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(n,s,t,o)=>N(s,t,o.trim(),r,i)),e}function N(e,r,i,n,s){let t=n.components?.[e]||
|
|
1011
|
+
`)??e+Ga;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(n,s,t)=>N("sidebar",s,t.trim(),r,i)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(n,s)=>N("sidebar",s,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(n,s,t)=>N(s,t,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(n,s,t,o)=>N(s,t,o.trim(),r,i)),e}function N(e,r,i,n,s){let t=n.components?.[e]||Uo[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${i}</div>`;let o=F(r),d=[t.fallbackClasses||`${s}-${e}`];if(o.class)d.push(o.class),delete o.class;if(t.render)return o.__fallbackClasses=d.join(" "),t.render(o,i);let p=be(o,t,d);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${p}>`;return`<${t.fallbackTag} ${p}>${i}</${t.fallbackTag}>`}function F(e){let r={},i=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,n;while((n=i.exec(e))!==null){let[s,t,o,d]=n,p=o??d;if(s.startsWith(":"))r[t]=p;else if(s.startsWith("@"))r[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=p;else if(p===void 0)r[t]=!0;else r[t]=p}return r}function re(e,r){let i=R(String(e.id||`craft-sidebar-${pe(r||JSON.stringify(e))}`)),n=ce(e.spaces)||oe(r),s=n.length?[]:le(e.sections)||j(r),t=String(e.selectedSpace||n[0]?.id||""),o=n.find((y)=>y.id===t)||n[0],d=String(e.selectedItem||e.selected||(n.length?o?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),p={id:i,variant:String(e.variant||"desktop"),material:String(e.material||"sidebar"),backgroundEffect:String(e.backgroundEffect||"shimmer"),allowsVibrancy:e.allowsVibrancy!==!1&&e.allowsVibrancy!=="false",materialOpacity:Number(e.materialOpacity??0.68),materialDarkOpacity:e.materialDarkOpacity===void 0?void 0:Number(e.materialDarkOpacity),minWidth:e.minWidth===void 0?240:Number(e.minWidth),maxWidth:e.maxWidth===void 0?340:Number(e.maxWidth),canCollapse:e.canCollapse!==!1&&e.canCollapse!=="false",searchPlaceholder:e.searchPlaceholder?String(e.searchPlaceholder):void 0,selectedItem:d,sections:s,spaces:n,selectedSpace:t||void 0},u=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),l=Number(e.width||e.sidebarWidth||286),b=e.native===!1||e.native==="false"?"false":"true",g=p.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${P(p.searchPlaceholder)}"></div>`:"",m;if(n.length)m=de(n,t,d);else if(s.length)m=s.map((y)=>L(y,d)).join("");else m=r;return`<aside class="${S(u)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${S(i)}" data-native="${b}" style="--craft-sidebar-width:${l}px">
|
|
1012
1012
|
${g}
|
|
1013
1013
|
${m}
|
|
1014
1014
|
</aside>
|
|
@@ -1029,7 +1029,7 @@ ${i}`+e.slice(t)}return i+e}var Vo={button:{nativeType:"craft-button",fallbackTa
|
|
|
1029
1029
|
${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${S(e.icon)}"${i}></span>`:""}
|
|
1030
1030
|
<span class="craft-sidebar-item-label">${P(e.label)}</span>
|
|
1031
1031
|
${e.badge?`<span class="craft-sidebar-item-badge">${P(e.badge)}</span>`:""}
|
|
1032
|
-
</button>`}function R(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function pe(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function P(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(e){return P(e).replace(/`/g,"`")}function ue(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function be(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,""");n.push(`${s}="${o}"`)}return n.join(" ")}function Yh(e,r){
|
|
1032
|
+
</button>`}function R(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function pe(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function P(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(e){return P(e).replace(/`/g,"`")}function ue(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function be(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,""");n.push(`${s}="${o}"`)}return n.join(" ")}function Yh(e,r){Uo[e]=r}function Zh(){return{...Uo}}import{chmodSync as ge,copyFileSync as me,mkdtempSync as V,rmSync as we,writeFileSync as J}from"fs";import{tmpdir as Q}from"os";import{join as D}from"path";function he(e){let r=Bun.spawnSync(["/usr/bin/plutil","-extract","Entitlements","xml1","-o","-","-"],{stdin:e});if(r.exitCode!==0)throw Error(`Could not extract the macOS profile entitlements: ${r.stderr.toString().trim()||r.stdout.toString().trim()}`);let i=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-","-"],{stdin:r.stdout});if(i.exitCode!==0)throw Error(`Could not convert the macOS profile entitlements: ${i.stderr.toString().trim()||i.stdout.toString().trim()}`);let n=JSON.parse(i.stdout.toString());if(!n||typeof n!=="object"||Array.isArray(n))throw Error("The macOS profile entitlements must be a dictionary.");return n}function ve(e,r){let i=D(r,"Contents","embedded.provisionprofile");me(e,i),ge(i,420)}async function Y(e,r=[],i={}){if(process.platform!=="darwin")return;let n=i.entitlements,s;try{if(i.provisioningProfile){if(!i.identity||i.identity==="-")throw Error("A provisioning profile requires a signing identity.");let u=Bun.spawnSync(["/usr/bin/security","cms","-D","-i",i.provisioningProfile]);if(u.exitCode!==0)throw Error("Could not decode the macOS provisioning profile.");let l=he(u.stdout),b={};if(i.entitlements){let g=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",i.entitlements]);if(g.exitCode!==0)throw Error("Could not read the app entitlements plist.");b=JSON.parse(g.stdout.toString())}for(let g of["com.apple.application-identifier","com.apple.developer.team-identifier"])if(l[g])b[g]=l[g];if(s=V(D(Q(),"stx-entitlements-")),n=D(s,"entitlements.plist"),J(n,JSON.stringify(b)),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",n]).exitCode!==0)throw Error("Could not generate the provisioned app entitlements.");ve(i.provisioningProfile,e)}let t;if(r.length){let u=!1;if(n){let l=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",n]);if(l.exitCode!==0)throw Error("Could not read native parent entitlements.");u=JSON.parse(l.stdout.toString())["com.apple.security.app-sandbox"]===!0}if(s??=V(D(Q(),"stx-entitlements-")),t=D(s,"helper.entitlements.plist"),J(t,JSON.stringify({"com.apple.security.cs.allow-jit":!0,...u?{"com.apple.security.app-sandbox":!0,"com.apple.security.inherit":!0}:{}})),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",t]).exitCode!==0)throw Error("Could not generate native helper entitlements.")}for(let u of[...r,e]){let l=i.hardenedRuntime?["--options","runtime"]:[];if(u===e&&n)l.push("--entitlements",n);if(u!==e&&t)l.push("--entitlements",t);let b=i.identity&&i.identity!=="-"?"--timestamp":"--timestamp=none",g=Bun.spawn(["/usr/bin/codesign","--force","--sign",i.identity||"-",b,...l,u],{stdout:"pipe",stderr:"pipe"}),[m,y]=await Promise.all([new Response(g.stderr).text(),g.exited]);if(y!==0)throw Error(`Could not sign native bundle ${u}: ${m.trim()}`)}let o=Bun.spawn(["/usr/bin/codesign","--verify","--strict",e],{stdout:"pipe",stderr:"pipe"}),[d,p]=await Promise.all([new Response(o.stderr).text(),o.exited]);if(p!==0)throw Error(`Invalid native bundle signature: ${d.trim()}`)}finally{if(s)we(s,{recursive:!0,force:!0})}}var G=(e)=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function X(e){let r=new Set,i=(n,s,t)=>{if(typeof n==="string")return`${s}<string>${G(n)}</string>`;if(typeof n==="boolean")return`${s}<${n}/>`;if(typeof n==="number"){if(!Number.isFinite(n))throw TypeError(`Non-finite Info.plist number at ${t}`);let o=Number.isSafeInteger(n)?"integer":"real";return`${s}<${o}>${n}</${o}>`}if(n!==null&&typeof n==="object"){let o=Array.isArray(n);if(!o&&Object.getPrototypeOf(n)!==Object.prototype&&Object.getPrototypeOf(n)!==null)throw TypeError(`Unsupported Info.plist value at ${t}`);if(r.has(n))throw TypeError(`Cyclic Info.plist value at ${t}`);r.add(n);try{let d=o?"array":"dict",p=`${s} `,u=o?Array.from(n,(l,b)=>i(l,p,`${t}[${b}]`)):Object.entries(n).map(([l,b])=>`${p}<key>${G(l)}</key>
|
|
1033
1033
|
${i(b,p,`${t}.${l}`)}`);return u.length?`${s}<${d}>
|
|
1034
1034
|
${u.join(`
|
|
1035
1035
|
`)}
|
|
@@ -1097,4 +1097,4 @@ Terminal=false
|
|
|
1097
1097
|
Categories=Utility;
|
|
1098
1098
|
Icon=${i.toLowerCase()}
|
|
1099
1099
|
`;w("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),m);let y=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(w("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),y),n.icon&&z(n.icon))I(n.icon,c(o,`${i.toLowerCase()}.png`));let T=_("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});T.on("close",(v)=>{if(fe(t),v===0)B(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${v}. Install from https://appimage.github.io/appimagetool/`})}),T.on("error",(v)=>{fe(t),s({success:!1,error:`appimagetool not found: ${v.message}`})})}catch(o){fe(t),s({success:!1,error:o.message})}})}function Za(){return[q()]}function Qa(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var Ae={buildNative:Ja,getAvailableTargets:Za,getAvailableFormats:Qa,detectPlatform:q},Qh=Ae;
|
|
1100
|
-
export{Hu,qa,Xh,Jh,Ka,
|
|
1100
|
+
export{Hu,qa,Xh,Jh,Ka,Uo,hs,Ga,Xa,Yh,Zh,Ja,Ya,Za,Qa,Qh};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{la,ua,da,fm,pa,fa,gm,ga,ma,Ql,mm}from"./chunk-
|
|
2
|
+
import{la,ua,da,fm,pa,fa,gm,ga,ma,Ql,mm}from"./chunk-zf68afyh.js";export{la as VideoProcessorCache,Ql as analyzeVideo,fm as clearVideoCache,ma as generateDASHManifest,ga as generateHLSManifest,pa as generatePoster,gm as generateSpriteSheet,fa as generateThumbnails,ua as getCachedVideoResult,mm as processVideo,da as setCachedVideoResult};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Vu,Wo,cr,Uu,Wu,qu,Ku,Gu,Xu,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,md,hd,yd,bd,wd,vd,xd,Sd,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Id,Od,Nd,dn,ec,Md,Dd,Ld,tc,jd,Bd,Fd,zd,Hd,Vd,nc,Ud,Wd,qd,Kd,Gd,Xd,Jd,Yd,Zd,lr,Qd,ep,tp,np,rp,sp,op,ip,ap,cp,lp,up,qo,dp,pp,fp,gp,mp,ys,bs,hp,yp,bp,wp,vp,rc,xp,Sp,kp,sc,Ko,_p,Cp,oc,ic,ws,ac,Ep,pn,Tp,cc,lc,Go,$p,Xo,Rp,Ap,Pp,Ip,Op,Np,Mp,uc,Dp,Lp,dc,jp,Bp,Fp,zp,Hp,Vp,Up,Wp,qp,Kp,Gp,Xp,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,cf,pc,lf,uf,df,pf,ff,gf,mf,hf,yf,bf,wf,ur,fc,gc,vf,dr,xf,Sf,kf,mc,hc,vs,xs,_f,Jo,Cf,Ef,Tf,$f,Rf,Af,Pf,If,Of,Nf,Mf,Df,Lf,jf,Bf,Ff,zf,Hf,Vf,Uf,yc,Wf,qf,bc,wc,Kf,Gf}from"./chunk-whcrca58.js";export{Od as AVAILABLE_COMPONENTS,rc as AutoUpdater,Nd as COMPONENT_STYLES,vs as DEFAULT_WATCH_INTERVAL_MS,hc as MAX_WATCH_INTERVAL_MS,mc as MIN_WATCH_INTERVAL_MS,Vd as MODAL_STYLES,Zu as TOAST_STYLES,Jd as TRAY_MENU_STYLES,oc as UPDATE_MANIFEST_ASSET,Bd as alert,sf as appInfo,Af as appleScript,Gf as applicationDataDirectory,Rf as audio,qf as backgroundDelay,ef as battery,$f as biometric,bf as bluetooth,Mf as bonjour,pn as bundlePathForExecutable,$p as caffeinate,xp as canReplaceBundle,Sp as clearQuarantine,Wp as clipboard,Hd as closeAllModals,up as closeAllWindows,jd as confirm,cf as contextMenu,zf as continuityCamera,Ff as coreml,wp as craftBinaryNotFoundMessage,qo as craftWindowArguments,ur as crashReporter,xd as createAccordion,gd as createAutocomplete,od as createAvatar,sd as createBadge,Qu as createButton,id as createCard,$d as createChart,td as createCheckbox,yd as createChip,Rd as createCodeEditor,dd as createColorPicker,Td as createDataGrid,pd as createDatePicker,bs as createDiskImage,cd as createDropdown,Pd as createFileExplorer,Ep as createGitHubUpdateManifest,ac as createGitHubUpdater,hd as createImageView,zp as createInterval,md as createLabel,_d as createListView,Ad as createMediaPlayer,Ud as createMenubar,kd as createModalComponent,Kf as createNativeUpdateApi,wc as createPantrySelfUpdater,Op as createPreferences,rd as createProgressBar,ud as createRadioButton,ld as createRating,wd as createScrollView,Go as createSelfUpdater,nd as createSlider,vd as createSplitView,Sd as createStepper,nc as createSystemTray,Cd as createTable,ad as createTabs,ed as createTextInput,fd as createTimePicker,Fp as createTimer,bd as createTooltip,Ed as createTreeView,Id as createWebView,dp as createWindow,fp as createWindowWithHTML,Xo as decaffeinate,Qp as deepLinks,Hp as delay,Xu as dismissAlertById,Ju as dismissAllAlerts,Yp as dragOut,kp as extractBundle,Pf as fileAssociations,Jo as focus,Ef as focusShortcutsReady,Up as formatCompact,Ip as formatDuration,Pp as formatRemainingTime,Dp as formatShortcut,Vp as formatTime,Kp as fs,sc as generateUpdateManifest,Yu as getActiveAlertCount,zd as getActiveModalCount,Wd as getActiveTrayInstances,cp as getActiveWindowIds,Ap as getCaffeinateStatus,Uf as getCapabilities,yc as getCapability,ip as getDesktopConfig,sp as getDialogBridgeScript,Bp as getRegisteredHotkeys,Gd as getSimulatedTrayHTML,Xd as getTrayBridgeScript,qd as getTrayInstance,lp as getWindow,mp as getWindowBridgeScript,ic as githubLatestAssetUrl,ws as githubReleaseAssetUrl,Xp as globalShortcuts,dr as handoff,Cf as hasFocusShortcuts,vf as iap,Mp as isAutoLaunchEnabled,Wf as isAvailable,Rp as isCaffeinated,Zp as isDragOutAvailable,gp as isWebviewAvailable,df as keychain,xf as liveActivities,Tf as localServer,Sf as location,Nf as log,hp as macOSRuntimeExecutablePath,af as menu,Bf as midi,gf as nativeAutoLaunch,mf as nativeTray,hf as nativeWindow,tf as network,qp as notifications,Gu as notify,pp as openDevWindow,yp as pack,bp as packageApp,bc as parsePantryUpdateManifest,uc as parseShortcut,Of as pdf,pf as permissions,ff as printing,Fd as prompt,cc as quitLauncher,Ko as readBundleIdentity,fc as redactPII,Lp as registerHotkey,lc as relaunchBundle,Vu as requestNotificationPermission,ap as resetDesktopConfig,vp as resolveCraftBinary,ys as resolveCraftExecutablePath,Tp as runningBundleTeamId,uf as screen,kf as screenCapture,xs as screenSharing,Vf as serial,Hf as serviceMenu,Np as setAutoLaunch,op as setDesktopConfig,Gp as shell,Wo as showAlert,ep as showAlertDialog,Qd as showColorPicker,tp as showConfirmDialog,np as showErrorDialog,Dd as showErrorModal,Ku as showErrorToast,ec as showInfoModal,Uu as showInfoToast,lr as showMessageBox,dn as showModal,Yd as showOpenDialog,tc as showQuestionModal,Zd as showSaveDialog,Ld as showSuccessModal,Wu as showSuccessToast,cr as showToast,rp as showWarningDialog,Md as showWarningModal,qu as showWarningToast,pc as sidebar,gc as signPayload,wf as speech,Lf as speechRecognition,Df as spotlight,of as standardMenus,_p as swapBundle,lf as system,If as tags,Jp as theme,yf as touchbar,Kd as triggerTrayAction,jp as unregisterAllHotkeys,dc as unregisterHotkey,nf as updater,Cp as verifyBundleTrust,jf as vision,_f as watchScreenSharing,rf as windowEvents};
|