@stacksjs/stx 0.2.905 → 0.2.908

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.
Files changed (250) hide show
  1. package/dist/app-shell.d.ts +1 -1
  2. package/dist/app-shell.js +1 -1
  3. package/dist/{chunk-n3fgrsva.js → chunk-0d3pkkrv.js} +2 -2
  4. package/dist/{chunk-fhb86pc9.js → chunk-0ek3s3b6.js} +150 -149
  5. package/dist/{chunk-qt2mr3f0.js → chunk-0mxkw6m6.js} +14 -9
  6. package/dist/{chunk-9y83pdcb.js → chunk-0vyytd9v.js} +3 -3
  7. package/dist/{chunk-4d6p92qh.js → chunk-13awnyq0.js} +1 -1
  8. package/dist/chunk-14497kj1.js +2 -0
  9. package/dist/chunk-1dc6h93m.js +2 -0
  10. package/dist/{chunk-ffytbb4x.js → chunk-1ezcxbpg.js} +5 -5
  11. package/dist/{chunk-eb5v9npc.js → chunk-1hx6dyy9.js} +2 -2
  12. package/dist/{chunk-a7bqrjm5.js → chunk-1jxkc6d0.js} +2 -2
  13. package/dist/{chunk-db7h6mgq.js → chunk-1pdntpwe.js} +4 -4
  14. package/dist/{chunk-vw6qytwm.js → chunk-1x0wcskp.js} +4 -4
  15. package/dist/chunk-20hy5p3p.js +2 -0
  16. package/dist/chunk-2fyey6pn.js +2 -0
  17. package/dist/chunk-2jkq15je.js +2 -0
  18. package/dist/{chunk-eb5cma4b.js → chunk-2m4d8jkv.js} +2 -2
  19. package/dist/{chunk-p89rpak1.js → chunk-2qk2ppgm.js} +1 -1
  20. package/dist/{chunk-arfpzf17.js → chunk-357qjcj1.js} +2 -2
  21. package/dist/{chunk-edpsk4bg.js → chunk-3m457a9q.js} +9 -9
  22. package/dist/{chunk-ng09dc4e.js → chunk-3npzxjr4.js} +2 -2
  23. package/dist/chunk-3qneemwh.js +2 -0
  24. package/dist/{chunk-nc5d3a5r.js → chunk-3syagjd7.js} +5 -5
  25. package/dist/chunk-43kz6rx9.js +2 -0
  26. package/dist/{chunk-bzndm04n.js → chunk-45326z5v.js} +2 -2
  27. package/dist/{chunk-zrvgr3hz.js → chunk-4ajsp5dp.js} +15 -15
  28. package/dist/{chunk-hdfhaddy.js → chunk-4b110x6r.js} +2 -2
  29. package/dist/chunk-4ge69wvr.js +2 -0
  30. package/dist/{chunk-xwzefw2r.js → chunk-4hrryats.js} +2 -2
  31. package/dist/chunk-4jmztn9d.js +2 -0
  32. package/dist/{chunk-rgrzmr35.js → chunk-59bbk5gx.js} +5 -5
  33. package/dist/{chunk-az1eczs2.js → chunk-5baag5dz.js} +7 -7
  34. package/dist/{chunk-pwpge9bj.js → chunk-5jc9hmwg.js} +2 -2
  35. package/dist/{chunk-ern5hyvr.js → chunk-5jn2qyv7.js} +1 -1
  36. package/dist/chunk-6756txp1.js +2 -0
  37. package/dist/{chunk-vtc9zmp6.js → chunk-69wpv1pr.js} +6 -6
  38. package/dist/chunk-6mw288vd.js +2 -0
  39. package/dist/{chunk-ayady5ws.js → chunk-6w9av0n9.js} +2 -2
  40. package/dist/{chunk-hnjeqxqy.js → chunk-6yketqa1.js} +2 -2
  41. package/dist/{chunk-5yvgzh6n.js → chunk-72pbhpq8.js} +2 -2
  42. package/dist/chunk-7hgqyea0.js +2 -0
  43. package/dist/chunk-7k1thytm.js +2 -0
  44. package/dist/chunk-7m5rpqjy.js +2 -0
  45. package/dist/chunk-7xpez9tc.js +2 -0
  46. package/dist/chunk-8f5x16ht.js +2 -0
  47. package/dist/{chunk-vfctk20v.js → chunk-8n42epb6.js} +3 -3
  48. package/dist/{chunk-k3ytyhkr.js → chunk-8p3vqt2q.js} +3 -3
  49. package/dist/{chunk-p92272k0.js → chunk-8tfpv6zf.js} +2 -2
  50. package/dist/chunk-9343arqn.js +2 -0
  51. package/dist/chunk-94r6mkcy.js +2 -0
  52. package/dist/{chunk-rdrstnn9.js → chunk-9atdw0p8.js} +2 -2
  53. package/dist/{chunk-5jrpzepc.js → chunk-9bexzgws.js} +2 -2
  54. package/dist/{chunk-0gc1hez6.js → chunk-9tj16d70.js} +3 -3
  55. package/dist/chunk-a0esj80g.js +3 -0
  56. package/dist/chunk-abxwggen.js +2 -0
  57. package/dist/{chunk-68r2zs20.js → chunk-ahf9j8wb.js} +4 -4
  58. package/dist/{chunk-3qr9ysey.js → chunk-am610nan.js} +7 -7
  59. package/dist/chunk-amye7vb0.js +2 -0
  60. package/dist/chunk-asewbsct.js +2 -0
  61. package/dist/{chunk-t9mjgt3q.js → chunk-av45fw8a.js} +1 -1
  62. package/dist/{chunk-0b57fgpn.js → chunk-b234w3mf.js} +30 -10
  63. package/dist/chunk-b25twdd7.js +2 -0
  64. package/dist/chunk-b7fmkwz2.js +2 -0
  65. package/dist/chunk-bprjp80g.js +2 -0
  66. package/dist/{chunk-945zygwa.js → chunk-c08jvjqt.js} +27 -27
  67. package/dist/{chunk-xc1f0c64.js → chunk-c0kgwh4k.js} +9 -9
  68. package/dist/chunk-c60egpe6.js +2 -0
  69. package/dist/{chunk-kf4z4efe.js → chunk-cfbmjgd0.js} +3 -3
  70. package/dist/{chunk-zzqg8y47.js → chunk-cjntf1jg.js} +2 -2
  71. package/dist/chunk-cjq455ve.js +2 -0
  72. package/dist/{chunk-rdnpq89q.js → chunk-ck4ypzet.js} +2 -2
  73. package/dist/{chunk-46khhke2.js → chunk-cpt9sg6d.js} +1 -1
  74. package/dist/{chunk-73ebyhqq.js → chunk-cq4cwfqf.js} +2 -2
  75. package/dist/chunk-cqq68aw8.js +2 -0
  76. package/dist/chunk-cssvev8r.js +2 -0
  77. package/dist/{chunk-qs0zk04y.js → chunk-cwcmmgvz.js} +2 -2
  78. package/dist/{chunk-5gnt3qtn.js → chunk-d4hnj3ct.js} +3 -3
  79. package/dist/{chunk-3q6x62hs.js → chunk-d8mnaesb.js} +132 -51
  80. package/dist/{chunk-5dw0xnk6.js → chunk-ddn98yz4.js} +5 -5
  81. package/dist/{chunk-qykbjg3z.js → chunk-e5rag6rh.js} +2 -2
  82. package/dist/{chunk-150cz8qq.js → chunk-eca022er.js} +7 -7
  83. package/dist/{chunk-fksmr50h.js → chunk-ekyx5z50.js} +6 -6
  84. package/dist/{chunk-xr1s56k5.js → chunk-eptzpvn0.js} +3 -3
  85. package/dist/chunk-f2yqqpvr.js +2 -0
  86. package/dist/chunk-f3msm5tk.js +2 -0
  87. package/dist/chunk-f74qzgp8.js +42 -0
  88. package/dist/{chunk-de61k0ab.js → chunk-fs43342z.js} +2 -2
  89. package/dist/{chunk-54x7h3sb.js → chunk-fycxc75p.js} +1 -1
  90. package/dist/chunk-fzh73jtc.js +2 -0
  91. package/dist/{chunk-gnf1e5q7.js → chunk-fznjm7qt.js} +2 -2
  92. package/dist/chunk-g67xjfe6.js +3 -0
  93. package/dist/{chunk-r0az4z6d.js → chunk-gfp39bzr.js} +2 -2
  94. package/dist/{chunk-8xb09hnn.js → chunk-gg31th5s.js} +4 -4
  95. package/dist/chunk-gmczbe3j.js +2 -0
  96. package/dist/{chunk-7nf7mp27.js → chunk-gyv2bsmn.js} +2 -2
  97. package/dist/chunk-h7xqba9k.js +2 -0
  98. package/dist/chunk-hg4vfrxr.js +2 -0
  99. package/dist/{chunk-9w7whtbx.js → chunk-hhspwfva.js} +2 -2
  100. package/dist/chunk-hpxhxwda.js +2 -0
  101. package/dist/{chunk-4j3zmxzw.js → chunk-jg5xc2m1.js} +15 -15
  102. package/dist/{chunk-4hk1mjtv.js → chunk-jhegz7az.js} +5 -5
  103. package/dist/chunk-jnk3nk5k.js +2 -0
  104. package/dist/{chunk-mry67rsk.js → chunk-jttzrv0w.js} +6 -6
  105. package/dist/{chunk-5tm1pvt3.js → chunk-jz37h2z0.js} +2 -2
  106. package/dist/chunk-jzbte09f.js +2 -0
  107. package/dist/chunk-k5v22gn4.js +2 -0
  108. package/dist/{chunk-50wjk5ap.js → chunk-kmy34he2.js} +2 -2
  109. package/dist/chunk-kt3f4rpy.js +2 -0
  110. package/dist/chunk-kydh790y.js +2 -0
  111. package/dist/chunk-mgcakk1m.js +2 -0
  112. package/dist/{chunk-vw7crz0z.js → chunk-mpfm5ctr.js} +4 -4
  113. package/dist/{chunk-7g2snypc.js → chunk-mrx20xza.js} +3 -3
  114. package/dist/chunk-n3bt1sv5.js +2 -0
  115. package/dist/chunk-n62nqhey.js +2 -0
  116. package/dist/chunk-naj7m2av.js +2 -0
  117. package/dist/{chunk-k3566kgd.js → chunk-nan0ysys.js} +2 -2
  118. package/dist/chunk-nrap20qt.js +2 -0
  119. package/dist/chunk-p2b90rz9.js +2 -0
  120. package/dist/chunk-pb2mztar.js +2 -0
  121. package/dist/{chunk-9hwg13ec.js → chunk-pc89t52s.js} +5 -5
  122. package/dist/{chunk-7b3dqeyr.js → chunk-phzhmnnm.js} +2 -2
  123. package/dist/chunk-pp89n1et.js +2 -0
  124. package/dist/chunk-ptrz5xwt.js +2 -0
  125. package/dist/{chunk-n23btj9k.js → chunk-q4nk8sq2.js} +3 -3
  126. package/dist/chunk-q9yahsww.js +2 -0
  127. package/dist/chunk-qgc59a7d.js +2 -0
  128. package/dist/chunk-qjkpwjg6.js +2 -0
  129. package/dist/chunk-qn9rrwp8.js +2 -0
  130. package/dist/chunk-qpf782pt.js +2 -0
  131. package/dist/{chunk-5mrt1enm.js → chunk-razwegar.js} +2 -2
  132. package/dist/{chunk-d1tcw019.js → chunk-rdeje2dd.js} +43 -43
  133. package/dist/chunk-s91tcznf.js +2 -0
  134. package/dist/{chunk-67pq803s.js → chunk-sdf4c754.js} +2 -2
  135. package/dist/chunk-senrtnx2.js +2 -0
  136. package/dist/{chunk-nzegc1hd.js → chunk-skxkqh9a.js} +2 -2
  137. package/dist/{chunk-czhzr5k1.js → chunk-sxqha69q.js} +5 -5
  138. package/dist/{chunk-bgkj0rxe.js → chunk-ta7cwykn.js} +4 -4
  139. package/dist/{chunk-nzf3c6n0.js → chunk-tpryfx8t.js} +10 -10
  140. package/dist/{chunk-jsehp750.js → chunk-trnw1tg5.js} +1 -1
  141. package/dist/{chunk-vbmvft7g.js → chunk-v0yay1kw.js} +1 -1
  142. package/dist/{chunk-1pb32z4r.js → chunk-v25gm9d9.js} +19 -19
  143. package/dist/{chunk-2sz1kh9m.js → chunk-va4xam1q.js} +1 -1
  144. package/dist/{chunk-pzj2se3m.js → chunk-vkxrsy13.js} +14 -14
  145. package/dist/chunk-vqys4n8f.js +2 -0
  146. package/dist/{chunk-bzd387yx.js → chunk-w3y8408q.js} +4 -4
  147. package/dist/chunk-w4177qn3.js +3 -0
  148. package/dist/{chunk-esm0pnpz.js → chunk-w98yt4d4.js} +2 -2
  149. package/dist/{chunk-7nn5s0c3.js → chunk-wbsbrm6n.js} +30 -30
  150. package/dist/chunk-x1svtz8k.js +2 -0
  151. package/dist/chunk-xn8eabng.js +2 -0
  152. package/dist/{chunk-kgyjavqg.js → chunk-xqe3c7pa.js} +5 -5
  153. package/dist/chunk-xwarwkaw.js +2 -0
  154. package/dist/{chunk-yqpkdecx.js → chunk-y9xq82ep.js} +6 -6
  155. package/dist/{chunk-z744ry8a.js → chunk-yjhktn0b.js} +9 -9
  156. package/dist/chunk-ykx4zt07.js +2 -0
  157. package/dist/{chunk-wbpnqr7h.js → chunk-yvp5tfrz.js} +3 -3
  158. package/dist/{chunk-g32hc78c.js → chunk-yzgtsrjb.js} +2 -2
  159. package/dist/chunk-z8e2m6kz.js +2 -0
  160. package/dist/{chunk-t14bn66j.js → chunk-zk1c6tg7.js} +3 -3
  161. package/dist/chunk-zk6qmkhb.js +2 -0
  162. package/dist/{chunk-30yqa2jw.js → chunk-zkp5awqw.js} +1 -1
  163. package/dist/cli.js +21 -21
  164. package/dist/client/signals-loop-conditional-runtime.js +5 -0
  165. package/dist/component-renderer.js +2 -24
  166. package/dist/craft-entry.js +2 -2
  167. package/dist/craft.js +2 -2
  168. package/dist/native/runtime/craft-bridge.js +5 -1
  169. package/dist/native/runtime/craft.d.ts +4 -0
  170. package/dist/offline/app-service-worker.d.ts +1 -0
  171. package/dist/offline/app-service-worker.js +99 -17
  172. package/dist/production-server.d.ts +0 -9
  173. package/dist/production-server.js +26 -11
  174. package/dist/pwa.js +3 -3
  175. package/dist/route-response-cache.js +4 -3
  176. package/dist/server-bindings.js +3 -1
  177. package/dist/spa-nav.d.ts +6 -0
  178. package/dist/spa-nav.js +5 -1
  179. package/dist/ssg.js +10 -10
  180. package/dist/stx-virtual-ts.d.ts +4 -0
  181. package/dist/stx-virtual-ts.js +22 -0
  182. package/dist/utils.js +22 -2
  183. package/package.json +5 -5
  184. package/dist/chunk-0ht6exrv.js +0 -2
  185. package/dist/chunk-1pbghytr.js +0 -2
  186. package/dist/chunk-31r1tk86.js +0 -2
  187. package/dist/chunk-3vhczypz.js +0 -2
  188. package/dist/chunk-4tzay5dt.js +0 -2
  189. package/dist/chunk-5astk182.js +0 -2
  190. package/dist/chunk-5tvse0vw.js +0 -2
  191. package/dist/chunk-6heg0cza.js +0 -2
  192. package/dist/chunk-726w7fm2.js +0 -2
  193. package/dist/chunk-73t3w7fh.js +0 -2
  194. package/dist/chunk-7bjrvyqk.js +0 -2
  195. package/dist/chunk-7n4mve8h.js +0 -2
  196. package/dist/chunk-7r294vc9.js +0 -2
  197. package/dist/chunk-7rn7w53f.js +0 -2
  198. package/dist/chunk-7v3tgpws.js +0 -2
  199. package/dist/chunk-81qvg3yd.js +0 -2
  200. package/dist/chunk-9bcrr81g.js +0 -2
  201. package/dist/chunk-9g6tfcrv.js +0 -2
  202. package/dist/chunk-be8x7mkn.js +0 -2
  203. package/dist/chunk-c87cndsj.js +0 -2
  204. package/dist/chunk-cp82351f.js +0 -2
  205. package/dist/chunk-cv609hgq.js +0 -2
  206. package/dist/chunk-cvxg2rc1.js +0 -2
  207. package/dist/chunk-dmc91qke.js +0 -2
  208. package/dist/chunk-dw23nre3.js +0 -2
  209. package/dist/chunk-fk593bkb.js +0 -2
  210. package/dist/chunk-fznzn35q.js +0 -2
  211. package/dist/chunk-gfz0czma.js +0 -2
  212. package/dist/chunk-ggchpq5r.js +0 -42
  213. package/dist/chunk-ghmb45zs.js +0 -2
  214. package/dist/chunk-hc8ks7y3.js +0 -2
  215. package/dist/chunk-hs2a040z.js +0 -2
  216. package/dist/chunk-hten266c.js +0 -2
  217. package/dist/chunk-jr3fmkq7.js +0 -2
  218. package/dist/chunk-k2fw6paw.js +0 -2
  219. package/dist/chunk-k79dvx67.js +0 -2
  220. package/dist/chunk-kf6j1ht4.js +0 -2
  221. package/dist/chunk-km1k3c4e.js +0 -2
  222. package/dist/chunk-knxb6d18.js +0 -2
  223. package/dist/chunk-kvjbpbmw.js +0 -2
  224. package/dist/chunk-kx9amwwr.js +0 -2
  225. package/dist/chunk-mhv84p0x.js +0 -2
  226. package/dist/chunk-mxxb3e9v.js +0 -2
  227. package/dist/chunk-mz44m7y7.js +0 -2
  228. package/dist/chunk-p3pjfj65.js +0 -2
  229. package/dist/chunk-p8eeg64w.js +0 -2
  230. package/dist/chunk-ph74v3ag.js +0 -3
  231. package/dist/chunk-pjpy86c3.js +0 -3
  232. package/dist/chunk-pnbeey2h.js +0 -3
  233. package/dist/chunk-ps5wfd4c.js +0 -2
  234. package/dist/chunk-qzx6h6af.js +0 -2
  235. package/dist/chunk-s0dmb7me.js +0 -2
  236. package/dist/chunk-tgwwa872.js +0 -2
  237. package/dist/chunk-tspqdt8e.js +0 -2
  238. package/dist/chunk-tyv0csb4.js +0 -2
  239. package/dist/chunk-v0r6zb87.js +0 -2
  240. package/dist/chunk-vxtna1b1.js +0 -2
  241. package/dist/chunk-wwtv5cht.js +0 -2
  242. package/dist/chunk-x2x1cqr0.js +0 -2
  243. package/dist/chunk-x43x2c6v.js +0 -2
  244. package/dist/chunk-xb192088.js +0 -2
  245. package/dist/chunk-xqx8t9w5.js +0 -2
  246. package/dist/chunk-xy0f5yds.js +0 -2
  247. package/dist/chunk-z33r3pzy.js +0 -2
  248. package/dist/chunk-zkr42285.js +0 -2
  249. package/dist/chunk-zrs22j09.js +0 -2
  250. package/dist/chunk-zw6tgr0s.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{c}from"./chunk-p92272k0.js";function r(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
2
+ import{c}from"./chunk-8tfpv6zf.js";function r(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
3
3
  (function() {
4
4
  'use strict';
5
5
 
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{bs,ws}from"./chunk-7nn5s0c3.js";import{x}from"./chunk-fhb86pc9.js";import{a}from"./chunk-4j3zmxzw.js";import{ot,fe}from"./chunk-9y83pdcb.js";import{xc}from"./chunk-czhzr5k1.js";import{W}from"./chunk-a7bqrjm5.js";import{w}from"./chunk-v6gkjg5f.js";import{f}from"./chunk-p92272k0.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 Vu=`
2
+ import{vs,xs}from"./chunk-wbsbrm6n.js";import{x}from"./chunk-0ek3s3b6.js";import{a}from"./chunk-jg5xc2m1.js";import{it,fe}from"./chunk-0vyytd9v.js";import{_c}from"./chunk-sxqha69q.js";import{W}from"./chunk-1jxkc6d0.js";import{w}from"./chunk-v6gkjg5f.js";import{f}from"./chunk-8tfpv6zf.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 qu=`
3
3
  <script>
4
4
  (function() {
5
5
  'use strict';
@@ -468,9 +468,9 @@ else if (data.type === 'event' && data.method) {
468
468
  }
469
469
  })();
470
470
  </script>
471
- `;function Ka(e={}){let{debug:r=!1,timeout:i=30000}=e;return Vu.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${i}`)}function Jh(){return!1}function Yh(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 Ka(t)})}function Ga(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let i=Ka(r),n=O(e,"head",`${i}
471
+ `;function Ja(e={}){let{debug:r=!1,timeout:i=30000}=e;return qu.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${i}`)}function Qh(){return!1}function ey(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 Ja(t)})}function Ya(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let i=Ja(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 Wo={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">
473
+ ${i}`+e.slice(t)}return i+e}var Ko={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}>
@@ -484,7 +484,7 @@ ${i}`+e.slice(t)}return i+e}var Wo={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:re},"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||""}">`}},ys=`
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:re},"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||""}">`}},ws=`
488
488
  <style id="craft-component-styles">
489
489
  /* Craft Component Base Styles */
490
490
  .craft-button {
@@ -902,7 +902,7 @@ ${i}`+e.slice(t)}return i+e}var Wo={button:{nativeType:"craft-button",fallbackTa
902
902
  }
903
903
  }
