@stacksjs/stx 0.2.413 → 0.2.414

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 (345) hide show
  1. package/dist/appearance-bootstrap.js +1 -1
  2. package/dist/binding-manifest.d.ts +1 -1
  3. package/dist/bundle-analyzer.js +20 -20
  4. package/dist/chunk-020xyn9q.js +3 -0
  5. package/dist/chunk-04jhmfbz.js +2 -0
  6. package/dist/chunk-10957mcb.js +2 -0
  7. package/dist/chunk-1098mas0.js +2 -0
  8. package/dist/chunk-169n1vpx.js +12 -0
  9. package/dist/chunk-1b6t12hd.js +2 -0
  10. package/dist/chunk-1chw8xsw.js +2 -0
  11. package/dist/chunk-1xdzcy9d.js +14 -0
  12. package/dist/chunk-2ce7f416.js +2 -0
  13. package/dist/chunk-2gr351s0.js +7 -0
  14. package/dist/chunk-2mkcjw08.js +2 -0
  15. package/dist/chunk-2v8wztd5.js +2 -0
  16. package/dist/chunk-340a824p.js +2 -0
  17. package/dist/chunk-39g1134q.js +2 -0
  18. package/dist/chunk-3c74vag1.js +2 -0
  19. package/dist/chunk-3kthfs03.js +3 -0
  20. package/dist/chunk-3qn1wcdg.js +2 -0
  21. package/dist/chunk-3s2vnqcf.js +2 -0
  22. package/dist/chunk-48bwk47q.js +2 -0
  23. package/dist/chunk-4bjravgk.js +2 -0
  24. package/dist/chunk-4jjme6a5.js +2 -0
  25. package/dist/chunk-5g3y8kym.js +2 -0
  26. package/dist/chunk-5gsxpaqk.js +2 -0
  27. package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
  28. package/dist/chunk-69mc2np8.js +2785 -0
  29. package/dist/chunk-6cfa3g0r.js +2 -0
  30. package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
  31. package/dist/chunk-6hc5vz20.js +3 -0
  32. package/dist/chunk-6q6g76vg.js +499 -0
  33. package/dist/{chunk-bwjxk1dw.js → chunk-6sgswrqw.js} +29 -29
  34. package/dist/chunk-6y8hnymb.js +2 -0
  35. package/dist/chunk-74j18qk0.js +930 -0
  36. package/dist/chunk-752hw7cd.js +4 -0
  37. package/dist/{chunk-kgd8kchy.js → chunk-765e1s44.js} +11 -76
  38. package/dist/chunk-7gkv67ky.js +4 -0
  39. package/dist/chunk-7z2ra0yf.js +2 -0
  40. package/dist/chunk-866n724v.js +2 -0
  41. package/dist/chunk-8nhshfz6.js +5 -0
  42. package/dist/chunk-92ps1xpk.js +2 -0
  43. package/dist/chunk-9g27ybyr.js +3 -0
  44. package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
  45. package/dist/{chunk-24zher49.js → chunk-9vrja6vp.js} +4 -4
  46. package/dist/chunk-9xrbve19.js +2 -0
  47. package/dist/chunk-a688m6js.js +3 -0
  48. package/dist/chunk-afhxw2t8.js +2 -0
  49. package/dist/chunk-ak1cgcah.js +5 -0
  50. package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
  51. package/dist/chunk-apg16xcn.js +2 -0
  52. package/dist/chunk-b52s5z0c.js +2 -0
  53. package/dist/chunk-b84h16er.js +61 -0
  54. package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
  55. package/dist/chunk-bmt7w2pk.js +2 -0
  56. package/dist/chunk-btmhj5t7.js +2 -0
  57. package/dist/chunk-ce1sejr3.js +3 -0
  58. package/dist/chunk-cg8hg6cs.js +3 -0
  59. package/dist/{chunk-4f9zyfdw.js → chunk-czxt605c.js} +4 -5
  60. package/dist/chunk-d44b9ktb.js +4 -0
  61. package/dist/chunk-daz5aqcf.js +24 -0
  62. package/dist/chunk-dgdm3hy3.js +2 -0
  63. package/dist/chunk-dvgv8nry.js +11 -0
  64. package/dist/chunk-dx7n22ed.js +2 -0
  65. package/dist/chunk-e57rhf65.js +3 -0
  66. package/dist/chunk-eed4fwps.js +3 -0
  67. package/dist/chunk-ej9j6k1q.js +3 -0
  68. package/dist/chunk-et0rr8c7.js +3 -0
  69. package/dist/chunk-f46qsp4m.js +4 -0
  70. package/dist/chunk-f6az0xj5.js +2 -0
  71. package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
  72. package/dist/chunk-fjs0a8h7.js +2 -0
  73. package/dist/chunk-fr2txj8q.js +829 -0
  74. package/dist/{chunk-xssw417m.js → chunk-ft4p6d28.js} +14 -14
  75. package/dist/chunk-fyzajkrx.js +2 -0
  76. package/dist/chunk-fzapbw9p.js +3 -0
  77. package/dist/chunk-g578mcb0.js +194 -0
  78. package/dist/chunk-gawrg4gb.js +216 -0
  79. package/dist/chunk-gw07qmjk.js +2 -0
  80. package/dist/chunk-h0atqq82.js +32 -0
  81. package/dist/chunk-h6zsqb9r.js +3 -0
  82. package/dist/{chunk-2snqdnk9.js → chunk-h85hrwkq.js} +13 -13
  83. package/dist/chunk-hbxz85wy.js +2 -0
  84. package/dist/chunk-hjg3ndgh.js +2 -0
  85. package/dist/chunk-hkxsewzk.js +2 -0
  86. package/dist/chunk-hrbbbtbn.js +2 -0
  87. package/dist/chunk-j03revz2.js +8 -0
  88. package/dist/chunk-j9qcrwbg.js +2 -0
  89. package/dist/chunk-jk4njz0w.js +2 -0
  90. package/dist/chunk-jmabeqfq.js +2 -0
  91. package/dist/chunk-jt0n43mk.js +2 -0
  92. package/dist/chunk-kjbv8a3m.js +2 -0
  93. package/dist/chunk-m1vdghnx.js +2 -0
  94. package/dist/chunk-m4sk62wb.js +5 -0
  95. package/dist/chunk-md8rqn48.js +30 -0
  96. package/dist/chunk-mepdnezf.js +17 -0
  97. package/dist/chunk-mhq0pjws.js +2 -0
  98. package/dist/chunk-mp6hy8g4.js +2 -0
  99. package/dist/chunk-ngc2wke4.js +3 -0
  100. package/dist/chunk-nn2vstke.js +2 -0
  101. package/dist/chunk-p2v2a68k.js +2 -0
  102. package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
  103. package/dist/chunk-pdt69hpb.js +2 -0
  104. package/dist/chunk-pgzvyrv6.js +29 -0
  105. package/dist/chunk-pj1wg7jg.js +2 -0
  106. package/dist/chunk-pqxzp1bb.js +3 -0
  107. package/dist/chunk-px7fvbj6.js +3 -0
  108. package/dist/chunk-q4c06e8x.js +20 -0
  109. package/dist/chunk-q6vrb2pe.js +2 -0
  110. package/dist/chunk-q7qchkvk.js +2 -0
  111. package/dist/chunk-q9bdh4s5.js +8 -0
  112. package/dist/chunk-qet5gc6s.js +2033 -0
  113. package/dist/chunk-qz519eyp.js +2 -0
  114. package/dist/chunk-r3f9jcf7.js +5 -0
  115. package/dist/chunk-rs4v4fha.js +4 -0
  116. package/dist/chunk-s2x4wcrz.js +2 -0
  117. package/dist/chunk-s5xezjps.js +3 -0
  118. package/dist/chunk-scezfp0w.js +30 -0
  119. package/dist/chunk-sd321bn3.js +2 -0
  120. package/dist/{chunk-smcj3442.js → chunk-sd47dzs0.js} +79 -79
  121. package/dist/chunk-se7mwqd1.js +2 -0
  122. package/dist/chunk-shr559s7.js +3 -0
  123. package/dist/chunk-syaw6b75.js +2 -0
  124. package/dist/chunk-t4hzprsm.js +3 -0
  125. package/dist/{chunk-pv3d7sfn.js → chunk-t61vdbje.js} +89 -89
  126. package/dist/chunk-tfexmdkt.js +3 -0
  127. package/dist/chunk-thyt8ed8.js +6 -0
  128. package/dist/chunk-v091jft4.js +12 -0
  129. package/dist/chunk-v4vaqxrf.js +33 -0
  130. package/dist/chunk-vgvtnwxa.js +4 -0
  131. package/dist/chunk-x0q32ees.js +3 -0
  132. package/dist/chunk-x5bpeb4a.js +2 -0
  133. package/dist/chunk-x72tv2cg.js +3 -0
  134. package/dist/chunk-xfp7k0v8.js +64 -0
  135. package/dist/chunk-xtdw3692.js +6 -0
  136. package/dist/chunk-y1cmjvk3.js +43 -0
  137. package/dist/chunk-y5310237.js +311 -0
  138. package/dist/chunk-ya0qecph.js +27 -0
  139. package/dist/chunk-yazk54jr.js +8 -0
  140. package/dist/chunk-ydjfar14.js +2 -0
  141. package/dist/chunk-ym95v4nc.js +3 -0
  142. package/dist/chunk-ynvdvbat.js +18 -0
  143. package/dist/chunk-yvx1ap9b.js +3 -0
  144. package/dist/chunk-z0g9jvv0.js +40 -0
  145. package/dist/chunk-z6d0jmjb.js +2 -0
  146. package/dist/{chunk-8sdhs0zk.js → chunk-zhxdpzga.js} +4 -4
  147. package/dist/cli.js +110 -110
  148. package/dist/craft-entry.js +7 -7
  149. package/dist/craft.js +7 -7
  150. package/dist/database.js +2 -2
  151. package/dist/image-optimization/component.js +4 -4
  152. package/dist/media/image/component.js +5 -5
  153. package/dist/media/protected/component.js +2 -2
  154. package/dist/media/video/index.js +4 -4
  155. package/dist/native/bridge/protocol.d.ts +325 -0
  156. package/dist/native/bridge/protocol.js +219 -0
  157. package/dist/native/cli.d.ts +24 -0
  158. package/dist/native/cli.js +52 -0
  159. package/dist/native/compiler/bundle.d.ts +41 -0
  160. package/dist/native/compiler/bundle.js +90 -0
  161. package/dist/native/compiler/client-script.d.ts +8 -0
  162. package/dist/native/compiler/client-script.js +31 -0
  163. package/dist/native/compiler/codegen.d.ts +10 -0
  164. package/dist/native/compiler/codegen.js +145 -0
  165. package/dist/native/compiler/headwind-to-style.d.ts +395 -0
  166. package/dist/native/compiler/headwind-to-style.js +1163 -0
  167. package/dist/native/compiler/html-to-ir.d.ts +41 -0
  168. package/dist/native/compiler/html-to-ir.js +411 -0
  169. package/dist/native/compiler/icons.d.ts +220 -0
  170. package/dist/native/compiler/icons.js +208 -0
  171. package/dist/native/compiler/ir.d.ts +234 -0
  172. package/dist/native/compiler/ir.js +15 -0
  173. package/dist/native/compiler/parser.d.ts +88 -0
  174. package/dist/native/compiler/parser.js +753 -0
  175. package/dist/native/compiler/render-screen.d.ts +26 -0
  176. package/dist/native/compiler/render-screen.js +31 -0
  177. package/dist/native/components/primitives.d.ts +291 -0
  178. package/dist/native/components/primitives.js +22 -0
  179. package/dist/native/hot-reload/client.d.ts +62 -0
  180. package/dist/native/hot-reload/client.js +324 -0
  181. package/dist/native/index.d.ts +90 -0
  182. package/dist/native/index.js +34 -0
  183. package/dist/native/primitives/ActivityIndicator.stx +5 -0
  184. package/dist/native/primitives/Button.stx +5 -0
  185. package/dist/native/primitives/DatePicker.stx +5 -0
  186. package/dist/native/primitives/FlatList.stx +5 -0
  187. package/dist/native/primitives/Image.stx +5 -0
  188. package/dist/native/primitives/ImageBackground.stx +5 -0
  189. package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
  190. package/dist/native/primitives/Modal.stx +5 -0
  191. package/dist/native/primitives/Picker.stx +5 -0
  192. package/dist/native/primitives/Pressable.stx +5 -0
  193. package/dist/native/primitives/RefreshControl.stx +5 -0
  194. package/dist/native/primitives/SafeAreaView.stx +5 -0
  195. package/dist/native/primitives/ScrollView.stx +5 -0
  196. package/dist/native/primitives/SectionList.stx +5 -0
  197. package/dist/native/primitives/Slider.stx +5 -0
  198. package/dist/native/primitives/StatusBar.stx +5 -0
  199. package/dist/native/primitives/Switch.stx +5 -0
  200. package/dist/native/primitives/Text.stx +5 -0
  201. package/dist/native/primitives/TextInput.stx +5 -0
  202. package/dist/native/primitives/TouchableHighlight.stx +5 -0
  203. package/dist/native/primitives/TouchableOpacity.stx +5 -0
  204. package/dist/native/primitives/View.stx +5 -0
  205. package/dist/native/runtime/craft.d.ts +75 -0
  206. package/dist/native/runtime/craft.js +0 -0
  207. package/dist/native/runtime/entry.d.ts +1 -0
  208. package/dist/native/runtime/entry.js +3 -0
  209. package/dist/native/runtime/index.d.ts +45 -0
  210. package/dist/native/runtime/index.js +165 -0
  211. package/dist/native/runtime/native-host.d.ts +33 -0
  212. package/dist/native/runtime/native-host.js +184 -0
  213. package/dist/native/runtime/screen.d.ts +43 -0
  214. package/dist/native/runtime/screen.js +808 -0
  215. package/dist/pwa/service-worker.js +1 -1
  216. package/dist/pwa/workbox.js +1 -1
  217. package/dist/pwa.js +8 -8
  218. package/dist/site-url.d.ts +1 -1
  219. package/dist/ssg.js +53 -53
  220. package/dist/visual-testing.js +42 -42
  221. package/dist/web-components/reactive-generator.js +2 -2
  222. package/package.json +9 -5
  223. package/dist/chunk-0btmm4m2.js +0 -147
  224. package/dist/chunk-0c2h69k2.js +0 -4
  225. package/dist/chunk-0d0qeqvv.js +0 -2
  226. package/dist/chunk-0psndabd.js +0 -2
  227. package/dist/chunk-0qv8yf53.js +0 -2
  228. package/dist/chunk-0vkxyvsd.js +0 -2
  229. package/dist/chunk-0we9nw1d.js +0 -3
  230. package/dist/chunk-0xqdmemy.js +0 -3
  231. package/dist/chunk-0y46fbkx.js +0 -3
  232. package/dist/chunk-158wqccn.js +0 -4422
  233. package/dist/chunk-1cyxbb8y.js +0 -16
  234. package/dist/chunk-1enwnh2a.js +0 -2
  235. package/dist/chunk-213pzm0d.js +0 -3
  236. package/dist/chunk-21hzqyja.js +0 -12
  237. package/dist/chunk-266t58b8.js +0 -5
  238. package/dist/chunk-27fgag95.js +0 -4
  239. package/dist/chunk-2a9n102n.js +0 -2
  240. package/dist/chunk-2eqzrczk.js +0 -2
  241. package/dist/chunk-2ke37m54.js +0 -14
  242. package/dist/chunk-35ds08e7.js +0 -3
  243. package/dist/chunk-3mtwkjcg.js +0 -2
  244. package/dist/chunk-4xr8zwkp.js +0 -2
  245. package/dist/chunk-58v77x2c.js +0 -2
  246. package/dist/chunk-5mhq8605.js +0 -2
  247. package/dist/chunk-5se8xt9e.js +0 -64
  248. package/dist/chunk-5zh0h080.js +0 -2
  249. package/dist/chunk-62435225.js +0 -2
  250. package/dist/chunk-6kdrncsx.js +0 -30
  251. package/dist/chunk-6n2rr3x7.js +0 -2
  252. package/dist/chunk-6xk87qf2.js +0 -30
  253. package/dist/chunk-72rwcbp6.js +0 -3
  254. package/dist/chunk-76w34xne.js +0 -3
  255. package/dist/chunk-7ekd7zj9.js +0 -2
  256. package/dist/chunk-7pr3wdd5.js +0 -3
  257. package/dist/chunk-7rxvafwc.js +0 -24
  258. package/dist/chunk-7tnwfa7w.js +0 -8
  259. package/dist/chunk-8c5je0wf.js +0 -2
  260. package/dist/chunk-8dz6nyvx.js +0 -2
  261. package/dist/chunk-98zj3fv2.js +0 -7
  262. package/dist/chunk-9e8t0twa.js +0 -3
  263. package/dist/chunk-9fqp72ze.js +0 -5
  264. package/dist/chunk-anydpa34.js +0 -3
  265. package/dist/chunk-ay6zjq8v.js +0 -3
  266. package/dist/chunk-az4v4ard.js +0 -3
  267. package/dist/chunk-ba5erggg.js +0 -2
  268. package/dist/chunk-bnagrdz6.js +0 -2
  269. package/dist/chunk-by8wghtf.js +0 -2
  270. package/dist/chunk-cd7h4q51.js +0 -2
  271. package/dist/chunk-cjmv8hgp.js +0 -33
  272. package/dist/chunk-cthf912y.js +0 -2
  273. package/dist/chunk-cxbpmwq5.js +0 -4
  274. package/dist/chunk-d3sy16qn.js +0 -2
  275. package/dist/chunk-dh6s7mrj.js +0 -1199
  276. package/dist/chunk-dm2nzg7a.js +0 -2
  277. package/dist/chunk-e2sgcnxc.js +0 -2
  278. package/dist/chunk-e3b7jj74.js +0 -2
  279. package/dist/chunk-ec4wq2sv.js +0 -6
  280. package/dist/chunk-ekzg97dn.js +0 -29
  281. package/dist/chunk-epjt342x.js +0 -2
  282. package/dist/chunk-eqe26g14.js +0 -18
  283. package/dist/chunk-ev0v1yma.js +0 -2
  284. package/dist/chunk-f53psr2y.js +0 -5
  285. package/dist/chunk-f8p69dsg.js +0 -3
  286. package/dist/chunk-f95drhdb.js +0 -194
  287. package/dist/chunk-ff5a6hvb.js +0 -17
  288. package/dist/chunk-fs5fy4h8.js +0 -2
  289. package/dist/chunk-fzsygce3.js +0 -2
  290. package/dist/chunk-g465x63k.js +0 -2
  291. package/dist/chunk-g708ekh1.js +0 -2
  292. package/dist/chunk-gcr9e83g.js +0 -11
  293. package/dist/chunk-gdmyrsr8.js +0 -4
  294. package/dist/chunk-gkms2ngq.js +0 -2
  295. package/dist/chunk-gnfywmgs.js +0 -7
  296. package/dist/chunk-hpf8kq7e.js +0 -2
  297. package/dist/chunk-j4x3faf8.js +0 -2
  298. package/dist/chunk-jkavtw9f.js +0 -2
  299. package/dist/chunk-kg1rdena.js +0 -3
  300. package/dist/chunk-km91wx0v.js +0 -2
  301. package/dist/chunk-kmsyvaex.js +0 -8
  302. package/dist/chunk-mrahwn5v.js +0 -8
  303. package/dist/chunk-nk3czvnk.js +0 -2
  304. package/dist/chunk-nmw4eewb.js +0 -2
  305. package/dist/chunk-nq5zxrk0.js +0 -4
  306. package/dist/chunk-ny67c03k.js +0 -3
  307. package/dist/chunk-p4wdxp2c.js +0 -2
  308. package/dist/chunk-pcxp4r9n.js +0 -3
  309. package/dist/chunk-pdyeaxc1.js +0 -2
  310. package/dist/chunk-pf06ded4.js +0 -2
  311. package/dist/chunk-pfs0gpzm.js +0 -2
  312. package/dist/chunk-pshdwq44.js +0 -2
  313. package/dist/chunk-pwgv84pn.js +0 -32
  314. package/dist/chunk-pwsnafp3.js +0 -4367
  315. package/dist/chunk-q9n5swx7.js +0 -3
  316. package/dist/chunk-qr346wnp.js +0 -2
  317. package/dist/chunk-r02hke04.js +0 -2
  318. package/dist/chunk-ranshpyc.js +0 -3
  319. package/dist/chunk-rn194bhp.js +0 -20
  320. package/dist/chunk-rn1hgyc8.js +0 -930
  321. package/dist/chunk-s7z5dp70.js +0 -43
  322. package/dist/chunk-s8jd13nb.js +0 -3
  323. package/dist/chunk-sn7exv0n.js +0 -2
  324. package/dist/chunk-t1tdjjht.js +0 -216
  325. package/dist/chunk-t6qx04s8.js +0 -499
  326. package/dist/chunk-t6y6gyps.js +0 -2
  327. package/dist/chunk-tjfs7cc3.js +0 -2
  328. package/dist/chunk-tkyrk66a.js +0 -3
  329. package/dist/chunk-tntv9hvq.js +0 -2
  330. package/dist/chunk-v3nwkveg.js +0 -12
  331. package/dist/chunk-vd4cb5xr.js +0 -2
  332. package/dist/chunk-vkhdce50.js +0 -2
  333. package/dist/chunk-w183av08.js +0 -2
  334. package/dist/chunk-w2m02njv.js +0 -2
  335. package/dist/chunk-wpjrcrs5.js +0 -2
  336. package/dist/chunk-wqmppf6b.js +0 -3
  337. package/dist/chunk-wtb9fxdy.js +0 -2
  338. package/dist/chunk-xmzygmcz.js +0 -3
  339. package/dist/chunk-xsng1mtq.js +0 -3
  340. package/dist/chunk-xxzefj4j.js +0 -2
  341. package/dist/chunk-yq8x8bxq.js +0 -47
  342. package/dist/chunk-ytma76qe.js +0 -3
  343. package/dist/chunk-yw1m115e.js +0 -2
  344. package/dist/chunk-z64a924m.js +0 -2
  345. package/dist/chunk-zcz9rs6p.js +0 -3
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{d,os,qi,Xi,fc,gc,mc,hc,yc,bc,Ve,N,Ue,vc,qn,wc,so,xc,We,n,Xn,io,g,K,ju}from"./chunk-69mc2np8.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-2gr351s0.js";import"./chunk-h0atqq82.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{K as clearComponentCache,xc as componentClientSignalNames,os as convertToCommonJS,g as createDetailedErrorMessage,yc as extractDirectiveNames,qi as extractScriptFromTemplate,d as extractVariables,n as fileExists,ju as getComponentCacheStats,gc as getPositionInfo,N as getSharedTranspiler,io as getSourceLineInfo,hc as hasDirectives,Xi as hasVariables,wc as isHydrateTrigger,bc as isJavaScriptScript,We as renderComponentWithSlot,Xn as resolveTemplatePath,vc as scopeOnRootElement,Ve as shouldTranspileTypeScript,so as slotContentHasExpressions,Ue as transpileTypeScript,qn as userComponentFileExists,mc as validateDirective,fc as validateTemplate};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function Ei(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function Ti(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
3
+ `);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
4
+ `)}function _i(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
5
+ export{Ei,Ti,_i};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{$e}from"./chunk-czxt605c.js";import{Rn,Kt}from"./chunk-765e1s44.js";import{f}from"./chunk-h0atqq82.js";import{ji,Bi,wt,M,Hn,Vn,Un,r,te,A,i}from"./chunk-69mc2np8.js";import{S}from"./chunk-ngc2wke4.js";import{xs}from"./chunk-2gr351s0.js";import{mo}from"./chunk-ak1cgcah.js";import{me,ie,ii,oi,Mt}from"./chunk-scezfp0w.js";import{yt,Ur}from"./chunk-xtdw3692.js";import{Nt}from"./chunk-9g27ybyr.js";import{dt,en,tn}from"./chunk-020xyn9q.js";import m from"fs";import c from"path";import{createHash as Y}from"crypto";function J(o){return Y("sha256").update(o).digest("hex").slice(0,8)}function U(o=!1){let l=o?Kt():Rn(),a=J(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function V(){let o=$e(),l=J(o);return{content:o,filename:`router.${l}.js`,hash:l}}import q from"path";import{createHash as ee}from"crypto";function re(o={}){let l=new Set;return{context:new Proxy(o,{get(s,e){if(e in s)return s[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(s,e){if(e in s)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(o,l,a={}){let s=q.resolve(o),e=await Bun.file(s).text(),_=ee("sha256").update(e).digest("hex").slice(0,16);ji();let R={};try{R=await i(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let v=g[1];if(/\bserver\b/.test(v))y.push(g[2])}let u=new Set(y.flatMap((v)=>te(v))),{context:w}=re({__filename:s,__dirname:q.dirname(s),__stx_serverDeclared:u}),C=new Set,P={...A,...R,...a,buildMode:"compile",strict:!1},b=await r(e,w,s,P,C),T=me(b),B=Bi();return{route:l,sourceFile:o,html:b,fragment:T,placeholders:B,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(C),contentHash:_,status:wt(e),streamTemplates:w.__streamTemplates}}var se=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(o,l){let a=0,s=0;if(!m.existsSync(o))return{copied:a,bytes:s};m.mkdirSync(l,{recursive:!0});function e(_,R){let y=m.readdirSync(_,{withFileTypes:!0});for(let d of y){if(se.has(d.name))continue;let g=c.join(_,d.name),u=c.join(R,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),a++,s+=m.statSync(u).size}}}return e(o,l),{copied:a,bytes:s}}async function Jc(o={}){let l=Date.now(),a=c.resolve(o.root||process.cwd()),s=c.resolve(a,o.outputDir||".output");console.log("[stx build] Starting production build...");let e=await i(a),_=c.resolve(a,o.componentsDir??e.componentsDir??"components"),R=c.resolve(a,o.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,o.layoutsDir??e.layoutsDir??"layouts"),d=o.publicDir??e.publicDir??"public",g=e.app?.head||{},u=e.app?.colorMode,w=e.router?.container||"main",C=o.routeRules??e.routeRules??{},P=Nt(C),b=o.serverApi??e.serverApi,T=typeof b==="object"?b:{};if(b)yt(a,T);if(e.runtimeConfig)S(e.runtimeConfig,{});if(m.existsSync(s))m.rmSync(s,{recursive:!0});let B=[c.join(s,"public","__stx"),c.join(s,"public","assets"),c.join(s,"server","pages"),c.join(s,"server","fragments")];for(let n of B)m.mkdirSync(n,{recursive:!0});console.log("[stx build] Discovering routes...");let v=M(a,{pagesDirs:e._layerPageDirs}),Q=["components","layouts","partials"],O=v.filter((n)=>!Q.some((h)=>n.pattern.startsWith(`/${h}/`)||n.pattern===`/${h}`));console.log(`[stx build] Found ${O.length} page routes (${v.length-O.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let D=U(o.debug),x=V();await Bun.write(c.join(s,"public","__stx",D.filename),D.content),await Bun.write(c.join(s,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${D.filename} (${(D.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let k=[],F=[];for(let n of O){let h=P(n.pattern),E=h.rendering==="prerender";if(E&&(n.pattern.includes(":")||n.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${n.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(n.filePath,n.pattern,{configDir:a,componentsDir:_,partialsDir:R,layoutsDir:y,debug:o.debug});if(k.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,D.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=Un(t.html,g,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=Hn(t.html,u);if(g.htmlAttrs)t.html=Vn(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let z=p[1];t.html=t.html.replace(" "+z,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${z}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await f(t.html),E){let p=await Mt(t,{params:{},request:new Request(`http://stx.build${n.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${n.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=ie(t.html,w);let G=n.pattern==="/"?"index":n.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),I=c.join("server","pages",`${G}.compiled.json`),W=c.join("server","fragments",`${G}.html`);await Bun.write(c.join(s,I),JSON.stringify(t,null,2)),await Bun.write(c.join(s,W),t.fragment),F.push({pattern:n.pattern,compiledPath:I,fragmentPath:W,isDynamic:t.hasServerScripts,hasParams:n.pattern.includes(":")||n.pattern.includes("["),prerendered:E}),console.log(`[stx build] \u2713 ${n.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${n.pattern}:`,t instanceof Error?t.message:t)}}let H=c.resolve(a,d);if(m.existsSync(H)){let{copied:n,bytes:h}=Z(H,c.join(s,"public"));if(n>0)console.log(`[stx build] Copied ${n} public asset${n===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let N=tn(a);if(N){let{copied:n,bytes:h}=Z(N,c.join(s,"public",en));if(n>0)console.log(`[stx build] Copied ${n} asset${n===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${dt}/`)}let K={runtime:D.filename,router:x.filename},j=ii(F,K,s);if(j.routeRules=C,j.routerContainer=w,b)j.apiRoutes=await Ur(a,s,T);if(e.runtimeConfig)await Bun.write(c.join(s,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await xs(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(s,"server/layers.json"),JSON.stringify(mo(e._layerGraph),null,2));oi(j,s);let L=Date.now()-l;return console.log(`
3
+ [stx build] Done in ${L}ms \u2014 ${k.length} pages compiled`),{pageCount:k.length,assets:K,outputDir:s,duration:L}}
4
+ export{Jc};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pa,lu,uu,du,pu,Ia,Da,fu,gu,mu,hu,Zt,Qt,Dn}from"./chunk-pqxzp1bb.js";import{he}from"./chunk-et0rr8c7.js";import"./chunk-69mc2np8.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-2gr351s0.js";import"./chunk-h0atqq82.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{pu as __setSignalsGeneratorsForTest,he as cacheEngineFingerprint,Qt as cacheTemplate,Zt as checkCache,hu as clearDevCaches,Da as getCachedRouterScript,Ia as getCachedSignalsRuntime,fu as getServeClientAsset,mu as getServeModuleBundle,Dn as hashFilePath,uu as invalidateFileCache,du as invalidateFileCacheByDir,lu as readFileCached,gu as registerServeModuleBundle,Pa as templateCache};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import"./chunk-z0g9jvv0.js";import"./chunk-shr559s7.js";import"./chunk-752hw7cd.js";import{o}from"./chunk-fzapbw9p.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||o(e.root,"story","snapshots");await f.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((p)=>a.fileName.toLowerCase().includes(p.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(a);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(a,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(a,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
3
+ `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -0,0 +1,30 @@
1
+ // @bun
2
+ import{Fi,Jr,vt,b,Be,Fe,zn,d,on}from"./chunk-69mc2np8.js";import{G,xe}from"./chunk-h0atqq82.js";import{O}from"./chunk-px7fvbj6.js";var D=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function F(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(D.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var H=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function ti(t){let n=[],e=[],r=[],o=0;while(o<t.length){let s=t.indexOf("<",o);if(s===-1)break;let a=xe(t,s);if(a>s){o=a;continue}let i=G(t,s);if(i>s){let c=t.slice(s,i),u=H.exec(c);if(u){let l=F(u[1],u[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}o=i;continue}o=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function V(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function B(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,o=r.match(/^[a-z][\w-]*/i);if(o)e.tag=o[0].toLowerCase(),r=r.slice(o[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let i=r.match(/^\.([\w-]+)/);if(i){e.className=i[1],r=r.slice(i[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function q(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function T(t,n="main"){let e=B(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,o=V(t),s;while((s=r.exec(t))!==null){if(P(s.index,o))continue;let a=s[1].toLowerCase(),i=s[2]||"";if(i.trimEnd().endsWith("/")||L.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!q(i,e))continue;let c=s[0],u=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,p;while((p=l.exec(t))!==null){if(P(p.index,o))continue;let h=p[1]==="/";if(!h&&(p[2]||"").trimEnd().endsWith("/"))continue;if(f+=h?-1:1,f===0)return{openTag:c,openIndex:s.index,start:u,end:p.index,tagName:a}}return null}return null}var Pe="private, no-store";function ni(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function se(t){return t.headers.get("X-STX-Router")==="true"}function z(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function C(t){return{Vary:z(t,"X-STX-Router")}}import E from"path";var U="stx-page-head:",W=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function X(){let t=O()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-jk4njz0w.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function ri(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=E.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Sr(t,n){try{let e=await Bun.file(t).text(),r=e,o=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(o)r=o[1].trim();let s=ti(e),a=[...s.client.map((m)=>m.fullTag),...s.signals.map((m)=>m.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(e))!==null)i.push(u[0]);let l=r;for(let m of s.server)l=l.replace(m.fullTag,"");for(let m of s.client)l=l.replace(m.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let f="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,f).replace(/<slot\s*>\s*<\/slot>/gi,f),!l.includes(f))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:p,extractVariables:h,defaultConfig:x,loadStxConfig:y}=await import("./chunk-48bwk47q.js"),R=await y(),g={__filename:t,__dirname:E.dirname(t)};for(let m of a){let A=m.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!m.includes("client")&&!m.includes('type="module"'))await h(A[1],g,t)}let S=await p(l,g,t,{...x,...R,...n},new Set),w=S.indexOf(f);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,w),afterSlot:S.substring(w+f.length),filePath:t,shellScripts:a,shellStyles:i}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function En(t,n,e){let r,o="",s=n.match(W);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();o=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",i=X(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>${a}</title>
8
+ ${o?` ${o}
9
+ `:""} ${t.shellStyles.join(`
10
+ `)}
11
+ </head>
12
+ <body>
13
+ ${t.beforeSlot}
14
+ <div data-stx-content>${n}</div>
15
+ ${t.afterSlot}
16
+ ${t.shellScripts.filter((l)=>!l.includes("server")).join(`
17
+ `)}
18
+ ${c}
19
+ ${i}
20
+ </body>
21
+ </html>`}function me(t,n={}){let e=t.trim();if(!on(e))return t;let r=[],o=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(o){let c=o[1],u=/<style\b[^>]*>[\s\S]*?<\/style>/gi,l;while((l=u.exec(c))!==null)r.push(l[0]);let f=c.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(f)r.push(f[0]);let p=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(p)r.push(p[0])}if(n.preserveHead&&o){let c=[],u=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=u.exec(o[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${U}${Buffer.from(c.join(`
22
+ `),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,u=e.slice(c,a).trim();if(r.length>0)return r.join(`
23
+ `)+`
24
+ `+u;return u}let i=e;if(i=i.replace(/<!DOCTYPE\b[^>]*>/i,""),i=i.replace(/<html\b[^>]*>/i,""),i=i.replace(/<\/html\s*>/i,""),o)i=i.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
25
+ `));return i=i.replace(/<body\b[^>]*>/i,""),i=i.replace(/<\/body\s*>/i,""),i.trim()}var N=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function J(t,n,e,r){if(!N.test(n))return!1;let o=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(o)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let i=t.indexOf(a);i!==-1;i=t.indexOf(a,i+a.length))if(i>=e&&i<r)return!1;return!0}function si(t){return se(t)}function ie(t,n="main"){let e=t.trim(),r=[],o=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let y=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,g;while((g=R.exec(y))!==null)r.push(g[0]);let S=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((g=S.exec(y))!==null){if(N.test(g[0])||g[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(g[0]))continue;o.push(g[0])}}let a=T(e,n);if(!a)return me(t);let{tagName:i,start:c,end:u}=a,l=e.slice(c,u).trim(),f=[],p=e.match(/<body\b[^>]*>/i),h=e.lastIndexOf("</body>");if(p&&p.index!==void 0&&h!==-1){let R=[[p.index+p[0].length,a.openIndex],[u+`</${i}>`.length,h]],g=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[S,w]of R){if(S>=w)continue;let m=e.slice(S,w),A;g.lastIndex=0;while((A=g.exec(m))!==null){if(J(e,A[0],c,u))continue;f.push(A[0])}}}let x=[];if(r.length>0)x.push(r.join(`
26
+ `));if(o.length>0)x.push(o.join(`
27
+ `));if(f.length>0)x.push(f.join(`
28
+ `));return x.push(l),x.join(`
29
+ `)}import _ from"fs";import I from"path";function ii(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function oi(t,n){let e=I.join(n,"manifest.json");_.writeFileSync(e,JSON.stringify(t,null,2))}function ai(t){let n=I.join(t,"manifest.json");if(!_.existsSync(n))return null;try{let e=_.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function k(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function K(t){let n=t.headers.get("content-type")||"",e={},r=(o,s)=>{let a=e[o];if(a===void 0)e[o]=s;else if(Array.isArray(a))a.push(s);else e[o]=[a,s]};if(n.includes("multipart/form-data")){let o=await t.formData();for(let[s,a]of o.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[o,s]of new URLSearchParams(await t.text()).entries())r(o,s);return e}return e}function kr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function j(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!kr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let o={};try{o=await K(e)}catch{}let s=await t.action({request:e,form:o,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,i=Y(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(t,f),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function Y(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(k(e,r));continue}if(r&&typeof r==="object"){let o=r;if(typeof o.value!=="string")continue;n.push(k(e,o.value,o))}}return n}function ci(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let o of n)r.append("Set-Cookie",o);for(let[o,s]of Object.entries(e??{}))if(o.toLowerCase()!=="location")r.set(o,s);return new Response(null,{status:303,headers:r})}async function Mt(t,n={}){let{html:e,context:r,redirect:o,cookies:s}=await Z(t,n),a=Be(r),i=Fe(r);if(o)return{html:e,redirect:o,cookies:s,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-bmt7w2pk.js"),u=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-se7mwqd1.js"),{defaultConfig:p}=await import("./chunk-syaw6b75.js"),h=r.streamBoundaries||{},x={...p,autoShell:!1},y=Object.keys(l).map((g)=>({id:g,render:async()=>{let S=typeof h[g]==="function"?await h[g]():void 0;return f(l[g],{...r,$boundary:S},t.sourceFile,x,new Set)}})),R=new Set(y.map((g)=>g.id));u=[...(u||[]).filter((g)=>!R.has(g.id)),...y]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:s,status:a,headers:i}}async function Z(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!Jr(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await d(a,e,t.sourceFile)}catch(i){if(n.__stx_strict_hydration)throw i;console.warn(`[stx] Server script error in ${t.sourceFile}:`,i)}let r=await j(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),o=(a)=>{let i=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=zn(e);if(!c)return i;let u=i.indexOf("</head>");return u<0?c+i:i.slice(0,u)+c+i.slice(u)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!Jr(t.html))return{html:o(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,i]of Object.entries(t.placeholders))if(i.expression)try{let c=b(i.expression,e);if(i.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?vt(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:o(Fi(t.html,s)),context:e,cookies:r.cookies}}
30
+ export{ti,Pe,ni,se,C,ri,Sr,En,me,si,ie,ii,oi,ai,kr,ci,Mt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ri,Ai,Pi,Oa,Ma}from"./chunk-q9bdh4s5.js";export{Ai as auditBuildOutput,Ri as auditConfig,Pi as calculateAuditResult,Ma as formatAuditResult,Oa as runPwaAudit};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Dk as m}from"./chunk-eqe26g14.js";import{kx as z}from"./chunk-ay6zjq8v.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
2
+ import{$i}from"./chunk-ynvdvbat.js";import{u}from"./chunk-cg8hg6cs.js";import{existsSync as z,mkdirSync as v,copyFileSync as k,chmodSync as T}from"fs";import{join as o,basename as te}from"path";import{spawn as E,execSync as re}from"child_process";import{tmpdir as M,homedir as q,platform as ae}from"os";var yu=`
3
3
  <script>
4
4
  (function() {
5
5
  'use strict';
@@ -465,7 +465,7 @@ else if (data.type === 'event' && data.method) {
465
465
  }
466
466
  })();
467
467
  </script>
468
- `;function D(q={}){let{debug:U=!1,timeout:$=30000}=q;return`
468
+ `;function hi(e={}){let{debug:r=!1,timeout:a=30000}=e;return`
469
469
  <script>
470
470
  (function() {
471
471
  'use strict';
@@ -931,23 +931,23 @@ else if (data.type === 'event' && data.method) {
931
931
  }
932
932
  })();
933
933
  </script>
934
- `.replace("debug: false,",`debug: ${U},`).replace("timeout: 30000",`timeout: ${$}`)}function Cq(){return!1}function yq(q,U={}){let $=/@craft(?:\(([\s\S]*?)\))?/g;return q.replace($,(J,W)=>{let K={};if(W)try{K=JSON.parse(W.replace(/'/g,'"'))}catch{try{K=Function(`return ${W}`)()}catch{console.warn(`[stx] Invalid @craft config: ${W}`)}}return D(K)})}function N(q,U={}){if(q.includes("__craftBridgeInitialized"))return q;let $=D(U);if(q.includes("</head>"))return q.replace("</head>",`${$}
935
- </head>`);if(q.includes("<body"))return q.replace(/(<body[^>]*>)/,`$1
936
- ${$}`);return $+q}var b={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:(q,U)=>{let $=q.checked?"checked":"",J=q.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
937
- <input type="checkbox" class="craft-checkbox" ${$} ${J}>
938
- <span class="craft-checkbox-label">${U||q.label||""}</span>
939
- </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:(q,U)=>{let $=q.min??0,J=q.max??100,W=q.step??1,K=q.value??50,Y=q.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${$}" max="${J}" step="${W}" value="${K}" ${Y}>`}},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:(q,U)=>{let $=q.size||40,J=q.src,W=String(q.alt||""),K=q.fallback||(W?W.charAt(0).toUpperCase():"?");if(J)return`<img class="craft-avatar" src="${J}" alt="${W}" style="width:${$}px;height:${$}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${$}px;height:${$}px;border-radius:50%;display:flex;align-items:center;justify-content:center">${K}</div>`}},progress:{nativeType:"craft-progress",fallbackTag:"div",fallbackClasses:"craft-progress",nativeProps:["value","max","variant"],render:(q,U)=>{let $=Number(q.value)||0,J=Number(q.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,$/J*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(q,U)=>{let $=q.size||24;return`<div class="craft-spinner" style="width:${$}px;height:${$}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:(q,U)=>{let $=q.open?"open":"",J=q.title||"";return`<dialog class="craft-modal" ${$}>
934
+ `.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${a}`)}function bu(){return!1}function vu(e,r={}){let a=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(a,(i,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 hi(t)})}function yi(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let a=hi(r);if(e.includes("</head>"))return e.replace("</head>",`${a}
935
+ </head>`);if(e.includes("<body"))return e.replace(/(<body[^>]*>)/,`$1
936
+ ${a}`);return a+e}var Br={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 a=e.checked?"checked":"",i=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
937
+ <input type="checkbox" class="craft-checkbox" ${a} ${i}>
938
+ <span class="craft-checkbox-label">${r||e.label||""}</span>
939
+ </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 a=e.min??0,i=e.max??100,s=e.step??1,t=e.value??50,n=e.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${a}" max="${i}" step="${s}" value="${t}" ${n}>`}},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 a=e.size||40,i=e.src,s=String(e.alt||""),t=e.fallback||(s?s.charAt(0).toUpperCase():"?");if(i)return`<img class="craft-avatar" src="${i}" alt="${s}" style="width:${a}px;height:${a}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${a}px;height:${a}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 a=Number(e.value)||0,i=Number(e.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,a/i*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(e,r)=>{let a=e.size||24;return`<div class="craft-spinner" style="width:${a}px;height:${a}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 a=e.open?"open":"",i=e.title||"";return`<dialog class="craft-modal" ${a}>
940
940
  <div class="craft-modal-content">
941
- ${J?`<div class="craft-modal-header"><h2>${J}</h2></div>`:""}
942
- <div class="craft-modal-body">${U}</div>
941
+ ${i?`<div class="craft-modal-header"><h2>${i}</h2></div>`:""}
942
+ <div class="craft-modal-body">${r}</div>
943
943
  </div>
944
- </dialog>`}},tabs:{nativeType:"craft-tabs",fallbackTag:"div",fallbackClasses:"craft-tabs",nativeProps:["activeTab","tabs"]},accordion:{nativeType:"craft-accordion",fallbackTag:"details",fallbackClasses:"craft-accordion",nativeProps:["open","title"],render:(q,U)=>{let $=q.open?"open":"",J=q.title||"Details";return`<details class="craft-accordion" ${$}>
945
- <summary class="craft-accordion-header">${J}</summary>
946
- <div class="craft-accordion-content">${U}</div>
947
- </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:(q,U)=>{let $=q.variant||"info",J=q.title||"";return`<div class="craft-alert craft-alert-${$}" role="alert">
948
- ${J?`<div class="craft-alert-title">${J}</div>`:""}
949
- <div class="craft-alert-content">${U}</div>
950
- </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:(q,U)=>{let $=q.content||"",J=q.position||"top";return`<span class="craft-tooltip" data-tooltip="${$}" data-position="${J}">${U}</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:r},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:a},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:t},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:o},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:(q,U)=>{return`<input type="color" class="craft-color-picker" value="${q.value||"#000000"}">`}},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(q,U)=>{let $=q.value||"",J=q.min||"",W=q.max||"";return`<input type="date" class="craft-date-picker" value="${$}" min="${J}" max="${W}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(q,U)=>{return`<input type="time" class="craft-time-picker" value="${q.value||""}">`}}},h=`
944
+ </dialog>`}},tabs:{nativeType:"craft-tabs",fallbackTag:"div",fallbackClasses:"craft-tabs",nativeProps:["activeTab","tabs"]},accordion:{nativeType:"craft-accordion",fallbackTag:"details",fallbackClasses:"craft-accordion",nativeProps:["open","title"],render:(e,r)=>{let a=e.open?"open":"",i=e.title||"Details";return`<details class="craft-accordion" ${a}>
945
+ <summary class="craft-accordion-header">${i}</summary>
946
+ <div class="craft-accordion-content">${r}</div>
947
+ </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 a=e.variant||"info",i=e.title||"";return`<div class="craft-alert craft-alert-${a}" role="alert">
948
+ ${i?`<div class="craft-alert-title">${i}</div>`:""}
949
+ <div class="craft-alert-content">${r}</div>
950
+ </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 a=e.content||"",i=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${a}" data-position="${i}">${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:j},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:H},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:V},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:W},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 a=e.value||"",i=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${a}" min="${i}" 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||""}">`}},bi=`
951
951
  <style id="craft-component-styles">
952
952
  /* Craft Component Base Styles */
953
953
  .craft-button {
@@ -1365,7 +1365,7 @@ ${$}`);return $+q}var b={button:{nativeType:"craft-button",fallbackTag:"button",
1365
1365
  }
1366
1366
  }
1367
1367
  </style>
1368
- `,bq=`
1368
+ `,wu=`
1369
1369
  <script id="craft-component-runtime">
1370
1370
  (function() {
1371
1371
  if (window.__stxCraftComponentRuntime) return;
@@ -1469,7 +1469,7 @@ ${$}`);return $+q}var b={button:{nativeType:"craft-button",fallbackTag:"button",
1469
1469
  document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
1470
1470
  })();
1471
1471
  </script>
1472
- `;function u(q,U={}){let{classPrefix:$="craft"}=U;if(!q.includes("craft-component-styles"))if(q.includes("</head>"))q=q.replace("</head>",`${`
1472
+ `;function vi(e,r={}){let{classPrefix:a="craft"}=r;if(!e.includes("craft-component-styles"))if(e.includes("</head>"))e=e.replace("</head>",`${`
1473
1473
  <style id="craft-component-styles">
1474
1474
  /* Craft Component Base Styles */
1475
1475
  .craft-button {
@@ -1888,7 +1888,7 @@ ${$}`);return $+q}var b={button:{nativeType:"craft-button",fallbackTag:"button",
1888
1888
  }
1889
1889
  </style>
1890
1890
  `}
1891
- </head>`);else if(q.includes("<style>"))q=q.replace("<style>",`${`
1891
+ </head>`);else if(e.includes("<style>"))e=e.replace("<style>",`${`
1892
1892
  <style id="craft-component-styles">
1893
1893
  /* Craft Component Base Styles */
1894
1894
  .craft-button {
@@ -2307,7 +2307,7 @@ ${$}`);return $+q}var b={button:{nativeType:"craft-button",fallbackTag:"button",
2307
2307
  }
2308
2308
  </style>
2309
2309
  `}
2310
- <style>`);else q=`
2310
+ <style>`);else e=`
2311
2311
  <style id="craft-component-styles">
2312
2312
  /* Craft Component Base Styles */
2313
2313
  .craft-button {
@@ -2725,7 +2725,7 @@ ${$}`);return $+q}var b={button:{nativeType:"craft-button",fallbackTag:"button",
2725
2725
  }
2726
2726
  }
2727
2727
  </style>
2728
- `+q;if(!q.includes("craft-component-runtime"))if(q.includes("</body>"))q=q.replace("</body>",`${`
2728
+ `+e;if(!e.includes("craft-component-runtime"))if(e.includes("</body>"))e=e.replace("</body>",`${`
2729
2729
  <script id="craft-component-runtime">
2730
2730
  (function() {
2731
2731
  if (window.__stxCraftComponentRuntime) return;
@@ -2830,7 +2830,7 @@ ${$}`);return $+q}var b={button:{nativeType:"craft-button",fallbackTag:"button",
2830
2830
  })();
2831
2831
  </script>
2832
2832
  `}
2833
- </body>`);else q+=`
2833
+ </body>`);else e+=`
2834
2834
  <script id="craft-component-runtime">
2835
2835
  (function() {
2836
2836
  if (window.__stxCraftComponentRuntime) return;
@@ -2934,89 +2934,89 @@ ${$}`);return $+q}var b={button:{nativeType:"craft-button",fallbackTag:"button",
2934
2934
  document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
2935
2935
  })();
2936
2936
  </script>
2937
- `;return q=q.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(J,W,K)=>{return C("sidebar",W,K.trim(),U,$)}),q=q.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(J,W)=>{return C("sidebar",W,"",U,$)}),q=q.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(J,W,K)=>{return C(W,K,"",U,$)}),q=q.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(J,W,K,Y)=>{return C(W,K,Y.trim(),U,$)}),q}function C(q,U,$,J,W){let K=J.components?.[q]||b[q];if(!K)return console.warn(`[stx] Unknown Craft component: @craft-${q}`),`<div class="${W}-unknown" data-component="${q}">${$}</div>`;let Y=y(U),L=[K.fallbackClasses||`${W}-${q}`];if(Y.class)L.push(Y.class),delete Y.class;if(K.render)return Y.__fallbackClasses=L.join(" "),K.render(Y,$);let Q=Wq(Y,K,L);if(["input","hr","br","img"].includes(K.fallbackTag))return`<${K.fallbackTag} ${Q}>`;return`<${K.fallbackTag} ${Q}>${$}</${K.fallbackTag}>`}function y(q){let U={},$=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,J;while((J=$.exec(q))!==null){let[W,K,Y,L]=J,Q=Y??L;if(W.startsWith(":"))U[K]=Q;else if(W.startsWith("@"))U[`on${K.charAt(0).toUpperCase()}${K.slice(1)}`]=Q;else if(Q===void 0)U[K]=!0;else U[K]=Q}return U}function r(q,U){let $=k(String(q.id||`craft-sidebar-${$q(U||JSON.stringify(q))}`)),J=qq(q.spaces)||e(U),W=J.length?[]:Uq(q.sections)||d(U),K=String(q.selectedSpace||J[0]?.id||""),Y=J.find((E)=>E.id===K)||J[0],L=String(q.selectedItem||q.selected||(J.length?Y?.sections[0]?.items[0]?.id:W[0]?.items[0]?.id)||""),Q={id:$,variant:String(q.variant||"desktop"),material:String(q.material||"sidebar"),backgroundEffect:String(q.backgroundEffect||"shimmer"),allowsVibrancy:q.allowsVibrancy!==!1&&q.allowsVibrancy!=="false",materialOpacity:Number(q.materialOpacity??0.68),materialDarkOpacity:q.materialDarkOpacity===void 0?void 0:Number(q.materialDarkOpacity),minWidth:q.minWidth===void 0?240:Number(q.minWidth),maxWidth:q.maxWidth===void 0?340:Number(q.maxWidth),canCollapse:q.canCollapse!==!1&&q.canCollapse!=="false",searchPlaceholder:q.searchPlaceholder?String(q.searchPlaceholder):void 0,selectedItem:L,sections:W,spaces:J,selectedSpace:K||void 0},X=String(q.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),w=Number(q.width||q.sidebarWidth||286),G=q.native===!1||q.native==="false"?"false":"true",B=Q.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${O(Q.searchPlaceholder)}"></div>`:"",_;if(J.length)_=Kq(J,K,L);else if(W.length)_=W.map((E)=>g(E,L)).join("");else _=U;return`<aside class="${R(X)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${R($)}" data-native="${G}" style="--craft-sidebar-width:${w}px">
2938
- ${B}
2939
- ${_}
2937
+ `;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),r,a)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),r,a)),e}function R(e,r,a,i,s){let t=i.components?.[e]||Br[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${a}</div>`;let n=A(r),c=[t.fallbackClasses||`${s}-${e}`];if(n.class)c.push(n.class),delete n.class;if(t.render)return n.__fallbackClasses=c.join(" "),t.render(n,a);let d=ee(n,t,c);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${d}>`;return`<${t.fallbackTag} ${d}>${a}</${t.fallbackTag}>`}function A(e){let r={},a=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,i;while((i=a.exec(e))!==null){let[s,t,n,c]=i,d=n??c;if(s.startsWith(":"))r[t]=d;else if(s.startsWith("@"))r[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=d;else if(d===void 0)r[t]=!0;else r[t]=d}return r}function j(e,r){let a=I(String(e.id||`craft-sidebar-${K(r||JSON.stringify(e))}`)),i=Q(e.spaces)||Y(r),s=i.length?[]:X(e.sections)||F(r),t=String(e.selectedSpace||i[0]?.id||""),n=i.find((g)=>g.id===t)||i[0],c=String(e.selectedItem||e.selected||(i.length?n?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),d={id:a,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:c,sections:s,spaces:i,selectedSpace:t||void 0},l=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),p=Number(e.width||e.sidebarWidth||286),f=e.native===!1||e.native==="false"?"false":"true",x=d.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${C(d.searchPlaceholder)}"></div>`:"",b;if(i.length)b=G(i,t,c);else if(s.length)b=s.map((g)=>D(g,c)).join("");else b=r;return`<aside class="${h(l)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${h(a)}" data-native="${f}" style="--craft-sidebar-width:${p}px">
2938
+ ${x}
2939
+ ${b}
2940
2940
  </aside>
2941
- <script type="application/json" data-craft-sidebar-config="${R($)}">${Jq(Q)}</script>`}function a(q,U){let $=k(String(q.id||q.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${R($)}">
2942
- ${q.label?`<div class="craft-sidebar-space-title">${O(String(q.label))}</div>`:""}
2943
- ${U}
2944
- </section>`}function t(q,U){let $=String(q.header||q.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${R(String(q.id||"section"))}">
2945
- ${$?`<div class="craft-sidebar-section-title">${O($)}</div>`:""}
2946
- ${U}
2947
- </section>`}function o(q,U){let $={id:String(q.id||k(String(q.label||U||"item"))),label:String(q.label||U||""),icon:q.icon?String(q.icon):void 0,badge:q.badge?String(q.badge):void 0,tintColor:q.tintColor?String(q.tintColor):void 0};return f($,String(q.selected||"")==="true")}function d(q){let U=[],$=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,J;while((J=$.exec(q))!==null){let W=y(J[1]||""),K=J[2]||"",Y=String(W.id||k(String(W.header||W.title||`section-${U.length+1}`))),L=String(W.header||W.title||Y),Q=p(K);U.push({id:Y,header:L,title:L,items:Q})}return U}function p(q){let U=[],$=/<@craft-sidebar-item\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-item>)/g,J;while((J=$.exec(q))!==null){let W=y(J[1]||""),K=String(W.label||(J[2]||"").replace(/<[^>]*>/g,"").trim()),Y=String(W.id||k(K||`item-${U.length+1}`));U.push({id:Y,label:K,icon:W.icon?String(W.icon):void 0,badge:W.badge?String(W.badge):void 0,tintColor:W.tintColor?String(W.tintColor):void 0})}return U}function e(q){let U=[],$=/<@craft-sidebar-space\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-space>)/g,J;while((J=$.exec(q))!==null){let W=y(J[1]||""),K=J[2]||"",Y=String(W.label||W.title||`Space ${U.length+1}`);U.push({id:String(W.id||k(Y)),label:Y,icon:W.icon?String(W.icon):void 0,tint:W.tint?String(W.tint):void 0,sections:d(K)})}return U}function qq(q){if(!q)return;if(Array.isArray(q))return q;if(typeof q!=="string")return;try{let U=JSON.parse(q);return Array.isArray(U)?U:void 0}catch{return}}function Kq(q,U,$){let J=q.map((K)=>`<button class="craft-sidebar-space-tab" type="button" data-space-target="${R(K.id)}" data-selected="${K.id===U?"true":"false"}" title="${R(K.label||K.id)}">${K.icon?`<span class="craft-sidebar-item-icon" data-icon="${R(K.icon)}"></span>`:O((K.label||K.id).charAt(0))}</button>`).join("");return`<div class="craft-sidebar-spaces">${q.map((K)=>`<section class="craft-sidebar-space" data-space-id="${R(K.id)}" data-selected="${K.id===U?"true":"false"}">
2948
- ${K.label?`<div class="craft-sidebar-space-title">${O(K.label)}</div>`:""}
2949
- ${K.sections.map((Y)=>g(Y,$)).join("")}
2941
+ <script type="application/json" data-craft-sidebar-config="${h(a)}">${Z(d)}</script>`}function H(e,r){let a=I(String(e.id||e.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${h(a)}">
2942
+ ${e.label?`<div class="craft-sidebar-space-title">${C(String(e.label))}</div>`:""}
2943
+ ${r}
2944
+ </section>`}function V(e,r){let a=String(e.header||e.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${h(String(e.id||"section"))}">
2945
+ ${a?`<div class="craft-sidebar-section-title">${C(a)}</div>`:""}
2946
+ ${r}
2947
+ </section>`}function W(e,r){let a={id:String(e.id||I(String(e.label||r||"item"))),label:String(e.label||r||""),icon:e.icon?String(e.icon):void 0,badge:e.badge?String(e.badge):void 0,tintColor:e.tintColor?String(e.tintColor):void 0};return O(a,String(e.selected||"")==="true")}function F(e){let r=[],a=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,i;while((i=a.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.id||I(String(s.header||s.title||`section-${r.length+1}`))),c=String(s.header||s.title||n),d=J(t);r.push({id:n,header:c,title:c,items:d})}return r}function J(e){let r=[],a=/<@craft-sidebar-item\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-item>)/g,i;while((i=a.exec(e))!==null){let s=A(i[1]||""),t=String(s.label||(i[2]||"").replace(/<[^>]*>/g,"").trim()),n=String(s.id||I(t||`item-${r.length+1}`));r.push({id:n,label:t,icon:s.icon?String(s.icon):void 0,badge:s.badge?String(s.badge):void 0,tintColor:s.tintColor?String(s.tintColor):void 0})}return r}function Y(e){let r=[],a=/<@craft-sidebar-space\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-space>)/g,i;while((i=a.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.label||s.title||`Space ${r.length+1}`);r.push({id:String(s.id||I(n)),label:n,icon:s.icon?String(s.icon):void 0,tint:s.tint?String(s.tint):void 0,sections:F(t)})}return r}function Q(e){if(!e)return;if(Array.isArray(e))return e;if(typeof e!=="string")return;try{let r=JSON.parse(e);return Array.isArray(r)?r:void 0}catch{return}}function G(e,r,a){let i=e.map((t)=>`<button class="craft-sidebar-space-tab" type="button" data-space-target="${h(t.id)}" data-selected="${t.id===r?"true":"false"}" title="${h(t.label||t.id)}">${t.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(t.icon)}"></span>`:C((t.label||t.id).charAt(0))}</button>`).join("");return`<div class="craft-sidebar-spaces">${e.map((t)=>`<section class="craft-sidebar-space" data-space-id="${h(t.id)}" data-selected="${t.id===r?"true":"false"}">
2948
+ ${t.label?`<div class="craft-sidebar-space-title">${C(t.label)}</div>`:""}
2949
+ ${t.sections.map((n)=>D(n,a)).join("")}
2950
2950
  </section>`).join("")}</div>
2951
- <div class="craft-sidebar-space-switcher">${J}</div>`}function Uq(q){if(!q)return;if(Array.isArray(q))return q;if(typeof q!=="string")return;try{let U=JSON.parse(q);return Array.isArray(U)?U:void 0}catch{return}}function g(q,U){let $=q.header||q.title||q.id;return`<section class="craft-sidebar-section" data-section-id="${R(q.id)}">
2952
- <div class="craft-sidebar-section-title">${O($)}</div>
2953
- ${q.items.map((J)=>f(J,J.id===U)).join("")}
2954
- </section>`}function f(q,U){let $=q.tintColor?` style="--craft-sidebar-icon-color:${R(q.tintColor)}"`:"";return`<button class="craft-sidebar-item" type="button" data-item-id="${R(q.id)}" data-selected="${U?"true":"false"}">
2955
- ${q.icon?`<span class="craft-sidebar-item-icon" data-icon="${R(q.icon)}"${$}></span>`:""}
2956
- <span class="craft-sidebar-item-label">${O(q.label)}</span>
2957
- ${q.badge?`<span class="craft-sidebar-item-badge">${O(q.badge)}</span>`:""}
2958
- </button>`}function k(q){return q.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function $q(q){let U=5381;for(let $=0;$<q.length;$++)U=U*33^q.charCodeAt($);return(U>>>0).toString(36)}function O(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function R(q){return O(q).replace(/`/g,"&#96;")}function Jq(q){return JSON.stringify(q).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function Wq(q,U,$){let J=[];J.push(`class="${$.join(" ")}"`),J.push(`data-craft="${U.nativeType}"`);for(let[W,K]of Object.entries(q))if(K===!0)J.push(W);else if(K!==!1&&K!==void 0&&K!==null){let Y=String(K).replace(/"/g,"&quot;");J.push(`${W}="${Y}"`)}return J.join(" ")}function Pq(q,U){b[q]=U}function vq(){return{...b}}async function Qq(q){let U=Date.now();try{if(!await Bun.file(q.input).exists())return{success:!1,target:q.target||I(),format:q.format||"app",error:`Input file not found: ${q.input}`};let $=q.target||I(),J=q.format||Tq($),W=q.output||Z(process.cwd(),"dist","native");if(!s(W))T(W,{recursive:!0});let K=await m(q.input,{context:q.context,options:{isDev:!1}});if(K=N(K,{debug:q.verbose}),K=u(K),!K.includes("craft-component-styles")){if(K.includes("</head>"))K=K.replace("</head>",`${h}
2959
- </head>`)}let Y=q.name||Yq(q.input,".stx"),L=q.version||"1.0.0",Q=q.craftPath||await Mq();if(!Q)return{success:!1,target:$,format:J,error:"Craft binary not found. Please install Craft or specify craftPath."};if(q.verbose)console.log(`\uD83D\uDCE6 Building native app for ${$}...`),console.log(` Input: ${q.input}`),console.log(` Output: ${W}`),console.log(` Craft: ${Q}`);let X;switch($){case"macos":X=await Xq(K,Y,L,W,J,q,Q);break;case"windows":X=await _q(K,Y,L,W,J,q,Q);break;case"linux":X=await Eq(K,Y,L,W,J,q,Q);break;case"ios":X=await Hq(K,Y,L,W,q,Q);break;case"android":X=await Rq(K,Y,L,W,q,Q);break;default:X={success:!1,target:$,format:J,error:`Unsupported target: ${$}`}}return X.duration=Date.now()-U,X}catch($){return{success:!1,target:q.target||I(),format:q.format||"app",error:$.message,duration:Date.now()-U}}}async function Xq(q,U,$,J,W,K,Y){let L=K.bundleId||`com.stx.${U.toLowerCase().replace(/[^a-z0-9]/g,"")}`,Q=Z(J,`${U}.app`),X=Z(Q,"Contents"),w=Z(X,"MacOS"),G=Z(X,"Resources");T(w,{recursive:!0}),T(G,{recursive:!0});let B=Z(G,"index.html");await Bun.write(B,q);let _="";if(K.sidebar?.enabled&&K.sidebar?.config)_=Z(G,"sidebar-config.json"),await Bun.write(_,JSON.stringify(K.sidebar.config));let E=K.sidebar?.enabled?`--native-sidebar --sidebar-width ${K.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",H=K.menubarOnly??K.systemTray;if((K.bundleStyle||(await Gq(Y)?"executable":"launcher"))==="executable"){let V=Z(w,U);F(Y,V),A(V,493);let M={html:"index.html",title:K.window?.title||U,width:K.window?.width||1200,height:K.window?.height||800,devTools:Boolean(K.devTools)};if(H)M.menubarOnly=!0;else if(K.systemTray)M.systemTray=!0;if(K.window?.frameless)M.frameless=!0;if(K.window?.transparent)M.transparent=!0;if(K.window?.alwaysOnTop)M.alwaysOnTop=!0;if(K.window?.resizable===!1)M.resizable=!1;await Bun.write(Z(G,"craft.json"),`${JSON.stringify(M,null,2)}
2960
- `)}else{let V=Z(w,"craft");F(Y,V),A(V,493);let M=K.sidebar?.enabled?`--native-sidebar --sidebar-width ${K.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",n=`#!/bin/bash
2951
+ <div class="craft-sidebar-space-switcher">${i}</div>`}function X(e){if(!e)return;if(Array.isArray(e))return e;if(typeof e!=="string")return;try{let r=JSON.parse(e);return Array.isArray(r)?r:void 0}catch{return}}function D(e,r){let a=e.header||e.title||e.id;return`<section class="craft-sidebar-section" data-section-id="${h(e.id)}">
2952
+ <div class="craft-sidebar-section-title">${C(a)}</div>
2953
+ ${e.items.map((i)=>O(i,i.id===r)).join("")}
2954
+ </section>`}function O(e,r){let a=e.tintColor?` style="--craft-sidebar-icon-color:${h(e.tintColor)}"`:"";return`<button class="craft-sidebar-item" type="button" data-item-id="${h(e.id)}" data-selected="${r?"true":"false"}">
2955
+ ${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(e.icon)}"${a}></span>`:""}
2956
+ <span class="craft-sidebar-item-label">${C(e.label)}</span>
2957
+ ${e.badge?`<span class="craft-sidebar-item-badge">${C(e.badge)}</span>`:""}
2958
+ </button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(e){let r=5381;for(let a=0;a<e.length;a++)r=r*33^e.charCodeAt(a);return(r>>>0).toString(36)}function C(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function h(e){return C(e).replace(/`/g,"&#96;")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,r,a){let i=[];i.push(`class="${a.join(" ")}"`),i.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,"&quot;");i.push(`${s}="${n}"`)}return i.join(" ")}function xu(e,r){Br[e]=r}function Su(){return{...Br}}async function wi(e){let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||P(),format:e.format||"app",error:`Input file not found: ${e.input}`};let a=e.target||P(),i=e.format||ue(a),s=e.output||o(process.cwd(),"dist","native");if(!z(s))v(s,{recursive:!0});let t=await $i(e.input,{context:e.context,options:{isDev:!1}});if(t=yi(t,{debug:e.verbose}),t=vi(t),!t.includes("craft-component-styles")){if(t.includes("</head>"))t=t.replace("</head>",`${bi}
2959
+ </head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",d=e.craftPath||await fe();if(!d)return{success:!1,target:a,format:i,error:"Craft binary not found. Please install Craft or specify craftPath."};if(e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${a}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${d}`);let l;switch(a){case"macos":l=await ie(t,n,c,s,i,e,d);break;case"windows":l=await oe(t,n,c,s,i,e,d);break;case"linux":l=await ce(t,n,c,s,i,e,d);break;case"ios":l=await de(t,n,c,s,e,d);break;case"android":l=await le(t,n,c,s,e,d);break;default:l={success:!1,target:a,format:i,error:`Unsupported target: ${a}`}}return l.duration=Date.now()-r,l}catch(a){return{success:!1,target:e.target||P(),format:e.format||"app",error:a.message,duration:Date.now()-r}}}async function ie(e,r,a,i,s,t,n){let c=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,d=o(i,`${r}.app`),l=o(d,"Contents"),p=o(l,"MacOS"),f=o(l,"Resources");v(p,{recursive:!0}),v(f,{recursive:!0});let x=o(f,"index.html");await Bun.write(x,e);let b="";if(t.sidebar?.enabled&&t.sidebar?.config)b=o(f,"sidebar-config.json"),await Bun.write(b,JSON.stringify(t.sidebar.config));let g=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",m=t.menubarOnly??t.systemTray;if((t.bundleStyle||(await se(n)?"executable":"launcher"))==="executable"){let S=o(p,r);k(n,S),T(S,493);let w={html:"index.html",title:t.window?.title||r,width:t.window?.width||1200,height:t.window?.height||800,devTools:Boolean(t.devTools)};if(m)w.menubarOnly=!0;else if(t.systemTray)w.systemTray=!0;if(t.window?.frameless)w.frameless=!0;if(t.window?.transparent)w.transparent=!0;if(t.window?.alwaysOnTop)w.alwaysOnTop=!0;if(t.window?.resizable===!1)w.resizable=!1;await Bun.write(o(f,"craft.json"),`${JSON.stringify(w,null,2)}
2960
+ `)}else{let S=o(p,"craft");k(n,S),T(S,493);let w=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",U=`#!/bin/bash
2961
2961
  set -euo pipefail
2962
2962
  DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
2963
2963
  RESOURCES="$DIR/../Resources"
2964
2964
  exec "$DIR/craft" --html-file "$RESOURCES/index.html" \\
2965
- ${[`--title "${K.window?.title||U}"`,`--width ${K.window?.width||1200}`,`--height ${K.window?.height||800}`,H?"--menubar-only":K.systemTray?"--system-tray":"",K.devTools?"":"--no-devtools",K.window?.frameless?"--frameless":"",K.window?.transparent?"--transparent":"",K.window?.alwaysOnTop?"--always-on-top":"",K.window?.resizable===!1?"--no-resize":"",M].filter(Boolean).join(" \\\n ")}
2966
- `,S=Z(w,U);await Bun.write(S,n),A(S,493)}let v=Boolean(K.icon&&await Bun.file(K.icon).exists());if(v)F(K.icon,Z(G,"AppIcon.icns"));let i={CFBundleExecutable:U,CFBundleIdentifier:L,CFBundleName:U,CFBundleDisplayName:U,CFBundleShortVersionString:$,CFBundleVersion:$,CFBundlePackageType:"APPL",CFBundleSignature:"????",LSMinimumSystemVersion:K.minimumSystemVersion||"13.0",NSHighResolutionCapable:!0,NSSupportsAutomaticGraphicsSwitching:!0,LSUIElement:K.menubarOnly??Boolean(K.systemTray),...v?{CFBundleIconFile:"AppIcon"}:{},...K.category?{LSApplicationCategoryType:K.category}:{},...K.copyright?{NSHumanReadableCopyright:K.copyright}:{},...K.infoPlist||{}};if(await Bun.write(Z(X,"Info.plist"),wq(i)),W==="dmg"){let V=Z(J,`${U}-${$}.dmg`),M=await zq(Q,V,U);if(!M.success)return{success:!1,target:"macos",format:"dmg",error:M.error};return{success:!0,target:"macos",format:"dmg",outputPath:V}}return{success:!0,target:"macos",format:"app",outputPath:Q}}async function Gq(q){try{let U=Bun.spawn([q,"--version"],{stdout:"pipe",stderr:"pipe"}),[$,J]=await Promise.all([new Response(U.stdout).text(),new Response(U.stderr).text()]);await U.exited;let K=`${$}
2967
- ${J}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!K)return!1;let[Y,L,Q]=K.slice(1).map(Number);if(Y>0||L>0)return!0;return Q>=57}catch{return!1}}function l(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wq(q){return`<?xml version="1.0" encoding="UTF-8"?>
2965
+ ${[`--title "${t.window?.title||r}"`,`--width ${t.window?.width||1200}`,`--height ${t.window?.height||800}`,m?"--menubar-only":t.systemTray?"--system-tray":"",t.devTools?"":"--no-devtools",t.window?.frameless?"--frameless":"",t.window?.transparent?"--transparent":"",t.window?.alwaysOnTop?"--always-on-top":"",t.window?.resizable===!1?"--no-resize":"",w].filter(Boolean).join(" \\\n ")}
2966
+ `,N=o(p,r);await Bun.write(N,U),T(N,493)}let B=Boolean(t.icon&&await Bun.file(t.icon).exists());if(B)k(t.icon,o(f,"AppIcon.icns"));let L={CFBundleExecutable:r,CFBundleIdentifier:c,CFBundleName:r,CFBundleDisplayName:r,CFBundleShortVersionString:a,CFBundleVersion:a,CFBundlePackageType:"APPL",CFBundleSignature:"????",LSMinimumSystemVersion:t.minimumSystemVersion||"13.0",NSHighResolutionCapable:!0,NSSupportsAutomaticGraphicsSwitching:!0,LSUIElement:t.menubarOnly??Boolean(t.systemTray),...B?{CFBundleIconFile:"AppIcon"}:{},...t.category?{LSApplicationCategoryType:t.category}:{},...t.copyright?{NSHumanReadableCopyright:t.copyright}:{},...t.infoPlist||{}};if(await Bun.write(o(l,"Info.plist"),ne(L)),s==="dmg"){let S=o(i,`${r}-${a}.dmg`),w=await pe(d,S,r);if(!w.success)return{success:!1,target:"macos",format:"dmg",error:w.error};return{success:!0,target:"macos",format:"dmg",outputPath:S}}return{success:!0,target:"macos",format:"app",outputPath:d}}async function se(e){try{let r=Bun.spawn([e,"--version"],{stdout:"pipe",stderr:"pipe"}),[a,i]=await Promise.all([new Response(r.stdout).text(),new Response(r.stderr).text()]);await r.exited;let t=`${a}
2967
+ ${i}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;let[n,c,d]=t.slice(1).map(Number);if(n>0||c>0)return!0;return d>=57}catch{return!1}}function _(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ne(e){return`<?xml version="1.0" encoding="UTF-8"?>
2968
2968
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2969
2969
  <plist version="1.0">
2970
2970
  <dict>
2971
- ${Object.entries(q).map(([$,J])=>{let W=typeof J==="boolean"?`<${J}/>`:typeof J==="number"?`<integer>${J}</integer>`:`<string>${l(String(J))}</string>`;return` <key>${l($)}</key>
2972
- ${W}`}).join(`
2971
+ ${Object.entries(e).map(([a,i])=>{let s=typeof i==="boolean"?`<${i}/>`:typeof i==="number"?`<integer>${i}</integer>`:`<string>${_(String(i))}</string>`;return` <key>${_(a)}</key>
2972
+ ${s}`}).join(`
2973
2973
  `)}
2974
2974
  </dict>
2975
2975
  </plist>
2976
- `}async function _q(q,U,$,J,W,K,Y){let L=Z(J,U);T(L,{recursive:!0});let Q=Z(L,"index.html");await Bun.write(Q,q),F(Y,Z(L,"craft.exe"));let X=`@echo off
2976
+ `}async function oe(e,r,a,i,s,t,n){let c=o(i,r);v(c,{recursive:!0});let d=o(c,"index.html");await Bun.write(d,e),k(n,o(c,"craft.exe"));let l=`@echo off
2977
2977
  set DIR=%~dp0
2978
2978
  "%DIR%craft.exe" --html-file "%DIR%index.html" ^
2979
- --title "${K.window?.title||U}" ^
2980
- --width ${K.window?.width||1200} ^
2981
- --height ${K.window?.height||800} ^
2982
- ${K.systemTray?"--system-tray":""} ^
2983
- ${K.devTools?"":"--no-devtools"}
2984
- `;if(await Bun.write(Z(L,`${U}.bat`),X),W==="zip"){let w=Z(J,`${U}-${$}-windows.zip`),G=await Bq(L,w);if(!G.success)return{success:!1,target:"windows",format:"zip",error:G.error};return{success:!0,target:"windows",format:"zip",outputPath:w}}return{success:!0,target:"windows",format:"app",outputPath:L}}async function Eq(q,U,$,J,W,K,Y){let L=Z(J,U);T(L,{recursive:!0});let Q=Z(L,"index.html");await Bun.write(Q,q);let X=Z(L,"craft");F(Y,X),A(X,493);let w=`#!/bin/bash
2979
+ --title "${t.window?.title||r}" ^
2980
+ --width ${t.window?.width||1200} ^
2981
+ --height ${t.window?.height||800} ^
2982
+ ${t.systemTray?"--system-tray":""} ^
2983
+ ${t.devTools?"":"--no-devtools"}
2984
+ `;if(await Bun.write(o(c,`${r}.bat`),l),s==="zip"){let p=o(i,`${r}-${a}-windows.zip`),f=await be(c,p);if(!f.success)return{success:!1,target:"windows",format:"zip",error:f.error};return{success:!0,target:"windows",format:"zip",outputPath:p}}return{success:!0,target:"windows",format:"app",outputPath:c}}async function ce(e,r,a,i,s,t,n){let c=o(i,r);v(c,{recursive:!0});let d=o(c,"index.html");await Bun.write(d,e);let l=o(c,"craft");k(n,l),T(l,493);let p=`#!/bin/bash
2985
2985
  set -euo pipefail
2986
2986
  DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
2987
2987
  exec "$DIR/craft" --html-file "$DIR/index.html" \\
2988
- --title "${K.window?.title||U}" \\
2989
- --width ${K.window?.width||1200} \\
2990
- --height ${K.window?.height||800} \\
2991
- ${K.systemTray?"--system-tray":""} \\
2992
- ${K.devTools?"":"--no-devtools"}
2993
- `,G=Z(L,U.toLowerCase());await Bun.write(G,w),A(G,493);let B=`[Desktop Entry]
2988
+ --title "${t.window?.title||r}" \\
2989
+ --width ${t.window?.width||1200} \\
2990
+ --height ${t.window?.height||800} \\
2991
+ ${t.systemTray?"--system-tray":""} \\
2992
+ ${t.devTools?"":"--no-devtools"}
2993
+ `,f=o(c,r.toLowerCase());await Bun.write(f,p),T(f,493);let x=`[Desktop Entry]
2994
2994
  Type=Application
2995
- Name=${U}
2996
- Exec=${G}
2995
+ Name=${r}
2996
+ Exec=${f}
2997
2997
  Terminal=false
2998
2998
  Categories=Utility;
2999
- `;if(await Bun.write(Z(L,`${U.toLowerCase()}.desktop`),B),W==="deb"){let _=Z(J,`${U.toLowerCase()}_${$}_amd64.deb`),E=await Oq(L,_,U,$,K);if(!E.success)return{success:!1,target:"linux",format:"deb",error:E.error};return{success:!0,target:"linux",format:"deb",outputPath:_}}if(W==="appimage"){let _=Z(J,`${U}-${$}-x86_64.AppImage`),E=await xq(L,_,U,K);if(!E.success)return{success:!1,target:"linux",format:"appimage",error:E.error};return{success:!0,target:"linux",format:"appimage",outputPath:_}}return{success:!0,target:"linux",format:"app",outputPath:L}}async function Hq(q,U,$,J,W,K){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${U}' to create an iOS project.`}}async function Rq(q,U,$,J,W,K){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${U}' to create an Android project.`}}async function Mq(){if(process.env.CRAFT_BIN&&await Bun.file(process.env.CRAFT_BIN).exists())return process.env.CRAFT_BIN;let q=[Z(process.cwd(),"../../craft/packages/zig/zig-out/bin/craft"),Z(process.cwd(),"../craft/packages/zig/zig-out/bin/craft"),Z(P(),"Code/Tools/craft/packages/zig/zig-out/bin/craft"),Z(P(),"Code/craft/packages/zig/zig-out/bin/craft"),"/usr/local/bin/craft","/usr/bin/craft",Z(P(),".local/bin/craft"),Z(process.env.LOCALAPPDATA||"","craft","craft.exe"),Z(process.env.PROGRAMFILES||"","craft","craft.exe")];for(let U of q)if(await Bun.file(U).exists())return U;try{let $=Zq("which craft 2>/dev/null || where craft 2>nul",{encoding:"utf-8"}).trim().split(`
3000
- `)[0];if($&&await Bun.file($).exists())return $}catch{}return null}function I(){switch(Lq()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function Tq(q){switch(q){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 zq(q,U,$){return new Promise((J)=>{let W=j("hdiutil",["create","-volname",$,"-srcfolder",q,"-ov","-format","UDZO",U]);W.on("close",(K)=>{if(K===0)J({success:!0});else J({success:!1,error:`hdiutil exited with code ${K}`})}),W.on("error",(K)=>{J({success:!1,error:K.message})})})}async function Bq(q,U){return new Promise(($)=>{let J=j("zip",["-r",U,"."],{cwd:q});J.on("close",(W)=>{if(W===0)$({success:!0});else $({success:!1,error:`zip exited with code ${W}`})}),J.on("error",(W)=>{$({success:!1,error:W.message})})})}async function Oq(q,U,$,J,W){return new Promise((K)=>{try{let Y=Z(c(),`stx-deb-${Date.now()}`),L=Z(Y,"DEBIAN"),Q=Z(Y,"usr","bin"),X=Z(Y,"usr","share","applications"),w=Z(Y,"usr","share",$.toLowerCase());T(L,{recursive:!0}),T(Q,{recursive:!0}),T(X,{recursive:!0}),T(w,{recursive:!0});let G=z("fs").readdirSync(q);for(let H of G)F(Z(q,H),Z(w,H));let B=`#!/bin/bash
3001
- exec /usr/share/${$.toLowerCase()}/${$.toLowerCase()} "$@"`;z("fs").writeFileSync(Z(Q,$.toLowerCase()),B),A(Z(Q,$.toLowerCase()),493);let _=`Package: ${$.toLowerCase()}
3002
- Version: ${J}
2999
+ `;if(await Bun.write(o(c,`${r.toLowerCase()}.desktop`),x),s==="deb"){let b=o(i,`${r.toLowerCase()}_${a}_amd64.deb`),g=await ge(c,b,r,a,t);if(!g.success)return{success:!1,target:"linux",format:"deb",error:g.error};return{success:!0,target:"linux",format:"deb",outputPath:b}}if(s==="appimage"){let b=o(i,`${r}-${a}-x86_64.AppImage`),g=await me(c,b,r,t);if(!g.success)return{success:!1,target:"linux",format:"appimage",error:g.error};return{success:!0,target:"linux",format:"appimage",outputPath:b}}return{success:!0,target:"linux",format:"app",outputPath:c}}async function de(e,r,a,i,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 le(e,r,a,i,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.`}}async function fe(){if(process.env.CRAFT_BIN&&await Bun.file(process.env.CRAFT_BIN).exists())return process.env.CRAFT_BIN;let e=[o(process.cwd(),"../../craft/packages/zig/zig-out/bin/craft"),o(process.cwd(),"../craft/packages/zig/zig-out/bin/craft"),o(q(),"Code/Tools/craft/packages/zig/zig-out/bin/craft"),o(q(),"Code/craft/packages/zig/zig-out/bin/craft"),"/usr/local/bin/craft","/usr/bin/craft",o(q(),".local/bin/craft"),o(process.env.LOCALAPPDATA||"","craft","craft.exe"),o(process.env.PROGRAMFILES||"","craft","craft.exe")];for(let r of e)if(await Bun.file(r).exists())return r;try{let a=re("which craft 2>/dev/null || where craft 2>nul",{encoding:"utf-8"}).trim().split(`
3000
+ `)[0];if(a&&await Bun.file(a).exists())return a}catch{}return null}function P(){switch(ae()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function ue(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 pe(e,r,a){return new Promise((i)=>{let s=E("hdiutil",["create","-volname",a,"-srcfolder",e,"-ov","-format","UDZO",r]);s.on("close",(t)=>{if(t===0)i({success:!0});else i({success:!1,error:`hdiutil exited with code ${t}`})}),s.on("error",(t)=>{i({success:!1,error:t.message})})})}async function be(e,r){return new Promise((a)=>{let i=E("zip",["-r",r,"."],{cwd:e});i.on("close",(s)=>{if(s===0)a({success:!0});else a({success:!1,error:`zip exited with code ${s}`})}),i.on("error",(s)=>{a({success:!1,error:s.message})})})}async function ge(e,r,a,i,s){return new Promise((t)=>{try{let n=o(M(),`stx-deb-${Date.now()}`),c=o(n,"DEBIAN"),d=o(n,"usr","bin"),l=o(n,"usr","share","applications"),p=o(n,"usr","share",a.toLowerCase());v(c,{recursive:!0}),v(d,{recursive:!0}),v(l,{recursive:!0}),v(p,{recursive:!0});let f=u("fs").readdirSync(e);for(let m of f)k(o(e,m),o(p,m));let x=`#!/bin/bash
3001
+ exec /usr/share/${a.toLowerCase()}/${a.toLowerCase()} "$@"`;u("fs").writeFileSync(o(d,a.toLowerCase()),x),T(o(d,a.toLowerCase()),493);let b=`Package: ${a.toLowerCase()}
3002
+ Version: ${i}
3003
3003
  Section: utils
3004
3004
  Priority: optional
3005
3005
  Architecture: amd64
3006
3006
  Depends: libgtk-3-0, libwebkit2gtk-4.0-37
3007
- Maintainer: ${W.author||"Unknown"}
3008
- Description: ${W.description||$}
3009
- `;z("fs").writeFileSync(Z(L,"control"),_);let E=j("dpkg-deb",["--build",Y,U]);E.on("close",(H)=>{if(z("fs").rmSync(Y,{recursive:!0,force:!0}),H===0)K({success:!0});else K({success:!1,error:`dpkg-deb exited with code ${H}`})}),E.on("error",(H)=>{z("fs").rmSync(Y,{recursive:!0,force:!0}),K({success:!1,error:H.message})})}catch(Y){K({success:!1,error:Y.message})}})}async function xq(q,U,$,J){return new Promise((W)=>{try{let K=Z(c(),`stx-appimage-${Date.now()}`),Y=Z(K,`${$}.AppDir`),L=Z(Y,"usr"),Q=Z(L,"bin"),X=Z(L,"share");T(Q,{recursive:!0}),T(X,{recursive:!0});let w=Z(X,$.toLowerCase());T(w,{recursive:!0});let G=z("fs").readdirSync(q);for(let x of G)F(Z(q,x),Z(w,x));let B=`#!/bin/bash
3007
+ Maintainer: ${s.author||"Unknown"}
3008
+ Description: ${s.description||a}
3009
+ `;u("fs").writeFileSync(o(c,"control"),b);let g=E("dpkg-deb",["--build",n,r]);g.on("close",(m)=>{if(u("fs").rmSync(n,{recursive:!0,force:!0}),m===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${m}`})}),g.on("error",(m)=>{u("fs").rmSync(n,{recursive:!0,force:!0}),t({success:!1,error:m.message})})}catch(n){t({success:!1,error:n.message})}})}async function me(e,r,a,i){return new Promise((s)=>{try{let t=o(M(),`stx-appimage-${Date.now()}`),n=o(t,`${a}.AppDir`),c=o(n,"usr"),d=o(c,"bin"),l=o(c,"share");v(d,{recursive:!0}),v(l,{recursive:!0});let p=o(l,a.toLowerCase());v(p,{recursive:!0});let f=u("fs").readdirSync(e);for(let y of f)k(o(e,y),o(p,y));let x=`#!/bin/bash
3010
3010
  SELF=$(readlink -f "$0")
3011
3011
  HERE=\${SELF%/*}
3012
3012
  export PATH="\${HERE}/usr/bin:\${PATH}"
3013
- exec "\${HERE}/usr/share/${$.toLowerCase()}/${$.toLowerCase()}" "$@"
3014
- `;z("fs").writeFileSync(Z(Y,"AppRun"),B),A(Z(Y,"AppRun"),493);let _=`[Desktop Entry]
3013
+ exec "\${HERE}/usr/share/${a.toLowerCase()}/${a.toLowerCase()}" "$@"
3014
+ `;u("fs").writeFileSync(o(n,"AppRun"),x),T(o(n,"AppRun"),493);let b=`[Desktop Entry]
3015
3015
  Type=Application
3016
- Name=${$}
3017
- Exec=${$.toLowerCase()}
3016
+ Name=${a}
3017
+ Exec=${a.toLowerCase()}
3018
3018
  Terminal=false
3019
3019
  Categories=Utility;
3020
- Icon=${$.toLowerCase()}
3021
- `;z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.desktop`),_);let E=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(z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.png`),E),J.icon&&s(J.icon))F(J.icon,Z(Y,`${$.toLowerCase()}.png`));let H=j("appimagetool",[Y,U],{env:{...process.env,ARCH:"x86_64"}});H.on("close",(x)=>{if(z("fs").rmSync(K,{recursive:!0,force:!0}),x===0)A(U,493),W({success:!0});else W({success:!1,error:`appimagetool exited with code ${x}. Install from https://appimage.github.io/appimagetool/`})}),H.on("error",(x)=>{z("fs").rmSync(K,{recursive:!0,force:!0}),W({success:!1,error:`appimagetool not found: ${x.message}`})})}catch(K){W({success:!1,error:K.message})}})}function Vq(){return[I()]}function Fq(q){switch(q){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 Aq={buildNative:Qq,getAvailableTargets:Vq,getAvailableFormats:Fq,detectPlatform:I},cq=Aq;
3022
- export{Iq as lk,D as mk,Cq as nk,yq as ok,N as pk,b as qk,h as rk,bq as sk,u as tk,Pq as uk,vq as vk,Qq as wk,Vq as xk,Fq as yk,cq as zk};
3020
+ Icon=${a.toLowerCase()}
3021
+ `;u("fs").writeFileSync(o(n,`${a.toLowerCase()}.desktop`),b);let g=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(u("fs").writeFileSync(o(n,`${a.toLowerCase()}.png`),g),i.icon&&z(i.icon))k(i.icon,o(n,`${a.toLowerCase()}.png`));let m=E("appimagetool",[n,r],{env:{...process.env,ARCH:"x86_64"}});m.on("close",(y)=>{if(u("fs").rmSync(t,{recursive:!0,force:!0}),y===0)T(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${y}. Install from https://appimage.github.io/appimagetool/`})}),m.on("error",(y)=>{u("fs").rmSync(t,{recursive:!0,force:!0}),s({success:!1,error:`appimagetool not found: ${y.message}`})})}catch(t){s({success:!1,error:t.message})}})}function xi(){return[P()]}function Si(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 he={buildNative:wi,getAvailableTargets:xi,getAvailableFormats:Si,detectPlatform:P},ku=he;
3022
+ export{yu,hi,bu,vu,yi,Br,bi,wu,vi,xu,Su,wi,xi,Si,ku};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{X,ps,gs,ms,r}from"./chunk-69mc2np8.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-2gr351s0.js";import"./chunk-h0atqq82.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{X as injectRouterScript,r as processDirectives,ps as processJsonDirective,gs as processOnceDirective,ms as validateClientScript};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function kc(o){return w.test(o)}async function vs(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(kc(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
3
+ export{kc,vs};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{A,Sc,i,T,Bu,Fu}from"./chunk-69mc2np8.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-2gr351s0.js";import"./chunk-h0atqq82.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{T as config,A as defaultConfig,Bu as defineStxConfig,i as loadStxConfig,Sc as resolveStxDirectories,Fu as validateConfig};