@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,3 @@
1
+ // @bun
2
+ import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function Ta(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
+ export{Ta};
@@ -1,15 +1,15 @@
1
1
  // @bun
2
- import{kx as O}from"./chunk-ay6zjq8v.js";import{mkdir as b,writeFile as T}from"fs/promises";import{join as q}from"path";var E="https://api.iconify.design";async function k(){let G=await fetch(`${E}/collections`);if(!G.ok)throw Error(`Failed to fetch collections: ${G.statusText}`);return await G.json()}async function P(G,z){try{let Z=O.resolve("@iconify/json"),X=`${`${Z.substring(0,Z.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${G}.json`,Q=Bun.file(X);if(await Q.exists()){let $=await Q.json();if(z&&z.length>0){let B={};for(let S of z)if($.icons[S])B[S]=$.icons[S];return{...$,icons:B}}return $}}catch{}let M=z&&z.length>0?`${E}/${G}.json?icons=${z.join(",")}`:`${E}/${G}.json`,U=await fetch(M);if(!U.ok)throw Error(`Failed to fetch icons for ${G}: ${U.statusText}`);return await U.json()}function j(G,z=24,M=24){return{body:G.body,width:G.width||z,height:G.height||M,viewBox:`0 0 ${G.width||z} ${G.height||M}`}}function F(G,z){let M=V(G);return`import type { IconData } from '@stacksjs/iconify-core'
2
+ import{u}from"./chunk-cg8hg6cs.js";import{mkdir as w,writeFile as m}from"fs/promises";import{join as l}from"path";var f="https://api.iconify.design";async function D(){let e=await fetch(`${f}/collections`);if(!e.ok)throw Error(`Failed to fetch collections: ${e.statusText}`);return await e.json()}async function P(e,t){try{let c=u.resolve("@iconify/json"),r=`${`${c.substring(0,c.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${e}.json`,s=Bun.file(r);if(await s.exists()){let a=await s.json();if(t&&t.length>0){let d={};for(let y of t)if(a.icons[y])d[y]=a.icons[y];return{...a,icons:d}}return a}}catch{}let n=t&&t.length>0?`${f}/${e}.json?icons=${t.join(",")}`:`${f}/${e}.json`,i=await fetch(n);if(!i.ok)throw Error(`Failed to fetch icons for ${e}: ${i.statusText}`);return await i.json()}function F(e,t=24,n=24){return{body:e.body,width:e.width||t,height:e.height||n,viewBox:`0 0 ${e.width||t} ${e.height||n}`}}function T(e,t){let n=h(e);return`import type { IconData } from '@stacksjs/iconify-core'
3
3
 
4
- export const ${M}: IconData = ${JSON.stringify(z,null,2)}
4
+ export const ${n}: IconData = ${JSON.stringify(t,null,2)}
5
5
 
6
- export default ${M}
7
- `}function h(G,z){return`<script>
6
+ export default ${n}
7
+ `}function A(e,t){return`<script>
8
8
  // Get props with defaults (handle undefined)
9
- const iconWidth = (typeof width !== 'undefined' ? width : null) || (typeof size !== 'undefined' ? size : null) || ${z.width||24}
10
- const iconHeight = (typeof height !== 'undefined' ? height : null) || (typeof size !== 'undefined' ? size : null) || ${z.height||24}
9
+ const iconWidth = (typeof width !== 'undefined' ? width : null) || (typeof size !== 'undefined' ? size : null) || ${t.width||24}
10
+ const iconHeight = (typeof height !== 'undefined' ? height : null) || (typeof size !== 'undefined' ? size : null) || ${t.height||24}
11
11
  const iconColor = typeof color !== 'undefined' ? color : 'currentColor'
12
- const viewBox = "${z.viewBox||`0 0 ${z.width||24} ${z.height||24}`}"
12
+ const viewBox = "${t.viewBox||`0 0 ${t.width||24} ${t.height||24}`}"
13
13
 
14
14
  // Build transform
15
15
  const transforms = []
@@ -33,7 +33,7 @@ const styleAttr = styles.length > 0 ? \` style="\${styles.join(' ')}"\` : ''
33
33
  const classAttr = typeof className !== 'undefined' && className ? \` class="\${className}"\` : ''
34
34
 
35
35
  // Icon body
36
- let body = ${JSON.stringify(z.body)}
36
+ let body = ${JSON.stringify(t.body)}
37
37
  if (iconColor && iconColor !== 'currentColor') {
38
38
  body = body.replace(/currentColor/g, iconColor)
39
39
  }
@@ -43,17 +43,17 @@ const svg = \`<svg xmlns="http://www.w3.org/2000/svg" width="\${iconWidth}" heig
43
43
  </script>
44
44
 
45
45
  {!! svg !!}
46
- `}function g(G){let z=new Set;return`// Icon data exports
47
- ${G.map((U)=>{let K=V(U);if(z.has(K)){let X=U.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(X))X=`_${X}`;K=X;let Q=2;while(z.has(K))K=`${X}_${Q}`,Q++}return z.add(K),`export { default as ${K} } from './${U}.js'`}).join(`
46
+ `}function _(e){let t=new Set;return`// Icon data exports
47
+ ${e.map((i)=>{let o=h(i);if(t.has(o)){let r=i.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(r))r=`_${r}`;o=r;let s=2;while(t.has(o))o=`${r}_${s}`,s++}return t.add(o),`export { default as ${o} } from './${i}.js'`}).join(`
48
48
  `)}
49
49
 
50
50
  export * from './types.js'
51
- `}function u(G){return`import type { IconData, IconProps } from '@stacksjs/iconify-core'
51
+ `}function E(e){return`import type { IconData, IconProps } from '@stacksjs/iconify-core'
52
52
 
53
53
  export type { IconData, IconProps }
54
54
 
55
- export type ${x(G)}Icon = IconData
56
- `}function N(G,z,M){let U={name:`@stacksjs/iconify-${G}`,type:"module",version:"0.0.1",description:`${z.name} icons for stx from Iconify`,author:z.author?.name||"Iconify",license:z.license?.spdx||"MIT",repository:{type:"git",url:"https://github.com/stacksjs/stx.git",directory:`packages/iconify-${G}`},keywords:["iconify","icons","svg",G,z.name,"stx"],sideEffects:!1,exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./*":"./dist/*"},main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist"],scripts:{build:"bun build.ts",prepublishOnly:"bun build.ts"},dependencies:{"@stacksjs/iconify-core":"workspace:*"}};return JSON.stringify(U,null,2)}function D(G){return`import { existsSync, readdirSync, statSync } from 'node:fs'
55
+ export type ${W(e)}Icon = IconData
56
+ `}function N(e,t,n){let i={name:`@stacksjs/iconify-${e}`,type:"module",version:"0.0.1",description:`${t.name} icons for stx from Iconify`,author:t.author?.name||"Iconify",license:t.license?.spdx||"MIT",repository:{type:"git",url:"https://github.com/stacksjs/stx.git",directory:`packages/iconify-${e}`},keywords:["iconify","icons","svg",e,t.name,"stx"],sideEffects:!1,exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./*":"./dist/*"},main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist"],scripts:{build:"bun build.ts",prepublishOnly:"bun build.ts"},dependencies:{"@stacksjs/iconify-core":"workspace:*"}};return JSON.stringify(i,null,2)}function U(e){return`import { existsSync, readdirSync, statSync } from 'node:fs'
57
57
  import { dirname, join } from 'node:path'
58
58
  import { fileURLToPath } from 'node:url'
59
59
  import dts from 'bun-plugin-dtsx'
@@ -88,7 +88,7 @@ function isDistFresh() {
88
88
  }
89
89
 
90
90
  if (isDistFresh()) {
91
- console.log('\u2713 @stacksjs/iconify-${G} dist is fresh, skipping rebuild')
91
+ console.log('\u2713 @stacksjs/iconify-${e} dist is fresh, skipping rebuild')
92
92
  } else {
93
93
  await Bun.build({
94
94
  entrypoints: [join(srcDir, 'index.ts')],
@@ -100,16 +100,16 @@ if (isDistFresh()) {
100
100
  sourcemap: 'external',
101
101
  splitting: true,
102
102
  })
103
- console.log('\u2713 Built @stacksjs/iconify-${G}')
103
+ console.log('\u2713 Built @stacksjs/iconify-${e}')
104
104
  }
105
- `}function d(G,z,M){return`# @stacksjs/iconify-${G}
105
+ `}function R(e,t,n){return`# @stacksjs/iconify-${e}
106
106
 
107
- ${z.name} icons for stx from Iconify.
107
+ ${t.name} icons for stx from Iconify.
108
108
 
109
109
  ## Installation
110
110
 
111
111
  \`\`\`bash
112
- bun add @stacksjs/iconify-${G}
112
+ bun add @stacksjs/iconify-${e}
113
113
  \`\`\`
114
114
 
115
115
  ## Usage
@@ -118,7 +118,7 @@ bun add @stacksjs/iconify-${G}
118
118
 
119
119
  \`\`\`html
120
120
  <script>
121
- import { home } from '@stacksjs/iconify-${G}'
121
+ import { home } from '@stacksjs/iconify-${e}'
122
122
  import { renderIcon } from '@stacksjs/iconify-core'
123
123
 
124
124
  export const homeIcon = renderIcon(home, { size: 24, color: 'currentColor' })
@@ -132,7 +132,7 @@ bun add @stacksjs/iconify-${G}
132
132
  ### In TypeScript/JavaScript
133
133
 
134
134
  \`\`\`typescript
135
- import { home, account, settings } from '@stacksjs/iconify-${G}'
135
+ import { home, account, settings } from '@stacksjs/iconify-${e}'
136
136
  import { renderIcon } from '@stacksjs/iconify-core'
137
137
 
138
138
  const svg = renderIcon(home, {
@@ -143,38 +143,38 @@ const svg = renderIcon(home, {
143
143
 
144
144
  ## Available Icons
145
145
 
146
- This package contains ${M} icons from ${z.name}.
146
+ This package contains ${n} icons from ${t.name}.
147
147
 
148
148
  ## License
149
149
 
150
- ${z.license?.title||"MIT"}
150
+ ${t.license?.title||"MIT"}
151
151
 
152
- ${z.license?.url?`License: ${z.license.url}`:""}
152
+ ${t.license?.url?`License: ${t.license.url}`:""}
153
153
 
154
154
  ## Credits
155
155
 
156
- - Icons: ${z.author?.name||"Iconify"}${z.author?.url?` (${z.author.url})`:""}
156
+ - Icons: ${t.author?.name||"Iconify"}${t.author?.url?` (${t.author.url})`:""}
157
157
  - Iconify: https://iconify.design/
158
- `}function C(G,z,M){let U=M.length,Z=M.slice(0,5).map(V),K=Z.map((Q)=>`${Q.charAt(0).toUpperCase()}${Q.slice(1)}Icon`),X=M.map((Q)=>{return`- \`${V(Q)}\``}).join(`
159
- `);return`# ${z.name}
158
+ `}function M(e,t,n){let i=n.length,c=n.slice(0,5).map(h),o=c.map((s)=>`${s.charAt(0).toUpperCase()}${s.slice(1)}Icon`),r=n.map((s)=>`- \`${h(s)}\``).join(`
159
+ `);return`# ${t.name}
160
160
 
161
- > ${z.name} icons for stx from Iconify
161
+ > ${t.name} icons for stx from Iconify
162
162
 
163
163
  ## Overview
164
164
 
165
- This package provides access to ${U} icons from the ${z.name} collection through the stx iconify integration.
165
+ This package provides access to ${i} icons from the ${t.name} collection through the stx iconify integration.
166
166
 
167
- **Collection ID:** \`${G}\`
168
- **Total Icons:** ${U}
169
- ${z.author?.name?`**Author:** ${z.author.name}${z.author.url?` ([Website](${z.author.url}))`:""}`:""}
170
- ${z.license?.title?`**License:** ${z.license.title}${z.license.url?` ([Details](${z.license.url}))`:""}`:""}
171
- ${z.category?`**Category:** ${z.category}`:""}
172
- ${z.palette!==void 0?`**Palette:** ${z.palette?"Yes (color icons)":"No (monotone icons)"}`:""}
167
+ **Collection ID:** \`${e}\`
168
+ **Total Icons:** ${i}
169
+ ${t.author?.name?`**Author:** ${t.author.name}${t.author.url?` ([Website](${t.author.url}))`:""}`:""}
170
+ ${t.license?.title?`**License:** ${t.license.title}${t.license.url?` ([Details](${t.license.url}))`:""}`:""}
171
+ ${t.category?`**Category:** ${t.category}`:""}
172
+ ${t.palette!==void 0?`**Palette:** ${t.palette?"Yes (color icons)":"No (monotone icons)"}`:""}
173
173
 
174
174
  ## Installation
175
175
 
176
176
  \`\`\`bash
177
- bun add @stacksjs/iconify-${G}
177
+ bun add @stacksjs/iconify-${e}
178
178
  \`\`\`
179
179
 
180
180
  ## Quick Start
@@ -184,30 +184,30 @@ bun add @stacksjs/iconify-${G}
184
184
  Icons are available as .stx components that can be used directly in templates:
185
185
 
186
186
  \`\`\`html
187
- <${K[0]||"Icon"} height="1em" />
188
- <${K[0]||"Icon"} width="1em" height="1em" />
189
- <${K[0]||"Icon"} height="24" />
187
+ <${o[0]||"Icon"} height="1em" />
188
+ <${o[0]||"Icon"} width="1em" height="1em" />
189
+ <${o[0]||"Icon"} height="24" />
190
190
  \`\`\`
191
191
 
192
192
  ### With Properties
193
193
 
194
194
  \`\`\`html
195
195
  <!-- Using size property -->
196
- <${K[0]||"Icon"} size="24" />
197
- <${K[0]||"Icon"} size="1em" />
196
+ <${o[0]||"Icon"} size="24" />
197
+ <${o[0]||"Icon"} size="1em" />
198
198
 
199
199
  <!-- Using width and height -->
200
- <${K[0]||"Icon"} width="24" height="32" />
200
+ <${o[0]||"Icon"} width="24" height="32" />
201
201
 
202
202
  <!-- With color -->
203
- <${K[0]||"Icon"} size="24" color="red" />
204
- <${K[0]||"Icon"} size="24" color="#4a90e2" />
203
+ <${o[0]||"Icon"} size="24" color="red" />
204
+ <${o[0]||"Icon"} size="24" color="#4a90e2" />
205
205
 
206
206
  <!-- With CSS class -->
207
- <${K[0]||"Icon"} size="24" class="icon-primary" />
207
+ <${o[0]||"Icon"} size="24" class="icon-primary" />
208
208
 
209
209
  <!-- With all properties -->
210
- <${K[0]||"Icon"}
210
+ <${o[0]||"Icon"}
211
211
  size="32"
212
212
  color="#4a90e2"
213
213
  class="my-icon"
@@ -232,9 +232,9 @@ Icons are available as .stx components that can be used directly in templates:
232
232
  </head>
233
233
  <body>
234
234
  <div class="icon-grid">
235
- <${K[0]||"Icon"} size="24" />
236
- <${K[1]||"Icon"} size="24" color="#4a90e2" />
237
- <${K[2]||"Icon"} size="32" class="my-icon" />
235
+ <${o[0]||"Icon"} size="24" />
236
+ <${o[1]||"Icon"} size="24" color="#4a90e2" />
237
+ <${o[2]||"Icon"} size="32" class="my-icon" />
238
238
  </div>
239
239
  </body>
240
240
  </html>
@@ -245,10 +245,10 @@ Icons are available as .stx components that can be used directly in templates:
245
245
  You can also import icon data and use the \`renderIcon\` function directly:
246
246
 
247
247
  \`\`\`typescript
248
- import { ${Z.slice(0,3).join(", ")} } from '@stacksjs/iconify-${G}'
248
+ import { ${c.slice(0,3).join(", ")} } from '@stacksjs/iconify-${e}'
249
249
  import { renderIcon } from '@stacksjs/iconify-core'
250
250
 
251
- const svg = renderIcon(${Z[0]||"icon"}, { size: 24 })
251
+ const svg = renderIcon(${c[0]||"icon"}, { size: 24 })
252
252
  \`\`\`
253
253
 
254
254
  ## Icon Properties
@@ -269,23 +269,23 @@ All icon component functions and \`renderIcon\` accept the following properties:
269
269
 
270
270
  ## Color
271
271
 
272
- ${z.palette?`### Color Icons
272
+ ${t.palette?`### Color Icons
273
273
 
274
274
  This collection contains color icons. While you can still set a color property, it may override the original colors.`:"### Monotone Icons\n\nMonotone icons use `currentColor` by default, allowing you to change icon color via the `color` property or CSS:"}
275
275
 
276
276
  \`\`\`html
277
277
  <!-- Via color property -->
278
- <${K[0]||"Icon"} size="24" color="red" />
279
- <${K[0]||"Icon"} size="24" color="#4a90e2" />
278
+ <${o[0]||"Icon"} size="24" color="red" />
279
+ <${o[0]||"Icon"} size="24" color="#4a90e2" />
280
280
 
281
281
  <!-- Via inline style -->
282
- <${K[0]||"Icon"} size="24" style="color: green;" />
282
+ <${o[0]||"Icon"} size="24" style="color: green;" />
283
283
 
284
284
  <!-- Via CSS class -->
285
- <${K[0]||"Icon"} size="24" class="text-primary" />
285
+ <${o[0]||"Icon"} size="24" class="text-primary" />
286
286
  \`\`\`
287
287
 
288
- ${!z.palette?`\`\`\`css
288
+ ${!t.palette?`\`\`\`css
289
289
  /* In your CSS */
290
290
  .text-primary {
291
291
  color: #4a90e2;
@@ -321,16 +321,16 @@ You do not need to set both properties. If you set one property, the other prope
321
321
  **Examples:**
322
322
 
323
323
  \`\`\`html
324
- <${K[0]||"DraftsIcon"} height="1em" />
325
- <${K[0]||"DraftsIcon"} width="1em" height="1em" />
326
- <${K[0]||"DraftsIcon"} height="24" />
324
+ <${o[0]||"DraftsIcon"} height="1em" />
325
+ <${o[0]||"DraftsIcon"} width="1em" height="1em" />
326
+ <${o[0]||"DraftsIcon"} height="24" />
327
327
  \`\`\`
328
328
 
329
329
  You can also use the \`size\` property as a shorthand for setting both width and height:
330
330
 
331
331
  \`\`\`html
332
- <${K[0]||"DraftsIcon"} size="24" />
333
- <${K[0]||"DraftsIcon"} size="1em" />
332
+ <${o[0]||"DraftsIcon"} size="24" />
333
+ <${o[0]||"DraftsIcon"} size="1em" />
334
334
  \`\`\`
335
335
 
336
336
  ### CSS Sizing
@@ -338,21 +338,21 @@ You can also use the \`size\` property as a shorthand for setting both width and
338
338
  You can also control icon size via CSS:
339
339
 
340
340
  \`\`\`css
341
- .${V(G)}-icon {
341
+ .${h(e)}-icon {
342
342
  width: 1em;
343
343
  height: 1em;
344
344
  }
345
345
  \`\`\`
346
346
 
347
347
  \`\`\`html
348
- <${K[0]||"DraftsIcon"} class="${V(G)}-icon" />
348
+ <${o[0]||"DraftsIcon"} class="${h(e)}-icon" />
349
349
  \`\`\`
350
350
 
351
351
  ## Available Icons
352
352
 
353
- This package contains **${U}** icons:
353
+ This package contains **${i}** icons:
354
354
 
355
- ${X}
355
+ ${r}
356
356
 
357
357
  ## Usage Examples
358
358
 
@@ -360,10 +360,10 @@ ${X}
360
360
 
361
361
  \`\`\`html
362
362
  <nav>
363
- <a href="/"><${K[0]||"Icon"} size="20" class="nav-icon" /> Home</a>
364
- <a href="/about"><${K[1]||"Icon"} size="20" class="nav-icon" /> About</a>
365
- <a href="/contact"><${K[2]||"Icon"} size="20" class="nav-icon" /> Contact</a>
366
- <a href="/settings"><${K[3]||"Icon"} size="20" class="nav-icon" /> Settings</a>
363
+ <a href="/"><${o[0]||"Icon"} size="20" class="nav-icon" /> Home</a>
364
+ <a href="/about"><${o[1]||"Icon"} size="20" class="nav-icon" /> About</a>
365
+ <a href="/contact"><${o[2]||"Icon"} size="20" class="nav-icon" /> Contact</a>
366
+ <a href="/settings"><${o[3]||"Icon"} size="20" class="nav-icon" /> Settings</a>
367
367
  </nav>
368
368
 
369
369
  <style>
@@ -385,7 +385,7 @@ ${X}
385
385
  ### Custom Styling
386
386
 
387
387
  \`\`\`html
388
- <${K[0]||"Icon"}
388
+ <${o[0]||"Icon"}
389
389
  size="24"
390
390
  class="icon icon-primary"
391
391
  style="opacity: 0.8; transition: opacity 0.2s;"
@@ -406,15 +406,15 @@ ${X}
406
406
  \`\`\`html
407
407
  <div class="status-grid">
408
408
  <div class="status-item">
409
- <${K[0]||"Icon"} size="16" color="#22c55e" />
409
+ <${o[0]||"Icon"} size="16" color="#22c55e" />
410
410
  <span>Success</span>
411
411
  </div>
412
412
  <div class="status-item">
413
- <${K[1]||"Icon"} size="16" color="#f59e0b" />
413
+ <${o[1]||"Icon"} size="16" color="#f59e0b" />
414
414
  <span>Warning</span>
415
415
  </div>
416
416
  <div class="status-item">
417
- <${K[2]||"Icon"} size="16" color="#ef4444" />
417
+ <${o[2]||"Icon"} size="16" color="#ef4444" />
418
418
  <span>Error</span>
419
419
  </div>
420
420
  </div>
@@ -425,8 +425,8 @@ ${X}
425
425
  1. **Use Components Directly**: Import and use icon components in your templates
426
426
  \`\`\`html
427
427
  <!-- Recommended -->
428
- <${K[0]||"Icon"} size="24" />
429
- <${K[1]||"Icon"} size="24" color="#4a90e2" />
428
+ <${o[0]||"Icon"} size="24" />
429
+ <${o[1]||"Icon"} size="24" color="#4a90e2" />
430
430
  \`\`\`
431
431
 
432
432
  2. **Use CSS for Theming**: Apply consistent styling through CSS classes
@@ -443,24 +443,24 @@ ${X}
443
443
  \`\`\`
444
444
 
445
445
  \`\`\`html
446
- <${K[0]||"Icon"} size="24" class="icon" />
446
+ <${o[0]||"Icon"} size="24" class="icon" />
447
447
  \`\`\`
448
448
 
449
449
  3. **Set Appropriate Sizes**: Use \`1em\` for inline icons, fixed pixel sizes for standalone icons
450
450
  \`\`\`html
451
451
  <!-- Inline with text -->
452
- <p>Click the <${K[0]||"Icon"} height="1em" /> icon to continue</p>
452
+ <p>Click the <${o[0]||"Icon"} height="1em" /> icon to continue</p>
453
453
 
454
454
  <!-- Standalone -->
455
- <${K[0]||"Icon"} size="24" />
455
+ <${o[0]||"Icon"} size="24" />
456
456
  \`\`\`
457
457
 
458
458
  4. **Use Data Import for Advanced Use Cases**: When you need more control
459
459
  \`\`\`html
460
460
  @js
461
- import { ${Z[0]||"icon"} } from '@stacksjs/iconify-${G}'
461
+ import { ${c[0]||"icon"} } from '@stacksjs/iconify-${e}'
462
462
  import { renderIcon } from '@stacksjs/iconify-core'
463
- global.customIcon = renderIcon(${Z[0]||"icon"}, { size: 24 })
463
+ global.customIcon = renderIcon(${c[0]||"icon"}, { size: 24 })
464
464
  @endjs
465
465
 
466
466
  {!! customIcon !!}
@@ -472,10 +472,10 @@ This package includes full TypeScript support with type definitions for all icon
472
472
 
473
473
  \`\`\`typescript
474
474
  import type { IconData } from '@stacksjs/iconify-core'
475
- import { ${Z[0]||"icon"} } from '@stacksjs/iconify-${G}'
475
+ import { ${c[0]||"icon"} } from '@stacksjs/iconify-${e}'
476
476
 
477
477
  // Icons are typed as IconData
478
- const myIcon: IconData = ${Z[0]||"icon"}
478
+ const myIcon: IconData = ${c[0]||"icon"}
479
479
  \`\`\`
480
480
 
481
481
  ## Related Packages
@@ -486,20 +486,20 @@ const myIcon: IconData = ${Z[0]||"icon"}
486
486
 
487
487
  ## License
488
488
 
489
- ${z.license?.title||"MIT"}
489
+ ${t.license?.title||"MIT"}
490
490
 
491
- ${z.license?.url?`See [license details](${z.license.url}) for more information.`:""}
491
+ ${t.license?.url?`See [license details](${t.license.url}) for more information.`:""}
492
492
 
493
493
  ## Credits
494
494
 
495
- - **Icons**: ${z.author?.name||"Iconify"}${z.author?.url?` ([Website](${z.author.url}))`:""}
495
+ - **Icons**: ${t.author?.name||"Iconify"}${t.author?.url?` ([Website](${t.author.url}))`:""}
496
496
  - **Iconify**: [https://iconify.design/](https://iconify.design/)
497
- - **Icon Set**: [View on Iconify](https://icon-sets.iconify.design/${G}/)
497
+ - **Icon Set**: [View on Iconify](https://icon-sets.iconify.design/${e}/)
498
498
 
499
499
  ## Resources
500
500
 
501
- - [Browse all icons in this collection](https://icon-sets.iconify.design/${G}/)
501
+ - [Browse all icons in this collection](https://icon-sets.iconify.design/${e}/)
502
502
  - [Iconify documentation](https://iconify.design/docs/)
503
503
  - [stx iconify integration guide](../../docs/iconify.md)
504
- `}async function m(G,z,M,U){console.log(`
505
- \uD83D\uDCE6 Generating package for ${G}...`);let K=(await k())[G];if(!K)throw Error(`Collection ${G} not found`);console.log(` Collection: ${K.name}`),console.log(` Total icons: ${K.total}`);let X=await P(G,M),Q=Object.keys(X.icons);console.log(` Generating ${Q.length} icons...`);let $=q(z,`iconify-${G}`),B=q($,"src");await b(B,{recursive:!0});let S=X.width||24,R=X.height||24;for(let L of Q){let A=X.icons[L],Y=j(A,S,R),_=F(L,Y);await T(q(B,`${L}.ts`),_);let w=h(L,Y);await T(q(B,`${L}-icon.stx`),w)}let v=g(Q);await T(q(B,"index.ts"),v);let y=u(G);await T(q(B,"types.ts"),y);let H=N(G,K,Q.length);await T(q($,"package.json"),H);let J=D(G);await T(q($,"build.ts"),J);let W=d(G,K,Q.length);if(await T(q($,"README.md"),W),U){let L=q(U,`iconify-${G}.md`),A=C(G,K,Q);await b(U,{recursive:!0}),await T(L,A),console.log(` \u2713 Generated documentation in ${L}`)}console.log(` \u2713 Generated ${Q.length} icons in ${$}`)}var I=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","let","static","yield","implements","interface","package","private","protected","public","await","eval","arguments"]);function V(G){let z=G.replace(/-([a-z0-9])/g,(M)=>M[1].toUpperCase());if(z=z.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(z))z=`_${z}`;if(I.has(z))z=`${z}_`;return z}function x(G){let z=V(G);return z.charAt(0).toUpperCase()+z.slice(1)}export{x as toPascalCase,V as toCamelCase,u as generateTypesFile,d as generateReadme,N as generatePackageJson,m as generatePackage,g as generateIndexFile,F as generateIconData,h as generateIconComponent,C as generateDocumentation,D as generateBuildFile,k as fetchCollections,P as fetchCollectionIcons,j as convertIconData};
504
+ `}async function G(e,t,n,i){console.log(`
505
+ \uD83D\uDCE6 Generating package for ${e}...`);let o=(await D())[e];if(!o)throw Error(`Collection ${e} not found`);console.log(` Collection: ${o.name}`),console.log(` Total icons: ${o.total}`);let r=await P(e,n),s=Object.keys(r.icons);console.log(` Generating ${s.length} icons...`);let a=l(t,`iconify-${e}`),d=l(a,"src");await w(d,{recursive:!0});let y=r.width||24,b=r.height||24;for(let p of s){let g=r.icons[p],I=F(g,y,b),z=T(p,I);await m(l(d,`${p}.ts`),z);let k=A(p,I);await m(l(d,`${p}-icon.stx`),k)}let v=_(s);await m(l(d,"index.ts"),v);let C=E(e);await m(l(d,"types.ts"),C);let S=N(e,o,s.length);await m(l(a,"package.json"),S);let x=U(e);await m(l(a,"build.ts"),x);let j=R(e,o,s.length);if(await m(l(a,"README.md"),j),i){let p=l(i,`iconify-${e}.md`),g=M(e,o,s);await w(i,{recursive:!0}),await m(p,g),console.log(` \u2713 Generated documentation in ${p}`)}console.log(` \u2713 Generated ${s.length} icons in ${a}`)}var B=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","let","static","yield","implements","interface","package","private","protected","public","await","eval","arguments"]);function h(e){let t=e.replace(/-([a-z0-9])/g,(n)=>n[1].toUpperCase());if(t=t.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(t))t=`_${t}`;if(B.has(t))t=`${t}_`;return t}function W(e){let t=h(e);return t.charAt(0).toUpperCase()+t.slice(1)}export{D as fetchCollections,G as generatePackage};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ var l=new Map,u=new Map;function m(t){if(l.set(t.name,t),t.client)u.set(t.name,t.client)}function qe(t){return m(t),{name:t.name,hasEndTag:t.hasEndTag??!0,description:t.description,handler:async(r,o,a,s)=>{let n=f(o,t.defaults);if(t.validate){let e=t.validate(n);if(e!==!0){let d=typeof e==="string"?e:`Invalid parameters for @${t.name}`;throw Error(d)}}let i=r;if(t.transform)i=await t.transform(r,n,a,s);if(t.clientScript){let e=t.clientScript(n);i+=`<script>${e}</script>`}if(t.css){let e=t.css(n);i+=`<style>${e}</style>`}return i}}}function f(t,c){let r={...c};for(let o of t){let a=o.indexOf(":"),s=o.indexOf("="),n=a>=0&&(s<0||a<s)?a:s;if(n>=0){let i=o.slice(0,n).trim(),e=o.slice(n+1).trim();if(e==="true")e=!0;else if(e==="false")e=!1;else if(e==="null")e=null;else if(!Number.isNaN(Number(e)))e=Number(e);else if(typeof e==="string"&&e.startsWith("{"))try{e=JSON.parse(e)}catch{}r[i]=e}else{let i=Object.keys(r).filter((e)=>!c||!(e in c)).length;r[i===0?"value":`arg${i}`]=o}}return r}
3
+ export{qe};
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function ae(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function pt(e){if(e.entries.length===0)return"[]";return`[
3
+ ${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
4
+ `)}
5
+ ]`}function Hr(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
6
+ export{ae,pt,Hr};
@@ -0,0 +1,12 @@
1
+ // @bun
2
+ import"./chunk-ce1sejr3.js";import"./chunk-8nhshfz6.js";import{y,N}from"./chunk-69mc2np8.js";import"./chunk-z0g9jvv0.js";import{P,D}from"./chunk-h0atqq82.js";import"./chunk-shr559s7.js";import"./chunk-czxt605c.js";import"./chunk-m4sk62wb.js";import"./chunk-xfp7k0v8.js";import"./chunk-ak1cgcah.js";import"./chunk-ngc2wke4.js";import"./chunk-2gr351s0.js";import"./chunk-7gkv67ky.js";import"./chunk-752hw7cd.js";import f from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],M=new Set(b);var l=new Map,h=P(64),S=new Set,v=0,C=new Set(b);function W(){l.clear(),h.clear()}function E(o){let n=new Map;for(let r of o){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=n.get(t);if(i&&!i.endsWith(".js"))continue;n.set(t,r)}return[...n.values()].sort()}function R(o,n){let r=n.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(o)}function I(o){if(!o)return[];let n=D(o,v),r=h.get(n);if(r)return r.slice();let a=o.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of C){if(S.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),h.set(n,t),t.slice()}async function U(o,n){let r=I(o);if(r.length===0)return null;let a=n??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=N({loader:"ts",target:"browser",define:y()}),k=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=E(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>k.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
3
+ ${u.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let w=r.filter((s)=>!d.has(s)&&!R(o,s));if(w.length>0)console.warn(`[stx] could not bundle ${w.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return l.set(t,""),null;let O=[...d].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
4
+ `),x=`<script data-stx-framework-composables>
5
+ ;(function(){
6
+ var __s = window.stx = window.stx || {};
7
+ ${m.join(`
8
+
9
+ `)}
10
+ ${O}
11
+ })();
12
+ </script>`;return l.set(t,x),x}function A(o){S.clear();for(let n of o)S.add(n);v++}export{A as __setRuntimeOwnedForTest,W as clearFrameworkComposableCache,U as getFrameworkComposableScript,I as referencedFrameworkComposables,E as selectComposableFiles};
@@ -0,0 +1,33 @@
1
+ // @bun
2
+ import{m}from"./chunk-ce1sejr3.js";import{R,Pt}from"./chunk-8nhshfz6.js";import{y,ze,N,i}from"./chunk-69mc2np8.js";import{ce,mt,ht}from"./chunk-mepdnezf.js";import{De,Xt,Q}from"./chunk-f46qsp4m.js";import _ from"path";var g=new Map,v=new Map,P=["composables","functions"];function E(n){let t=_.basename(n,".ts");return t==="index"||t==="types"||n.endsWith(".d.ts")}async function G(n){if(n)return _.resolve(n);let t=`<default>:${process.cwd()}`,l=v.get(t);if(l!==void 0)return l;let s=await J();if(s!==null)v.set(t,s);return s}async function J(){let n=await i(),t=n.root||process.cwd(),l=n.composablesDir;if(l)return _.resolve(t,l);for(let s of P){let r=_.resolve(t,s);try{let c=new Bun.Glob("**/*.ts");for await(let a of c.scan({cwd:r,absolute:!0}))if(!E(a))return r}catch{}}return null}async function j(n){let t=Array.isArray(n)?n:n?[_.resolve(n)]:(await i())._layerComposableDirs??[await G()].filter((s)=>!!s),l=new Map;for(let s of t){let r=new Bun.Glob("**/*.ts");try{for await(let c of r.scan({cwd:s,absolute:!0})){let a=_.relative(s,c);if(!E(c)&&!l.has(a))l.set(a,c)}}catch{}}return{key:t.join("\x00"),files:[...l.values()].sort()}}async function Mr(n){let{files:t}=await j(n),l=N({loader:"ts",target:"browser",define:y()}),s=[];for(let r of t)try{let c=await Bun.file(r).text(),a=l.scan(c).exports.filter((d)=>d!=="default");if(a.length>0)s.push({file:r,names:a})}catch{}return s}function T(n,t){return new RegExp(`\\b${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(n)}function z(n,t,l){let s=new Map;for(let{file:d,names:f}of n)for(let u of f)if(!s.has(u))s.set(u,d);let r=(d)=>{let f=[];for(let[u,w]of s)if(T(d,u))f.push(w);return f},c=new Set,a=l.flatMap(r);while(a.length>0){let d=[];for(let f of a){if(c.has(f))continue;c.add(f);for(let u of r(t.get(f)??""))if(!c.has(u))d.push(u)}a=d}return c}async function bl(n,t,l){let{key:s,files:r}=await j(n);if(!s)return null;let c=()=>[...new Set([...r,...r.flatMap((e)=>ce(e))])],a=De(c());if(r.length===0)return Q(g,s,a,""),null;r.sort();let d=N({loader:"ts",target:"browser",define:y()}),f=new Map,u=[];for(let e of r)try{let o=await Bun.file(e).text();f.set(e,o);let h=d.scan(o).exports.filter((p)=>p!=="default");if(h.length>0)u.push({file:e,names:h})}catch{f.set(e,"")}let w=t===void 0?new Set(r):z(u,f,l?[t,...l]:[t]);if(w.size===0)return null;let B=r.filter((e)=>w.has(e)),x=`${s}\x00${B.join("\x00")}`,M=Xt(g,x,a);if(M!==void 0)return M||null;let S=[],b=new Set,D=new Set;for(let e of B)try{let o=f.get(e)??await Bun.file(e).text(),h=_.basename(e,".ts");for(let p of o.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(p[1])D.add(p[1]);try{for(let p of d.scan(o).exports)if(p!=="default")b.add(p)}catch{}if(o=R(o),mt(o))o=await ht(o,e,{projectRoot:process.cwd(),externalizeUserModules:!1}),o=ze(o);o=Pt(o),o=o.replace(/^export\s+(default\s+)?/gm,""),o=d.transformSync(o),S.push(`// Composable: ${h}
3
+ ${o.trim()}`)}catch(o){console.warn(`[stx] Failed to load composable ${e}:`,o)}if(S.length===0||b.size===0)return Q(g,x,a,""),null;let F=[...b].map((e)=>` try { if (!(${JSON.stringify(e)} in __c)) __c[${JSON.stringify(e)}] = ${e}; } catch (e) {}`).join(`
4
+ `),k=JSON.stringify([...b]),C=S.join(`
5
+
6
+ `),O=m.filter((e)=>!D.has(e)&&new RegExp(`\\b${e}\\b`).test(C)).map((e)=>`var ${e} = __stx[${JSON.stringify(e)}];`).join(`
7
+ `),I=JSON.stringify(new Bun.CryptoHasher("md5").update(`${k}\x00${C}`).digest("hex").slice(0,12)),A=`;(function(){
8
+ var __bundles = window.__stxComposableBundles || (window.__stxComposableBundles = {});
9
+ if (__bundles[${I}]) return;
10
+ __bundles[${I}] = true;
11
+ var __published = window.__stxComposableGlobals || (window.__stxComposableGlobals = {});
12
+ window.__composables = window.__composables || {};
13
+ var __c = window.__composables;
14
+ var __stx = window.stx || {};
15
+ ${O}
16
+ ${C}
17
+ ${F}
18
+ var __names = ${k};
19
+ for (var __i = 0; __i < __names.length; __i++) {
20
+ var __n = __names[__i];
21
+ if (!(__n in __c) || __published[__n]) continue;
22
+ var __takenByBuiltin = !!(window.stx && __n in window.stx);
23
+ if (__takenByBuiltin || __n in window) {
24
+ console.warn('[stx] composable "' + __n + '" is not available as a bare identifier: '
25
+ + (__takenByBuiltin ? 'a built-in of that name already exists' : 'window already defines that property')
26
+ + '. Rename it, or use: import { ' + __n + ' } from "@composables"');
27
+ continue;
28
+ }
29
+ window[__n] = __c[__n];
30
+ __published[__n] = true;
31
+ }
32
+ })();`;return a=De(c()),Q(g,x,a,A),A}function vl(){g.clear(),v.clear()}
33
+ export{Mr,bl,vl};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{U}from"./chunk-6hc5vz20.js";function g(e,t){let r={};for(let n of e)r[n]=U(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=U(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function gi(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=U(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var ka=gi;class qt{rules=[];defaultValue="";addRule(e){let t=new qt;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new qt;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new qt;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var hl=new qt;function Ca(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
3
+ `)}catch{return""}})}function $a(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
4
+ `)}catch{return""}})}function Ea(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function yl(e,t,r){let n=e;return n=Ca(n,t,r),n=$a(n,t,r),n=Ea(n,t,r),n}export{gi,ka,qt,hl,Ca,$a,Ea,yl};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as il}from"ts-broadcasting";import{Broadcast as ol,BroadcastServer as al}from"ts-broadcasting";var e=null,u=[];function Yc(){return e}async function Zc(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Qc(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function el(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Go(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Go(n,t,r){if(!i())return;s.send(n,t,r)}function tl(n,t,r){if(!i())return;s.toUser(n,t,r)}function nl(n,t,r){if(!i())return;s.toUsers(n,t,r)}function rl(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function sl(n,t,r){if(!i())return;s.presence(n,t,r)}
3
+ export{Yc,Zc,Qc,el,Go,tl,nl,rl,sl,il,ol,al};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{cl}from"./chunk-e57rhf65.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{cl as buildApp};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{le}from"./chunk-69mc2np8.js";import{de,S,Ke}from"./chunk-ngc2wke4.js";import{z}from"./chunk-h0atqq82.js";import{Y,Ce}from"./chunk-czxt605c.js";import{Pe,se,C,ie,ai,kr,ci,Mt}from"./chunk-scezfp0w.js";import{Wr}from"./chunk-xtdw3692.js";import{Nt}from"./chunk-9g27ybyr.js";import J from"fs";import M from"path";var{serve:ae}=globalThis.Bun;import k from"zlib";import{promisify as q}from"util";var Q=q(k.brotliCompress),Z=q(k.gzip),K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function ne(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((a)=>e.startsWith(a)))return!1;return K.some((a)=>e.startsWith(a))}function re(t){let e=new Map;for(let a of t.split(",")){let[s,...i]=a.trim().split(";"),l=s.trim().toLowerCase();if(!l)continue;let m=1;for(let f of i){let x=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(f);if(!x)continue;let g=Number.parseFloat(x[1]);if(Number.isFinite(g))m=g}e.set(l,m)}return e}function oe(t){if(!t)return null;let e=re(t),a=e.get("*"),s=(i)=>e.get(i)??a??0;if(s("br")>0)return"br";if(s("gzip")>0)return"gzip";return null}async function Ot(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ne(e.headers.get("content-type")))return e;let s=oe(t.headers.get("accept-encoding"));if(!s)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let l=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:W(e.headers)});if(i.length<(a.threshold??te))return l();try{let m=s==="br"?await Q(i,{params:{[k.constants.BROTLI_PARAM_QUALITY]:a.quality??5,[k.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await Z(i);if(m.length>=i.length)return l();let f=W(e.headers);return f.set("Content-Encoding",s),f.set("Content-Length",String(m.length)),new Response(m,{status:e.status,statusText:e.statusText,headers:f})}catch{return l()}}function W(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class D{now;entries=new z(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let s,i=async()=>{let r=s??await a();return r.headers.set("Cache-Control","private, no-store"),r.headers.set("Vary",C(r.headers.get("Vary")).Vary),r};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let l=new URL(t.url),m=`${l.origin}${l.pathname}${l.search}|${se(t)?"fragment":"document"}`,f=this.entries.get(m),x=(r)=>{let T=new Headers(r.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-r.created)/1000)))),new Response(r.body.slice(0),{headers:T})},g=f?(this.now()-f.created)/1000:1/0;if(f&&g<e.maxAge)return x(f);let b=this.generation,B=async()=>{let r=await a();s=r;let T=(r.headers.get("Vary")??"").toLowerCase().split(",").map((R)=>R.trim()).filter(Boolean);if(r.status!==200||r.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(r.headers.get("Cache-Control")??"")||T.some((R)=>R!=="x-stx-router"&&R!=="accept-encoding"))return null;let L=await r.clone().arrayBuffer();if(L.byteLength>1048576)return null;r.headers.set("Vary",C(r.headers.get("Vary")).Vary);let n={body:L,headers:Array.from(r.headers.entries()),created:this.now(),path:l.pathname};if(this.generation===b)this.entries.set(m,n);return n},v=this.pending.get(m);if(!v){if(this.pending.size>=1000)return i();v=B().finally(()=>{if(this.pending.get(m)===v)this.pending.delete(m)}),this.pending.set(m,v)}if(f&&g<e.maxAge+(e.swr??0))return v.catch(()=>{}),x(f);let E=await v;return E?x(E):i()}}var ce={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function ll(t={}){let e=M.resolve(t.outputDir||".output"),a=t.port??3000,s=ai(e);if(!s)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${s.routes.length} routes...`);let i=Nt(s.routeRules),l=new D,m=Wr(e,s.apiRoutes??[]),f=Bun.file(M.join(e,"server/runtime-config.json")),x=t.runtimeConfig??(await f.exists()?await f.json():void 0),g=x?S(x):void 0,b=new Map,B=new Map,v=new Map,E=new Map;for(let n of s.routes)try{let R=M.join(e,n.compiledPath),c=JSON.parse(await Bun.file(R).text());if(g)c.html=Ke(c.html,g);b.set(n.pattern,c),v.set(n.pattern,Ce(c.html)),E.set(n.pattern,le(c.html));let N=M.join(e,n.fragmentPath);if(await Bun.file(N).exists()){let A=await Bun.file(N).text();B.set(n.pattern,g?Ke(A,g):A)}}catch(R){console.warn(`[stx] Failed to load route ${n.pattern}:`,R)}let r=new Map,T=[];for(let n of s.routes)if(n.hasParams){let{regex:R,params:c}=Y(n.pattern);T.push({regex:R,route:n,paramNames:c})}else r.set(n.pattern,n);let L=ae({port:a,async fetch(n){return Ot(n,await de(g??S(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let N=await m(n);if(N)return N;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=M.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=M.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${M.sep}`))try{if(J.existsSync(u)&&J.statSync(u).isFile()){let h=M.extname(u).toLowerCase(),j=ce[h]||"application/octet-stream",_=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":j,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=se(n),y=null,G={};if(y=r.get(c)||null,!y)for(let{regex:p,route:d,paramNames:u}of T){let o=c.match(p);if(o){y=d,u.forEach((h,j)=>{G[h]=o[j+1]});break}}if(!y){let p=r.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let O=i(c),U=Object.keys(O).length>0;return l.respond(n,O.cache,async()=>{let p=b.get(y.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=B.get(y.pattern);if(o){let h=v.get(y.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(y.pattern)?{"X-STX-Runtime":E.get(y.pattern)?"true":"false"}:{},...h?{"X-STX-Layout":h.layout,"X-STX-Layout-Group":h.group}:{},...C(),...O.cache?{}:{"Cache-Control":Pe}}})}}let d=kr(n.method),u=b.get(y.pattern);if(!u){let o=r.get("/500")||null;if(o){let h=b.get(o.pattern);if(h)return new Response(h.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(y.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...C(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:h,redirect:j,cookies:_,status:H,headers:I}=await Mt(u,{params:G,request:n,method:n.method,__stx_strict_hydration:U,__stx_runtime_config:g});if(j)return ci(j,_,I);if(h&&h.length>0){let{renderStreamingPage:P,streamToResponse:F}=await import("./chunk-bmt7w2pk.js"),X=new Headers({...C(),...I,"Cache-Control":"private, no-store"});for(let V of _??[])X.append("Set-Cookie",V);if(A&&!d){let V=Ce(o);X.set("X-STX-Fragment","true"),X.set("X-STX-Runtime",le(o)?"true":"false"),X.set("X-STX-Layout",V.layout),X.set("X-STX-Layout-Group",V.group)}return F(P(A&&!d?ie(o,s.routerContainer||"main"):o,h,{timeoutMs:30000}),{status:H??u.status??200,headers:X})}let w=new Headers({"Content-Type":"text/html",...C(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of _??[])w.append("Set-Cookie",P);for(let[P,F]of Object.entries(I??{}))w.set(P,F);if(w.set("Vary",C(w.get("Vary")).Vary),A&&!d){let P=Ce(o);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",le(o)?"true":"false"),w.set("X-STX-Layout",P.layout),w.set("X-STX-Layout-Group",P.group),new Response(ie(o,s.routerContainer||"main"),{status:H??u.status??200,headers:w})}return new Response(o,{status:H??u.status??200,headers:w})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),U)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${L.port}`),console.log(`[stx] Serving ${s.routes.length} routes (${b.size} pre-loaded)`),{port:L.port,stop:()=>{l.invalidate(),L.stop()},invalidate:(n)=>l.invalidate(n)}}
3
+ export{Ot,ll};