904
904
  </style>
905
- `,Xa=`
905
+ `,Za=`
906
906
  <script id="craft-component-runtime">
907
907
  (function() {
908
908
  if (window.__stxCraftComponentRuntime) return;
@@ -1006,9 +1006,9 @@ ${i}`+e.slice(t)}return i+e}var Wo={button:{nativeType:"craft-button",fallbackTa
1006
1006
  document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
1007
1007
  })();
1008
1008
  </script>
1009
- `;function Ja(e,r={}){let{classPrefix:i="craft"}=r;if(!e.includes("craft-component-styles"))e=O(e,"head",`${ys}
1010
- `)??ys+e;if(!e.includes("craft-component-runtime"))e=O(e,"body",`${Xa}
1011
- `)??e+Xa;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]||Wo[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">
1009
+ `;function Qa(e,r={}){let{classPrefix:i="craft"}=r;if(!e.includes("craft-component-styles"))e=O(e,"head",`${ws}
1010
+ `)??ws+e;if(!e.includes("craft-component-runtime"))e=O(e,"body",`${Za}
1011
+ `)??e+Za;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]||Ko[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 Wo={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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function S(e){return P(e).replace(/`/g,"&#96;")}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,"&quot;");n.push(`${s}="${o}"`)}return n.join(" ")}function Zh(e,r){Wo[e]=r}function Qh(){return{...Wo}}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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");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>
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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function S(e){return P(e).replace(/`/g,"&#96;")}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,"&quot;");n.push(`${s}="${o}"`)}return n.join(" ")}function ty(e,r){Ko[e]=r}function ny(){return{...Ko}}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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");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
  `)}
