@stacksjs/stx 0.2.815 → 0.2.816
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-4rny8rf5.js → chunk-0h99mrb0.js} +3 -3
- package/dist/chunk-0j8qrqke.js +2 -0
- package/dist/chunk-0yjm4j26.js +2 -0
- package/dist/{chunk-kvz01wzc.js → chunk-17wb2x3z.js} +2 -2
- package/dist/{chunk-bmkm1c8s.js → chunk-1bgv727x.js} +37 -5
- package/dist/{chunk-z1edw8fc.js → chunk-24354nk5.js} +2 -2
- package/dist/{chunk-m8zbae89.js → chunk-2v7qvj69.js} +2 -2
- package/dist/{chunk-0dnzcrb1.js → chunk-314zqrv0.js} +1 -1
- package/dist/{chunk-w5xq1217.js → chunk-3jd5ak8h.js} +1 -1
- package/dist/chunk-45gv3akm.js +2 -0
- package/dist/{chunk-m8w7rcmt.js → chunk-4vxbcf4a.js} +2 -2
- package/dist/{chunk-et8n16k2.js → chunk-4ypwqrj2.js} +1 -1
- package/dist/chunk-5b6tsg13.js +2 -0
- package/dist/{chunk-cfbpvm5e.js → chunk-5efv1fhk.js} +2 -2
- package/dist/{chunk-5d8123c9.js → chunk-5wcgqr21.js} +7 -7
- package/dist/{chunk-k86573fe.js → chunk-6cw072n5.js} +1 -1
- package/dist/{chunk-3ht64v1a.js → chunk-7bfsvkvd.js} +6 -6
- package/dist/{chunk-hbq922er.js → chunk-7r5efkbz.js} +1 -1
- package/dist/{chunk-gebb12ak.js → chunk-7rk7wfm6.js} +6 -6
- package/dist/{chunk-vn5cd6av.js → chunk-8ca33v3s.js} +1 -1
- package/dist/{chunk-ewzdsksb.js → chunk-8g8h2xwz.js} +1 -1
- package/dist/{chunk-bejj0gra.js → chunk-8h3jv8dd.js} +1 -1
- package/dist/chunk-956zq9b7.js +2 -0
- package/dist/{chunk-t4j2rw91.js → chunk-981z8va1.js} +2 -2
- package/dist/{chunk-few3k1dz.js → chunk-9avsdbz5.js} +2 -2
- package/dist/{chunk-1cxf9chb.js → chunk-9d79afs9.js} +6 -6
- package/dist/{chunk-macvhhf0.js → chunk-9mnr9x0d.js} +2 -2
- package/dist/{chunk-qckgv0vz.js → chunk-9mtw71xy.js} +1 -1
- package/dist/{chunk-84qv8bxe.js → chunk-9t9qf38k.js} +20 -20
- package/dist/chunk-9yc4fw7e.js +2 -0
- package/dist/{chunk-x2hc3zth.js → chunk-a350jjd3.js} +1 -1
- package/dist/chunk-ar7w1kx0.js +2 -0
- package/dist/{chunk-kmr3cd71.js → chunk-atdn8n6b.js} +7 -7
- package/dist/{chunk-t6sddfv8.js → chunk-azg5e5ts.js} +5 -5
- package/dist/chunk-b7vfs0cq.js +2 -0
- package/dist/{chunk-pr6nrg6x.js → chunk-b9ntt41z.js} +1 -1
- package/dist/{chunk-h9cpa5jq.js → chunk-be2stv5x.js} +1 -1
- package/dist/{chunk-9k037sk6.js → chunk-bxtwbkc1.js} +1 -1
- package/dist/{chunk-mjjfx1yp.js → chunk-c6w39fdb.js} +4 -4
- package/dist/chunk-c8vhjxm9.js +2 -0
- package/dist/{chunk-eqrjfceb.js → chunk-d3d5s0va.js} +1 -1
- package/dist/{chunk-5h0p34jj.js → chunk-e2855m6w.js} +1 -1
- package/dist/{chunk-b12wg4jp.js → chunk-e58g2n9k.js} +1 -1
- package/dist/{chunk-1carv1dw.js → chunk-f54t0qar.js} +1 -1
- package/dist/{chunk-3qr7dz76.js → chunk-f8zs50z0.js} +1 -1
- package/dist/{chunk-q9ggx1jb.js → chunk-g74r0edp.js} +3 -3
- package/dist/chunk-geyvz4ae.js +2 -0
- package/dist/chunk-gqe0hnbb.js +2 -0
- package/dist/{chunk-gt0csenq.js → chunk-h5c786jf.js} +20 -20
- package/dist/{chunk-3z0e637x.js → chunk-jg9f5nqf.js} +5 -5
- package/dist/chunk-jham85mf.js +2 -0
- package/dist/{chunk-c4y1pcf6.js → chunk-jrjd02kf.js} +4 -4
- package/dist/{chunk-080zb2qx.js → chunk-k4xkbk2z.js} +1 -1
- package/dist/{chunk-8taa0exz.js → chunk-kq40yvdh.js} +1 -1
- package/dist/{chunk-dvbd5fxe.js → chunk-kvhsdyfg.js} +1 -1
- package/dist/{chunk-y7sf7aj0.js → chunk-m0x96g8e.js} +1 -1
- package/dist/{chunk-cbx7qght.js → chunk-mkr46mzz.js} +1 -1
- package/dist/{chunk-ycr9bkww.js → chunk-mmyrdbxx.js} +1 -1
- package/dist/{chunk-ybjfr7e8.js → chunk-n761hp6d.js} +2 -2
- package/dist/chunk-nctnc7tn.js +2 -0
- package/dist/{chunk-b0yvap9e.js → chunk-nkb214z1.js} +8 -8
- package/dist/{chunk-d2vr1169.js → chunk-nqcqench.js} +102 -101
- package/dist/chunk-nr58sedd.js +2 -0
- package/dist/{chunk-bfm5cedw.js → chunk-ntn6bnjv.js} +2 -2
- package/dist/{chunk-se251nhv.js → chunk-p0fp7p7x.js} +1 -1
- package/dist/chunk-p7tg362f.js +2 -0
- package/dist/{chunk-p9y5hh4m.js → chunk-pkjza0vv.js} +3 -3
- package/dist/{chunk-pda7fv19.js → chunk-ps3t15gp.js} +1 -1
- package/dist/{chunk-mmh2k7ab.js → chunk-pyytr30r.js} +5 -5
- package/dist/chunk-qffx1nqg.js +2 -0
- package/dist/chunk-qn6y53v0.js +2 -0
- package/dist/chunk-qyxr6kq1.js +20 -0
- package/dist/{chunk-c5fved0k.js → chunk-qz8bz1f2.js} +1 -1
- package/dist/chunk-r4kdwpbh.js +2 -0
- package/dist/{chunk-r1vkk7qp.js → chunk-r5nt1bcx.js} +1 -1
- package/dist/{chunk-3ec6jf9b.js → chunk-r6dtrd7y.js} +3 -3
- package/dist/chunk-sj4vw93g.js +2 -0
- package/dist/chunk-spgf7r7h.js +2 -0
- package/dist/chunk-sxhya0hd.js +2 -0
- package/dist/{chunk-vbc8a8fh.js → chunk-t2sg2tp2.js} +2 -2
- package/dist/chunk-tnjzhbkc.js +2 -0
- package/dist/{chunk-6em1xeax.js → chunk-tvc5n28s.js} +1 -1
- package/dist/chunk-veh49fc5.js +2 -0
- package/dist/chunk-vft84x6s.js +2 -0
- package/dist/{chunk-7qarrdq6.js → chunk-vn6jxchy.js} +1 -1
- package/dist/chunk-wbkca2se.js +2 -0
- package/dist/{chunk-rvb5gz33.js → chunk-wbzgtf5c.js} +1 -1
- package/dist/{chunk-0yf28g7v.js → chunk-wrygfmhf.js} +1 -1
- package/dist/{chunk-7cwb7pyf.js → chunk-x6fpj9hh.js} +1 -1
- package/dist/{chunk-6vbtvpn4.js → chunk-y4xcym3k.js} +2 -2
- package/dist/{chunk-gb3tv53p.js → chunk-yts2b9d8.js} +2 -2
- package/dist/{chunk-72pek719.js → chunk-z87g05z5.js} +1 -1
- package/dist/{chunk-tc15aznt.js → chunk-zcb34wfr.js} +1 -1
- package/dist/chunk-zjw5gm1n.js +2 -0
- package/dist/chunk-zkzp1ckd.js +3 -0
- package/dist/cli.js +12 -12
- package/dist/component-resolution.d.ts +33 -0
- package/dist/component-resolution.js +30 -0
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/media/client/upload-fetch.d.ts +6 -0
- package/dist/media/client/upload-fetch.js +62 -0
- package/dist/native/bridge/protocol.d.ts +2 -1
- package/dist/native/bridge/protocol.js +27 -4
- package/dist/native/runtime/craft-bridge.js +29 -7
- package/dist/pwa.js +1 -1
- package/dist/runtime-injection.js +2 -0
- package/dist/ssg.js +4 -4
- package/dist/stx-virtual-ts.d.ts +26 -5
- package/dist/stx-virtual-ts.js +67 -11
- package/dist/typecheck.js +6 -4
- package/dist/types/config-types.d.ts +1 -0
- package/dist/utils.js +6 -3
- package/package.json +5 -5
- package/dist/chunk-053yyx5n.js +0 -2
- package/dist/chunk-0x02gm7d.js +0 -2
- package/dist/chunk-0xv48z98.js +0 -3
- package/dist/chunk-0ywcbka3.js +0 -2
- package/dist/chunk-1ydz2w3t.js +0 -2
- package/dist/chunk-2gcvcpt8.js +0 -2
- package/dist/chunk-2yngdnq6.js +0 -2
- package/dist/chunk-6dcc4ezx.js +0 -2
- package/dist/chunk-74ck7kk1.js +0 -20
- package/dist/chunk-74dw9yf0.js +0 -2
- package/dist/chunk-7bxk9mjy.js +0 -2
- package/dist/chunk-81pykb48.js +0 -2
- package/dist/chunk-85w7kf2j.js +0 -2
- package/dist/chunk-89pes7at.js +0 -2
- package/dist/chunk-as5ej9s8.js +0 -2
- package/dist/chunk-cea665ds.js +0 -2
- package/dist/chunk-eg95a7q7.js +0 -2
- package/dist/chunk-km00bn5z.js +0 -2
- package/dist/chunk-qfc662nf.js +0 -2
- package/dist/chunk-qxr4teqr.js +0 -2
- package/dist/chunk-rdsrc8wv.js +0 -2
- package/dist/chunk-rpw3f34s.js +0 -2
- package/dist/chunk-s7db9xc4.js +0 -2
- package/dist/chunk-tdcgskyy.js +0 -2
- package/dist/chunk-vhe6p6b0.js +0 -2
- package/dist/chunk-xd5n2qx4.js +0 -2
- package/dist/chunk-yacdg7kq.js +0 -2
- package/dist/chunk-z5b863fw.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{u,f,tl,d,t,l}from"./chunk-gebb12ak.js";import{Ze,vt,ln,Ko}from"./chunk-1carv1dw.js";function L(w,e){try{let p=w.trim();if(f(p))return d(p,Object.keys(e))(...Object.values(e));else return u(p,e)}catch{return!1}}function Q(w,e,p){let n=w,v=!0;while(v){v=!1;let g=n.match(/@switch\s*\(/);if(!g||g.index===void 0)break;let b=g.index,s=Ko(n,b);if(!s)break;try{let o;if(f(s.expression))o=d(s.expression,Object.keys(e))(...Object.values(e));else o=u(s.expression,e);let r="",a=!1;for(let i of s.cases)if(i.type==="default"){if(!a)r=i.content.trim()}else try{let y;if(i.value&&f(i.value))y=d(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=u(i.value,e);if(o===y){r=i.content.trim(),a=!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),a=l("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+a+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,(p,n)=>e[Number(n)]??p)}function se(w,e,p){let{masked:n,scripts:v}=H(w);return J(K(n,e,p),v)}function K(w,e,p){let n=w;n=Q(n,e,p);{let g=!0;while(g){g=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Ze(n,s+7);if(!o)break;let r=o.endPos,a=vt(n,"unless","endunless",r);if(a===-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,a),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,h=/@(?: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=h.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(a+10),g=!0}}n=zo(n,e,p),n=Ho(n,e,p),n=Fo(n,e);let v=()=>{let g=ln(n);if(g.length===0)return!1;let b=Array(g.length);for(let r=g.length-1;r>=0;r--){let a=g[r];try{let i="",y=!1;for(let m of a.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?tl(m.condition,e):!1)i=m.content,y=!0}catch(c){i=l(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]=l("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(g.length*2+1),o=0;for(let r=0;r<g.length;r++){let a=g[r];s[r*2]=n.slice(o,a.start),s[r*2+1]=b[r],o=a.end}return s[g.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let g=n;if(!v())break;if(n===g)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 p=w[e];if(p!=="'"&&p!=='"')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===p){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 Fo(w,e){let p=w;function n(s,o,r,a){let i=1,y=a,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),h=x?x.index:1/0,E=k?k.index:1/0;if(h<E)i++,y=h+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 a=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,h)=>k.pos-h.pos);for(let k of c)if(k.type==="open")a++;else if(k.type==="close")a--;else if(k.type==="else"&&a===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=p.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+5),m=q(y);if(m)a=m.value,i=r+5+m.consumed;else i=r+5;let c=n(p,"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=p.slice(i,c),k=v(x,"auth","endauth"),h;if(!e.auth)h=!1;else h=a?L(`auth?.check && auth?.user?.[${a}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=p.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+6),m=q(y);if(m)a=m.value,i=r+6+m.consumed;else i=r+6;let c=n(p,"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=p.slice(i,c),k=v(x,"guest","endguest"),h;if(!e.auth)h=!0;else h=a?L(`!auth?.check || !auth?.user?.[${a}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+9),s=!0}}function g(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 a=[s];if(o)a.push(o);if(r){let i=L(r,e);a.push(i)}return e.permissions.check(...a)}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",a=!0;while(a){a=!1;let i=p.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=p.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(p,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 h=p.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(h))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(h))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(h))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(h))!==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:h.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=h.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:h.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:h.length;I.push({content:h.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<h.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:h.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:h.slice(F)})}let O=g(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=g(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}}p=p.substring(0,y)+V+p.substring(k+`@${o}`.length),a=!0}}return p}function zo(w,e,p){let n=w;function v(g,b,s,o,r){let a=!0;while(a){a=!1;let i=new RegExp(`@${b}\\s*\\(`),y=g.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Ze(g,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=vt(g,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 h=g.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<h.length){let R=h.indexOf("@",P);if(R===-1)break;let T=h.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 _=h.slice(0,S),M=h.slice(S+5);T=R?_:M}else T=R?h:"";g=g.substring(0,m)+T+g.substring(k+`@${s}`.length),a=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=l(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);g=g.substring(0,m)+_+g.substring(k+`@${s}`.length);break}}return g}return n=v(n,"isset","endisset",(g)=>{let b=L(g,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(g)=>{let b=L(g,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 Ho(w,e,p){let n=w,v="development";function g(b,s,o,r){let a=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,a.lastIndex=0;let k=a.exec(c);if(!k)break;let h=k.index,E=h+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){a.lastIndex=C,i.lastIndex=C;let O=a.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 ${h} 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,h)+I+c.substring(P+F),x=!0}return c}return n=g(n,"env","endenv",!1),n=g(n,"production","endproduction",v==="production"),n=g(n,"development","enddevelopment",v==="development"),n=g(n,"staging","endstaging",v==="staging"),n=g(n,"testing","endtesting",v==="testing"),n}
|
|
2
|
+
import{u,f,tl,d,t,l}from"./chunk-7rk7wfm6.js";import{Ze,vt,ln,Ko}from"./chunk-f54t0qar.js";function L(w,e){try{let p=w.trim();if(f(p))return d(p,Object.keys(e))(...Object.values(e));else return u(p,e)}catch{return!1}}function Q(w,e,p){let n=w,v=!0;while(v){v=!1;let g=n.match(/@switch\s*\(/);if(!g||g.index===void 0)break;let b=g.index,s=Ko(n,b);if(!s)break;try{let o;if(f(s.expression))o=d(s.expression,Object.keys(e))(...Object.values(e));else o=u(s.expression,e);let r="",a=!1;for(let i of s.cases)if(i.type==="default"){if(!a)r=i.content.trim()}else try{let y;if(i.value&&f(i.value))y=d(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=u(i.value,e);if(o===y){r=i.content.trim(),a=!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),a=l("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+a+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,(p,n)=>e[Number(n)]??p)}function se(w,e,p){let{masked:n,scripts:v}=H(w);return J(K(n,e,p),v)}function K(w,e,p){let n=w;n=Q(n,e,p);{let g=!0;while(g){g=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Ze(n,s+7);if(!o)break;let r=o.endPos,a=vt(n,"unless","endunless",r);if(a===-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,a),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,h=/@(?: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=h.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(a+10),g=!0}}n=zo(n,e,p),n=Ho(n,e,p),n=Fo(n,e);let v=()=>{let g=ln(n);if(g.length===0)return!1;let b=Array(g.length);for(let r=g.length-1;r>=0;r--){let a=g[r];try{let i="",y=!1;for(let m of a.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?tl(m.condition,e):!1)i=m.content,y=!0}catch(c){i=l(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]=l("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(g.length*2+1),o=0;for(let r=0;r<g.length;r++){let a=g[r];s[r*2]=n.slice(o,a.start),s[r*2+1]=b[r],o=a.end}return s[g.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let g=n;if(!v())break;if(n===g)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 p=w[e];if(p!=="'"&&p!=='"')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===p){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 Fo(w,e){let p=w;function n(s,o,r,a){let i=1,y=a,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),h=x?x.index:1/0,E=k?k.index:1/0;if(h<E)i++,y=h+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 a=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,h)=>k.pos-h.pos);for(let k of c)if(k.type==="open")a++;else if(k.type==="close")a--;else if(k.type==="else"&&a===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=p.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+5),m=q(y);if(m)a=m.value,i=r+5+m.consumed;else i=r+5;let c=n(p,"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=p.slice(i,c),k=v(x,"auth","endauth"),h;if(!e.auth)h=!1;else h=a?L(`auth?.check && auth?.user?.[${a}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=p.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+6),m=q(y);if(m)a=m.value,i=r+6+m.consumed;else i=r+6;let c=n(p,"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=p.slice(i,c),k=v(x,"guest","endguest"),h;if(!e.auth)h=!0;else h=a?L(`!auth?.check || !auth?.user?.[${a}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+9),s=!0}}function g(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 a=[s];if(o)a.push(o);if(r){let i=L(r,e);a.push(i)}return e.permissions.check(...a)}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",a=!0;while(a){a=!1;let i=p.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=p.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(p,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 h=p.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(h))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(h))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(h))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(h))!==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:h.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=h.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:h.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:h.length;I.push({content:h.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<h.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:h.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:h.slice(F)})}let O=g(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=g(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}}p=p.substring(0,y)+V+p.substring(k+`@${o}`.length),a=!0}}return p}function zo(w,e,p){let n=w;function v(g,b,s,o,r){let a=!0;while(a){a=!1;let i=new RegExp(`@${b}\\s*\\(`),y=g.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Ze(g,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=vt(g,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 h=g.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<h.length){let R=h.indexOf("@",P);if(R===-1)break;let T=h.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 _=h.slice(0,S),M=h.slice(S+5);T=R?_:M}else T=R?h:"";g=g.substring(0,m)+T+g.substring(k+`@${s}`.length),a=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=l(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);g=g.substring(0,m)+_+g.substring(k+`@${s}`.length);break}}return g}return n=v(n,"isset","endisset",(g)=>{let b=L(g,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(g)=>{let b=L(g,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 Ho(w,e,p){let n=w,v="development";function g(b,s,o,r){let a=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,a.lastIndex=0;let k=a.exec(c);if(!k)break;let h=k.index,E=h+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){a.lastIndex=C,i.lastIndex=C;let O=a.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 ${h} 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,h)+I+c.substring(P+F),x=!0}return c}return n=g(n,"env","endenv",!1),n=g(n,"production","endproduction",v==="production"),n=g(n,"development","enddevelopment",v==="development"),n=g(n,"staging","endstaging",v==="staging"),n=g(n,"testing","endtesting",v==="testing"),n}
|
|
3
3
|
export{se,Fo,zo,Ho};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Br,
|
|
2
|
+
import{jr,Br,Bg,Fg,zg,Hg,Vg}from"./chunk-0h99mrb0.js";export{jr as collectMessageCatalogs,Fg as loadPageMessages,zg as messageAreasIn,Hg as pageLanguages,Bg as pageMessagesEnabled,Vg as pageMessagesScript,Br as pathSpellings};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ti,ey,ty,cl,Ve,wg,Ys,ny,ry,sy,oy,iy,ay,cy,ly,uy}from"./chunk-
|
|
2
|
+
import{Ti,ey,ty,cl,Ve,wg,Ys,ny,ry,sy,oy,iy,ay,cy,ly,uy}from"./chunk-7rk7wfm6.js";export{ay as applyHead,ny as definePageMeta,Ti as getHead,ey as getPageMeta,Ve as mergeHeadConfigs,cy as processHeadDirective,uy as processMetaDirective,ly as processTitleDirective,iy as renderBodyAttrs,sy as renderHead,oy as renderHtmlAttrs,ty as resetHead,Ys as seoMetaToHeadConfig,cl as useHead,ry as usePageTitle,wg as useSeoMeta,ry as useTitle};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function
|
|
3
|
-
export{
|
|
2
|
+
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Or(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Or(i,n,r+1,o))return!0}return!1}var k=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],ll=["onMount","onDestroy"];function at(e="const",t=[],r){let o=t.length?k.filter((s)=>!t.includes(s)):k;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=k.filter((e)=>!y.includes(e));function Ri(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],E=/\s@[a-z][\w.:-]*\s*=/i;function ul(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Ri(e))return!0;return T(e,t)}function T(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Or(r[1],t))return!0;return!1}function dl(e,t){if(!e)return!1;let r=f(e);return E.test(r)||d(r,t)}var R=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function pl(e){return R.includes(e.toLowerCase())}var Zs=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],_=["x-init","x-transition","x-effect","x-on"],fl=[...Zs,..._];function gl(){return`{${Zs.map((e)=>`'${e}':1`).join(",")}}`}var Ai=["class","style","text","html","show","model","if","ref"];function ml(){return`{${Ai.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function hl(){return`/^(${p.join("|")})(?:\\.|$)/`}function yl(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var w=65536,A=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=w;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=A){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
|
|
3
|
+
export{Or,k,ll,at,Ri,ul,dl,pl,Zs,fl,gl,Ai,ml,hl,yl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Df,Oh,Nh,Mh,Dh,Lf,jf,Lh,jh,Xo,Bh,lr,ur,ws}from"./chunk-24354nk5.js";import{nt}from"./chunk-5emrarpf.js";import"./chunk-nqcqench.js";import"./chunk-kq40yvdh.js";import"./chunk-m7hfcxt3.js";import"./chunk-7rk7wfm6.js";import"./chunk-r9e0r6jx.js";import"./chunk-n761hp6d.js";export{Dh as __setSignalsGeneratorsForTest,nt as cacheEngineFingerprint,ur as cacheTemplate,lr as checkCache,Bh as clearDevCaches,jf as getCachedRouterScript,Lf as getCachedSignalsRuntime,Lh as getServeClientAsset,Xo as getServeModuleBundle,ws as hashFilePath,Nh as invalidateFileCache,Mh as invalidateFileCacheByDir,Oh as readFileCached,jh as registerServeModuleBundle,Df as templateCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{es
|
|
2
|
+
import{Qr,es}from"./chunk-r6dtrd7y.js";import{S}from"./chunk-nqcqench.js";import{a}from"./chunk-atdn8n6b.js";import{Ke,re}from"./chunk-baj6w8ja.js";import{Ga}from"./chunk-y4xcym3k.js";import{j}from"./chunk-cmnze7at.js";import{g}from"./chunk-0dve54ne.js";import{existsSync as F,mkdirSync as y,copyFileSync as P,chmodSync as I,rmSync as ve}from"fs";import{join as c,basename as xe,resolve as X}from"path";import{spawn as z}from"child_process";import{platform as ye}from"os";function E(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=S(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 pu=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -484,7 +484,7 @@ ${i}`+e.slice(t)}return i+e}var ko={button:{nativeType:"craft-button",fallbackTa
|
|
|
484
484
|
</details>`}},divider:{nativeType:"craft-divider",fallbackTag:"hr",fallbackClasses:"craft-divider",nativeProps:["orientation","variant"]},table:{nativeType:"craft-table",fallbackTag:"table",fallbackClasses:"craft-table",nativeProps:["columns","rows","sortable","selectable"]},list:{nativeType:"craft-list",fallbackTag:"ul",fallbackClasses:"craft-list",nativeProps:["items","selectable"]},tree:{nativeType:"craft-tree",fallbackTag:"div",fallbackClasses:"craft-tree",nativeProps:["nodes","expandable","selectable"]},alert:{nativeType:"craft-alert",fallbackTag:"div",fallbackClasses:"craft-alert",nativeProps:["variant","title","dismissible"],render:(e,r)=>{let i=e.variant||"info",n=e.title||"";return`<div class="craft-alert craft-alert-${i}" role="alert">
|
|
485
485
|
${n?`<div class="craft-alert-title">${n}</div>`:""}
|
|
486
486
|
<div class="craft-alert-content">${r}</div>
|
|
487
|
-
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,r)=>{let i=e.content||"",n=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${i}" data-position="${n}">${r}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:te},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:ae},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:ie},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:ne},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,r)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,r)=>{let i=e.value||"",n=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${i}" min="${n}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,r)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},
|
|
487
|
+
</div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,r)=>{let i=e.content||"",n=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${i}" data-position="${n}">${r}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:te},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:ae},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:ie},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:ne},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,r)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,r)=>{let i=e.value||"",n=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${i}" min="${n}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,r)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},Zr=`
|
|
488
488
|
<style id="craft-component-styles">
|
|
489
489
|
/* Craft Component Base Styles */
|
|
490
490
|
.craft-button {
|
|
@@ -1006,8 +1006,8 @@ ${i}`+e.slice(t)}return i+e}var ko={button:{nativeType:"craft-button",fallbackTa
|
|
|
1006
1006
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
1007
1007
|
})();
|
|
1008
1008
|
</script>
|
|
1009
|
-
`;function _a(e,r={}){let{classPrefix:i="craft"}=r;if(!e.includes("craft-component-styles"))e=E(e,"head",`${
|
|
1010
|
-
`)??
|
|
1009
|
+
`;function _a(e,r={}){let{classPrefix:i="craft"}=r;if(!e.includes("craft-component-styles"))e=E(e,"head",`${Zr}
|
|
1010
|
+
`)??Zr+e;if(!e.includes("craft-component-runtime"))e=E(e,"body",`${ka}
|
|
1011
1011
|
`)??e+ka;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(n,s,t)=>A("sidebar",s,t.trim(),r,i)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(n,s)=>A("sidebar",s,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(n,s,t)=>A(s,t,"",r,i)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(n,s,t,o)=>A(s,t,o.trim(),r,i)),e}function A(e,r,i,n,s){let t=n.components?.[e]||ko[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${i}</div>`;let o=N(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 f=ue(o,t,d);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${f}>`;return`<${t.fallbackTag} ${f}>${i}</${t.fallbackTag}>`}function N(e){let r={},i=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,n;while((n=i.exec(e))!==null){let[s,t,o,d]=n,f=o??d;if(s.startsWith(":"))r[t]=f;else if(s.startsWith("@"))r[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=f;else if(f===void 0)r[t]=!0;else r[t]=f}return r}function te(e,r){let i=B(String(e.id||`craft-sidebar-${fe(r||JSON.stringify(e))}`)),n=ce(e.spaces)||oe(r),s=n.length?[]:le(e.sections)||M(r),t=String(e.selectedSpace||n[0]?.id||""),o=n.find((v)=>v.id===t)||n[0],d=String(e.selectedItem||e.selected||(n.length?o?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),f={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},p=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),l=Number(e.width||e.sidebarWidth||286),u=e.native===!1||e.native==="false"?"false":"true",b=f.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${T(f.searchPlaceholder)}"></div>`:"",m;if(n.length)m=de(n,t,d);else if(s.length)m=s.map((v)=>L(v,d)).join("");else m=r;return`<aside class="${x(p)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${x(i)}" data-native="${u}" style="--craft-sidebar-width:${l}px">
|
|
1012
1012
|
${b}
|
|
1013
1013
|
${m}
|
|
@@ -1038,8 +1038,8 @@ ${s}</${d}>`:`${s}<${d}/>`}finally{r.delete(n)}}throw TypeError(`Unsupported Inf
|
|
|
1038
1038
|
<plist version="1.0">
|
|
1039
1039
|
${i(e,"","infoPlist")}
|
|
1040
1040
|
</plist>
|
|
1041
|
-
`}async function Ca(e){if(e.window?.cornerRadius!==void 0&&(!Number.isFinite(e.window.cornerRadius)||e.window.cornerRadius<0||e.window.cornerRadius>128))throw Error("Native window cornerRadius must be between 0 and 128");let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||D(),format:e.format||"app",error:`Input file not found: ${e.input}`};let i=e.target||D(),n=e.format||Be(i);if(e.backend&&i!=="macos")throw Error("Native backend bundles currently support macOS only.");if(e.backend&&!F(X(e.backend.entry)))throw Error(`Native backend not found: ${e.backend.entry}`);let s=e.output||c(process.cwd(),"dist","native");if(!F(s))y(s,{recursive:!0});let t=await a(process.cwd()),o=await Ga(e.input,{context:e.context,options:{...t,isDev:!1},injectCSS:!0});if(o=Sa(o,{debug:e.verbose}),o=_a(o),!o.includes("craft-component-styles")){if(o.includes("</head>"))o=o.replace("</head>",`${
|
|
1042
|
-
</head>`)}let d=e.name||xe(e.input,".stx"),f=e.version||"1.0.0",p=e.craftPath||Ea(e.runtimeProfile);if(!p)return{success:!1,target:i,format:n,error:"Craft native binary not found on PATH. Run pantry install craft, or specify craftPath for framework development."};if(e.runtimeProfile==="webview"){if(i!=="macos")throw Error("The webview runtime profile is currently available on macOS only.");let u=Bun.spawnSync([p,"--runtime-profile"],{stdout:"pipe",stderr:"pipe",timeout:1e4});if(u.exitCode!==0||u.stdout.toString().trim()!=="webview")throw Error("The requested Craft webview runtime is unavailable. Upgrade Craft with Pantry before building.")}if(p=
|
|
1041
|
+
`}async function Ca(e){if(e.window?.cornerRadius!==void 0&&(!Number.isFinite(e.window.cornerRadius)||e.window.cornerRadius<0||e.window.cornerRadius>128))throw Error("Native window cornerRadius must be between 0 and 128");let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||D(),format:e.format||"app",error:`Input file not found: ${e.input}`};let i=e.target||D(),n=e.format||Be(i);if(e.backend&&i!=="macos")throw Error("Native backend bundles currently support macOS only.");if(e.backend&&!F(X(e.backend.entry)))throw Error(`Native backend not found: ${e.backend.entry}`);let s=e.output||c(process.cwd(),"dist","native");if(!F(s))y(s,{recursive:!0});let t=await a(process.cwd()),o=await Ga(e.input,{context:e.context,options:{...t,isDev:!1},injectCSS:!0});if(o=Sa(o,{debug:e.verbose}),o=_a(o),!o.includes("craft-component-styles")){if(o.includes("</head>"))o=o.replace("</head>",`${Zr}
|
|
1042
|
+
</head>`)}let d=e.name||xe(e.input,".stx"),f=e.version||"1.0.0",p=e.craftPath||Ea(e.runtimeProfile);if(!p)return{success:!1,target:i,format:n,error:"Craft native binary not found on PATH. Run pantry install craft, or specify craftPath for framework development."};if(e.runtimeProfile==="webview"){if(i!=="macos")throw Error("The webview runtime profile is currently available on macOS only.");let u=Bun.spawnSync([p,"--runtime-profile"],{stdout:"pipe",stderr:"pipe",timeout:1e4});if(u.exitCode!==0||u.stdout.toString().trim()!=="webview")throw Error("The requested Craft webview runtime is unavailable. Upgrade Craft with Pantry before building.")}if(p=Qr(e.craftPath,e.runtimeProfile),e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${i}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${p}`);let l;switch(i){case"macos":l=await Se(o,d,f,s,n,e,p);break;case"windows":l=await $e(o,d,f,s,n,e,p);break;case"linux":l=await Te(o,d,f,s,n,e,p);break;case"ios":l=await Pe(o,d,f,s,e,p);break;case"android":l=await Ie(o,d,f,s,e,p);break;default:l={success:!1,target:i,format:n,error:`Unsupported target: ${i}`}}return l.duration=Date.now()-r,l}catch(i){return{success:!1,target:e.target||D(),format:e.format||"app",error:i.message,duration:Date.now()-r}}}async function Se(e,r,i,n,s,t,o){let d=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,f=c(n,`${r}.app`),p=c(f,"Contents"),l=c(p,"MacOS"),u=c(p,"Resources");ve(f,{recursive:!0,force:!0}),y(l,{recursive:!0}),y(u,{recursive:!0});let b=c(u,"index.html");await Bun.write(b,e);let m="";if(t.sidebar?.enabled&&t.sidebar?.config)m=c(u,"sidebar-config.json"),await Bun.write(m,JSON.stringify(t.sidebar.config));let v=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",k=t.menubarOnly??t.systemTray,h=t.bundleStyle||(await ke(o)?"executable":"launcher");if(t.backend){if(!await Ce(o))throw Error("This Craft runtime does not support bundled backends. Upgrade Craft before building this app.");P(o,c(l,r)),I(c(l,r),493);let C=Ke("native-backend");try{let w=c(C,"launcher.ts"),U=c(import.meta.dir,"native-backend"+(import.meta.path.endsWith(".ts")?".ts":".js"));await Bun.write(w,`import { runNativeBackend } from ${JSON.stringify(U)}
|
|
1043
1043
|
import * as backend from ${JSON.stringify(X(t.backend.entry))}
|
|
1044
1044
|
await runNativeBackend({ html: ${JSON.stringify(e)}, fetch: backend.default, shutdown: Reflect.get(backend, "shutdown"),
|
|
1045
1045
|
maxRequestBodySize: ${t.backend.maxRequestBodySize??33554432} })
|
|
@@ -1076,7 +1076,7 @@ Name=${r}
|
|
|
1076
1076
|
Exec=${u}
|
|
1077
1077
|
Terminal=false
|
|
1078
1078
|
Categories=Utility;
|
|
1079
|
-
`;if(await Bun.write(c(d,`${r.toLowerCase()}.desktop`),b),s==="deb"){let m=c(n,`${r.toLowerCase()}_${i}_amd64.deb`),v=await Oe(d,m,r,i,t);if(!v.success)return{success:!1,target:"linux",format:"deb",error:v.error};return{success:!0,target:"linux",format:"deb",outputPath:m}}if(s==="appimage"){let m=c(n,`${r}-${i}-x86_64.AppImage`),v=await De(d,m,r,t);if(!v.success)return{success:!1,target:"linux",format:"appimage",error:v.error};return{success:!0,target:"linux",format:"appimage",outputPath:m}}return{success:!0,target:"linux",format:"app",outputPath:d}}async function Pe(e,r,i,n,s,t){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${r}' to create an iOS project.`}}async function Ie(e,r,i,n,s,t){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${r}' to create an Android project.`}}function Ea(e="full"){let r=process.env.CRAFT_BIN;if(r){if(!F(r))throw Error(`CRAFT_BIN points to a missing file: ${r}`);return r}return Bun.which(e==="webview"?"craft-webview":"craft",{PATH:process.env.PATH??"",cwd:process.cwd()})}function D(){switch(ye()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function Be(e){switch(e){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function Re(e,r,i){return
|
|
1079
|
+
`;if(await Bun.write(c(d,`${r.toLowerCase()}.desktop`),b),s==="deb"){let m=c(n,`${r.toLowerCase()}_${i}_amd64.deb`),v=await Oe(d,m,r,i,t);if(!v.success)return{success:!1,target:"linux",format:"deb",error:v.error};return{success:!0,target:"linux",format:"deb",outputPath:m}}if(s==="appimage"){let m=c(n,`${r}-${i}-x86_64.AppImage`),v=await De(d,m,r,t);if(!v.success)return{success:!1,target:"linux",format:"appimage",error:v.error};return{success:!0,target:"linux",format:"appimage",outputPath:m}}return{success:!0,target:"linux",format:"app",outputPath:d}}async function Pe(e,r,i,n,s,t){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${r}' to create an iOS project.`}}async function Ie(e,r,i,n,s,t){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${r}' to create an Android project.`}}function Ea(e="full"){let r=process.env.CRAFT_BIN;if(r){if(!F(r))throw Error(`CRAFT_BIN points to a missing file: ${r}`);return r}return Bun.which(e==="webview"?"craft-webview":"craft",{PATH:process.env.PATH??"",cwd:process.cwd()})}function D(){switch(ye()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function Be(e){switch(e){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function Re(e,r,i){return es({appBundlePath:e,outputPath:r,volumeName:i})}async function Ee(e,r){return new Promise((i)=>{let n=z("zip",["-r",r,"."],{cwd:e});n.on("close",(s)=>{if(s===0)i({success:!0});else i({success:!1,error:`zip exited with code ${s}`})}),n.on("error",(s)=>{i({success:!1,error:s.message})})})}async function Oe(e,r,i,n,s){return new Promise((t)=>{let o=Ke("deb");try{let d=c(o,"pkg"),f=c(d,"DEBIAN"),p=c(d,"usr","bin"),l=c(d,"usr","share","applications"),u=c(d,"usr","share",i.toLowerCase());y(f,{recursive:!0}),y(p,{recursive:!0}),y(l,{recursive:!0}),y(u,{recursive:!0});let b=g("fs").readdirSync(e);for(let h of b)P(c(e,h),c(u,h));let m=`#!/bin/bash
|
|
1080
1080
|
exec /usr/share/${i.toLowerCase()}/${i.toLowerCase()} "$@"`;g("fs").writeFileSync(c(p,i.toLowerCase()),m),I(c(p,i.toLowerCase()),493);let v=`Package: ${i.toLowerCase()}
|
|
1081
1081
|
Version: ${n}
|
|
1082
1082
|
Section: utils
|
|
@@ -1098,4 +1098,4 @@ Terminal=false
|
|
|
1098
1098
|
Categories=Utility;
|
|
1099
1099
|
Icon=${i.toLowerCase()}
|
|
1100
1100
|
`;g("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),m);let v=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(g("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),v),n.icon&&F(n.icon))P(n.icon,c(o,`${i.toLowerCase()}.png`));let k=z("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});k.on("close",(h)=>{if(re(t),h===0)I(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${h}. Install from https://appimage.github.io/appimagetool/`})}),k.on("error",(h)=>{re(t),s({success:!1,error:`appimagetool not found: ${h.message}`})})}catch(o){re(t),s({success:!1,error:o.message})}})}function Ta(){return[D()]}function $a(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 qe={buildNative:Ca,getAvailableTargets:Ta,getAvailableFormats:$a,detectPlatform:D},xh=qe;
|
|
1101
|
-
export{pu,xa,yh,bh,Sa,ko,
|
|
1101
|
+
export{pu,xa,yh,bh,Sa,ko,Zr,ka,_a,wh,vh,Ca,Ea,Ta,$a,xh};
|