@@ -1038,7 +1038,7 @@ ${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 Ya(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||q(),format:e.format||"app",error:`Input file not found: ${e.input}`};let i=e.target||q(),n=e.format||Re(i);if(e.backend&&i!=="macos")throw Error("Native backend bundles currently support macOS only.");if(e.backend&&!z(K(e.backend.entry)))throw Error(`Native backend not found: ${e.backend.entry}`);let s=e.output||c(process.cwd(),"dist","native");if(!z(s))C(s,{recursive:!0});let t=await a(process.cwd()),o=await xc(e.input,{context:e.context,options:{...t,isDev:!1},injectCSS:!0});if(o=Ga(o,{debug:e.verbose}),o=Ja(o),!o.includes("craft-component-styles")){if(o.includes("</head>"))o=f(o,ys)}let d=e.name||ye(e.input,".stx"),p=e.version||"1.0.0",u=e.craftPath||Za(e.runtimeProfile);if(!u)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 b=Bun.spawnSync([u,"--runtime-profile"],{stdout:"pipe",stderr:"pipe",timeout:1e4});if(b.exitCode!==0||b.stdout.toString().trim()!=="webview")throw Error("The requested Craft webview runtime is unavailable. Upgrade Craft with Pantry before building.")}if(u=bs(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: ${u}`);let l;switch(i){case"macos":l=await Ce(o,d,p,s,n,e,u);break;case"windows":l=await Te(o,d,p,s,n,e,u);break;case"linux":l=await Pe(o,d,p,s,n,e,u);break;case"ios":l=await Ie(o,d,p,s,e,u);break;case"android":l=await Be(o,d,p,s,e,u);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||q(),format:e.format||"app",error:i.message,duration:Date.now()-r}}}async function Ce(e,r,i,n,s,t,o){let d=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,p=c(n,`${r}.app`),u=c(p,"Contents"),l=c(u,"MacOS"),b=c(u,"Resources");xe(p,{recursive:!0,force:!0}),C(l,{recursive:!0}),C(b,{recursive:!0});let g=c(b,"index.html");await Bun.write(g,e);let m="";if(t.sidebar?.enabled&&t.sidebar?.config)m=c(b,"sidebar-config.json"),await Bun.write(m,JSON.stringify(t.sidebar.config));let y=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",T=t.menubarOnly??t.systemTray,v=t.bundleStyle||(await $e(o)?"executable":"launcher");if(t.backend){if(!await ke(o))throw Error("This Craft runtime does not support bundled backends. Upgrade Craft before building this app.");I(o,c(l,r)),B(c(l,r),493);let k=ot("native-backend");try{let h=c(k,"launcher.ts"),M=c(import.meta.dir,"native-backend"+(import.meta.path.endsWith(".ts")?".ts":".js"));await Bun.write(h,`import { runNativeBackend } from ${JSON.stringify(M)}
1041
+ `}async function ec(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||q(),format:e.format||"app",error:`Input file not found: ${e.input}`};let i=e.target||q(),n=e.format||Re(i);if(e.backend&&i!=="macos")throw Error("Native backend bundles currently support macOS only.");if(e.backend&&!z(K(e.backend.entry)))throw Error(`Native backend not found: ${e.backend.entry}`);let s=e.output||c(process.cwd(),"dist","native");if(!z(s))C(s,{recursive:!0});let t=await a(process.cwd()),o=await _c(e.input,{context:e.context,options:{...t,isDev:!1},injectCSS:!0});if(o=Ya(o,{debug:e.verbose}),o=Qa(o),!o.includes("craft-component-styles")){if(o.includes("</head>"))o=f(o,ws)}let d=e.name||ye(e.input,".stx"),p=e.version||"1.0.0",u=e.craftPath||tc(e.runtimeProfile);if(!u)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 b=Bun.spawnSync([u,"--runtime-profile"],{stdout:"pipe",stderr:"pipe",timeout:1e4});if(b.exitCode!==0||b.stdout.toString().trim()!=="webview")throw Error("The requested Craft webview runtime is unavailable. Upgrade Craft with Pantry before building.")}if(u=vs(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: ${u}`);let l;switch(i){case"macos":l=await Ce(o,d,p,s,n,e,u);break;case"windows":l=await Te(o,d,p,s,n,e,u);break;case"linux":l=await Pe(o,d,p,s,n,e,u);break;case"ios":l=await Ie(o,d,p,s,e,u);break;case"android":l=await Be(o,d,p,s,e,u);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||q(),format:e.format||"app",error:i.message,duration:Date.now()-r}}}async function Ce(e,r,i,n,s,t,o){let d=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,p=c(n,`${r}.app`),u=c(p,"Contents"),l=c(u,"MacOS"),b=c(u,"Resources");xe(p,{recursive:!0,force:!0}),C(l,{recursive:!0}),C(b,{recursive:!0});let g=c(b,"index.html");await Bun.write(g,e);let m="";if(t.sidebar?.enabled&&t.sidebar?.config)m=c(b,"sidebar-config.json"),await Bun.write(m,JSON.stringify(t.sidebar.config));let y=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",T=t.menubarOnly??t.systemTray,v=t.bundleStyle||(await $e(o)?"executable":"launcher");if(t.backend){if(!await ke(o))throw Error("This Craft runtime does not support bundled backends. Upgrade Craft before building this app.");I(o,c(l,r)),B(c(l,r),493);let k=it("native-backend");try{let h=c(k,"launcher.ts"),M=c(import.meta.dir,"native-backend"+(import.meta.path.endsWith(".ts")?".ts":".js"));await Bun.write(h,`import { runNativeBackend } from ${JSON.stringify(M)}
1042
1042
  import * as backend from ${JSON.stringify(K(t.backend.entry))}
1043
1043
  await runNativeBackend({ html: ${JSON.stringify(e)}, fetch: backend.default, shutdown: Reflect.get(backend, "shutdown"),
1044
1044
  maxRequestBodySize: ${t.backend.maxRequestBodySize??33554432} })
@@ -1075,7 +1075,7 @@ Name=${r}
1075
1075
  Exec=${b}
1076
1076
  Terminal=false
1077
1077
  Categories=Utility;
1078
- `;if(await Bun.write(c(d,`${r.toLowerCase()}.desktop`),g),s==="deb"){let m=c(n,`${r.toLowerCase()}_${i}_amd64.deb`),y=await De(d,m,r,i,t);if(!y.success)return{success:!1,target:"linux",format:"deb",error:y.error};return{success:!0,target:"linux",format:"deb",outputPath:m}}if(s==="appimage"){let m=c(n,`${r}-${i}-x86_64.AppImage`),y=await qe(d,m,r,t);if(!y.success)return{success:!1,target:"linux",format:"appimage",error:y.error};return{success:!0,target:"linux",format:"appimage",outputPath:m}}return{success:!0,target:"linux",format:"app",outputPath:d}}async function Ie(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 Be(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 Za(e="full"){let r=process.env.CRAFT_BIN;if(r){if(!z(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 q(){switch(Se()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function Re(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 Ee(e,r,i){return ws({appBundlePath:e,outputPath:r,volumeName:i})}async function Oe(e,r){return new Promise((i)=>{let n=_("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 De(e,r,i,n,s){return new Promise((t)=>{let o=ot("deb");try{let d=c(o,"pkg"),p=c(d,"DEBIAN"),u=c(d,"usr","bin"),l=c(d,"usr","share","applications"),b=c(d,"usr","share",i.toLowerCase());C(p,{recursive:!0}),C(u,{recursive:!0}),C(l,{recursive:!0}),C(b,{recursive:!0});let g=w("fs").readdirSync(e);for(let v of g)I(c(e,v),c(b,v));let m=`#!/bin/bash
1078
+ `;if(await Bun.write(c(d,`${r.toLowerCase()}.desktop`),g),s==="deb"){let m=c(n,`${r.toLowerCase()}_${i}_amd64.deb`),y=await De(d,m,r,i,t);if(!y.success)return{success:!1,target:"linux",format:"deb",error:y.error};return{success:!0,target:"linux",format:"deb",outputPath:m}}if(s==="appimage"){let m=c(n,`${r}-${i}-x86_64.AppImage`),y=await qe(d,m,r,t);if(!y.success)return{success:!1,target:"linux",format:"appimage",error:y.error};return{success:!0,target:"linux",format:"appimage",outputPath:m}}return{success:!0,target:"linux",format:"app",outputPath:d}}async function Ie(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 Be(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 tc(e="full"){let r=process.env.CRAFT_BIN;if(r){if(!z(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 q(){switch(Se()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function Re(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 Ee(e,r,i){return xs({appBundlePath:e,outputPath:r,volumeName:i})}async function Oe(e,r){return new Promise((i)=>{let n=_("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 De(e,r,i,n,s){return new Promise((t)=>{let o=it("deb");try{let d=c(o,"pkg"),p=c(d,"DEBIAN"),u=c(d,"usr","bin"),l=c(d,"usr","share","applications"),b=c(d,"usr","share",i.toLowerCase());C(p,{recursive:!0}),C(u,{recursive:!0}),C(l,{recursive:!0}),C(b,{recursive:!0});let g=w("fs").readdirSync(e);for(let v of g)I(c(e,v),c(b,v));let m=`#!/bin/bash
1079
1079
  exec /usr/share/${i.toLowerCase()}/${i.toLowerCase()} "$@"`;w("fs").writeFileSync(c(u,i.toLowerCase()),m),B(c(u,i.toLowerCase()),493);let y=`Package: ${i.toLowerCase()}
1080
1080
  Version: ${n}
1081
1081
  Section: utils
@@ -1084,7 +1084,7 @@ Architecture: amd64
1084
1084
  Depends: libgtk-3-0, libwebkit2gtk-4.0-37
1085
1085
  Maintainer: ${s.author||"Unknown"}
1086
1086
  Description: ${s.description||i}
1087
- `;w("fs").writeFileSync(c(p,"control"),y);let T=_("dpkg-deb",["--build",d,r]);T.on("close",(v)=>{if(fe(o),v===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${v}`})}),T.on("error",(v)=>{fe(o),t({success:!1,error:v.message})})}catch(d){fe(o),t({success:!1,error:d.message})}})}async function qe(e,r,i,n){return new Promise((s)=>{let t=ot("appimage");try{let o=c(t,`${i}.AppDir`),d=c(o,"usr"),p=c(d,"bin"),u=c(d,"share");C(p,{recursive:!0}),C(u,{recursive:!0});let l=c(u,i.toLowerCase());C(l,{recursive:!0});let b=w("fs").readdirSync(e);for(let v of b)I(c(e,v),c(l,v));let g=`#!/bin/bash
1087
+ `;w("fs").writeFileSync(c(p,"control"),y);let T=_("dpkg-deb",["--build",d,r]);T.on("close",(v)=>{if(fe(o),v===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${v}`})}),T.on("error",(v)=>{fe(o),t({success:!1,error:v.message})})}catch(d){fe(o),t({success:!1,error:d.message})}})}async function qe(e,r,i,n){return new Promise((s)=>{let t=it("appimage");try{let o=c(t,`${i}.AppDir`),d=c(o,"usr"),p=c(d,"bin"),u=c(d,"share");C(p,{recursive:!0}),C(u,{recursive:!0});let l=c(u,i.toLowerCase());C(l,{recursive:!0});let b=w("fs").readdirSync(e);for(let v of b)I(c(e,v),c(l,v));let g=`#!/bin/bash
1088
1088
  SELF=$(readlink -f "$0")
1089
1089
  HERE=\${SELF%/*}
1090
1090
  export PATH="\${HERE}/usr/bin:\${PATH}"
@@ -1096,5 +1096,5 @@ Exec=${i.toLowerCase()}
1096
1096
  Terminal=false
1097
1097
  Categories=Utility;
1098
1098
  Icon=${i.toLowerCase()}
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 Qa(){return[q()]}function ec(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:Ya,getAvailableTargets:Qa,getAvailableFormats:ec,detectPlatform:q},ey=Ae;
1100
- export{Vu,Ka,Jh,Yh,Ga,Wo,ys,Xa,Ja,Zh,Qh,Ya,Za,Qa,ec,ey};
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 nc(){return[q()]}function rc(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:ec,getAvailableTargets:nc,getAvailableFormats:rc,detectPlatform:q},ry=Ae;
1100
+ export{qu,Ja,Qh,ey,Ya,Ko,ws,Za,Qa,ty,ny,ec,tc,nc,rc,ry};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{y,Ui,Sl,kl,Hg,Ug,Vg,Wg,qg,po,Kg,Ye,ie,Ze,Xg,Hr,Gg,El,Tl,qi,Qe,s,On,$l,b,Ce,Iy}from"./chunk-0ek3s3b6.js";import"./chunk-4hrryats.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Tl as SIGNAL_COMPOSABLE_CALL,Ce as clearComponentCache,qi as componentClientSignalNames,Ui as convertToCommonJS,b as createDetailedErrorMessage,qg as extractDirectiveNames,Sl as extractScriptFromTemplate,y as extractVariables,s as fileExists,Iy as getComponentCacheStats,Ug as getPositionInfo,ie as getSharedTranspiler,$l as getSourceLineInfo,Wg as hasDirectives,kl as hasVariables,Gg as isHydrateTrigger,Kg as isJavaScriptScript,Qe as renderComponentWithSlot,On as resolveTemplatePath,Xg as scopeOnRootElement,po as scopeSequenceKey,Ye as shouldTranspileTypeScript,El as slotContentHasExpressions,Ze as transpileTypeScript,Hr as userComponentFileExists,Vg as validateDirective,Hg as validateTemplate};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{nt,Vn,oa}from"./chunk-xr1s56k5.js";function So(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?nt(a,e):null,h=u?Vn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
2
+ import{st,Vn,ca}from"./chunk-eptzpvn0.js";function _o(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?st(a,e):null,h=u?Vn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
3
3
  * Service Worker - Auto-generated by stx
4
4
  * Cache Version: ${i}
5
5
  *
@@ -13,7 +13,7 @@ import{nt,Vn,oa}from"./chunk-xr1s56k5.js";function So(e,a){let t=e.pwa;if(!t?.en
13
13
  * Additional features:
14
14
  * - Push notifications: ${r?.enabled?"enabled":"disabled"}
15
15
  * - Background sync: ${s?.enabled?"enabled":"disabled"}
16
- * - Cache limits: ${n?.maxSize?`${oa(n.maxSize*1024*1024)}`:"unlimited"}
16
+ * - Cache limits: ${n?.maxSize?`${ca(n.maxSize*1024*1024)}`:"unlimited"}
17
17
  */
18
18
 
19
19
  const CACHE_VERSION = '${i}';
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
825
825
  event.waitUntil(registerFormSync(event.data.payload));
826
826
  }
827
827
  });
828
- `}function tn(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Zl(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function sm(e,a){if(!e.pwa?.enabled)return"";if(Zl(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-9w7whtbx.js");return t(e,a)}return So(e,a)}
829
- export{So,tn,Zl,sm};
828
+ `}function tn(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function tu(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function am(e,a){if(!e.pwa?.enabled)return"";if(tu(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-hhspwfva.js");return t(e,a)}return _o(e,a)}
829
+ export{_o,tn,tu,am};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import i from"path";var En=".stx",o="STX_DIR",e=null;function sl(t){e=t?.trim()||null}function Ir(){return process.env[o]?.trim()||e||En}function l(t=process.cwd(),...n){let r=Ir();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function Or(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==En&&!n.startsWith(`${En}/`))return t;let r=n.slice(En.length+1);return r?i.join(Ir(),r):Ir()}
3
+ export{En,sl,Ir,l,Or};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function Ze(n,f){return m.run(n,f)}function Dn(){return m.getStore()}function po(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Gi(){return po().public}function z(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Jt(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
3
- export{Ze,Dn,po,Gi,z,Jt};
2
+ import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function et(n,f){return m.run(n,f)}function Ln(){return m.getStore()}function go(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Yi(){return go().public}function z(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Jt(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
3
+ export{et,Ln,go,Yi,z,Jt};