@stacksjs/stx 0.2.412 → 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 (350) hide show
  1. package/dist/appearance-bootstrap.js +1 -1
  2. package/dist/binding-manifest.d.ts +1 -1
  3. package/dist/builtins/image-delivery.d.ts +38 -0
  4. package/dist/builtins/image-delivery.js +17 -0
  5. package/dist/builtins/stx-image.js +1 -5
  6. package/dist/bundle-analyzer.js +20 -20
  7. package/dist/chunk-020xyn9q.js +3 -0
  8. package/dist/chunk-04jhmfbz.js +2 -0
  9. package/dist/chunk-10957mcb.js +2 -0
  10. package/dist/chunk-1098mas0.js +2 -0
  11. package/dist/chunk-169n1vpx.js +12 -0
  12. package/dist/chunk-1b6t12hd.js +2 -0
  13. package/dist/chunk-1chw8xsw.js +2 -0
  14. package/dist/chunk-1xdzcy9d.js +14 -0
  15. package/dist/chunk-2ce7f416.js +2 -0
  16. package/dist/chunk-2gr351s0.js +7 -0
  17. package/dist/chunk-2mkcjw08.js +2 -0
  18. package/dist/chunk-2v8wztd5.js +2 -0
  19. package/dist/chunk-340a824p.js +2 -0
  20. package/dist/chunk-39g1134q.js +2 -0
  21. package/dist/chunk-3c74vag1.js +2 -0
  22. package/dist/chunk-3kthfs03.js +3 -0
  23. package/dist/chunk-3qn1wcdg.js +2 -0
  24. package/dist/chunk-3s2vnqcf.js +2 -0
  25. package/dist/chunk-48bwk47q.js +2 -0
  26. package/dist/chunk-4bjravgk.js +2 -0
  27. package/dist/chunk-4jjme6a5.js +2 -0
  28. package/dist/chunk-5g3y8kym.js +2 -0
  29. package/dist/chunk-5gsxpaqk.js +2 -0
  30. package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
  31. package/dist/chunk-69mc2np8.js +2785 -0
  32. package/dist/chunk-6cfa3g0r.js +2 -0
  33. package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
  34. package/dist/chunk-6hc5vz20.js +3 -0
  35. package/dist/chunk-6q6g76vg.js +499 -0
  36. package/dist/{chunk-dbc5awz9.js → chunk-6sgswrqw.js} +29 -29
  37. package/dist/chunk-6y8hnymb.js +2 -0
  38. package/dist/chunk-74j18qk0.js +930 -0
  39. package/dist/chunk-752hw7cd.js +4 -0
  40. package/dist/{chunk-t5ja7qkn.js → chunk-765e1s44.js} +11 -76
  41. package/dist/chunk-7gkv67ky.js +4 -0
  42. package/dist/chunk-7z2ra0yf.js +2 -0
  43. package/dist/chunk-866n724v.js +2 -0
  44. package/dist/chunk-8nhshfz6.js +5 -0
  45. package/dist/chunk-92ps1xpk.js +2 -0
  46. package/dist/chunk-9g27ybyr.js +3 -0
  47. package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
  48. package/dist/{chunk-qvnbnsv9.js → chunk-9vrja6vp.js} +4 -4
  49. package/dist/chunk-9xrbve19.js +2 -0
  50. package/dist/chunk-a688m6js.js +3 -0
  51. package/dist/chunk-afhxw2t8.js +2 -0
  52. package/dist/chunk-ak1cgcah.js +5 -0
  53. package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
  54. package/dist/chunk-apg16xcn.js +2 -0
  55. package/dist/chunk-b52s5z0c.js +2 -0
  56. package/dist/chunk-b84h16er.js +61 -0
  57. package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
  58. package/dist/chunk-bmt7w2pk.js +2 -0
  59. package/dist/chunk-btmhj5t7.js +2 -0
  60. package/dist/chunk-ce1sejr3.js +3 -0
  61. package/dist/chunk-cg8hg6cs.js +3 -0
  62. package/dist/{chunk-8wp64mym.js → chunk-czxt605c.js} +4 -5
  63. package/dist/chunk-d44b9ktb.js +4 -0
  64. package/dist/chunk-daz5aqcf.js +24 -0
  65. package/dist/chunk-dgdm3hy3.js +2 -0
  66. package/dist/chunk-dvgv8nry.js +11 -0
  67. package/dist/chunk-dx7n22ed.js +2 -0
  68. package/dist/chunk-e57rhf65.js +3 -0
  69. package/dist/chunk-eed4fwps.js +3 -0
  70. package/dist/chunk-ej9j6k1q.js +3 -0
  71. package/dist/chunk-et0rr8c7.js +3 -0
  72. package/dist/chunk-f46qsp4m.js +4 -0
  73. package/dist/chunk-f6az0xj5.js +2 -0
  74. package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
  75. package/dist/chunk-fjs0a8h7.js +2 -0
  76. package/dist/chunk-fr2txj8q.js +829 -0
  77. package/dist/{chunk-vx86cf4r.js → chunk-ft4p6d28.js} +14 -14
  78. package/dist/chunk-fyzajkrx.js +2 -0
  79. package/dist/chunk-fzapbw9p.js +3 -0
  80. package/dist/chunk-g578mcb0.js +194 -0
  81. package/dist/chunk-gawrg4gb.js +216 -0
  82. package/dist/chunk-gw07qmjk.js +2 -0
  83. package/dist/chunk-h0atqq82.js +32 -0
  84. package/dist/chunk-h6zsqb9r.js +3 -0
  85. package/dist/{chunk-hdysywd8.js → chunk-h85hrwkq.js} +13 -13
  86. package/dist/chunk-hbxz85wy.js +2 -0
  87. package/dist/chunk-hjg3ndgh.js +2 -0
  88. package/dist/chunk-hkxsewzk.js +2 -0
  89. package/dist/chunk-hrbbbtbn.js +2 -0
  90. package/dist/chunk-j03revz2.js +8 -0
  91. package/dist/chunk-j9qcrwbg.js +2 -0
  92. package/dist/chunk-jk4njz0w.js +2 -0
  93. package/dist/chunk-jmabeqfq.js +2 -0
  94. package/dist/chunk-jt0n43mk.js +2 -0
  95. package/dist/chunk-kjbv8a3m.js +2 -0
  96. package/dist/chunk-m1vdghnx.js +2 -0
  97. package/dist/chunk-m4sk62wb.js +5 -0
  98. package/dist/chunk-md8rqn48.js +30 -0
  99. package/dist/chunk-mepdnezf.js +17 -0
  100. package/dist/chunk-mhq0pjws.js +2 -0
  101. package/dist/chunk-mp6hy8g4.js +2 -0
  102. package/dist/chunk-ngc2wke4.js +3 -0
  103. package/dist/chunk-nn2vstke.js +2 -0
  104. package/dist/chunk-p2v2a68k.js +2 -0
  105. package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
  106. package/dist/chunk-pdt69hpb.js +2 -0
  107. package/dist/chunk-pgzvyrv6.js +29 -0
  108. package/dist/chunk-pj1wg7jg.js +2 -0
  109. package/dist/chunk-pqxzp1bb.js +3 -0
  110. package/dist/chunk-px7fvbj6.js +3 -0
  111. package/dist/chunk-q4c06e8x.js +20 -0
  112. package/dist/chunk-q6vrb2pe.js +2 -0
  113. package/dist/chunk-q7qchkvk.js +2 -0
  114. package/dist/chunk-q9bdh4s5.js +8 -0
  115. package/dist/chunk-qet5gc6s.js +2033 -0
  116. package/dist/chunk-qz519eyp.js +2 -0
  117. package/dist/chunk-r3f9jcf7.js +5 -0
  118. package/dist/chunk-rs4v4fha.js +4 -0
  119. package/dist/chunk-s2x4wcrz.js +2 -0
  120. package/dist/chunk-s5xezjps.js +3 -0
  121. package/dist/chunk-scezfp0w.js +30 -0
  122. package/dist/chunk-sd321bn3.js +2 -0
  123. package/dist/{chunk-eenk6s3t.js → chunk-sd47dzs0.js} +79 -79
  124. package/dist/chunk-se7mwqd1.js +2 -0
  125. package/dist/chunk-shr559s7.js +3 -0
  126. package/dist/chunk-syaw6b75.js +2 -0
  127. package/dist/chunk-t4hzprsm.js +3 -0
  128. package/dist/{chunk-s9za1vvd.js → chunk-t61vdbje.js} +89 -89
  129. package/dist/chunk-tfexmdkt.js +3 -0
  130. package/dist/chunk-thyt8ed8.js +6 -0
  131. package/dist/chunk-v091jft4.js +12 -0
  132. package/dist/chunk-v4vaqxrf.js +33 -0
  133. package/dist/chunk-vgvtnwxa.js +4 -0
  134. package/dist/chunk-x0q32ees.js +3 -0
  135. package/dist/chunk-x5bpeb4a.js +2 -0
  136. package/dist/chunk-x72tv2cg.js +3 -0
  137. package/dist/chunk-xfp7k0v8.js +64 -0
  138. package/dist/chunk-xtdw3692.js +6 -0
  139. package/dist/chunk-y1cmjvk3.js +43 -0
  140. package/dist/chunk-y5310237.js +311 -0
  141. package/dist/chunk-ya0qecph.js +27 -0
  142. package/dist/chunk-yazk54jr.js +8 -0
  143. package/dist/chunk-ydjfar14.js +2 -0
  144. package/dist/chunk-ym95v4nc.js +3 -0
  145. package/dist/chunk-ynvdvbat.js +18 -0
  146. package/dist/chunk-yvx1ap9b.js +3 -0
  147. package/dist/chunk-z0g9jvv0.js +40 -0
  148. package/dist/chunk-z6d0jmjb.js +2 -0
  149. package/dist/{chunk-fpwzacpm.js → chunk-zhxdpzga.js} +4 -4
  150. package/dist/cli.js +110 -110
  151. package/dist/craft-entry.js +7 -7
  152. package/dist/craft.js +7 -7
  153. package/dist/database.js +2 -2
  154. package/dist/image-optimization/component.js +4 -4
  155. package/dist/index.d.ts +2 -0
  156. package/dist/index.js +1 -0
  157. package/dist/media/image/component.js +5 -5
  158. package/dist/media/protected/component.js +2 -2
  159. package/dist/media/video/index.js +4 -4
  160. package/dist/native/bridge/protocol.d.ts +325 -0
  161. package/dist/native/bridge/protocol.js +219 -0
  162. package/dist/native/cli.d.ts +24 -0
  163. package/dist/native/cli.js +52 -0
  164. package/dist/native/compiler/bundle.d.ts +41 -0
  165. package/dist/native/compiler/bundle.js +90 -0
  166. package/dist/native/compiler/client-script.d.ts +8 -0
  167. package/dist/native/compiler/client-script.js +31 -0
  168. package/dist/native/compiler/codegen.d.ts +10 -0
  169. package/dist/native/compiler/codegen.js +145 -0
  170. package/dist/native/compiler/headwind-to-style.d.ts +395 -0
  171. package/dist/native/compiler/headwind-to-style.js +1163 -0
  172. package/dist/native/compiler/html-to-ir.d.ts +41 -0
  173. package/dist/native/compiler/html-to-ir.js +411 -0
  174. package/dist/native/compiler/icons.d.ts +220 -0
  175. package/dist/native/compiler/icons.js +208 -0
  176. package/dist/native/compiler/ir.d.ts +234 -0
  177. package/dist/native/compiler/ir.js +15 -0
  178. package/dist/native/compiler/parser.d.ts +88 -0
  179. package/dist/native/compiler/parser.js +753 -0
  180. package/dist/native/compiler/render-screen.d.ts +26 -0
  181. package/dist/native/compiler/render-screen.js +31 -0
  182. package/dist/native/components/primitives.d.ts +291 -0
  183. package/dist/native/components/primitives.js +22 -0
  184. package/dist/native/hot-reload/client.d.ts +62 -0
  185. package/dist/native/hot-reload/client.js +324 -0
  186. package/dist/native/index.d.ts +90 -0
  187. package/dist/native/index.js +34 -0
  188. package/dist/native/primitives/ActivityIndicator.stx +5 -0
  189. package/dist/native/primitives/Button.stx +5 -0
  190. package/dist/native/primitives/DatePicker.stx +5 -0
  191. package/dist/native/primitives/FlatList.stx +5 -0
  192. package/dist/native/primitives/Image.stx +5 -0
  193. package/dist/native/primitives/ImageBackground.stx +5 -0
  194. package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
  195. package/dist/native/primitives/Modal.stx +5 -0
  196. package/dist/native/primitives/Picker.stx +5 -0
  197. package/dist/native/primitives/Pressable.stx +5 -0
  198. package/dist/native/primitives/RefreshControl.stx +5 -0
  199. package/dist/native/primitives/SafeAreaView.stx +5 -0
  200. package/dist/native/primitives/ScrollView.stx +5 -0
  201. package/dist/native/primitives/SectionList.stx +5 -0
  202. package/dist/native/primitives/Slider.stx +5 -0
  203. package/dist/native/primitives/StatusBar.stx +5 -0
  204. package/dist/native/primitives/Switch.stx +5 -0
  205. package/dist/native/primitives/Text.stx +5 -0
  206. package/dist/native/primitives/TextInput.stx +5 -0
  207. package/dist/native/primitives/TouchableHighlight.stx +5 -0
  208. package/dist/native/primitives/TouchableOpacity.stx +5 -0
  209. package/dist/native/primitives/View.stx +5 -0
  210. package/dist/native/runtime/craft.d.ts +75 -0
  211. package/dist/native/runtime/craft.js +0 -0
  212. package/dist/native/runtime/entry.d.ts +1 -0
  213. package/dist/native/runtime/entry.js +3 -0
  214. package/dist/native/runtime/index.d.ts +45 -0
  215. package/dist/native/runtime/index.js +165 -0
  216. package/dist/native/runtime/native-host.d.ts +33 -0
  217. package/dist/native/runtime/native-host.js +184 -0
  218. package/dist/native/runtime/screen.d.ts +43 -0
  219. package/dist/native/runtime/screen.js +808 -0
  220. package/dist/pwa/service-worker.js +1 -1
  221. package/dist/pwa/workbox.js +1 -1
  222. package/dist/pwa.js +8 -8
  223. package/dist/site-url.d.ts +1 -1
  224. package/dist/ssg.js +53 -53
  225. package/dist/visual-testing.js +42 -42
  226. package/dist/web-components/reactive-generator.js +2 -2
  227. package/package.json +9 -5
  228. package/dist/chunk-00g9x6w2.js +0 -2
  229. package/dist/chunk-04tgatyy.js +0 -2
  230. package/dist/chunk-097jnwd5.js +0 -2
  231. package/dist/chunk-0btmm4m2.js +0 -147
  232. package/dist/chunk-0c2h69k2.js +0 -4
  233. package/dist/chunk-0pkk226n.js +0 -2
  234. package/dist/chunk-0we9nw1d.js +0 -3
  235. package/dist/chunk-0y46fbkx.js +0 -3
  236. package/dist/chunk-18n1ftn0.js +0 -33
  237. package/dist/chunk-1a0v39k5.js +0 -3
  238. package/dist/chunk-1fs9jvpb.js +0 -2
  239. package/dist/chunk-1qq26zt0.js +0 -2
  240. package/dist/chunk-1te8k8gp.js +0 -3
  241. package/dist/chunk-1ws3xcea.js +0 -1199
  242. package/dist/chunk-213jwgpx.js +0 -3
  243. package/dist/chunk-24w86pek.js +0 -32
  244. package/dist/chunk-27fgag95.js +0 -4
  245. package/dist/chunk-2fw05hs2.js +0 -3
  246. package/dist/chunk-2tbez006.js +0 -2
  247. package/dist/chunk-38wvkv3s.js +0 -2
  248. package/dist/chunk-3rkejwjp.js +0 -2
  249. package/dist/chunk-3t65wb35.js +0 -2
  250. package/dist/chunk-3w6z6tw9.js +0 -2
  251. package/dist/chunk-4q1c6fw2.js +0 -7
  252. package/dist/chunk-50pszj17.js +0 -2
  253. package/dist/chunk-563shnkz.js +0 -3
  254. package/dist/chunk-5h104qh1.js +0 -2
  255. package/dist/chunk-5qjk7drw.js +0 -20
  256. package/dist/chunk-603x5gb2.js +0 -2
  257. package/dist/chunk-6kd5jjwc.js +0 -2
  258. package/dist/chunk-6kdrncsx.js +0 -30
  259. package/dist/chunk-6zggmce7.js +0 -4422
  260. package/dist/chunk-72rwcbp6.js +0 -3
  261. package/dist/chunk-76w34xne.js +0 -3
  262. package/dist/chunk-7dmgt8at.js +0 -2
  263. package/dist/chunk-82pd4b5w.js +0 -2
  264. package/dist/chunk-8d7nf67s.js +0 -2
  265. package/dist/chunk-8w2mqdnv.js +0 -2
  266. package/dist/chunk-90b2vt2n.js +0 -2
  267. package/dist/chunk-9e8t0twa.js +0 -3
  268. package/dist/chunk-9fqp72ze.js +0 -5
  269. package/dist/chunk-9xew0kgf.js +0 -2
  270. package/dist/chunk-a7bnvz91.js +0 -24
  271. package/dist/chunk-akwd34xt.js +0 -29
  272. package/dist/chunk-anydpa34.js +0 -3
  273. package/dist/chunk-aq1xq0r4.js +0 -16
  274. package/dist/chunk-bbt3tp6f.js +0 -499
  275. package/dist/chunk-bn1edb1y.js +0 -47
  276. package/dist/chunk-btd7ds3x.js +0 -2
  277. package/dist/chunk-c4511wng.js +0 -2
  278. package/dist/chunk-c4h579e3.js +0 -2
  279. package/dist/chunk-cj3adc77.js +0 -5
  280. package/dist/chunk-cs54ek9m.js +0 -6
  281. package/dist/chunk-ct1jwd4r.js +0 -2
  282. package/dist/chunk-cxrgxzxc.js +0 -2
  283. package/dist/chunk-de8t7sc9.js +0 -17
  284. package/dist/chunk-fcnrgxck.js +0 -2
  285. package/dist/chunk-fqzcft9d.js +0 -2
  286. package/dist/chunk-gbmeh7jg.js +0 -3
  287. package/dist/chunk-gc06g35w.js +0 -2
  288. package/dist/chunk-gs18069g.js +0 -194
  289. package/dist/chunk-gvbf1mhs.js +0 -930
  290. package/dist/chunk-h564hgzt.js +0 -2
  291. package/dist/chunk-h83jrhfq.js +0 -3
  292. package/dist/chunk-hj4vpyhp.js +0 -2
  293. package/dist/chunk-hrkvsj5c.js +0 -11
  294. package/dist/chunk-hyr4ag1k.js +0 -2
  295. package/dist/chunk-jxvmf02k.js +0 -2
  296. package/dist/chunk-k5ptvy0b.js +0 -4
  297. package/dist/chunk-k80sn8d1.js +0 -2
  298. package/dist/chunk-k8t2cmyd.js +0 -2
  299. package/dist/chunk-kmsyvaex.js +0 -8
  300. package/dist/chunk-kq4b6cwj.js +0 -2
  301. package/dist/chunk-kvmx7dnb.js +0 -2
  302. package/dist/chunk-kxc2h5vn.js +0 -5
  303. package/dist/chunk-mbxehgrq.js +0 -2
  304. package/dist/chunk-mgnq5de2.js +0 -2
  305. package/dist/chunk-mgrckqww.js +0 -2
  306. package/dist/chunk-mq5ewmz6.js +0 -2
  307. package/dist/chunk-mrahwn5v.js +0 -8
  308. package/dist/chunk-n2swas11.js +0 -3
  309. package/dist/chunk-n4299xgy.js +0 -2
  310. package/dist/chunk-naw4jt7j.js +0 -2
  311. package/dist/chunk-ny67c03k.js +0 -3
  312. package/dist/chunk-p4jb9v0w.js +0 -2
  313. package/dist/chunk-p4zrvt5f.js +0 -14
  314. package/dist/chunk-p5wp0ce6.js +0 -43
  315. package/dist/chunk-pcxp4r9n.js +0 -3
  316. package/dist/chunk-pjrn29gg.js +0 -2
  317. package/dist/chunk-prxwsp7n.js +0 -2
  318. package/dist/chunk-py2r6wtv.js +0 -2
  319. package/dist/chunk-q738pwv6.js +0 -2
  320. package/dist/chunk-q9n5swx7.js +0 -3
  321. package/dist/chunk-qmmp5kb5.js +0 -2
  322. package/dist/chunk-qqpqgwvb.js +0 -30
  323. package/dist/chunk-rcv2ehpq.js +0 -18
  324. package/dist/chunk-rq414kn5.js +0 -3
  325. package/dist/chunk-rz9f3zqz.js +0 -7
  326. package/dist/chunk-s6g8wksg.js +0 -2
  327. package/dist/chunk-s8jd13nb.js +0 -3
  328. package/dist/chunk-spxsw4mp.js +0 -2
  329. package/dist/chunk-strcy64y.js +0 -2
  330. package/dist/chunk-t1htzg9e.js +0 -4
  331. package/dist/chunk-t1tdjjht.js +0 -216
  332. package/dist/chunk-tat1cjec.js +0 -2
  333. package/dist/chunk-td08rnk3.js +0 -3
  334. package/dist/chunk-tgadbsd4.js +0 -2
  335. package/dist/chunk-tgrpp58r.js +0 -2
  336. package/dist/chunk-tkyrk66a.js +0 -3
  337. package/dist/chunk-tp8pzf94.js +0 -3
  338. package/dist/chunk-twz64kvy.js +0 -2
  339. package/dist/chunk-v3nwkveg.js +0 -12
  340. package/dist/chunk-vsbmc9kt.js +0 -2
  341. package/dist/chunk-vzgzaw66.js +0 -12
  342. package/dist/chunk-wc66mcn4.js +0 -4367
  343. package/dist/chunk-wkanrfb3.js +0 -2
  344. package/dist/chunk-x8f6wqxd.js +0 -2
  345. package/dist/chunk-xsng1mtq.js +0 -3
  346. package/dist/chunk-xwts5yky.js +0 -4
  347. package/dist/chunk-z5rwnnk1.js +0 -3
  348. package/dist/chunk-zcz9rs6p.js +0 -3
  349. package/dist/chunk-zpcnbdhn.js +0 -64
  350. package/dist/chunk-zq4ssxj9.js +0 -8
@@ -1,930 +0,0 @@
1
- // @bun
2
- import{ix as y}from"./chunk-2fw05hs2.js";function b4(){if(typeof Notification<"u"&&Notification.permission==="granted")return!0;return!1}function RZ(){return typeof window<"u"&&typeof document<"u"}async function u4(){if(typeof Notification>"u")return!1;if(Notification.permission==="granted")return!0;if(Notification.permission==="denied")return!1;return await Notification.requestPermission()==="granted"}var g=new Map;function m4(){return`alert-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function h4(Z){switch(Z){case"info":return"&#x2139;";case"success":return"&#x2714;";case"warning":return"&#x26A0;";case"error":return"&#x2716;";default:return"&#x2139;"}}function c4(Z="top-right"){if(!RZ())throw Error("Toast container requires browser environment");try{let Y=document.querySelector(`.stx-toast-container[data-position="${Z}"]`);if(Y)return Y}catch{}let $=document.createElement("div");$.className=`stx-toast-container ${Z}`,$.dataset.position=Z;try{if(document.body)document.body.appendChild($)}catch{}return $}function p4(Z){let{options:$}=Z,Y=h4($.type),J=$.type||"info",Q=$.duration!==0;return`
3
- <div class="stx-toast ${J}" data-alert-id="${Z.id}" role="alert" aria-live="polite">
4
- <div class="stx-toast-icon">${Y}</div>
5
- <div class="stx-toast-content">
6
- ${$.title?`<div class="stx-toast-title">${fZ($.title)}</div>`:""}
7
- <div class="stx-toast-message">${fZ($.message)}</div>
8
- </div>
9
- ${Q?'<button class="stx-toast-close" aria-label="Close">&times;</button>':""}
10
- </div>
11
- `}function fZ(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function ZZ(Z){if(Z.timeout)clearTimeout(Z.timeout);if(g.delete(Z.id),Z.element&&RZ())Z.element.classList.add("dismissing"),setTimeout(()=>{Z.element?.remove()},200)}async function jZ(Z){let $=m4(),Y=b4(),J=Z.duration??5000,Q={id:$,options:Z};if(g.set($,Q),Y&&Z.type!=="error")try{let X=new Notification(Z.title||"Notification",{body:Z.message,icon:Z.type==="success"?"\u2713":Z.type==="warning"?"\u26A0":"\u2139",tag:$});if(X.onclick=()=>{if(Z.onClick)Z.onClick();X.close()},J>0)Q.timeout=setTimeout(()=>{X.close(),g.delete($)},J);return}catch{}if(RZ())try{let X=c4(Z.position),K=document.createElement("div");K.innerHTML=p4(Q);let z=K.firstElementChild;if(!z){let F=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${F}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`);return}Q.element=z;try{X.appendChild(z)}catch{let F=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${F}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`);return}if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>{try{z.classList.add("visible")}catch{}});try{z.addEventListener("click",(F)=>{if(F.target.classList?.contains("stx-toast-close")){ZZ(Q);return}if(Z.onClick)Z.onClick()})}catch{}if(J>0)Q.timeout=setTimeout(()=>{ZZ(Q)},J)}catch{let X=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${X}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`)}else{let X=(Z.type||"info").toUpperCase();if(console.log(`[stx-alert] ${X}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`),J>0)Q.timeout=setTimeout(()=>{g.delete($)},J)}}async function d(Z){return jZ({...Z,position:Z.position||"top-right"})}async function l4(Z,$=3000){return d({message:Z,type:"info",duration:$})}async function d4(Z,$=3000){return d({message:Z,type:"success",duration:$})}async function r4(Z,$=3000){return d({message:Z,type:"warning",duration:$})}async function n4(Z,$=5000){return d({message:Z,type:"error",duration:$})}async function o4(Z,$,Y="info"){return jZ({title:Z,message:$,type:Y})}function a4(Z){let $=g.get(Z);if($)ZZ($)}function i4(){for(let Z of g.values())ZZ(Z)}function s4(){return g.size}var t4=`
12
- .stx-toast-container {
13
- position: fixed;
14
- z-index: 10001;
15
- display: flex;
16
- flex-direction: column;
17
- gap: 8px;
18
- max-width: 400px;
19
- pointer-events: none;
20
- }
21
-
22
- .stx-toast-container.top-left { top: 16px; left: 16px; }
23
- .stx-toast-container.top-center { top: 16px; left: 50%; transform: translateX(-50%); }
24
- .stx-toast-container.top-right { top: 16px; right: 16px; }
25
- .stx-toast-container.bottom-left { bottom: 16px; left: 16px; }
26
- .stx-toast-container.bottom-center { bottom: 16px; left: 50%; transform: translateX(-50%); }
27
- .stx-toast-container.bottom-right { bottom: 16px; right: 16px; }
28
-
29
- .stx-toast {
30
- display: flex;
31
- align-items: flex-start;
32
- gap: 12px;
33
- padding: 12px 16px;
34
- background: #fff;
35
- border-radius: 8px;
36
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
37
- pointer-events: auto;
38
- cursor: pointer;
39
- opacity: 0;
40
- transform: translateY(-10px);
41
- transition: opacity 0.2s, transform 0.2s;
42
- }
43
-
44
- .stx-toast.visible {
45
- opacity: 1;
46
- transform: translateY(0);
47
- }
48
-
49
- .stx-toast.dismissing {
50
- opacity: 0;
51
- transform: translateX(100%);
52
- }
53
-
54
- @media (prefers-color-scheme: dark) {
55
- .stx-toast {
56
- background: #2d2d2d;
57
- color: #fff;
58
- }
59
- }
60
-
61
- .stx-toast-icon {
62
- font-size: 20px;
63
- flex-shrink: 0;
64
- margin-top: 2px;
65
- }
66
-
67
- .stx-toast.info .stx-toast-icon { color: #3498db; }
68
- .stx-toast.success .stx-toast-icon { color: #27ae60; }
69
- .stx-toast.warning .stx-toast-icon { color: #f39c12; }
70
- .stx-toast.error .stx-toast-icon { color: #e74c3c; }
71
-
72
- .stx-toast-content {
73
- flex: 1;
74
- min-width: 0;
75
- }
76
-
77
- .stx-toast-title {
78
- font-weight: 600;
79
- margin-bottom: 4px;
80
- }
81
-
82
- .stx-toast-message {
83
- color: #666;
84
- font-size: 14px;
85
- line-height: 1.4;
86
- }
87
-
88
- @media (prefers-color-scheme: dark) {
89
- .stx-toast-message { color: #aaa; }
90
- }
91
-
92
- .stx-toast-close {
93
- background: none;
94
- border: none;
95
- font-size: 20px;
96
- cursor: pointer;
97
- opacity: 0.5;
98
- padding: 0;
99
- line-height: 1;
100
- color: inherit;
101
- transition: opacity 0.15s;
102
- }
103
-
104
- .stx-toast-close:hover {
105
- opacity: 1;
106
- }
107
-
108
- /* Border accent for different types */
109
- .stx-toast.info { border-left: 4px solid #3498db; }
110
- .stx-toast.success { border-left: 4px solid #27ae60; }
111
- .stx-toast.warning { border-left: 4px solid #f39c12; }
112
- .stx-toast.error { border-left: 4px solid #e74c3c; }
113
- `;function _(Z="stx"){return`${Z}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function q(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function D(...Z){return Z.filter(Boolean).join(" ")}function L(Z){if(!Z)return"";return Object.entries(Z).map(([$,Y])=>`${$.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${Y}`).join("; ")}function e4(Z){let{text:$,variant:Y="primary",size:J="medium",disabled:Q=!1,loading:X=!1,icon:K,iconPosition:z="left",id:F=_("btn"),className:R,style:O}=Z,V=D("stx-button",`stx-button--${Y}`,`stx-button--${J}`,Q&&"stx-button--disabled",X&&"stx-button--loading",R),j=L(O),U=K?`<span class="stx-button-icon">${K}</span>`:"",W=X?'<span class="stx-button-spinner"></span>':"",T=z==="left"?`${U}${W}<span class="stx-button-text">${q($)}</span>`:`<span class="stx-button-text">${q($)}</span>${U}${W}`;return`<button id="${F}" class="${V}" ${Q||X?"disabled":""} ${j?`style='${j}'`:""}>${T}</button>`}function Z6(Z){let{value:$="",placeholder:Y="",type:J="text",disabled:Q=!1,readonly:X=!1,maxLength:K,minLength:z,pattern:F,required:R=!1,autocomplete:O,label:V,error:j,hint:U,id:W=_("input"),className:T,style:N}=Z,E=D("stx-input",j&&"stx-input--error",Q&&"stx-input--disabled",T),S=L(N),e=[`type="${J}"`,`id="${W}"`,`class="${E}"`,$&&`value="${q($)}"`,Y&&`placeholder="${q(Y)}"`,Q&&"disabled",X&&"readonly",R&&"required",K&&`maxlength="${K}"`,z&&`minlength="${z}"`,F&&`pattern="${q(F)}"`,O&&`autocomplete="${O}"`,S&&`style="${S}"`].filter(Boolean).join(" "),w="";if(V)w+=`<label class="stx-input-label" for="${W}">${q(V)}</label>`;if(w+=`<input ${e} />`,j)w+=`<div class="stx-input-error">${q(j)}</div>`;else if(U)w+=`<div class="stx-input-hint">${q(U)}</div>`;return`<div class="stx-input-wrapper">${w}</div>`}function $6(Z){let{checked:$=!1,label:Y,disabled:J=!1,indeterminate:Q=!1,id:X=_("checkbox"),className:K,style:z}=Z,F=D("stx-checkbox",J&&"stx-checkbox--disabled",K),R=L(z),O=['type="checkbox"',`id="${X}"`,$&&"checked",J&&"disabled",Q&&'data-indeterminate="true"'].filter(Boolean).join(" ");return`
114
- <label class="${F}" ${R?`style="${R}"`:""}>
115
- <input ${O} />
116
- <span class="stx-checkbox-box"></span>
117
- ${Y?`<span class="stx-checkbox-label">${q(Y)}</span>`:""}
118
- </label>
119
- `}function Y6(Z){let{value:$=50,min:Y=0,max:J=100,step:Q=1,disabled:X=!1,label:K,showValue:z=!0,id:F=_("slider"),className:R,style:O}=Z,V=D("stx-slider",X&&"stx-slider--disabled",R),j=L(O),U=['type="range"',`id="${F}"`,`value="${$}"`,`min="${Y}"`,`max="${J}"`,`step="${Q}"`,X&&"disabled"].filter(Boolean).join(" "),W="";if(K)W+=`<label class="stx-slider-label" for="${F}">${q(K)}</label>`;if(W+=`<div class="stx-slider-track"><input ${U} /></div>`,z)W+=`<span class="stx-slider-value">${$}</span>`;return`<div class="${V}" ${j?`style='${j}'`:""}>${W}</div>`}function J6(Z){let{value:$,max:Y=100,variant:J="default",size:Q="medium",showLabel:X=!1,indeterminate:K=!1,id:z=_("progress"),className:F,style:R}=Z,O=Math.min(100,Math.max(0,$/Y*100)),V=D("stx-progress",`stx-progress--${J}`,`stx-progress--${Q}`,K&&"stx-progress--indeterminate",F),j=L(R);return`
120
- <div id="${z}" class="${V}" role="progressbar" aria-valuenow="${$}" aria-valuemin="0" aria-valuemax="${Y}" ${j?`style="${j}"`:""}>
121
- <div class="stx-progress-bar" style="width: ${K?"100%":`${O}%`}"></div>
122
- ${X?`<span class="stx-progress-label">${Math.round(O)}%</span>`:""}
123
- </div>
124
- `}function G6(Z){let{text:$,variant:Y="default",size:J="medium",id:Q=_("badge"),className:X,style:K}=Z,z=D("stx-badge",`stx-badge--${Y}`,`stx-badge--${J}`,X),F=L(K);return`<span id="${Q}" class="${z}" ${F?`style='${F}'`:""}>${q($)}</span>`}function Q6(Z){let{src:$,alt:Y="",name:J,size:Q="medium",shape:X="circle",id:K=_("avatar"),className:z,style:F}=Z,R=typeof Q==="number"?"":`stx-avatar--${Q}`,O=typeof Q==="number"?`width: ${Q}px; height: ${Q}px;`:"",V=D("stx-avatar",R,`stx-avatar--${X}`,z),j=[O,L(F)].filter(Boolean).join(" "),U=J?J.split(" ").map((W)=>W[0]).join("").toUpperCase().slice(0,2):"";if($)return`<div id="${K}" class="${V}" ${j?`style="${j}"`:""}>
125
- <img src="${q($)}" alt="${q(Y)}" class="stx-avatar-img" />
126
- </div>`;return`<div id="${K}" class="${V}" ${j?`style="${j}"`:""}>
127
- <span class="stx-avatar-initials">${U}</span>
128
- </div>`}function X6(Z){let{title:$,subtitle:Y,content:J,image:Q,footer:X,variant:K="default",id:z=_("card"),className:F,style:R}=Z,O=D("stx-card",`stx-card--${K}`,F),V=L(R),j="";if(Q)j+=`<div class="stx-card-image"><img src="${q(Q)}" alt="" /></div>`;if(j+='<div class="stx-card-body">',$)j+=`<h3 class="stx-card-title">${q($)}</h3>`;if(Y)j+=`<p class="stx-card-subtitle">${q(Y)}</p>`;if(J)j+=`<div class="stx-card-content">${q(J)}</div>`;if(j+="</div>",X)j+=`<div class="stx-card-footer">${q(X)}</div>`;return`<div id="${z}" class="${O}" ${V?`style='${V}'`:""}>${j}</div>`}function z6(Z){let{tabs:$,activeTab:Y,variant:J="default",id:Q=_("tabs"),className:X,style:K}=Z,z=D("stx-tabs",`stx-tabs--${J}`,X),F=L(K),R=$.map((O,V)=>{let j=Y?O.value===Y:V===0;return`<button class="${D("stx-tab",j&&"stx-tab--active",O.disabled&&"stx-tab--disabled")}" data-value="${q(O.value)}" ${O.disabled?"disabled":""} role="tab" aria-selected="${j}">${q(O.label)}</button>`}).join("");return`<div id="${Q}" class="${z}" role="tablist" ${F?`style='${F}'`:""}>${R}</div>`}function K6(Z){let{options:$,value:Y,placeholder:J="Select...",disabled:Q=!1,id:X=_("dropdown"),className:K,style:z}=Z,F=D("stx-dropdown",Q&&"stx-dropdown--disabled",K),R=L(z),O=$.map((j)=>{let U=j.value===Y?"selected":"",W=j.disabled?"disabled":"";return`<option value="${q(j.value)}" ${U} ${W}>${q(j.label)}</option>`}).join(""),V=Y?"":`<option value="" disabled selected>${q(J)}</option>`;return`<select id="${X}" class="${F}" ${Q?"disabled":""} ${R?`style='${R}'`:""}>${V}${O}</select>`}function F6(Z){let{value:$=0,max:Y=5,readonly:J=!1,size:Q="medium",allowHalf:X=!1,id:K=_("rating"),className:z,style:F}=Z,R=D("stx-rating",`stx-rating--${Q}`,J&&"stx-rating--readonly",z),O=L(F),V="";for(let j=1;j<=Y;j++){let U=j<=$,W=X&&j-0.5===$;V+=`<span class="stx-star ${U?"stx-star--filled":W?"stx-star--half":""}" data-value="${j}">\u2605</span>`}return`<div id="${K}" class="${R}" role="slider" aria-valuenow="${$}" aria-valuemin="0" aria-valuemax="${Y}" ${O?`style='${O}'`:""}>${V}</div>`}function R6(Z){let{value:$,name:Y,checked:J=!1,label:Q,disabled:X=!1,id:K=_("radio"),className:z,style:F}=Z,R=D("stx-radio",X&&"stx-radio--disabled",z),O=L(F),V=['type="radio"',`id="${K}"`,`name="${q(Y)}"`,`value="${q($)}"`,J&&"checked",X&&"disabled"].filter(Boolean).join(" ");return`
129
- <label class="${R}" ${O?`style="${O}"`:""}>
130
- <input ${V} />
131
- <span class="stx-radio-circle"></span>
132
- ${Q?`<span class="stx-radio-label">${q(Q)}</span>`:""}
133
- </label>
134
- `}function j6(Z){let{value:$="#3498db",disabled:Y=!1,label:J,presetColors:Q=["#e74c3c","#f39c12","#27ae60","#3498db","#9b59b6","#1abc9c","#34495e","#000000"],id:X=_("color"),className:K,style:z}=Z,F=D("stx-color-picker",Y&&"stx-color-picker--disabled",K),R=L(z),O="";if(J)O+=`<label class="stx-color-picker-label" for="${X}">${q(J)}</label>`;if(O+=`<div class="stx-color-picker-input">
135
- <input type="color" id="${X}" value="${q($)}" ${Y?"disabled":""} />
136
- <span class="stx-color-picker-value">${q($)}</span>
137
- </div>`,Q.length>0){O+='<div class="stx-color-picker-presets">';for(let V of Q)O+=`<button class="stx-color-preset" style="background: ${q(V)}" data-color="${q(V)}" ${Y?"disabled":""}></button>`;O+="</div>"}return`<div class="${F}" ${R?`style='${R}'`:""}>${O}</div>`}function O6(Z){let{value:$,min:Y,max:J,disabled:Q=!1,label:X,placeholder:K="Select date",showClear:z=!0,id:F=_("date"),className:R,style:O}=Z,V=D("stx-date-picker",Q&&"stx-date-picker--disabled",R),j=L(O),U=$ instanceof Date?$.toISOString().split("T")[0]:$||"",W=Y instanceof Date?Y.toISOString().split("T")[0]:Y,T=J instanceof Date?J.toISOString().split("T")[0]:J,N=['type="date"',`id="${F}"`,U&&`value="${U}"`,W&&`min="${W}"`,T&&`max="${T}"`,Q&&"disabled",`placeholder="${q(K)}"`].filter(Boolean).join(" "),E="";if(X)E+=`<label class="stx-date-picker-label" for="${F}">${q(X)}</label>`;return E+=`<div class="stx-date-picker-input">
138
- <input ${N} />
139
- ${z&&U?'<button class="stx-date-picker-clear" type="button">&times;</button>':""}
140
- </div>`,`<div class="${V}" ${j?`style='${j}'`:""}>${E}</div>`}function V6(Z){let{value:$="",disabled:Y=!1,label:J,step:Q=60,min:X,max:K,id:z=_("time"),className:F,style:R}=Z,O=D("stx-time-picker",Y&&"stx-time-picker--disabled",F),V=L(R),j=['type="time"',`id="${z}"`,$&&`value="${q($)}"`,`step="${Q}"`,X&&`min="${q(X)}"`,K&&`max="${q(K)}"`,Y&&"disabled"].filter(Boolean).join(" "),U="";if(J)U+=`<label class="stx-time-picker-label" for="${z}">${q(J)}</label>`;return U+=`<input ${j} class="stx-time-picker-input" />`,`<div class="${O}" ${V?`style='${V}'`:""}>${U}</div>`}function q6(Z){let{options:$,value:Y="",placeholder:J="Search...",disabled:Q=!1,label:X,loading:K=!1,id:z=_("autocomplete"),className:F,style:R}=Z,O=D("stx-autocomplete",Q&&"stx-autocomplete--disabled",F),V=L(R),j=$.find((T)=>T.value===Y),U=j?j.label:Y,W="";if(X)W+=`<label class="stx-autocomplete-label" for="${z}">${q(X)}</label>`;W+=`<div class="stx-autocomplete-input-wrapper">
141
- <input type="text" id="${z}" value="${q(U)}" placeholder="${q(J)}" ${Q?"disabled":""} autocomplete="off" class="stx-autocomplete-input" />
142
- ${K?'<span class="stx-autocomplete-spinner"></span>':""}
143
- </div>`,W+='<ul class="stx-autocomplete-list">';for(let T of $)W+=`<li class="stx-autocomplete-item ${T.value===Y?"stx-autocomplete-item--selected":""}" data-value="${q(T.value)}">${q(T.label)}</li>`;return W+="</ul>",`<div class="${O}" ${V?`style='${V}'`:""}>${W}</div>`}function P6(Z){let{text:$,htmlFor:Y,required:J=!1,size:Q="medium",id:X=_("label"),className:K,style:z}=Z,F=D("stx-label",`stx-label--${Q}`,K),R=L(z);return`<label id="${X}" class="${F}" ${Y?`for='${q(Y)}'`:""} ${R?`style='${R}'`:""}>${q($)}${J?'<span class="stx-label-required">*</span>':""}</label>`}function U6(Z){let{src:$,alt:Y="",width:J,height:Q,objectFit:X="cover",fallback:K,loading:z="lazy",id:F=_("image"),className:R,style:O}=Z,V=D("stx-image",R),j={objectFit:X};if(J)j.width=typeof J==="number"?`${J}px`:J;if(Q)j.height=typeof Q==="number"?`${Q}px`:Q;let U=[L(j),L(O)].filter(Boolean).join("; "),W=K?`onerror="this.src='${q(K)}'"`:"";return`<img id="${F}" class="${V}" src="${q($)}" alt="${q(Y)}" loading="${z}" ${U?`style='${U}'`:""} ${W} />`}function W6(Z){let{text:$,variant:Y="default",size:J="medium",removable:Q=!1,icon:X,id:K=_("chip"),className:z,style:F}=Z,R=D("stx-chip",`stx-chip--${Y}`,`stx-chip--${J}`,z),O=L(F),V="";if(X)V+=`<span class="stx-chip-icon">${X}</span>`;if(V+=`<span class="stx-chip-text">${q($)}</span>`,Q)V+='<button class="stx-chip-remove" type="button">&times;</button>';return`<span id="${K}" class="${R}" ${O?`style='${O}'`:""}>${V}</span>`}function L6(Z){let{text:$,position:Y="top",delay:J=200,children:Q,id:X=_("tooltip"),className:K,style:z}=Z,F=D("stx-tooltip-wrapper",K),R=L(z);return`<div id="${X}" class="${F}" ${R?`style="${R}"`:""} data-tooltip="${q($)}" data-position="${Y}" data-delay="${J}">
144
- ${Q}
145
- <span class="stx-tooltip stx-tooltip--${Y}">${q($)}</span>
146
- </div>`}function D6(Z){let{direction:$="vertical",showScrollbar:Y=!0,smooth:J=!0,height:Q,width:X,children:K,id:z=_("scroll"),className:F,style:R}=Z,O=D("stx-scroll-view",`stx-scroll-view--${$}`,!Y&&"stx-scroll-view--hide-scrollbar",J&&"stx-scroll-view--smooth",F),V={};if(Q)V.height=typeof Q==="number"?`${Q}px`:Q;if(X)V.width=typeof X==="number"?`${X}px`:X;let j=[L(V),L(R)].filter(Boolean).join("; ");return`<div id="${z}" class="${O}" ${j?`style='${j}'`:""}>${K}</div>`}function M6(Z){let{direction:$="horizontal",sizes:Y=[50,50],resizable:J=!0,children:Q,id:X=_("split"),className:K,style:z}=Z,F=D("stx-split-view",`stx-split-view--${$}`,J&&"stx-split-view--resizable",K),R=L(z),O=$==="horizontal"?"width":"height";return`<div id="${X}" class="${F}" ${R?`style="${R}"`:""}>
147
- <div class="stx-split-pane" style="${O}: ${Y[0]}%">${Q[0]}</div>
148
- ${J?'<div class="stx-split-divider"></div>':""}
149
- <div class="stx-split-pane" style="${O}: ${Y[1]}%">${Q[1]}</div>
150
- </div>`}function _6(Z){let{items:$,multiple:Y=!1,defaultOpen:J=[],id:Q=_("accordion"),className:X,style:K}=Z,z=D("stx-accordion",X),F=L(K),R="";return $.forEach((O,V)=>{let j=J.includes(V),U=D("stx-accordion-item",j&&"stx-accordion-item--open",O.disabled&&"stx-accordion-item--disabled");R+=`<div class="${U}" data-index="${V}">
151
- <button class="stx-accordion-header" ${O.disabled?"disabled":""} aria-expanded="${j}" data-multiple="${Y}">
152
- <span class="stx-accordion-title">${q(O.title)}</span>
153
- <span class="stx-accordion-icon">\u25BC</span>
154
- </button>
155
- <div class="stx-accordion-content" ${j?"":"hidden"}>
156
- ${q(O.content)}
157
- </div>
158
- </div>`}),`<div id="${Q}" class="${z}" ${F?`style='${F}'`:""}>${R}</div>`}function T6(Z){let{steps:$,currentStep:Y,orientation:J="horizontal",id:Q=_("stepper"),className:X,style:K}=Z,z=D("stx-stepper",`stx-stepper--${J}`,X),F=L(K),R="";return $.forEach((O,V)=>{let j=D("stx-step",V<Y&&"stx-step--completed",V===Y&&"stx-step--active");if(R+=`<div class="${j}" data-step="${V}">
159
- <div class="stx-step-indicator">
160
- ${V<Y?"\u2713":V+1}
161
- </div>
162
- <div class="stx-step-content">
163
- <div class="stx-step-label">${q(O.label)}</div>
164
- ${O.description?`<div class="stx-step-description">${q(O.description)}</div>`:""}
165
- </div>
166
- </div>`,V<$.length-1)R+='<div class="stx-step-connector"></div>'}),`<div id="${Q}" class="${z}" ${F?`style='${F}'`:""}>${R}</div>`}function N6(Z){let{open:$=!1,title:Y,size:J="medium",closable:Q=!0,children:X,footer:K,id:z=_("modal"),className:F,style:R}=Z,O=D("stx-modal-component",`stx-modal-component--${J}`,F),V=L(R);if(!$)return`<div id="${z}" class="${O} stx-modal-component--hidden" ${V?`style='${V}'`:""}></div>`;let j='<div class="stx-modal-component-overlay">';if(j+='<div class="stx-modal-component-dialog">',Y||Q){if(j+='<div class="stx-modal-component-header">',Y)j+=`<h3 class="stx-modal-component-title">${q(Y)}</h3>`;if(Q)j+='<button class="stx-modal-component-close">&times;</button>';j+="</div>"}if(j+=`<div class="stx-modal-component-body">${X}</div>`,K)j+=`<div class="stx-modal-component-footer">${K}</div>`;return j+="</div></div>",`<div id="${z}" class="${O}" ${V?`style='${V}'`:""}>${j}</div>`}function E6(Z){let{items:$,selectable:Y=!1,multiSelect:J=!1,emptyMessage:Q="No items",id:X=_("list"),className:K,style:z}=Z,F=D("stx-list-view",Y&&"stx-list-view--selectable",J&&"stx-list-view--multi",K),R=L(z);if($.length===0)return`<div id="${X}" class="${F}" ${R?`style="${R}"`:""}>
167
- <div class="stx-list-view-empty">${q(Q)}</div>
168
- </div>`;let O='<ul class="stx-list-view-items">';for(let V of $){let j=D("stx-list-view-item",V.selected&&"stx-list-view-item--selected");O+=`<li class="${j}" data-id="${q(V.id)}" ${Y?'tabindex="0"':""}>${V.content}</li>`}return O+="</ul>",`<div id="${X}" class="${F}" ${R?`style='${R}'`:""}>${O}</div>`}function A6(Z){let{columns:$,data:Y,striped:J=!1,bordered:Q=!1,hoverable:X=!0,sortBy:K,sortOrder:z,id:F=_("table"),className:R,style:O}=Z,V=D("stx-table",J&&"stx-table--striped",Q&&"stx-table--bordered",X&&"stx-table--hoverable",R),j=L(O),U="<table>";U+="<thead><tr>";for(let W of $){let N=W.key===K?`stx-table-sorted stx-table-sorted--${z}`:"",E=W.sortable?'data-sortable="true"':"",S=W.width?`style="width: ${W.width}"`:"";U+=`<th class="${N}" ${E} ${S} data-key="${q(W.key)}">${q(W.label)}${W.sortable?'<span class="stx-table-sort-icon"></span>':""}</th>`}U+="</tr></thead>",U+="<tbody>";for(let W of Y){U+="<tr>";for(let T of $){let N=W[T.key];U+=`<td>${N!=null?q(String(N)):""}</td>`}U+="</tr>"}return U+="</tbody></table>",`<div id="${F}" class="${V}" ${j?`style='${j}'`:""}>${U}</div>`}function vZ(Z,$,Y,J){let Q=$.includes(Z.key),X=Y.includes(Z.key),K=Z.children&&Z.children.length>0,F=`<div class="${D("stx-tree-node",X&&"stx-tree-node--selected",Z.disabled&&"stx-tree-node--disabled")}" data-key="${q(Z.key)}">`;if(F+='<div class="stx-tree-node-content">',K)F+=`<span class="stx-tree-toggle ${Q?"stx-tree-toggle--expanded":""}">\u25B6</span>`;else F+='<span class="stx-tree-toggle-placeholder"></span>';if(J)F+=`<input type="checkbox" class="stx-tree-checkbox" ${X?"checked":""} ${Z.disabled?"disabled":""} />`;if(Z.icon)F+=`<span class="stx-tree-icon">${Z.icon}</span>`;if(F+=`<span class="stx-tree-label">${q(Z.label)}</span>`,F+="</div>",K&&Q){F+='<div class="stx-tree-children">';for(let R of Z.children)F+=vZ(R,$,Y,J);F+="</div>"}return F+="</div>",F}function k6(Z){let{nodes:$,expandedKeys:Y=[],selectedKeys:J=[],checkable:Q=!1,id:X=_("tree"),className:K,style:z}=Z,F=D("stx-tree-view",Q&&"stx-tree-view--checkable",K),R=L(z),O="";for(let V of $)O+=vZ(V,Y,J,Q);return`<div id="${X}" class="${F}" role="tree" ${R?`style='${R}'`:""}>${O}</div>`}function H6(Z){let{columns:$,data:Y,pagination:J,selectable:Q=!1,id:X=_("datagrid"),className:K,style:z}=Z,F=D("stx-data-grid",Q&&"stx-data-grid--selectable",K),R=L(z),O='<div class="stx-data-grid-table-wrapper">';if(O+='<table class="stx-data-grid-table">',O+="<thead><tr>",Q)O+='<th class="stx-data-grid-select-all"><input type="checkbox" /></th>';for(let V of $){let j=V.width?`style="width: ${V.width}"`:"";O+=`<th ${j}>
169
- <div class="stx-data-grid-header-cell">
170
- <span>${q(V.label)}</span>
171
- ${V.sortable?'<button class="stx-data-grid-sort">\u21C5</button>':""}
172
- ${V.filterable?'<button class="stx-data-grid-filter">\u22BB</button>':""}
173
- </div>
174
- </th>`}O+="</tr></thead>",O+="<tbody>";for(let V of Y){if(O+="<tr>",Q)O+='<td class="stx-data-grid-select"><input type="checkbox" /></td>';for(let j of $){let U=V[j.key];O+=`<td>${U!=null?q(String(U)):""}</td>`}O+="</tr>"}if(O+="</tbody></table></div>",J){let V=Math.ceil(J.total/J.pageSize);O+=`<div class="stx-data-grid-pagination">
175
- <span class="stx-data-grid-page-info">Page ${J.page} of ${V} (${J.total} items)</span>
176
- <div class="stx-data-grid-page-buttons">
177
- <button class="stx-data-grid-page-btn" ${J.page<=1?"disabled":""}>\u25C0</button>
178
- <button class="stx-data-grid-page-btn" ${J.page>=V?"disabled":""}>\u25B6</button>
179
- </div>
180
- </div>`}return`<div id="${X}" class="${F}" ${R?`style='${R}'`:""}>${O}</div>`}function x6(Z){let{type:$,data:Y,options:J={},width:Q="100%",height:X=300,id:K=_("chart"),className:z,style:F}=Z,R=D("stx-chart",`stx-chart--${$}`,z),O={width:typeof Q==="number"?`${Q}px`:Q,height:typeof X==="number"?`${X}px`:X},V=[L(O),L(F)].filter(Boolean).join("; "),j=JSON.stringify({type:$,data:Y,options:J});return`<div id="${K}" class="${R}" style="${V}" data-chart='${q(j)}'>
181
- <div class="stx-chart-placeholder">
182
- ${J.title?`<div class="stx-chart-title">${q(J.title)}</div>`:""}
183
- <div class="stx-chart-type">${$.charAt(0).toUpperCase()+$.slice(1)} Chart</div>
184
- <div class="stx-chart-info">${Y.datasets.length} dataset(s), ${Y.labels.length} labels</div>
185
- </div>
186
- </div>`}function C6(Z){let{value:$="",language:Y="plaintext",theme:J="dark",lineNumbers:Q=!0,readOnly:X=!1,height:K=300,tabSize:z=2,wordWrap:F=!1,id:R=_("code"),className:O,style:V}=Z,j=D("stx-code-editor",`stx-code-editor--${J}`,Q&&"stx-code-editor--line-numbers",X&&"stx-code-editor--readonly",F&&"stx-code-editor--wrap",O),U={height:typeof K==="number"?`${K}px`:K},W=[L(U),L(V)].filter(Boolean).join("; "),T=$.split(`
187
- `),N="";if(Q){N+='<div class="stx-code-editor-gutter">';for(let E=1;E<=T.length;E++)N+=`<div class="stx-code-editor-line-number">${E}</div>`;N+="</div>"}return N+=`<pre class="stx-code-editor-content"><code class="language-${q(Y)}">${q($)}</code></pre>`,`<div id="${R}" class="${j}" style="${W}" data-language="${q(Y)}" data-tab-size="${z}">${N}</div>`}function I6(Z){let{src:$,type:Y="video",poster:J,autoplay:Q=!1,loop:X=!1,muted:K=!1,controls:z=!0,width:F,height:R,id:O=_("media"),className:V,style:j}=Z,U=D("stx-media-player",`stx-media-player--${Y}`,V),W={};if(F)W.width=typeof F==="number"?`${F}px`:F;if(R)W.height=typeof R==="number"?`${R}px`:R;let T=[L(W),L(j)].filter(Boolean).join("; "),N=[`id="${O}-media"`,`src="${q($)}"`,z&&"controls",Q&&"autoplay",X&&"loop",K&&"muted",Y==="video"&&J&&`poster="${q(J)}"`].filter(Boolean).join(" "),E=Y==="video"?`<video ${N}>Your browser does not support the video tag.</video>`:`<audio ${N}>Your browser does not support the audio tag.</audio>`;return`<div id="${O}" class="${U}" ${T?`style='${T}'`:""}>${E}</div>`}function S6(Z){if(Z===void 0)return"";let $=["B","KB","MB","GB"],Y=Z,J=0;while(Y>=1024&&J<$.length-1)Y/=1024,J++;return`${Y.toFixed(1)} ${$[J]}`}function w6(Z){let{files:$,viewMode:Y="list",showHidden:J=!1,selectable:Q=!0,id:X=_("files"),className:K,style:z}=Z,F=D("stx-file-explorer",`stx-file-explorer--${Y}`,K),R=L(z),O=J?$:$.filter((j)=>!j.name.startsWith(".")),V="";if(Y==="list"){V='<table class="stx-file-explorer-list"><thead><tr><th>Name</th><th>Size</th><th>Modified</th></tr></thead><tbody>';for(let j of O){let U=j.icon||(j.type==="folder"?"\uD83D\uDCC1":"\uD83D\uDCC4"),W=j.type==="file"?S6(j.size):"",T=j.modified?j.modified.toLocaleDateString():"";V+=`<tr class="stx-file-explorer-item ${Q?"stx-file-explorer-item--selectable":""}" data-path="${q(j.path)}" data-type="${j.type}">
188
- <td><span class="stx-file-explorer-icon">${U}</span>${q(j.name)}</td>
189
- <td>${W}</td>
190
- <td>${T}</td>
191
- </tr>`}V+="</tbody></table>"}else{V='<div class="stx-file-explorer-grid">';for(let j of O){let U=j.icon||(j.type==="folder"?"\uD83D\uDCC1":"\uD83D\uDCC4");V+=`<div class="stx-file-explorer-item ${Q?"stx-file-explorer-item--selectable":""}" data-path="${q(j.path)}" data-type="${j.type}">
192
- <div class="stx-file-explorer-icon">${U}</div>
193
- <div class="stx-file-explorer-name">${q(j.name)}</div>
194
- </div>`}V+="</div>"}return`<div id="${X}" class="${F}" ${R?`style='${R}'`:""}>${V}</div>`}function B6(Z){let{url:$,width:Y="100%",height:J=400,sandbox:Q=!0,allowScripts:X=!0,id:K=_("webview"),className:z,style:F}=Z,R=D("stx-webview",z),O={width:typeof Y==="number"?`${Y}px`:Y,height:typeof J==="number"?`${J}px`:J},V=[L(O),L(F)].filter(Boolean).join("; "),j=[];if(Q){if(j.push("allow-same-origin"),X)j.push("allow-scripts")}let U=Q?`sandbox="${j.join(" ")}"`:"";return`<iframe id="${K}" class="${R}" src="${q($)}" style="${V}" ${U} loading="lazy" frameborder="0"></iframe>`}var f6=["Button","TextInput","Checkbox","RadioButton","Slider","ColorPicker","DatePicker","TimePicker","Autocomplete","Label","ImageView","ProgressBar","Avatar","Badge","Chip","Card","Tooltip","Toast","ScrollView","SplitView","Accordion","Stepper","Modal","Tabs","Dropdown","ListView","Table","TreeView","DataGrid","Chart","Rating","CodeEditor","MediaPlayer","FileExplorer","WebView"],v6=`
195
- /* Button */
196
- .stx-button {
197
- display: inline-flex;
198
- align-items: center;
199
- justify-content: center;
200
- gap: 8px;
201
- padding: 8px 16px;
202
- border: none;
203
- border-radius: 6px;
204
- font-size: 14px;
205
- font-weight: 500;
206
- cursor: pointer;
207
- transition: all 0.15s;
208
- }
209
- .stx-button--primary { background: #3498db; color: #fff; }
210
- .stx-button--primary:hover { background: #2980b9; }
211
- .stx-button--secondary { background: #6c757d; color: #fff; }
212
- .stx-button--outline { background: transparent; border: 1px solid #3498db; color: #3498db; }
213
- .stx-button--ghost { background: transparent; color: #3498db; }
214
- .stx-button--destructive { background: #e74c3c; color: #fff; }
215
- .stx-button--small { padding: 4px 8px; font-size: 12px; }
216
- .stx-button--large { padding: 12px 24px; font-size: 16px; }
217
- .stx-button--disabled { opacity: 0.5; cursor: not-allowed; }
218
- .stx-button--loading { pointer-events: none; }
219
- .stx-button-spinner { width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; }
220
- @keyframes spin { to { transform: rotate(360deg); } }
221
-
222
- /* Input */
223
- .stx-input-wrapper { display: flex; flex-direction: column; gap: 4px; }
224
- .stx-input-label { font-size: 14px; font-weight: 500; color: #333; }
225
- .stx-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.15s; }
226
- .stx-input:focus { outline: none; border-color: #3498db; }
227
- .stx-input--error { border-color: #e74c3c; }
228
- .stx-input-error { font-size: 12px; color: #e74c3c; }
229
- .stx-input-hint { font-size: 12px; color: #666; }
230
-
231
- /* Checkbox */
232
- .stx-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
233
- .stx-checkbox input { display: none; }
234
- .stx-checkbox-box { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 4px; transition: all 0.15s; }
235
- .stx-checkbox input:checked + .stx-checkbox-box { background: #3498db; border-color: #3498db; }
236
- .stx-checkbox--disabled { opacity: 0.5; cursor: not-allowed; }
237
-
238
- /* Progress */
239
- .stx-progress { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; position: relative; }
240
- .stx-progress-bar { height: 100%; background: #3498db; transition: width 0.3s; }
241
- .stx-progress--success .stx-progress-bar { background: #27ae60; }
242
- .stx-progress--warning .stx-progress-bar { background: #f39c12; }
243
- .stx-progress--error .stx-progress-bar { background: #e74c3c; }
244
- .stx-progress--indeterminate .stx-progress-bar { animation: progress-indeterminate 1.5s infinite; }
245
- @keyframes progress-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
246
-
247
- /* Badge */
248
- .stx-badge { display: inline-flex; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
249
- .stx-badge--default { background: #e0e0e0; color: #333; }
250
- .stx-badge--primary { background: #3498db; color: #fff; }
251
- .stx-badge--success { background: #27ae60; color: #fff; }
252
- .stx-badge--warning { background: #f39c12; color: #fff; }
253
- .stx-badge--error { background: #e74c3c; color: #fff; }
254
-
255
- /* Avatar */
256
- .stx-avatar { display: inline-flex; align-items: center; justify-content: center; background: #3498db; color: #fff; overflow: hidden; }
257
- .stx-avatar--circle { border-radius: 50%; }
258
- .stx-avatar--square { border-radius: 0; }
259
- .stx-avatar--rounded { border-radius: 8px; }
260
- .stx-avatar--small { width: 32px; height: 32px; font-size: 12px; }
261
- .stx-avatar--medium { width: 40px; height: 40px; font-size: 14px; }
262
- .stx-avatar--large { width: 56px; height: 56px; font-size: 18px; }
263
- .stx-avatar-img { width: 100%; height: 100%; object-fit: cover; }
264
-
265
- /* Card */
266
- .stx-card { background: #fff; border-radius: 8px; overflow: hidden; }
267
- .stx-card--outlined { border: 1px solid #e0e0e0; }
268
- .stx-card--elevated { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
269
- .stx-card-image img { width: 100%; display: block; }
270
- .stx-card-body { padding: 16px; }
271
- .stx-card-title { margin: 0 0 4px; font-size: 18px; }
272
- .stx-card-subtitle { margin: 0 0 8px; color: #666; font-size: 14px; }
273
- .stx-card-footer { padding: 12px 16px; border-top: 1px solid #e0e0e0; }
274
-
275
- /* Tabs */
276
- .stx-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e0e0e0; }
277
- .stx-tab { padding: 8px 16px; border: none; background: none; cursor: pointer; color: #666; border-bottom: 2px solid transparent; transition: all 0.15s; }
278
- .stx-tab:hover { color: #333; }
279
- .stx-tab--active { color: #3498db; border-bottom-color: #3498db; }
280
- .stx-tab--disabled { opacity: 0.5; cursor: not-allowed; }
281
- .stx-tabs--pills { border-bottom: none; }
282
- .stx-tabs--pills .stx-tab { border-radius: 20px; border-bottom: none; }
283
- .stx-tabs--pills .stx-tab--active { background: #3498db; color: #fff; }
284
-
285
- /* Dropdown */
286
- .stx-dropdown { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff; cursor: pointer; min-width: 150px; }
287
- .stx-dropdown:focus { outline: none; border-color: #3498db; }
288
- .stx-dropdown--disabled { opacity: 0.5; cursor: not-allowed; }
289
-
290
- /* Rating */
291
- .stx-rating { display: inline-flex; gap: 4px; }
292
- .stx-star { color: #ddd; cursor: pointer; transition: color 0.15s; }
293
- .stx-star--filled { color: #f1c40f; }
294
- .stx-star--half { background: linear-gradient(90deg, #f1c40f 50%, #ddd 50%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
295
- .stx-rating--readonly .stx-star { cursor: default; }
296
- .stx-rating--small .stx-star { font-size: 16px; }
297
- .stx-rating--medium .stx-star { font-size: 24px; }
298
- .stx-rating--large .stx-star { font-size: 32px; }
299
-
300
- /* Slider */
301
- .stx-slider { display: flex; align-items: center; gap: 12px; }
302
- .stx-slider-track { flex: 1; }
303
- .stx-slider input[type="range"] { width: 100%; }
304
- .stx-slider-value { min-width: 40px; text-align: right; font-size: 14px; }
305
-
306
- /* Radio Button */
307
- .stx-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
308
- .stx-radio input { display: none; }
309
- .stx-radio-circle { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 50%; position: relative; transition: all 0.15s; }
310
- .stx-radio input:checked + .stx-radio-circle { border-color: #3498db; }
311
- .stx-radio input:checked + .stx-radio-circle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; background: #3498db; border-radius: 50%; }
312
- .stx-radio--disabled { opacity: 0.5; cursor: not-allowed; }
313
-
314
- /* Color Picker */
315
- .stx-color-picker { display: flex; flex-direction: column; gap: 8px; }
316
- .stx-color-picker-input { display: flex; align-items: center; gap: 8px; }
317
- .stx-color-picker-input input[type="color"] { width: 40px; height: 40px; border: none; cursor: pointer; }
318
- .stx-color-picker-value { font-family: monospace; }
319
- .stx-color-picker-presets { display: flex; gap: 4px; flex-wrap: wrap; }
320
- .stx-color-preset { width: 24px; height: 24px; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
321
- .stx-color-preset:hover { border-color: #333; }
322
-
323
- /* Date/Time Picker */
324
- .stx-date-picker, .stx-time-picker { display: flex; flex-direction: column; gap: 4px; }
325
- .stx-date-picker-input, .stx-time-picker-input { display: flex; align-items: center; gap: 4px; }
326
- .stx-date-picker-input input, .stx-time-picker-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
327
- .stx-date-picker-clear { background: none; border: none; cursor: pointer; font-size: 16px; }
328
-
329
- /* Autocomplete */
330
- .stx-autocomplete { position: relative; }
331
- .stx-autocomplete-input-wrapper { position: relative; }
332
- .stx-autocomplete-input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
333
- .stx-autocomplete-spinner { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border: 2px solid #ddd; border-top-color: #3498db; border-radius: 50%; animation: spin 0.6s linear infinite; }
334
- .stx-autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd; border-radius: 6px; max-height: 200px; overflow-y: auto; display: none; z-index: 10; }
335
- .stx-autocomplete:focus-within .stx-autocomplete-list { display: block; }
336
- .stx-autocomplete-item { padding: 8px 12px; cursor: pointer; }
337
- .stx-autocomplete-item:hover { background: #f5f5f5; }
338
- .stx-autocomplete-item--selected { background: #e8f4fc; }
339
-
340
- /* Label */
341
- .stx-label { display: inline-block; font-weight: 500; }
342
- .stx-label--small { font-size: 12px; }
343
- .stx-label--medium { font-size: 14px; }
344
- .stx-label--large { font-size: 16px; }
345
- .stx-label-required { color: #e74c3c; margin-left: 2px; }
346
-
347
- /* Image */
348
- .stx-image { display: block; max-width: 100%; }
349
-
350
- /* Chip */
351
- .stx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; font-size: 13px; }
352
- .stx-chip--default { background: #e0e0e0; color: #333; }
353
- .stx-chip--primary { background: #e8f4fc; color: #3498db; }
354
- .stx-chip--success { background: #e8f8f0; color: #27ae60; }
355
- .stx-chip--warning { background: #fef5e7; color: #f39c12; }
356
- .stx-chip--error { background: #fdebeb; color: #e74c3c; }
357
- .stx-chip--small { padding: 2px 8px; font-size: 11px; }
358
- .stx-chip--large { padding: 6px 16px; font-size: 15px; }
359
- .stx-chip-remove { background: none; border: none; cursor: pointer; opacity: 0.6; padding: 0 2px; }
360
- .stx-chip-remove:hover { opacity: 1; }
361
-
362
- /* Tooltip */
363
- .stx-tooltip-wrapper { position: relative; display: inline-block; }
364
- .stx-tooltip { position: absolute; background: #333; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; z-index: 1000; }
365
- .stx-tooltip-wrapper:hover .stx-tooltip { opacity: 1; visibility: visible; }
366
- .stx-tooltip--top { bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 8px; }
367
- .stx-tooltip--bottom { top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; }
368
- .stx-tooltip--left { right: 100%; top: 50%; transform: translateY(-50%); margin-right: 8px; }
369
- .stx-tooltip--right { left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; }
370
-
371
- /* Scroll View */
372
- .stx-scroll-view { overflow: auto; }
373
- .stx-scroll-view--vertical { overflow-x: hidden; overflow-y: auto; }
374
- .stx-scroll-view--horizontal { overflow-x: auto; overflow-y: hidden; }
375
- .stx-scroll-view--hide-scrollbar::-webkit-scrollbar { display: none; }
376
- .stx-scroll-view--hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
377
- .stx-scroll-view--smooth { scroll-behavior: smooth; }
378
-
379
- /* Split View */
380
- .stx-split-view { display: flex; }
381
- .stx-split-view--horizontal { flex-direction: row; }
382
- .stx-split-view--vertical { flex-direction: column; }
383
- .stx-split-pane { overflow: auto; }
384
- .stx-split-divider { background: #e0e0e0; flex-shrink: 0; }
385
- .stx-split-view--horizontal .stx-split-divider { width: 4px; cursor: col-resize; }
386
- .stx-split-view--vertical .stx-split-divider { height: 4px; cursor: row-resize; }
387
- .stx-split-divider:hover { background: #3498db; }
388
-
389
- /* Accordion */
390
- .stx-accordion { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
391
- .stx-accordion-item { border-bottom: 1px solid #e0e0e0; }
392
- .stx-accordion-item:last-child { border-bottom: none; }
393
- .stx-accordion-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: none; border: none; cursor: pointer; font-size: 14px; }
394
- .stx-accordion-header:hover { background: #f5f5f5; }
395
- .stx-accordion-icon { transition: transform 0.2s; }
396
- .stx-accordion-item--open .stx-accordion-icon { transform: rotate(180deg); }
397
- .stx-accordion-content { padding: 0 16px 16px; }
398
- .stx-accordion-item--disabled { opacity: 0.5; }
399
- .stx-accordion-item--disabled .stx-accordion-header { cursor: not-allowed; }
400
-
401
- /* Stepper */
402
- .stx-stepper { display: flex; }
403
- .stx-stepper--horizontal { flex-direction: row; align-items: flex-start; }
404
- .stx-stepper--vertical { flex-direction: column; }
405
- .stx-step { display: flex; align-items: center; }
406
- .stx-stepper--vertical .stx-step { flex-direction: row; }
407
- .stx-step-indicator { width: 32px; height: 32px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; flex-shrink: 0; }
408
- .stx-step--completed .stx-step-indicator { background: #27ae60; color: #fff; }
409
- .stx-step--active .stx-step-indicator { background: #3498db; color: #fff; }
410
- .stx-step-content { margin-left: 12px; }
411
- .stx-step-label { font-size: 14px; font-weight: 500; }
412
- .stx-step-description { font-size: 12px; color: #666; }
413
- .stx-step-connector { flex: 1; height: 2px; background: #e0e0e0; margin: 0 8px; min-width: 20px; }
414
- .stx-stepper--vertical .stx-step-connector { width: 2px; height: 20px; margin: 8px 0 8px 15px; }
415
-
416
- /* Modal Component */
417
- .stx-modal-component--hidden { display: none; }
418
- .stx-modal-component-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; }
419
- .stx-modal-component-dialog { background: #fff; border-radius: 12px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
420
- .stx-modal-component--small .stx-modal-component-dialog { width: 300px; }
421
- .stx-modal-component--medium .stx-modal-component-dialog { width: 500px; }
422
- .stx-modal-component--large .stx-modal-component-dialog { width: 800px; }
423
- .stx-modal-component--fullscreen .stx-modal-component-dialog { width: 100%; height: 100%; border-radius: 0; }
424
- .stx-modal-component-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid #e0e0e0; }
425
- .stx-modal-component-title { margin: 0; font-size: 18px; }
426
- .stx-modal-component-close { background: none; border: none; font-size: 24px; cursor: pointer; opacity: 0.6; }
427
- .stx-modal-component-close:hover { opacity: 1; }
428
- .stx-modal-component-body { padding: 16px; overflow-y: auto; flex: 1; }
429
- .stx-modal-component-footer { padding: 16px; border-top: 1px solid #e0e0e0; display: flex; justify-content: flex-end; gap: 8px; }
430
-
431
- /* List View */
432
- .stx-list-view { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
433
- .stx-list-view-items { list-style: none; margin: 0; padding: 0; }
434
- .stx-list-view-item { padding: 12px 16px; border-bottom: 1px solid #e0e0e0; }
435
- .stx-list-view-item:last-child { border-bottom: none; }
436
- .stx-list-view--selectable .stx-list-view-item { cursor: pointer; }
437
- .stx-list-view--selectable .stx-list-view-item:hover { background: #f5f5f5; }
438
- .stx-list-view-item--selected { background: #e8f4fc; }
439
- .stx-list-view-empty { padding: 24px; text-align: center; color: #666; }
440
-
441
- /* Table */
442
- .stx-table { overflow-x: auto; }
443
- .stx-table table { width: 100%; border-collapse: collapse; }
444
- .stx-table th, .stx-table td { padding: 12px; text-align: left; }
445
- .stx-table th { font-weight: 600; background: #f5f5f5; }
446
- .stx-table--bordered th, .stx-table--bordered td { border: 1px solid #e0e0e0; }
447
- .stx-table--striped tbody tr:nth-child(even) { background: #f9f9f9; }
448
- .stx-table--hoverable tbody tr:hover { background: #f5f5f5; }
449
- .stx-table th[data-sortable] { cursor: pointer; }
450
- .stx-table-sort-icon::after { content: '\u21C5'; margin-left: 4px; opacity: 0.3; }
451
- .stx-table-sorted .stx-table-sort-icon::after { opacity: 1; }
452
- .stx-table-sorted--asc .stx-table-sort-icon::after { content: '\u2191'; }
453
- .stx-table-sorted--desc .stx-table-sort-icon::after { content: '\u2193'; }
454
-
455
- /* Tree View */
456
- .stx-tree-view { font-size: 14px; }
457
- .stx-tree-node { padding-left: 20px; }
458
- .stx-tree-node-content { display: flex; align-items: center; gap: 4px; padding: 4px; cursor: pointer; border-radius: 4px; }
459
- .stx-tree-node-content:hover { background: #f5f5f5; }
460
- .stx-tree-node--selected > .stx-tree-node-content { background: #e8f4fc; }
461
- .stx-tree-node--disabled { opacity: 0.5; }
462
- .stx-tree-toggle { width: 16px; cursor: pointer; transition: transform 0.2s; }
463
- .stx-tree-toggle--expanded { transform: rotate(90deg); }
464
- .stx-tree-toggle-placeholder { width: 16px; }
465
- .stx-tree-children { padding-left: 8px; }
466
-
467
- /* Data Grid */
468
- .stx-data-grid { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
469
- .stx-data-grid-table-wrapper { overflow-x: auto; }
470
- .stx-data-grid-table { width: 100%; border-collapse: collapse; }
471
- .stx-data-grid-table th, .stx-data-grid-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e0e0e0; }
472
- .stx-data-grid-table th { background: #f5f5f5; }
473
- .stx-data-grid-header-cell { display: flex; align-items: center; gap: 8px; }
474
- .stx-data-grid-sort, .stx-data-grid-filter { background: none; border: none; cursor: pointer; opacity: 0.5; }
475
- .stx-data-grid-sort:hover, .stx-data-grid-filter:hover { opacity: 1; }
476
- .stx-data-grid-pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid #e0e0e0; }
477
- .stx-data-grid-page-buttons { display: flex; gap: 4px; }
478
- .stx-data-grid-page-btn { padding: 4px 8px; border: 1px solid #e0e0e0; background: #fff; cursor: pointer; border-radius: 4px; }
479
- .stx-data-grid-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
480
-
481
- /* Chart */
482
- .stx-chart { background: #f9f9f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
483
- .stx-chart-placeholder { text-align: center; padding: 20px; }
484
- .stx-chart-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
485
- .stx-chart-type { font-size: 14px; color: #666; }
486
- .stx-chart-info { font-size: 12px; color: #999; margin-top: 4px; }
487
-
488
- /* Code Editor */
489
- .stx-code-editor { display: flex; font-family: 'Monaco', 'Menlo', monospace; font-size: 13px; line-height: 1.5; overflow: hidden; border-radius: 8px; }
490
- .stx-code-editor--dark { background: #1e1e1e; color: #d4d4d4; }
491
- .stx-code-editor--light { background: #fff; color: #333; border: 1px solid #e0e0e0; }
492
- .stx-code-editor-gutter { padding: 12px 8px; background: rgba(0,0,0,0.1); text-align: right; user-select: none; }
493
- .stx-code-editor-line-number { color: #858585; }
494
- .stx-code-editor-content { flex: 1; padding: 12px; overflow: auto; }
495
- .stx-code-editor-content pre { margin: 0; }
496
- .stx-code-editor--wrap .stx-code-editor-content { white-space: pre-wrap; word-wrap: break-word; }
497
-
498
- /* Media Player */
499
- .stx-media-player video, .stx-media-player audio { width: 100%; display: block; }
500
- .stx-media-player--video { background: #000; }
501
-
502
- /* File Explorer */
503
- .stx-file-explorer { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
504
- .stx-file-explorer-list { width: 100%; border-collapse: collapse; }
505
- .stx-file-explorer-list th { text-align: left; padding: 8px 12px; background: #f5f5f5; font-weight: 500; }
506
- .stx-file-explorer-list td { padding: 8px 12px; border-top: 1px solid #e0e0e0; }
507
- .stx-file-explorer-item--selectable { cursor: pointer; }
508
- .stx-file-explorer-item--selectable:hover { background: #f5f5f5; }
509
- .stx-file-explorer-icon { margin-right: 8px; }
510
- .stx-file-explorer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 16px; padding: 16px; }
511
- .stx-file-explorer--grid .stx-file-explorer-item { text-align: center; padding: 12px; border-radius: 8px; }
512
- .stx-file-explorer--grid .stx-file-explorer-icon { font-size: 32px; display: block; margin-bottom: 8px; }
513
- .stx-file-explorer--grid .stx-file-explorer-name { font-size: 12px; word-break: break-all; }
514
-
515
- /* WebView */
516
- .stx-webview { border: none; display: block; }
517
-
518
- /* Dark mode support */
519
- @media (prefers-color-scheme: dark) {
520
- .stx-input-label { color: #eee; }
521
- .stx-input { background: #333; border-color: #555; color: #fff; }
522
- .stx-card { background: #2d2d2d; color: #fff; }
523
- .stx-card-subtitle { color: #aaa; }
524
- .stx-progress { background: #444; }
525
- .stx-dropdown { background: #333; border-color: #555; color: #fff; }
526
- .stx-accordion { border-color: #444; }
527
- .stx-accordion-item { border-color: #444; }
528
- .stx-accordion-header:hover { background: #333; }
529
- .stx-list-view { border-color: #444; }
530
- .stx-list-view-item { border-color: #444; }
531
- .stx-list-view--selectable .stx-list-view-item:hover { background: #333; }
532
- .stx-table th { background: #333; }
533
- .stx-table--bordered th, .stx-table--bordered td { border-color: #444; }
534
- .stx-tree-node-content:hover { background: #333; }
535
- .stx-data-grid { border-color: #444; }
536
- .stx-data-grid-table th, .stx-data-grid-table td { border-color: #444; }
537
- .stx-data-grid-table th { background: #333; }
538
- .stx-modal-component-dialog { background: #2d2d2d; color: #fff; }
539
- .stx-modal-component-header, .stx-modal-component-footer { border-color: #444; }
540
- .stx-file-explorer { border-color: #444; }
541
- .stx-file-explorer-list th { background: #333; }
542
- .stx-file-explorer-list td { border-color: #444; }
543
- .stx-autocomplete-list { background: #333; border-color: #444; }
544
- .stx-autocomplete-item:hover { background: #444; }
545
- .stx-chip--default { background: #444; color: #eee; }
546
- .stx-chip--primary { background: #1a3a52; }
547
- .stx-chip--success { background: #1a3a2a; }
548
- .stx-chip--warning { background: #3a2a1a; }
549
- .stx-chip--error { background: #3a1a1a; }
550
- }
551
- `;function y6(){return!1}function OZ(){return typeof window<"u"&&typeof document<"u"}var b=[];function g6(){return`modal-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function b6(Z){switch(Z){case"info":return"&#x2139;";case"warning":return"&#x26A0;";case"error":return"&#x2716;";case"success":return"&#x2714;";case"question":return"&#x2753;";default:return"&#x2139;"}}function $Z(Z){if(Z==="question")return[{label:"No",style:"default"},{label:"Yes",style:"primary"}];return[{label:"OK",style:"primary"}]}function u6(Z){let{options:$}=Z,Y=b6($.type),J=$.buttons||$Z($.type),Q=$.type||"info",X="";return J.forEach((K,z)=>{let F=K.style==="destructive"?"destructive":K.style==="primary"?"primary":"default",R=z===($.defaultButton??J.length-1)?"autofocus":"";X+=`<button class="stx-modal-btn ${F}" data-index="${z}" ${R}>${K.label}</button>`}),`
552
- <div class="stx-modal-overlay" data-modal-id="${Z.id}">
553
- <div class="stx-modal ${Q}" role="dialog" aria-modal="true" aria-labelledby="${Z.id}-title">
554
- <div class="stx-modal-icon">${Y}</div>
555
- <div class="stx-modal-content">
556
- ${$.title?`<h2 id="${Z.id}-title" class="stx-modal-title">${yZ($.title)}</h2>`:""}
557
- <p class="stx-modal-message">${yZ($.message)}</p>
558
- </div>
559
- <div class="stx-modal-buttons">${X}</div>
560
- </div>
561
- </div>
562
- `}function yZ(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function C(Z,$,Y=!1){let J=b.indexOf(Z);if(J>-1)b.splice(J,1);if(Z.element&&OZ())Z.element.remove();let X=(Z.options.buttons||$Z(Z.options.type))[$];if(X?.action)X.action();Z.resolve({buttonIndex:$,cancelled:Y})}async function h(Z){let $=y6(),Y=g6();return new Promise((J)=>{let Q={id:Y,options:Z,resolve:J};if(b.push(Q),$)console.log(`[stx-modal] Showing native modal: ${Z.title||"Modal"}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);else if(OZ())try{let X=document.createElement("div");X.innerHTML=u6(Q);let K=X.firstElementChild;if(!K){console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);return}Q.element=K;try{document.body.appendChild(K)}catch{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);return}try{K.querySelectorAll(".stx-modal-btn").forEach((z)=>{z.addEventListener("click",()=>{let F=Number.parseInt(z.dataset.index||"0",10);C(Q,F,!1)})})}catch{}try{K.addEventListener("click",(z)=>{if(z.target===K){let F=Z.cancelButton??0;C(Q,F,!0)}})}catch{}try{let z=(F)=>{if(F.key==="Escape"){let R=Z.cancelButton??0;C(Q,R,!0),document.removeEventListener("keydown",z)}else if(F.key==="Enter"){let R=Z.defaultButton??(Z.buttons||$Z(Z.type)).length-1;C(Q,R,!1),document.removeEventListener("keydown",z)}};document.addEventListener("keydown",z)}catch{}try{let z=K.querySelector(".stx-modal-btn[autofocus]");if(z)z.focus()}catch{}if(typeof process<"u"&&process.env.BUN_TEST)setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}catch{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}else{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`);let X=Z.buttons||$Z(Z.type);console.log(`[stx-modal] Buttons: ${X.map((K)=>K.label).join(", ")}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}})}async function gZ(Z,$){return h({title:Z,message:$,type:"info"})}async function m6(Z,$){return h({title:Z,message:$,type:"warning"})}async function h6(Z,$){return h({title:Z,message:$,type:"error"})}async function c6(Z,$){return h({title:Z,message:$,type:"success"})}async function bZ(Z,$){return h({title:Z,message:$,type:"question",buttons:[{label:"No",style:"default"},{label:"Yes",style:"primary"}],defaultButton:1,cancelButton:0})}async function p6(Z,$="Confirm"){return(await bZ($,Z)).buttonIndex===1}async function l6(Z,$="Alert"){await gZ($,Z)}async function d6(Z,$="",Y="Input"){if(OZ()&&typeof window.prompt==="function")return window.prompt(Z,$);return console.log(`[stx-modal] PROMPT: ${Y}`),console.log(`[stx-modal] ${Z}`),console.log(`[stx-modal] Default: ${$}`),$}function r6(){return b.length}function n6(){while(b.length>0){let Z=b[b.length-1];C(Z,0,!0)}}var o6=`
563
- .stx-modal-overlay {
564
- position: fixed;
565
- inset: 0;
566
- background: rgba(0, 0, 0, 0.5);
567
- display: flex;
568
- align-items: center;
569
- justify-content: center;
570
- z-index: 10000;
571
- animation: stx-modal-fade-in 0.15s ease-out;
572
- }
573
-
574
- @keyframes stx-modal-fade-in {
575
- from { opacity: 0; }
576
- to { opacity: 1; }
577
- }
578
-
579
- .stx-modal {
580
- background: #fff;
581
- border-radius: 12px;
582
- padding: 24px;
583
- max-width: 400px;
584
- width: 90%;
585
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
586
- animation: stx-modal-slide-up 0.2s ease-out;
587
- }
588
-
589
- @keyframes stx-modal-slide-up {
590
- from { transform: translateY(20px); opacity: 0; }
591
- to { transform: translateY(0); opacity: 1; }
592
- }
593
-
594
- @media (prefers-color-scheme: dark) {
595
- .stx-modal {
596
- background: #2d2d2d;
597
- color: #fff;
598
- }
599
- }
600
-
601
- .stx-modal-icon {
602
- font-size: 48px;
603
- text-align: center;
604
- margin-bottom: 16px;
605
- }
606
-
607
- .stx-modal.info .stx-modal-icon { color: #3498db; }
608
- .stx-modal.warning .stx-modal-icon { color: #f39c12; }
609
- .stx-modal.error .stx-modal-icon { color: #e74c3c; }
610
- .stx-modal.success .stx-modal-icon { color: #27ae60; }
611
- .stx-modal.question .stx-modal-icon { color: #9b59b6; }
612
-
613
- .stx-modal-content {
614
- text-align: center;
615
- margin-bottom: 24px;
616
- }
617
-
618
- .stx-modal-title {
619
- margin: 0 0 8px;
620
- font-size: 20px;
621
- font-weight: 600;
622
- }
623
-
624
- .stx-modal-message {
625
- margin: 0;
626
- color: #666;
627
- line-height: 1.5;
628
- }
629
-
630
- @media (prefers-color-scheme: dark) {
631
- .stx-modal-message { color: #aaa; }
632
- }
633
-
634
- .stx-modal-buttons {
635
- display: flex;
636
- gap: 8px;
637
- justify-content: center;
638
- }
639
-
640
- .stx-modal-btn {
641
- padding: 10px 24px;
642
- border-radius: 6px;
643
- font-size: 14px;
644
- font-weight: 500;
645
- cursor: pointer;
646
- border: none;
647
- transition: background 0.15s, transform 0.1s;
648
- }
649
-
650
- .stx-modal-btn:hover {
651
- transform: translateY(-1px);
652
- }
653
-
654
- .stx-modal-btn:active {
655
- transform: translateY(0);
656
- }
657
-
658
- .stx-modal-btn.default {
659
- background: #e0e0e0;
660
- color: #333;
661
- }
662
-
663
- .stx-modal-btn.default:hover {
664
- background: #d0d0d0;
665
- }
666
-
667
- .stx-modal-btn.primary {
668
- background: #3498db;
669
- color: #fff;
670
- }
671
-
672
- .stx-modal-btn.primary:hover {
673
- background: #2980b9;
674
- }
675
-
676
- .stx-modal-btn.destructive {
677
- background: #e74c3c;
678
- color: #fff;
679
- }
680
-
681
- .stx-modal-btn.destructive:hover {
682
- background: #c0392b;
683
- }
684
-
685
- @media (prefers-color-scheme: dark) {
686
- .stx-modal-btn.default {
687
- background: #444;
688
- color: #fff;
689
- }
690
- .stx-modal-btn.default:hover {
691
- background: #555;
692
- }
693
- }
694
- `;import uZ from"process";function a6(){if(uZ.platform)return uZ.platform;return"unknown"}function hZ(){if(typeof window<"u"&&window.craft?.tray)return!0;return!1}function cZ(Z,$){if(Z.type==="separator")return{id:`sep-${$}`,label:"",type:"separator"};let Y={id:`item-${$}-${Z.label.replace(/\s+/g,"-").toLowerCase()}`,label:Z.label,type:Z.type||"normal",enabled:Z.enabled!==!1};if(Z.accelerator)Y.shortcut=Z.accelerator;if(Z.type==="checkbox")Y.checked=Z.checked||!1;if(Z.type==="submenu"&&Z.submenu)Y.submenu=Z.submenu.map((J,Q)=>cZ(J,Q));return Y}function VZ(Z){return Z.map(($,Y)=>cZ($,Y))}function pZ(Z,$=0){if(Z.type==="separator")return'<hr class="stx-tray-separator" />';let Y=" ".repeat($),J=Z.enabled===!1?"disabled":"",Q=Z.checked?"\u2713 ":"",X=Z.accelerator?`<span class="accelerator">${Z.accelerator}</span>`:"",K=`${Y}<div class="stx-tray-item ${J}" data-action="${Z.label}">`;if(K+=`<span class="label">${Q}${Z.label}</span>${X}`,Z.type==="submenu"&&Z.submenu){K+='<span class="arrow">\u25B8</span>',K+='<div class="stx-tray-submenu">';for(let z of Z.submenu)K+=pZ(z,$+1);K+="</div>"}return K+="</div>",K}function i6(Z){let $='<div class="stx-tray-menu">';for(let Y of Z)$+=pZ(Y);return $+="</div>",$}var v=new Map;function s6(){return`tray-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}var mZ=!1;function t6(){if(mZ||typeof window>"u")return;window.addEventListener("craft:tray:menu",(Z)=>{let{action:$}=Z.detail;for(let Y of v.values()){let J=Y.handlers.get($);if(J){J();break}}}),mZ=!0}async function lZ(Z={}){let $=s6(),Y=a6(),J=hZ(),Q={icon:Z.icon||"",tooltip:Z.tooltip||"stx Application",menu:Z.menu||[],visible:!0},X=new Map;for(let z of Z.menu||[]){if(z.type!=="separator"&&z.onClick)X.set(z.label,z.onClick);if(z.type==="submenu"&&z.submenu){for(let F of z.submenu)if(F.type!=="separator"&&F.onClick)X.set(F.label,F.onClick)}}if(v.set($,{state:Q,handlers:X}),J){t6();let z=window;try{if(Q.tooltip)await z.craft.tray.setTitle({title:Q.tooltip}),await z.craft.tray.setTooltip({tooltip:Q.tooltip});if(Q.icon)await z.craft.tray.setIcon({icon:Q.icon});let F=VZ(Q.menu);await z.craft.tray.setMenu({items:F}),console.log(`[stx-tray] Native tray created for ${Y}`)}catch(F){console.warn("[stx-tray] Failed to create native tray:",F)}}else console.log("[stx-tray] Created simulated tray (not in Craft window)"),console.log(`[stx-tray] ID: ${$}`),console.log(`[stx-tray] Tooltip: ${Q.tooltip}`),console.log(`[stx-tray] Menu items: ${Q.menu.length}`);return{id:$,setIcon:(z)=>{if(Q.icon=z,J)window.craft.tray.setIcon({icon:z}).catch((R)=>{console.warn("[stx-tray] Failed to set icon:",R)});console.log(`[stx-tray:${$}] Icon updated`)},setTooltip:(z)=>{if(Q.tooltip=z,J)window.craft.tray.setTooltip({tooltip:z}).catch((R)=>{console.warn("[stx-tray] Failed to set tooltip:",R)});console.log(`[stx-tray:${$}] Tooltip: ${z}`)},setMenu:(z)=>{Q.menu=z,X.clear();for(let F of z){if(F.type!=="separator"&&F.onClick)X.set(F.label,F.onClick);if(F.type==="submenu"&&F.submenu){for(let R of F.submenu)if(R.type!=="separator"&&R.onClick)X.set(R.label,R.onClick)}}if(J){let F=window,R=VZ(z);F.craft.tray.setMenu({items:R}).catch((O)=>{console.warn("[stx-tray] Failed to set menu:",O)})}console.log(`[stx-tray:${$}] Menu updated (${z.length} items)`)},destroy:()=>{if(Q.visible=!1,v.delete($),J)window.craft.tray.destroy?.().catch((F)=>{console.warn("[stx-tray] Failed to destroy tray:",F)});console.log(`[stx-tray:${$}] Destroyed`)}}}var e6=lZ;function Z8(){return Array.from(v.keys())}function $8(Z){let $=v.get(Z);if(!$)return null;let Y=hZ();return{id:Z,setIcon:(J)=>{if($.state.icon=J,Y)window.craft.tray.setIcon({icon:J}).catch(()=>{})},setTooltip:(J)=>{if($.state.tooltip=J,Y)window.craft.tray.setTooltip({tooltip:J}).catch(()=>{})},setMenu:(J)=>{if($.state.menu=J,Y){let Q=window,X=VZ(J);Q.craft.tray.setMenu({items:X}).catch(()=>{})}},destroy:()=>{if(v.delete(Z),Y)window.craft.tray.destroy?.().catch(()=>{})}}}function Y8(Z,$){let Y=v.get(Z);if(!Y)return!1;let J=Y.handlers.get($);if(J)return J(),!0;return!1}function J8(Z){let $=v.get(Z);if(!$)return null;return i6($.state.menu)}function G8(){return`
695
- // STX Desktop Tray Bridge
696
- // Provides convenient wrappers around window.craft.tray APIs
697
- window.stxTray = {
698
- setTitle: (title) => window.craft?.tray?.setTitle({ title }),
699
- setTooltip: (tooltip) => window.craft?.tray?.setTooltip({ tooltip }),
700
- setIcon: (icon) => window.craft?.tray?.setIcon({ icon }),
701
- setMenu: (items) => window.craft?.tray?.setMenu({ items }),
702
- destroy: () => window.craft?.tray?.destroy(),
703
-
704
- // Check if tray is available
705
- isAvailable: () => typeof window.craft?.tray !== 'undefined',
706
- };
707
- `}var Q8=`
708
- .stx-tray-menu {
709
- background: #2d2d2d;
710
- border-radius: 8px;
711
- padding: 4px 0;
712
- min-width: 200px;
713
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
714
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
715
- font-size: 13px;
716
- color: #fff;
717
- }
718
-
719
- .stx-tray-item {
720
- padding: 6px 12px;
721
- display: flex;
722
- align-items: center;
723
- justify-content: space-between;
724
- cursor: pointer;
725
- position: relative;
726
- }
727
-
728
- .stx-tray-item:hover {
729
- background: #3d3d3d;
730
- }
731
-
732
- .stx-tray-item.disabled {
733
- opacity: 0.5;
734
- cursor: not-allowed;
735
- }
736
-
737
- .stx-tray-item .label {
738
- flex: 1;
739
- }
740
-
741
- .stx-tray-item .accelerator {
742
- margin-left: 20px;
743
- opacity: 0.6;
744
- font-size: 12px;
745
- }
746
-
747
- .stx-tray-item .arrow {
748
- margin-left: 8px;
749
- font-size: 10px;
750
- }
751
-
752
- .stx-tray-separator {
753
- margin: 4px 0;
754
- border: none;
755
- border-top: 1px solid #444;
756
- }
757
-
758
- .stx-tray-submenu {
759
- position: absolute;
760
- left: 100%;
761
- top: 0;
762
- background: #2d2d2d;
763
- border-radius: 8px;
764
- padding: 4px 0;
765
- min-width: 150px;
766
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
767
- display: none;
768
- }
769
-
770
- .stx-tray-item:hover > .stx-tray-submenu {
771
- display: block;
772
- }
773
- `;function dZ(Z){let $=new Set(Z.properties??[]);if(Z.canChooseDirectories)$.add("openDirectory");if(Z.canChooseFiles)$.add("openFile");if(Z.multiSelections)$.add("multiSelections");if(Z.showHiddenFiles)$.add("showHiddenFiles");if(Z.canCreateDirectories)$.add("createDirectory");return{...Z,properties:[...$]}}function X8(){if(typeof window>"u")return;return window.craft?.dialog}var z8={error:"critical",warning:"warning",question:"info",info:"info",none:"info"};function K8(Z){let $=[Z.title?Z.message:"",Z.detail??""].filter(Boolean).join(`
774
-
775
- `);return{title:Z.title||Z.message,message:$||void 0,style:z8[Z.type??"none"]??"info",buttons:Z.buttons}}function rZ(Z,$){if(typeof Z==="number"&&Number.isFinite(Z))return{response:Z};if(Z&&typeof Z==="object"){let J=Z;if(typeof J.response==="number")return{response:J.response};if(typeof J.buttonIndex==="number")return{response:J.buttonIndex}}let Y=$.buttons??["OK"];return{response:$.cancelButton??Math.max(0,Y.length-1)}}function qZ(){if(typeof window<"u"&&window.craft?.dialog)return!0;return!1}async function F8(Z={}){if(qZ()){let $=window;try{return await $.craft.dialog.showOpenDialog(dZ(Z))}catch(Y){console.warn("[stx-dialog] Failed to show native open dialog:",Y)}}return new Promise(($)=>{if(typeof document>"u"){$({canceled:!0,filePaths:[]});return}let Y=new Set(dZ(Z).properties),J=document.createElement("input");if(J.type="file",J.multiple=Y.has("multiSelections"),Z.filters?.length){let Q=Z.filters.flatMap((X)=>X.extensions.map((K)=>`.${K}`));J.accept=Q.join(",")}if(Y.has("openDirectory")&&!Y.has("openFile"))J.webkitdirectory=!0;J.onchange=()=>{let Q=Array.from(J.files||[]);if(Q.length===0)$({canceled:!0,filePaths:[]});else{let X=Q.map((K)=>K.name);$({canceled:!1,filePaths:X})}},J.oncancel=()=>{$({canceled:!0,filePaths:[]})},J.click()})}async function R8(Z={}){if(qZ()){let Y=window;try{return await Y.craft.dialog.showSaveDialog(Z)}catch(J){console.warn("[stx-dialog] Failed to show native save dialog:",J)}}if(typeof window<"u"&&"showSaveFilePicker"in window)try{let Y=Z.filters?.map((Q)=>({description:Q.name,accept:{"*/*":Q.extensions.map((X)=>`.${X}`)}}));return{canceled:!1,filePath:(await window.showSaveFilePicker({suggestedName:Z.defaultPath,types:Y})).name}}catch(Y){return{canceled:!0}}console.warn("[stx-dialog] Save dialog not available, using prompt fallback");let $=prompt("Enter filename:",Z.defaultPath||"file.txt");if($)return{canceled:!1,filePath:$};return{canceled:!0}}async function r(Z){let $=X8();if(typeof $?.showMessageBox==="function")try{return rZ(await $.showMessageBox(Z),Z)}catch(z){console.warn("[stx-dialog] Failed to show native message box:",z)}else if(typeof $?.showAlert==="function")try{return rZ(await $.showAlert(K8(Z)),Z)}catch(z){console.warn("[stx-dialog] Failed to show native alert:",z)}let Y=Z.buttons||["OK"],J=Z.detail?`
776
-
777
- ${Z.detail}`:"",Q=`${Z.message}${J}`;if(Y.length===1)return alert(Q),{response:0};let X=Z.cancelButton??Y.length-1,K=Z.defaultButton!==void 0&&Z.defaultButton!==X?Z.defaultButton:Y.findIndex((z,F)=>F!==X);if(Y.length>2)console.warn(`[stx-dialog] ${Y.length} buttons requested; a browser confirm offers two. Reachable: "${Y[K]}" and "${Y[X]}".`);return{response:confirm(Q)?K:X}}async function j8(Z={}){if(qZ()){let $=window;try{return await $.craft.dialog.showColorPicker(Z)}catch(Y){console.warn("[stx-dialog] Failed to show native color picker:",Y)}}return new Promise(($)=>{if(typeof document>"u"){$({canceled:!0});return}let Y=document.createElement("input");Y.type="color",Y.value=Z.color||"#000000",Y.onchange=()=>{$({canceled:!1,color:Y.value})},Y.oncancel=()=>{$({canceled:!0})},Y.click()})}async function O8(Z,$){await r({type:"info",title:$||"Alert",message:Z,buttons:["OK"]})}async function V8(Z,$){return(await r({type:"question",title:$||"Confirm",message:Z,buttons:["OK","Cancel"],defaultButton:0,cancelButton:1})).response===0}async function q8(Z,$){await r({type:"error",title:$||"Error",message:Z,buttons:["OK"]})}async function P8(Z,$){await r({type:"warning",title:$||"Warning",message:Z,buttons:["OK"]})}function U8(){return`
778
- // STX Desktop Dialog Bridge
779
- // Provides convenient wrappers around window.craft.dialog APIs
780
- window.stxDialog = {
781
- // File dialogs
782
- showOpenDialog: (options) => window.craft?.dialog?.showOpenDialog(options),
783
- showSaveDialog: (options) => window.craft?.dialog?.showSaveDialog(options),
784
-
785
- // Message dialogs.
786
- //
787
- // The bridge's dialog namespace has no showMessageBox -- showAlert is the
788
- // method it actually implements, and it answers with the button index. So
789
- // this prefers showMessageBox when a host provides one and uses showAlert
790
- // otherwise, instead of calling a method that is not there (stacksjs/stx#2040).
791
- showMessageBox: async (options) => {
792
- const api = window.craft?.dialog;
793
- if (typeof api?.showMessageBox === 'function') {
794
- const raw = await api.showMessageBox(options);
795
- if (typeof raw === 'number') return { response: raw };
796
- if (raw && typeof raw.response === 'number') return { response: raw.response };
797
- if (raw && typeof raw.buttonIndex === 'number') return { response: raw.buttonIndex };
798
- }
799
- else if (typeof api?.showAlert === 'function') {
800
- const index = await api.showAlert({
801
- title: options.title || options.message,
802
- message: options.title ? options.message : options.detail,
803
- buttons: options.buttons,
804
- });
805
- if (typeof index === 'number') return { response: index };
806
- }
807
- // Unreadable: answer with cancel, never with the action button.
808
- const buttons = options.buttons || ['OK'];
809
- return { response: options.cancelButton ?? Math.max(0, buttons.length - 1) };
810
- },
811
-
812
- // Color picker
813
- showColorPicker: (options) => window.craft?.dialog?.showColorPicker(options),
814
-
815
- // Font picker
816
- showFontPicker: (options) => window.craft?.dialog?.showFontPicker(options),
817
-
818
- // Convenience functions
819
- alert: async (message, title) => {
820
- return window.stxDialog.showMessageBox({
821
- type: 'info',
822
- title: title || 'Alert',
823
- message,
824
- buttons: ['OK'],
825
- });
826
- },
827
-
828
- // OK first, matching showConfirmDialog: NSAlert adds buttons right-to-left
829
- // and makes the first one the default, so ['Cancel', 'OK'] built a confirm
830
- // that defaulted to Cancel and put OK on the left. This wrapper still had
831
- // the old order after the typed path was corrected.
832
- confirm: async (message, title) => {
833
- const result = await window.stxDialog.showMessageBox({
834
- type: 'question',
835
- title: title || 'Confirm',
836
- message,
837
- buttons: ['OK', 'Cancel'],
838
- defaultButton: 0,
839
- cancelButton: 1,
840
- });
841
- return result?.response === 0;
842
- },
843
-
844
- error: async (message, title) => {
845
- return window.stxDialog.showMessageBox({
846
- type: 'error',
847
- title: title || 'Error',
848
- message,
849
- buttons: ['OK'],
850
- });
851
- },
852
-
853
- // Check if dialog is available
854
- isAvailable: () => typeof window.craft?.dialog !== 'undefined',
855
- };
856
- `}import I from"process";import{existsSync as W8}from"fs";import{dirname as L8,join as D8}from"path";import{craftBinaryNotFoundMessage as nZ,resolveCraftBinary as M8}from"craft-native";var c={};function _8(Z){c={...c,...Z}}function T8(){return{...c}}function N8(){c={}}function PZ(Z){if(!Z.sidebarConfig)return;let $={...Z.sidebarConfig};if($.variant==="desktop")$.material=$.material??"sidebar",$.backgroundEffect=$.backgroundEffect??"shimmer",$.allowsVibrancy=$.allowsVibrancy??!0;return $}function YZ(){let Z=L8(I.execPath),$=Z.includes(".app/Contents/MacOS")?D8(Z,"craft"):void 0,Y=[I.env.CRAFT_BINARY_PATH,c.craftBinaryPath,...c.additionalSearchPaths||[],$];for(let J of Y)if(J&&W8(J))return J;return M8()}var H=new Map;function UZ(Z){let $=H.get(Z);if(!$||$.closed)return;$.closed=!0;for(let Y of $.closeListeners??[])try{Y()}catch(J){console.warn(`[stx/desktop] window ${Z} close listener threw:`,J)}$.closeListeners?.clear()}var E8=50;async function WZ(Z,$){let Y=$.show().then(()=>({failed:!1}),(Q)=>({failed:!0,error:Q})),J=await Promise.race([Y,new Promise((Q)=>setTimeout(()=>Q(null),E8))]);if(J?.failed)throw J.error;Y.then(()=>UZ(Z))}function A8(){return Array.from(H.keys())}function k8(Z){let $=H.get(Z);if(!$)return null;return JZ(Z,$.app)}function H8(){for(let[Z,$]of H)try{$.app?.close?.()}catch(Y){console.warn(`Failed to close window ${Z}:`,Y)}H.clear()}function JZ(Z,$){return{id:Z,show:()=>{console.log(`[stx/desktop] Window ${Z} shown`)},hide:()=>{console.log("[stx/desktop] To hide window, use window.craft.window.hide() from inside the webview")},close:()=>{let Y=H.get(Z);if(Y?.app)Y.app.close(),UZ(Z),H.delete(Z),console.log(`[stx/desktop] Window ${Z} closed`)},onClosed:(Y)=>{let J=H.get(Z);if(!J||J.closed)return queueMicrotask(Y),()=>{};return J.closeListeners??=new Set,J.closeListeners.add(Y),()=>J.closeListeners?.delete(Y)},focus:()=>{console.log("[stx/desktop] To focus window, use window.craft.window.focus() from inside the webview")},minimize:()=>{console.log("[stx/desktop] To minimize window, use window.craft.window.minimize() from inside the webview")},maximize:()=>{console.log("[stx/desktop] To maximize window, use window.craft.window.maximize() from inside the webview")},restore:()=>{console.log("[stx/desktop] To restore window, use window.craft.window.show() from inside the webview")},setTitle:(Y)=>{console.log(`[stx/desktop] To set title, use window.craft.window.setTitle({ title: "${Y}" }) from inside the webview`)},loadURL:(Y)=>{console.log(`[stx/desktop] To navigate, use window.location.href = "${Y}" from inside the webview`)},reload:()=>{console.log("[stx/desktop] To reload, use window.craft.window.reload() from inside the webview")}}}function LZ(Z,$={}){let Y=["--url",Z,"--title",$.title||"stx Desktop","--width",String($.width??1200),"--height",String($.height??800)];if($.darkMode)Y.push("--dark");if($.hotReload)Y.push("--hot-reload");if($.resizable===!1)Y.push("--no-resize");if($.frameless)Y.push("--frameless");if($.alwaysOnTop)Y.push("--always-on-top");if($.titlebarHidden)Y.push("--titlebar-hidden");if($.systemTray)Y.push("--system-tray");if($.hideDockIcon)Y.push("--hide-dock-icon");if($.devTools===!1)Y.push("--no-devtools");if($.nativeSidebar)Y.push("--native-sidebar");if($.sidebarWidth!==void 0)Y.push("--sidebar-width",String($.sidebarWidth));let J=PZ($);if(J)Y.push("--sidebar-config",JSON.stringify(J));return Y}async function x8(Z,$={}){let Y=`craft-window-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,J=YZ();try{let{createApp:Q}=await import("craft-native"),X=Q({url:Z,craftPath:J,window:{title:$.title||"stx Desktop",width:$.width??1200,height:$.height??800,darkMode:$.darkMode??!1,hotReload:$.hotReload??!1,resizable:$.resizable??!0,frameless:$.frameless??!1,alwaysOnTop:$.alwaysOnTop??!1,titlebarHidden:$.titlebarHidden??!1,systemTray:$.systemTray??!1,hideDockIcon:$.hideDockIcon??!1,devTools:$.devTools??!1,nativeSidebar:$.nativeSidebar??!1,sidebarWidth:$.sidebarWidth,sidebarConfig:PZ($)}});return H.set(Y,{app:X,url:Z,options:$}),await WZ(Y,X),JZ(Y,X)}catch{try{let{spawn:Q}=await import("child_process"),X=Q(J,LZ(Z,$),{stdio:"inherit"});X.on("error",(z)=>{console.error(z.code==="ENOENT"?nZ(J):`craft child error: ${z.message}`)});let K={close:()=>X.kill()};return H.set(Y,{app:K,url:Z,options:$}),X.on("exit",()=>UZ(Y)),JZ(Y,K)}catch(Q){return console.error("Failed to spawn craft binary:",Q.message),null}}}async function C8(Z,$={}){let Y=`http://localhost:${Z}/`;if(I.env.NODE_ENV==="test"||I.env.BUN_TEST)return console.warn("\u26A0 Skipping native window in test environment"),console.log("(Skipping browser fallback in test environment)"),!1;try{let{createApp:Q}=await import("craft-native");console.log("\u26A1 Opening native window via craft-native\u2026");let X=!$.nativeSidebar,K=PZ($),z=Q({url:Y,craftPath:YZ(),window:{title:$.title||"stx Development",width:$.width||1400,height:$.height||900,resizable:!0,systemTray:X,darkMode:$.darkMode??!0,hotReload:$.hotReload??!0,devTools:!0,titlebarHidden:$.titlebarHidden??!1,nativeSidebar:$.nativeSidebar??!1,sidebarWidth:$.sidebarWidth??260,sidebarConfig:K}}),F=`dev-window-${Z}`;return H.set(F,{app:z,url:Y,options:$}),await WZ(F,z),console.log(`\u2713 Native window opened at ${Y}`),!0}catch{let Q=YZ();try{console.log(`\u26A1 Opening native window via craft binary (${Q})\u2026`);let{spawn:X}=await import("child_process"),K=X(Q,LZ(Y,{title:"stx Development",width:1400,height:900,hotReload:!0,...$}),{stdio:"inherit"});K.on("exit",()=>I.exit(0)),K.on("error",(F)=>{console.warn(F.code==="ENOENT"?nZ(Q):`craft child error: ${F.message}`)});let z=`dev-window-${Z}`;return H.set(z,{app:{close:()=>K.kill()},url:Y,options:$}),console.log(`\u2713 Native window opened at ${Y}`),!0}catch(X){console.warn("\u26A0 Could not spawn craft binary:",X.message)}if(I.env.NODE_ENV==="test"||I.env.BUN_TEST)return console.log("(Skipping browser fallback in test environment)"),!1;console.log("\uD83D\uDCF1 Opening in browser instead\u2026");try{let{spawn:X}=await import("child_process"),K=I.platform;return X(K==="darwin"?"open":K==="win32"?"cmd":"xdg-open",K==="win32"?["/c","start",Y]:[Y],{detached:!0,stdio:"ignore"}).unref(),console.log(`\u2713 Browser opened at ${Y}`),!0}catch(X){return console.error("Could not open browser:",X),console.log(`Please open manually: ${Y}`),!1}}}async function I8(Z,$={}){let{title:Y="stx Desktop",width:J=1200,height:Q=800,darkMode:X=!1,hotReload:K=!1,resizable:z=!0,frameless:F=!1,alwaysOnTop:R=!1}=$;try{let{createApp:O}=await import("craft-native"),V=YZ(),j=O({html:Z,craftPath:V,window:{title:Y,width:J,height:Q,darkMode:X,hotReload:K,resizable:z,frameless:F,alwaysOnTop:R}}),U=`craft-window-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return H.set(U,{app:j,url:"html-content",options:$}),await WZ(U,j),JZ(U,j)}catch(O){return console.error("Failed to create window with HTML:",O),null}}function S8(){try{return y.resolve("craft-native"),!0}catch{return!1}}function w8(){return`
857
- // STX Desktop Window Bridge
858
- // Provides convenient wrappers around window.craft APIs
859
- window.stxWindow = {
860
- // Window control
861
- hide: () => window.craft?.window?.hide(),
862
- show: () => window.craft?.window?.show(),
863
- toggle: () => window.craft?.window?.toggle(),
864
- close: () => window.craft?.window?.close(),
865
- minimize: () => window.craft?.window?.minimize(),
866
- maximize: () => window.craft?.window?.maximize(),
867
- focus: () => window.craft?.window?.focus(),
868
- center: () => window.craft?.window?.center(),
869
- reload: () => window.craft?.window?.reload(),
870
- toggleFullscreen: () => window.craft?.window?.toggleFullscreen(),
871
-
872
- // Window properties
873
- setTitle: (title) => window.craft?.window?.setTitle({ title }),
874
- setSize: (width, height) => window.craft?.window?.setSize({ width, height }),
875
- setPosition: (x, y) => window.craft?.window?.setPosition({ x, y }),
876
- setAlwaysOnTop: (alwaysOnTop) => window.craft?.window?.setAlwaysOnTop({ alwaysOnTop }),
877
- setResizable: (resizable) => window.craft?.window?.setResizable({ resizable }),
878
- setOpacity: (opacity) => window.craft?.window?.setOpacity({ opacity }),
879
-
880
- // macOS-specific
881
- setVibrancy: (vibrancy) => window.craft?.window?.setVibrancy({ vibrancy }),
882
-
883
- // App control
884
- quit: () => window.craft?.app?.quit(),
885
- isDarkMode: () => window.craft?.app?.isDarkMode(),
886
- getLocale: () => window.craft?.app?.getLocale(),
887
-
888
- // Notifications
889
- notify: (options) => window.craft?.app?.notify(options),
890
-
891
- // Check if running in Craft
892
- isCraftAvailable: () => typeof window.craft !== 'undefined',
893
- };
894
-
895
- // Expose as global for backwards compatibility
896
- window.desktop = window.stxWindow;
897
- `}import{pack as B8,packageApp as f8}from"craft-native";import{craftBinaryNotFoundMessage as v8,resolveCraftBinary as y8}from"craft-native";import n from"process";import{spawn as g8}from"child_process";import{AutoUpdater as oZ,canReplaceBundle as b8,clearQuarantine as u8,extractBundle as m8,generateUpdateManifest as aZ,readBundleIdentity as DZ,swapBundle as h8,verifyBundleTrust as c8}from"craft-native";var iZ="update.json";function sZ(Z,$){return`https://github.com/${Z}/releases/latest/download/${$}`}function tZ(Z,$,Y){return`https://github.com/${Z}/releases/download/${$}/${Y}`}function eZ(Z){let{repository:$,manifestAsset:Y=iZ,...J}=Z;return new oZ({...J,updateUrl:sZ($,Y)})}function p8(Z){let $=Z.tag??`v${Z.version}`,Y={};for(let[J,Q]of Object.entries(Z.artifacts)){if(!Q)continue;Y[J]={path:Q,url:tZ(Z.repository,$,Q.split("/").pop())}}return aZ({version:Z.version,releaseNotes:Z.releaseNotes,platforms:Y})}function GZ(Z=n.execPath){let $=Z.split("/");for(let Y=0;Y<$.length;Y++)if($[Y].endsWith(".app"))return $.slice(0,Y+1).join("/");return null}async function l8(){let Z=GZ();if(!Z)return null;return(await DZ(Z)).teamId}function Z4(){let Z=n.ppid;if(Z>1)try{n.kill(Z,"SIGTERM");return}catch{}n.exit(0)}function $4(Z={}){let $=Z.appPath??GZ(),Y=Z.quit??(()=>n.exit(0));if($)g8("/usr/bin/open",["-n",$],{detached:!0,stdio:"ignore"}).unref();let J=Z.quitDelayMs??0;if(J>0){setTimeout(Y,J).unref?.();return}Y()}async function d8(Z){let{appPath:$,requireSameTeam:Y=!0,macos:J,...Q}=Z,X=$??GZ();if(!X)throw Error("createSelfUpdater: this process is not running from an .app bundle, so there is nothing to update. Pass `appPath` explicitly, or skip the updater in development.");let K=J?.teamId??(Y?(await DZ(X)).teamId??void 0:void 0);return eZ({...Q,appPath:X,macos:{...J,teamId:K},relaunch:Z.relaunch??((z)=>$4({appPath:z,quit:Z4,quitDelayMs:250}))})}var MZ=null,A=null;class Y4{_process;_startedAt;_endsAt;_options;_expireHandlers=[];_expireTimer=null;_stopped=!1;constructor(Z,$){this._process=Z,this._options=$,this._startedAt=new Date;let Y=$.duration;if(Y&&Y>0){let J=Y*60*1000;this._endsAt=new Date(this._startedAt.getTime()+J),this._expireTimer=setTimeout(()=>{this._stopped=!0;for(let Q of this._expireHandlers)try{Q()}catch{}},J)}else this._endsAt=null}get pid(){return this._process.pid}get startedAt(){return this._startedAt}get endsAt(){return this._endsAt}get options(){return{...this._options}}get isActive(){if(this._stopped)return!1;return this._process.exitCode===null}get remainingMs(){if(!this._endsAt)return null;let Z=this._endsAt.getTime()-Date.now();return Math.max(0,Z)}get elapsedMs(){return Date.now()-this._startedAt.getTime()}stop(){if(this._stopped)return;if(this._stopped=!0,this._expireTimer)clearTimeout(this._expireTimer),this._expireTimer=null;try{this._process.kill()}catch{}}onExpire(Z){this._expireHandlers.push(Z)}}function r8(Z={}){J4();let{duration:$,preventDisplaySleep:Y=!0,preventIdleSleep:J=!0,preventSystemSleep:Q=!0,preventDiskSleep:X=!1,assertUserActivity:K=!0}=Z,z=[];if(Y)z.push("-d");if(J)z.push("-i");if(Q)z.push("-s");if(X)z.push("-m");if(K)z.push("-u");let F=[...z];if($&&$>0)F.push("-t",String($*60));let R=Bun.spawn(["/usr/bin/caffeinate",...F],{stdio:["ignore","ignore","ignore"]}),O=new Y4(R,Z);return MZ=R,A=O,O}function J4(Z){if(Z){if(Z.stop(),A===Z)MZ=null,A=null;return}if(A)A.stop();MZ=null,A=null}function n8(){return A!==null&&A.isActive}function o8(){if(!A||!A.isActive)return{active:!1,instance:null,startedAt:null,endsAt:null,durationMinutes:null};let $=A.options.duration;return{active:!0,instance:A,startedAt:A.startedAt,endsAt:A.endsAt,durationMinutes:$&&$>0?$:-1}}function a8(Z){let $=Z||A;if(!$||!$.isActive)return"0:00";let Y=$.remainingMs;if(Y===null)return"\u221E";let J=Math.ceil(Y/1000),Q=Math.floor(J/3600),X=Math.floor(J%3600/60),K=J%60;if(Q>0)return`${Q}:${String(X).padStart(2,"0")}:${String(K).padStart(2,"0")}`;return`${X}:${String(K).padStart(2,"0")}`}function i8(Z){if(Z<=0||Z===-1)return"Indefinitely";if(Z<60)return`${Z} minutes`;if(Z===60)return"1 hour";if(Z%60===0)return`${Z/60} hours`;let $=Math.floor(Z/60),Y=Z%60;return`${$}h ${Y}m`}import{existsSync as _Z,mkdirSync as s8,readFileSync as t8,watch as e8,writeFileSync as Z9}from"fs";import{homedir as $9,platform as Y9}from"os";import{dirname as J9,join as o}from"path";function G9(Z){let $=Y9(),Y=$9();switch($){case"darwin":return o(Y,"Library","Application Support",Z);case"win32":return o(process.env.APPDATA||o(Y,"AppData","Roaming"),Z);default:return o(Y,".config",Z)}}class G4{_defaults;_data;_path;_changeHandlers=new Map;_anyChangeHandlers=new Set;_watcher=null;_writeTimer=null;_writing=!1;constructor(Z){this._defaults={...Z.defaults};let $=Z.path?J9(Z.path):G9(Z.name);if(this._path=Z.path||o($,"preferences.json"),!_Z($))s8($,{recursive:!0});if(this._data=this._load(),Z.watch!==!1)this._setupWatcher()}get path(){return this._path}get(Z){if(Z in this._data)return this._data[Z];return this._defaults[Z]}set(Z,$){let Y=this.get(Z);if(JSON.stringify(Y)===JSON.stringify($))return;this._data[Z]=$,this._scheduleSave(),this._notifyChange(Z,$,Y)}getAll(){return{...this._defaults,...this._data}}has(Z){return Z in this._data}delete(Z){if(!(Z in this._data))return;let $=this._data[Z];delete this._data[Z],this._scheduleSave(),this._notifyChange(Z,this._defaults[Z],$)}reset(){let Z={...this._data};this._data={},this._save();for(let $ of Object.keys(Z)){let Y=this._defaults[$];this._notifyChange($,Y,Z[$])}}onChange(Z,$){let Y=Z;if(!this._changeHandlers.has(Y))this._changeHandlers.set(Y,new Set);return this._changeHandlers.get(Y).add($),()=>{this._changeHandlers.get(Y)?.delete($)}}onAnyChange(Z){return this._anyChangeHandlers.add(Z),()=>{this._anyChangeHandlers.delete(Z)}}close(){if(this._watcher)this._watcher.close(),this._watcher=null;if(this._writeTimer)clearTimeout(this._writeTimer),this._writeTimer=null,this._save()}_load(){try{if(_Z(this._path)){let Z=t8(this._path,"utf-8");return JSON.parse(Z)}}catch{}return{}}_save(){this._writing=!0;try{let Z=JSON.stringify({...this._defaults,...this._data},null,2);Z9(this._path,Z,"utf-8")}catch(Z){console.error(`Failed to save preferences to ${this._path}:`,Z)}finally{setTimeout(()=>{this._writing=!1},100)}}_scheduleSave(){if(this._writeTimer)clearTimeout(this._writeTimer);this._writeTimer=setTimeout(()=>{this._writeTimer=null,this._save()},50)}_setupWatcher(){try{if(!_Z(this._path))this._save();this._watcher=e8(this._path,()=>{if(this._writing)return;let Z=this._load(),$={...this._data};this._data=Z;let Y=new Set([...Object.keys($),...Object.keys(Z)]);for(let J of Y){let Q=J in $?$[J]:this._defaults[J],X=J in Z?Z[J]:this._defaults[J];if(JSON.stringify(Q)!==JSON.stringify(X))this._notifyChange(J,X,Q)}})}catch{}}_notifyChange(Z,$,Y){let J=this._changeHandlers.get(Z);if(J)for(let Q of J)try{Q($,Y)}catch{}for(let Q of this._anyChangeHandlers)try{Q(Z,$,Y)}catch{}}}function Q9(Z){return new G4(Z)}import{existsSync as p,mkdirSync as Q4,readFileSync as X9,unlinkSync as X4,writeFileSync as z4}from"fs";import{homedir as QZ,platform as K4}from"os";import{join as l}from"path";function F4(Z){let $=Z.toLowerCase().replace(/[^a-z0-9]/g,"-");return l(QZ(),"Library","LaunchAgents",`com.${$}.plist`)}function R4(Z){let $=process.env.XDG_CONFIG_HOME||l(QZ(),".config");return l($,"autostart",`${Z.toLowerCase()}.desktop`)}async function z9(Z,$){let Y=$.appName||"StxApp",J=F4(Y),Q=l(QZ(),"Library","LaunchAgents");if(Z){let X=$.appPath||process.execPath,K=$.args||[],z=[X,...K],F=`<?xml version="1.0" encoding="UTF-8"?>
898
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
899
- <plist version="1.0">
900
- <dict>
901
- <key>Label</key>
902
- <string>com.${Y.toLowerCase().replace(/[^a-z0-9]/g,"-")}</string>
903
- <key>ProgramArguments</key>
904
- <array>
905
- ${z.map((R)=>` <string>${j9(R)}</string>`).join(`
906
- `)}
907
- </array>
908
- <key>RunAtLoad</key>
909
- <true/>
910
- <key>KeepAlive</key>
911
- <false/>
912
- ${$.isHidden?` <key>ProcessType</key>
913
- <string>Background</string>`:""}
914
- </dict>
915
- </plist>`;if(!p(Q))Q4(Q,{recursive:!0});z4(J,F,"utf-8")}else if(p(J))X4(J)}async function K9(Z,$){let Y=$.appName||"StxApp",J=R4(Y),Q=l(process.env.XDG_CONFIG_HOME||l(QZ(),".config"),"autostart");if(Z){let X=$.appPath||process.execPath,K=$.args||[],z=[X,...K].join(" "),F=`[Desktop Entry]
916
- Type=Application
917
- Name=${Y}
918
- Exec=${z}
919
- Terminal=false
920
- StartupNotify=false
921
- ${$.isHidden?`X-GNOME-Autostart-enabled=true
922
- NoDisplay=true`:""}
923
- `;if(!p(Q))Q4(Q,{recursive:!0});z4(J,F,"utf-8")}else if(p(J))X4(J)}async function F9(Z){return p(F4(Z))}async function R9(Z){let $=R4(Z);if(!p($))return!1;try{let Y=X9($,"utf-8");if(Y.includes("X-GNOME-Autostart-enabled=false"))return!1;if(Y.includes("Hidden=true"))return!1;return!0}catch{return!1}}function j9(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}async function O9(Z,$={}){let Y=K4();switch(Y){case"darwin":return z9(Z,$);case"linux":return K9(Z,$);default:throw Error(`Auto-launch is not yet supported on ${Y}`)}}async function V9(Z){let $=Z||"StxApp";switch(K4()){case"darwin":return F9($);case"linux":return R9($);default:return!1}}var B=new Map,q9=0,XZ=!1;function j4(Z){let $=Z.split("+").map((J)=>J.trim()),Y={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let J of $){let Q=J.toLowerCase();switch(Q){case"cmd":case"command":case"meta":case"\u2318":Y.meta=!0;break;case"ctrl":case"control":case"\u2303":Y.ctrl=!0;break;case"shift":case"\u21E7":Y.shift=!0;break;case"alt":case"option":case"opt":case"\u2325":Y.alt=!0;break;case"cmdorctrl":case"commandorcontrol":if(typeof process<"u"&&process.platform==="darwin")Y.meta=!0;else Y.ctrl=!0;break;default:Y.key=Q}}return Y}function P9(Z){let $=[];if(Z.ctrl)$.push("\u2303");if(Z.alt)$.push("\u2325");if(Z.shift)$.push("\u21E7");if(Z.meta)$.push("\u2318");return $.push(Z.key.toUpperCase()),$.join("")}function U9(Z,$){if($.meta!==Z.metaKey)return!1;if($.ctrl!==Z.ctrlKey)return!1;if($.shift!==Z.shiftKey)return!1;if($.alt!==Z.altKey)return!1;return Z.key.toLowerCase()===$.key||Z.code.toLowerCase()===`key${$.key}`}function O4(Z){for(let[,$]of B)if(U9(Z,$.parsed)){Z.preventDefault(),Z.stopPropagation();try{$.handler()}catch{}break}}function W9(){if(XZ)return;if(typeof document>"u")return;document.addEventListener("keydown",O4,!0),XZ=!0}function TZ(){if(!XZ)return;if(typeof document>"u")return;document.removeEventListener("keydown",O4,!0),XZ=!1}async function L9(Z,$){if(typeof window>"u")return!1;let Y=window.craft;if(!Y?.hotkeys?.register)return!1;try{return await Y.hotkeys.register(Z,$),!0}catch{return!1}}async function NZ(Z){if(typeof window>"u")return;let $=window.craft;if(!$?.hotkeys?.unregister)return;try{await $.hotkeys.unregister(Z)}catch{}}function D9(Z,$){let Y=`hotkey_${++q9}_${Date.now()}`,J=j4(Z);B.set(Y,{shortcut:Z,handler:$,parsed:J}),L9(Y,Z),W9();let Q={shortcut:Z,id:Y,unregister(){V4(Q)}};return Q}function V4(Z){if(B.delete(Z.id),NZ(Z.id),B.size===0)TZ()}function M9(){for(let[Z]of B)NZ(Z);B.clear(),TZ()}function _9(){return Array.from(B.entries()).map(([Z,$])=>({shortcut:$.shortcut,id:Z,unregister(){if(B.delete(Z),NZ(Z),B.size===0)TZ()}}))}class q4{_duration;_tickInterval;_remaining;_running=!1;_paused=!1;_complete=!1;_intervalId=null;_lastTick=0;_completionHandlers=new Set;_tickHandlers=new Set;constructor(Z){if(this._duration=Z.duration,this._tickInterval=Z.tickInterval||1000,this._remaining=Z.duration,Z.onComplete)this._completionHandlers.add(Z.onComplete);if(Z.onTick)this._tickHandlers.add(Z.onTick);if(Z.autoStart)this.start()}get isRunning(){return this._running&&!this._paused}get isPaused(){return this._paused}get isComplete(){return this._complete}get remaining(){if(this._running&&!this._paused){let Z=Date.now()-this._lastTick;return Math.max(0,this._remaining-Z)}return Math.max(0,this._remaining)}get elapsed(){return this._duration-this.remaining}get duration(){return this._duration}get progress(){if(this._duration===0)return 1;return Math.min(1,this.elapsed/this._duration)}start(){if(this._running)return;this._running=!0,this._paused=!1,this._complete=!1,this._lastTick=Date.now(),this._startInterval()}stop(){this._clearInterval(),this._running=!1,this._paused=!1,this._remaining=this._duration}pause(){if(!this._running||this._paused)return;let Z=Date.now()-this._lastTick;this._remaining=Math.max(0,this._remaining-Z),this._clearInterval(),this._paused=!0}resume(){if(!this._paused)return;this._paused=!1,this._lastTick=Date.now(),this._startInterval()}reset(){this._clearInterval(),this._running=!1,this._paused=!1,this._complete=!1,this._remaining=this._duration}onComplete(Z){return this._completionHandlers.add(Z),()=>{this._completionHandlers.delete(Z)}}onTick(Z){return this._tickHandlers.add(Z),()=>{this._tickHandlers.delete(Z)}}_startInterval(){this._clearInterval(),this._intervalId=setInterval(()=>{let Z=Date.now(),$=Z-this._lastTick;this._lastTick=Z,this._remaining=Math.max(0,this._remaining-$);for(let Y of this._tickHandlers)try{Y(this._remaining)}catch{}if(this._remaining<=0){this._clearInterval(),this._running=!1,this._complete=!0;for(let Y of this._completionHandlers)try{Y()}catch{}}},this._tickInterval)}_clearInterval(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null}}class P4{_interval;_handler;_immediate;_running=!1;_intervalId=null;constructor(Z){if(this._interval=Z.interval,this._handler=Z.handler,this._immediate=Z.immediate!==!1,this._immediate)this.start()}get isRunning(){return this._running}start(){if(this._running)return;this._running=!0,this._intervalId=setInterval(()=>{try{this._handler()}catch{}},this._interval)}stop(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null;this._running=!1}}function T9(Z){return new q4(Z)}function N9(Z){return new P4(Z)}function E9(Z){return new Promise(($)=>setTimeout($,Z))}function A9(Z){let $=Math.ceil(Z/1000),Y=Math.floor($/3600),J=Math.floor($%3600/60),Q=$%60;if(Y>0)return`${Y}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${J}:${String(Q).padStart(2,"0")}`}function k9(Z){let $=Math.ceil(Z/1000),Y=Math.floor($/3600),J=Math.floor($%3600/60),Q=$%60;if(Y>0){if(J>0)return`${Y}h ${J}m`;return`${Y}h`}if(J>0){if(Q>0)return`${J}m ${Q}s`;return`${J}m`}return`${Q}s`}function G(Z){if(typeof window>"u")return!1;let $=window.craft;return!!($&&$[Z])}function M(Z){if(!G(Z))throw Error(`craft.${Z} is not available \u2014 this API requires a Craft native window`);return window.craft[Z]}function P(Z,$){if(typeof window>"u")return()=>{};let Y=(J)=>$(J.detail??{});return window.addEventListener(Z,Y),()=>window.removeEventListener(Z,Y)}var H9={async writeText(Z){if(G("clipboard")){await window.craft.clipboard.writeText(Z);return}if(typeof navigator<"u"&&navigator.clipboard)await navigator.clipboard.writeText(Z)},async readText(){if(G("clipboard")){let Z=await window.craft.clipboard.readText();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.readText)try{return await navigator.clipboard.readText()}catch{return""}return""},async writeHTML(Z){if(G("clipboard")){await window.craft.clipboard.writeHTML(Z);return}if(typeof navigator<"u"&&navigator.clipboard?.write)try{let $=new window.ClipboardItem({"text/html":new Blob([Z],{type:"text/html"}),"text/plain":new Blob([x9(Z)],{type:"text/plain"})});await navigator.clipboard.write([$])}catch{}},async readHTML(){if(G("clipboard")){let Z=await window.craft.clipboard.readHTML();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.read)try{let Z=await navigator.clipboard.read();for(let $ of Z)if($.types.includes("text/html"))return await(await $.getType("text/html")).text()}catch{}return""},async clear(){if(G("clipboard")){await window.craft.clipboard.clear();return}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText("")}catch{}},async hasText(){if(G("clipboard"))return await window.craft.clipboard.hasText();return(await this.readText()).length>0},async hasHTML(){if(G("clipboard"))return await window.craft.clipboard.hasHTML();return(await this.readHTML()).length>0},async hasImage(){if(G("clipboard"))return await window.craft.clipboard.hasImage();return!1}};function x9(Z){return Z.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<\/?(br|p|div|li|h[1-6])\b[^>]*>/gi,`
924
- `).replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/\n{3,}/g,`
925
-
926
- `).trim()}var C9={async show(Z){if(!Z.title)throw Error("notification title is required");if(G("notifications")){await window.craft.notifications.show(Z);return}if(typeof window<"u"&&"Notification"in window){let $=window.Notification;if($.permission==="granted")new $(Z.title,{body:Z.body,icon:Z.icon});else if($.permission==="default"){if(await $.requestPermission()==="granted")new $(Z.title,{body:Z.body,icon:Z.icon})}}},async schedule(Z){if(G("notifications")){let J={...Z};if(J.triggerAt instanceof Date)J.triggerAt=J.triggerAt.toISOString();await window.craft.notifications.schedule(J);return}let $=I9(Z.triggerAt),Y=Math.max(0,$-Date.now());setTimeout(()=>{this.show(Z).catch(()=>{})},Y)},async cancel(Z){if(G("notifications"))await window.craft.notifications.cancel(Z)},async cancelAll(){if(G("notifications"))await window.craft.notifications.cancelAll()},async setBadge(Z){let $=Math.max(0,Math.round(Number.isFinite(Z)?Z:0));if(G("notifications")){await window.craft.notifications.setBadge($);return}if(typeof navigator<"u"&&navigator.setAppBadge)try{await navigator.setAppBadge($)}catch{}},async clearBadge(){if(G("notifications")){await window.craft.notifications.clearBadge();return}if(typeof navigator<"u"&&navigator.clearAppBadge)try{await navigator.clearAppBadge()}catch{}},async requestPermission(){if(G("notifications"))return await window.craft.notifications.requestPermission();if(typeof window<"u"&&"Notification"in window){let Z=window.Notification;if(Z.permission==="granted")return!0;if(Z.permission==="denied")return!1;return await Z.requestPermission()==="granted"}return!1},async registerCategories(Z){if(!Array.isArray(Z)||Z.length===0)return;if(G("notifications")){let $=window.craft.notifications.registerCategories;if(typeof $==="function")await $(Z)}},onActionClicked(Z){return P("craft:notification:actionClicked",Z)},onReply(Z){return P("craft:notification:reply",Z)}};function I9(Z){if(Z==null)return Date.now();if(Z instanceof Date)return Z.getTime();if(typeof Z==="number")return Z;let $=Date.parse(Z);return Number.isNaN($)?Date.now():$}var S9={async readFile(Z){let $=await M("fs").readFile(Z);return $&&$.data||""},async readBuffer(Z){let $=await M("fs").readFile(Z),Y=$&&$.data||"";if($&&$.base64===!0)return B9(Y);return new TextEncoder().encode(Y)},async writeFile(Z,$){await M("fs").writeFile(Z,$)},async writeBuffer(Z,$){let Y=w9($),J=M("fs");if(typeof J.writeFileBytes==="function")await J.writeFileBytes(Z,Y);else await J.writeFile(Z,Y)},async copy(Z,$){if(Z===$)throw Error("fs.copy: source and destination must differ");await M("fs").copy(Z,$)},async move(Z,$){if(Z===$)throw Error("fs.move: source and destination must differ");await M("fs").move(Z,$)},async appendFile(Z,$){await M("fs").appendFile(Z,$)},async deleteFile(Z){await M("fs").deleteFile(Z)},async exists(Z){return await M("fs").exists(Z)},async stat(Z){return f9(await M("fs").stat(Z))},async readDir(Z){let $=await M("fs").readDir(Z),Y=$&&$.entries||[],J=Z.endsWith("/")?Z.slice(0,-1):Z;return Y.map((Q)=>({name:Q.name,path:`${J}/${Q.name}`,isDirectory:!!Q.isDirectory}))},async mkdir(Z,$){await M("fs").mkdir(Z,$)},async rmdir(Z,$){await M("fs").rmdir(Z,$)},async watch(Z,$){await M("fs").watch(Z,$)},async unwatch(Z){await M("fs").unwatch(Z)},onChange(Z){return P("craft:fs:change",Z)},async watchTree(Z,$,Y){let J=`watch-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Q=M("fs");await Q.watch(Z,J,{recursive:!!$.recursive});let X=$.kinds&&$.kinds.length>0?new Set($.kinds):null,K=Math.max(0,Math.floor($.coalesceMs??0)),z=[],F=null,R=!1,O=()=>{if(F=null,z.length===0)return;let j=z;z=[];try{Y(j)}catch{}},V=P("craft:fs:change",(j)=>{if(R)return;if(j.id!==J)return;if(X&&j.kind&&!X.has(j.kind))return;if(z.push(j),K===0){O();return}if(F==null)F=setTimeout(O,K)});return{id:J,async stop(){if(R)return;if(R=!0,V(),F)clearTimeout(F),F=null;if(z.length>0)O();try{await Q.unwatch(J)}catch{}}}},async homeDir(){return await M("fs").homeDir()},async tempDir(){return await M("fs").tempDir()},async appDataDir(){return await M("fs").appDataDir()}};function w9(Z){let $="";for(let Y=0;Y<Z.length;Y++)$+=String.fromCharCode(Z[Y]);return typeof btoa==="function"?btoa($):Buffer.from(Z).toString("base64")}function B9(Z){let $=typeof atob==="function"?atob(Z):Buffer.from(Z,"base64").toString("binary"),Y=new Uint8Array($.length);for(let J=0;J<$.length;J++)Y[J]=$.charCodeAt(J);return Y}function f9(Z){return{isFile:!!Z.isFile,isDirectory:!!Z.isDirectory,isSymlink:!!Z.isSymlink,size:Number(Z.size)||0,modifiedAt:Z.modifiedAt!=null?Z.modifiedAt<1000000000000?Z.modifiedAt*1000:Z.modifiedAt:0}}var a=new Set,U4=!1;function v9(){if(U4)return;if(typeof window>"u"||typeof window.addEventListener!=="function")return;window.addEventListener("craft:shell:exit",(Z)=>{let $=Z.detail;if($?.id)a.delete($.id)}),U4=!0}var y9=new Set(["javascript:","data:","file:","vbscript:"]),g9={async openExternal(Z){let $=Z.trim().toLowerCase();for(let Y of y9)if($.startsWith(Y))throw Error(`shell.openExternal: ${Y} URLs are blocked for safety`);if(G("shell")){await window.craft.shell.openExternal(Z);return}if(typeof window<"u"&&typeof window.open==="function")window.open(Z,"_blank","noopener,noreferrer")},async openPath(Z){await M("shell").openPath(Z)},async showInFinder(Z){await M("shell").showInFinder(Z)},async spawn(Z,$,Y=[],J={}){if(v9(),!Z||typeof Z!=="string")throw Error("shell.spawn: id must be a non-empty string");if(!$||typeof $!=="string")throw Error("shell.spawn: command must be a non-empty string");if(!Array.isArray(Y))throw Error("shell.spawn: args must be an array");for(let Q of Y)if(typeof Q!=="string")throw Error("shell.spawn: args entries must be strings");if(a.has(Z))throw Error(`shell.spawn: id "${Z}" is already in use \u2014 call kill(id) first or pick a different id`);a.add(Z);try{await M("shell").spawn(Z,$,Y,J)}catch(Q){throw a.delete(Z),Q}},async kill(Z){await M("shell").kill(Z),a.delete(Z)},async getEnv(Z){if(G("shell")){let $=await window.craft.shell.getEnv(Z);return $==null?void 0:String($)}return},async setEnv(Z,$){await M("shell").setEnv(Z,$)},onStdout(Z){return P("craft:shell:stdout",Z)},onStderr(Z){return P("craft:shell:stderr",Z)},onExit(Z){return P("craft:shell:exit",Z)}};function u(){return window.craft.shortcuts}var b9={async register(Z,$,Y){if(!G("shortcuts"))return;await u().register(Z,$,Y)},async unregister(Z){if(!G("shortcuts"))return;await u().unregister(Z)},async unregisterAll(){if(!G("shortcuts"))return;await u().unregisterAll()},async enable(Z){if(!G("shortcuts"))return;await u().enable(Z)},async disable(Z){if(!G("shortcuts"))return;await u().disable(Z)},async isRegistered(Z){if(!G("shortcuts"))return!1;return await u().isRegistered(Z)},async list(){if(!G("shortcuts"))return[];return await u().list()},on(Z){return P("craft:shortcut",Z)}};var u9={get(){if(G("theme"))try{return window.craft.theme.get()}catch{}return{appearance:m9()}},onChange(Z){if(Z(this.get()),G("theme"))return P("craft:theme",Z);if(typeof window<"u"&&window.matchMedia){let $=window.matchMedia("(prefers-color-scheme: dark)"),Y=()=>Z({appearance:$.matches?"dark":"light"});return $.addEventListener("change",Y),()=>$.removeEventListener("change",Y)}return()=>{}},async current(){return this.get()}};function m9(){if(typeof window>"u"||!window.matchMedia)return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}async function h9(Z,$={}){if(!G("dragOut"))throw Error("dragOut requires a Craft native window");let Y=Array.isArray(Z)?Z:[Z];if(Y.length===0)throw Error("dragOut: at least one path required");await window.craft.dragOut.start(Y,$)}function c9(){return G("dragOut")}var p9={onUrl(Z){if(!G("deepLink"))return()=>{};return P("craft:deepLink",Z)},getInitialUrl(){if(typeof window>"u")return null;if(G("deepLink"))try{return window.craft.deepLink.getInitialUrl()}catch{return null}return window.__craftPendingDeepLink||null},consumeInitialUrl(){let Z=this.getInitialUrl();if(typeof window<"u")window.__craftPendingDeepLink=void 0;return Z},isAvailable(){return G("deepLink")}};var l9={async isCharging(){if(G("power"))return await window.craft.power.isCharging();let Z=await zZ();return Z?!!Z.charging:!1},async isPluggedIn(){if(G("power"))return await window.craft.power.isPluggedIn();let Z=await zZ();return Z?!!Z.charging||Z.level>=0.999:!1},async isLowPowerMode(){if(G("power"))return await window.craft.power.isLowPowerMode();return!1},async level(){if(G("power")){let $=await window.craft.power.batteryLevel();return typeof $==="number"?$:null}let Z=await zZ();return Z?Z.level:null},async timeRemaining(){if(G("power")){let Y=await window.craft.power.timeRemaining();return typeof Y==="number"?Y:null}let Z=await zZ();if(!Z)return null;let $=Z.charging?Z.chargingTime:Z.dischargingTime;return Number.isFinite($)?Math.round($/60):null},async thermalState(){if(G("power"))return await window.craft.power.thermalState()||"unknown";return"unknown"},async uptimeSeconds(){if(G("power"))return await window.craft.power.uptimeSeconds();if(typeof performance<"u"&&typeof performance.now==="function")return Math.round(performance.now()/1000);return 0},async preventSleep(Z="app is busy"){if(G("power")){await window.craft.power.preventSleep(Z);return}if(typeof navigator>"u"||!navigator.wakeLock)return;let $=window;if($.__craftWebWakeLock?.release){try{await $.__craftWebWakeLock.release()}catch{}$.__craftWebWakeLock=null}try{let Y=await navigator.wakeLock.request("screen");$.__craftWebWakeLock=Y}catch{}},async allowSleep(){if(G("power")){await window.craft.power.allowSleep();return}let Z=window.__craftWebWakeLock;if(Z&&typeof Z.release==="function"){try{await Z.release()}catch{}window.__craftWebWakeLock=null}},onSleep(Z){return P("craft:powerSleep",Z)},onWake(Z){return P("craft:powerWake",Z)}};async function zZ(){if(typeof navigator>"u")return null;let Z=navigator;if(typeof Z.getBattery!=="function")return null;try{return await Z.getBattery()}catch{return null}}var d9={async connectionType(){if(G("network"))return await window.craft.network.connectionType();return W4()},async wifiSSID(){if(G("network"))return await window.craft.network.wifiSSID()||void 0;return},async wifiSignalStrength(){if(G("network")){let Z=await window.craft.network.wifiSignalStrength();return typeof Z==="number"?Z:void 0}return},async ipAddress(){if(G("network"))return await window.craft.network.ipAddress();return""},async macAddress(){if(G("network"))return await window.craft.network.macAddress();return""},async interfaces(){if(G("network"))return await window.craft.network.interfaces();return[]},async isVPNConnected(){if(G("network"))return await window.craft.network.isVPNConnected();return!1},async proxySettings(){if(G("network"))return await window.craft.network.proxySettings()||{};return{}},async openPreferences(){if(G("network"))await window.craft.network.openPreferences()},onChange(Z){if(G("network"))return P("craft:networkChange",Z);if(typeof window>"u")return()=>{};let $=()=>Z({type:W4(),online:!0}),Y=()=>Z({type:"none",online:!1});return window.addEventListener("online",$),window.addEventListener("offline",Y),()=>{window.removeEventListener("online",$),window.removeEventListener("offline",Y)}}};function W4(){if(typeof navigator>"u")return"unknown";if(navigator.onLine===!1)return"none";let Z=navigator.connection;if(!Z)return"unknown";let $=String(Z.type||Z.effectiveType||"unknown").toLowerCase();if($==="wifi"||$==="cellular"||$==="ethernet"||$==="bluetooth"||$==="none")return $;return"unknown"}var r9={async checkForUpdates(){if(!G("updater"))return;await window.craft.updater.checkForUpdates()},async checkInBackground(){if(!G("updater"))return;await window.craft.updater.checkInBackground()},async setAutomaticChecks(Z){if(!G("updater"))return;await window.craft.updater.setAutomaticChecks(Z)},async setCheckInterval(Z){if(!G("updater"))return;if(!Number.isFinite(Z))throw Error("setCheckInterval: must be a finite number");let $=Z<=0?0:Math.max(60,Math.round(Z));await window.craft.updater.setCheckInterval($)},async setFeedURL(Z){if(!G("updater"))return;await window.craft.updater.setFeedURL(Z)},async getLastUpdateCheckDate(){if(!G("updater"))return null;return await window.craft.updater.getLastUpdateCheckDate()||null},async getUpdateInfo(){if(!G("updater"))return null;let Z=await window.craft.updater.getUpdateInfo();if(!Z||typeof Z.version!=="string"||Z.version.length===0)return null;return Z},onAvailable(Z){return P("craft:updateAvailable",Z)},onDownloaded(Z){return P("craft:updateDownloaded",Z)},async verifySignature({payload:Z,signatureB64:$,publicKeyB64:Y}){let J=L4(Z),Q;try{Q=await crypto.subtle.importKey("raw",KZ(Y),{name:"Ed25519"},!1,["verify"])}catch{return!1}try{return await crypto.subtle.verify("Ed25519",Q,KZ($),J)}catch{return!1}},async verifyDownload({url:Z,signatureB64:$,publicKeyB64:Y,fetchInit:J}){let Q;try{Q=await fetch(Z,J)}catch{return{ok:!1,reason:"fetch-failed"}}if(!Q.ok)return{ok:!1,reason:"http-error",status:Q.status};let X=new Uint8Array(await Q.arrayBuffer()),K;try{K=await crypto.subtle.importKey("raw",KZ(Y),{name:"Ed25519"},!1,["verify"])}catch{return{ok:!1,reason:"bad-key"}}let z=!1;try{z=await crypto.subtle.verify("Ed25519",K,KZ($),L4(X))}catch{z=!1}if(!z)return{ok:!1,reason:"bad-signature"};return{ok:!0,payload:X}}};function L4(Z){if(Z instanceof ArrayBuffer)return new Uint8Array(Z);let $=new ArrayBuffer(Z.byteLength),Y=new Uint8Array($);return Y.set(Z),Y}function KZ(Z){if(typeof atob==="function"){let J=atob(Z),Q=new ArrayBuffer(J.length),X=new Uint8Array(Q);for(let K=0;K<J.length;K++)X[K]=J.charCodeAt(K);return X}let $=Buffer.from(Z,"base64"),Y=new ArrayBuffer($.length);return new Uint8Array(Y).set($),new Uint8Array(Y)}var n9={onFocus(Z){if(G("window"))return P("craft:window:focus",()=>Z());return EZ("focus",Z)},onBlur(Z){if(G("window"))return P("craft:window:blur",()=>Z());return EZ("blur",Z)},onResize(Z){if(G("window"))return P("craft:window:resize",Z);if(typeof window>"u")return()=>{};let $=()=>Z({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},onMove(Z){if(G("window"))return P("craft:window:move",Z);return()=>{}},onClose(Z){if(G("window"))return P("craft:window:close",()=>Z());return EZ("beforeunload",Z)},onMinimize(Z){if(G("window"))return P("craft:window:minimize",()=>Z());if(typeof document>"u")return()=>{};let $=()=>{if(document.visibilityState==="hidden")Z()};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},onRestore(Z){if(G("window"))return P("craft:window:restore",()=>Z());if(typeof document>"u")return()=>{};let $=()=>{if(document.visibilityState==="visible")Z()};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)}};function EZ(Z,$){if(typeof window>"u")return()=>{};let Y=()=>$();return window.addEventListener(Z,Y),()=>window.removeEventListener(Z,Y)}var D4={name:"",version:"0.0.0"},o9={async hideDockIcon(){if(G("app"))await window.craft.app.hideDockIcon()},async showDockIcon(){if(G("app"))await window.craft.app.showDockIcon()},async quit(){if(G("app"))await window.craft.app.quit()},async getInfo(){if(!G("app"))return D4;let Z=await window.craft.app.getInfo();return{...D4,...Z||{}}},async notify(Z){if(!Z.title)throw Error("notify: title is required");if(G("app"))await window.craft.app.notify(Z)},async setBadge(Z){if(G("app"))await window.craft.app.setBadge(Z)},async bounce(Z="informational"){if(G("app"))await window.craft.app.bounce(Z)}};var a9={app(Z,$={}){return{label:Z,items:[{label:`About ${Z}`,role:"about"},{separator:!0},...$.settings?[{id:"stx.menu.settings",label:"Settings\u2026",shortcut:"cmd+,",onClick:$.settings},{separator:!0}]:[],{label:`Hide ${Z}`,role:"hide",shortcut:"cmd+h"},{label:"Hide Others",role:"hideOthers",shortcut:"cmd+alt+h"},{label:"Show All",role:"showAll"},{separator:!0},{label:`Quit ${Z}`,role:"quit",shortcut:"cmd+q"}]}},edit(){return{label:"Edit",items:[{label:"Undo",role:"undo",shortcut:"cmd+z"},{label:"Redo",role:"redo",shortcut:"cmd+shift+z"},{separator:!0},{label:"Cut",role:"cut",shortcut:"cmd+x"},{label:"Copy",role:"copy",shortcut:"cmd+c"},{label:"Paste",role:"paste",shortcut:"cmd+v"},{label:"Select All",role:"selectAll",shortcut:"cmd+a"}]}},window(){return{label:"Window",items:[{label:"Minimize",role:"minimize",shortcut:"cmd+m"},{label:"Zoom",role:"zoom"},{separator:!0},{label:"Close Window",role:"close",shortcut:"cmd+w"}]}},leading(Z,$={}){return[this.app(Z,$),this.edit()]}},i9=0;function s9(Z){let $=new Map;return{payload:{menus:Z.menus.map((J)=>({label:J.label,items:J.items.map((Q)=>{let{onClick:X,...K}=Q;if(K.separator)return K;let z=K.id??`stx.menu.${i9++}`;if(X)$.set(z,X);return{...K,id:z}})}))},handlers:$}}var AZ=null,t9={async set(Z){if(!G("menu"))return!1;let{payload:$,handlers:Y}=s9(Z);if(AZ?.(),AZ=null,Y.size>0)AZ=P("craft:menu:action",(J)=>{Y.get(J.id)?.()});return await window.craft.menu.set($),!0},async setDock(Z){if(G("menu"))await window.craft.menu.setDock(Z)},async addItem(Z,$){if(G("menu"))await window.craft.menu.addItem(Z,$)},async removeItem(Z){if(G("menu"))await window.craft.menu.removeItem(Z)},async enableItem(Z){if(G("menu"))await window.craft.menu.enableItem(Z)},async disableItem(Z){if(G("menu"))await window.craft.menu.disableItem(Z)},async checkItem(Z){if(G("menu"))await window.craft.menu.checkItem(Z)},async uncheckItem(Z){if(G("menu"))await window.craft.menu.uncheckItem(Z)},async setItemLabel(Z,$){if(G("menu"))await window.craft.menu.setItemLabel(Z,$)},async clearDock(){if(G("menu"))await window.craft.menu.clearDock()},onAction(Z){return P("craft:menu:action",Z)}};function _4(Z){if(Z.separator)return{id:Z.id||"",title:"",type:"separator"};return{id:Z.id||"",title:Z.title||"",icon:Z.icon,shortcut:Z.shortcut,enabled:Z.disabled?!1:void 0,checked:Z.checked?!0:void 0,type:Z.submenu?"submenu":void 0,submenu:Z.submenu?.map(_4)}}async function M4(Z){if(!Z.items||Z.items.length===0)throw Error("contextMenu.show requires at least one item");if(!G("nativeUI"))return null;let $=window.craft?.nativeUI;if(!$)return null;let Y=await $.showContextMenu({targetId:Z.targetId||"",targetType:"general",x:Math.round(Z.x),y:Math.round(Z.y),items:Z.items.map(_4)});return{id:typeof Y?.id==="string"?Y.id:null,targetId:Y?.targetId}}var e9={available(){return G("nativeUI")},async show(Z){return await M4(Z)!==null},async pick(Z){return(await M4(Z))?.id??null},onAction(Z){return P("craft:contextmenu:action",($)=>{if(typeof $.id==="string")Z({id:$.id,targetId:$.targetId??""})})}};function kZ(Z){if(Z===null||Z===void 0||Z===0)return"";return String(Z)}function T4(Z){return Z.map(($)=>({id:$.id,header:$.header,items:$.items.map((Y)=>({id:Y.id,label:Y.label,icon:Y.icon,badge:kZ(Y.badge)||void 0}))}))}function N4(Z){return JSON.stringify(Z.map(($)=>[$.id,$.header??"",$.items.map((Y)=>[Y.id,Y.label,Y.icon??""])]))}function E4(Z){return new Map(Z.flatMap(($)=>$.items.map((Y)=>[Y.id,kZ(Y.badge)])))}var A4={available(){return G("nativeUI")&&typeof window.craft?.nativeUI?._emitSidebarSelect==="function"},create(Z){if(!A4.available())return null;let $=window.craft?.nativeUI;if(!$)return null;let Y=$.createSidebar({id:Z.id,sections:T4(Z.sections),selected:Z.selected}),J=Z.sections,Q=new Set;return Y.onSelect((X)=>{for(let K of[...Q])K(X)}),{id:Y.id,update(X){if(N4(X)===N4(J)){let K=E4(J);for(let[z,F]of E4(X))if(K.get(z)!==F)Y.updateItem(z,{badge:F})}else Y.setSections(T4(X));J=X},updateItem(X,K){Y.updateItem(X,{...K.label!==void 0?{label:K.label}:{},...K.icon!==void 0?{icon:K.icon}:{},..."badge"in K?{badge:kZ(K.badge)}:{}}),J=J.map((z)=>({...z,items:z.items.map((F)=>F.id===X?{...F,...K}:F)}))},select(X){Y.setSelectedItem(X)},onSelect(X){return Q.add(X),()=>Q.delete(X)},destroy(){Q.clear(),Y.destroy()}}}};var Z$={accentColor:()=>x("system","accentColor",()=>""),highlightColor:()=>x("system","highlightColor",()=>""),language:()=>x("system","language",()=>{if(typeof navigator>"u")return"";return navigator.language?.split("-")[0]||""}),locale:()=>x("system","locale",()=>{if(typeof navigator>"u")return"";return navigator.language||""}),timezone:()=>x("system","timezone",()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}),is24HourTime:()=>x("system","is24HourTime",()=>{try{let Z=new Intl.DateTimeFormat([],{hour:"numeric"}).resolvedOptions();return Z.hourCycle==="h23"||Z.hourCycle==="h24"}catch{return!1}}),reduceMotion:()=>x("system","reduceMotion",()=>HZ("(prefers-reduced-motion: reduce)")),reduceTransparency:()=>x("system","reduceTransparency",()=>HZ("(prefers-reduced-transparency: reduce)")),increaseContrast:()=>x("system","increaseContrast",()=>HZ("(prefers-contrast: more)")),systemVersion:()=>x("system","systemVersion",()=>""),hostname:()=>x("system","hostname",()=>""),username:()=>x("system","username",()=>""),async openPreferences(){if(G("system"))await window.craft.system.openPreferences()}};async function x(Z,$,Y){if(G(Z))return await window.craft[Z][$]();return await Y()}function HZ(Z){if(typeof window>"u"||!window.matchMedia)return!1;return window.matchMedia(Z).matches}var $$={async getDisplays(){if(G("screen"))return await window.craft.screen.getDisplays();return k4()},async getPrimary(){if(G("screen")){let Z=await window.craft.screen.getPrimary();return Z&&typeof Z.width==="number"?Z:null}return k4()[0]??null},onChange(Z){if(G("screen"))return P("craft:screen:change",()=>Z());if(typeof window>"u")return()=>{};let $=()=>Z();return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)}};function k4(){if(typeof window>"u"||!window.screen)return[];let Z=window.screen;return[{id:0,x:Z.left??0,y:Z.top??0,width:Z.width||0,height:Z.height||0,workX:Z.availLeft??0,workY:Z.availTop??0,workWidth:Z.availWidth??Z.width??0,workHeight:Z.availHeight??Z.height??0,scaleFactor:window.devicePixelRatio||1}]}var Y$={async set(Z,$,Y){if(!Z)throw Error("keychain.set: service is required");if(!$)throw Error("keychain.set: account is required");await M("keychain").set(Z,$,Y)},async get(Z,$){if(!Z)throw Error("keychain.get: service is required");if(!$)throw Error("keychain.get: account is required");let Y=await M("keychain").get(Z,$);return typeof Y==="string"?Y:null},async delete(Z,$){if(!Z)throw Error("keychain.delete: service is required");if(!$)throw Error("keychain.delete: account is required");await M("keychain").delete(Z,$)},async has(Z,$){if(!Z)throw Error("keychain.has: service is required");if(!$)throw Error("keychain.has: account is required");return await M("keychain").has(Z,$)}};var J$={async check(Z){if(G("permissions"))return await window.craft.permissions.check(Z);return await H4(Z)},async request(Z){if(G("permissions"))return await window.craft.permissions.request(Z);return await G$(Z)},async openSettings(Z){if(G("permissions"))await window.craft.permissions.openSettings(Z)}};async function H4(Z){if(typeof navigator>"u"||!navigator.permissions?.query)return"not-supported";try{let $=await navigator.permissions.query({name:Z});return Q$($.state)}catch{return"not-supported"}}async function G$(Z){if(Z==="notifications"&&typeof window<"u"&&"Notification"in window){let $=await window.Notification.requestPermission();return $==="granted"?"granted":$==="denied"?"denied":"undetermined"}return await H4(Z)}function Q$(Z){if(Z==="granted")return"granted";if(Z==="denied")return"denied";if(Z==="prompt")return"undetermined";return"undetermined"}var X$={async print(){if(G("printing")){await window.craft.printing.print();return}if(typeof window<"u"&&typeof window.print==="function")window.print()},async printToPDF(Z){if(!Z)throw Error("printToPDF: path is required");let $=Z.startsWith("/"),Y=/^[a-zA-Z]:[\\/]/.test(Z)||Z.startsWith("\\\\");if(!$&&!Y)throw Error("printToPDF: path must be absolute");let J=await M("printing").printToPDF(Z);return{ok:!!(J&&J.ok),path:J?.path}}};var z$={async enable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.enable()},async disable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.disable()},async isEnabled(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.isEnabled()}};function xZ(){if(!G("window"))return null;return window.craft.window}function f(Z){let $=xZ();if(!$)return Promise.resolve();try{return Promise.resolve(Z($)).then(()=>{return},()=>{return})}catch{return Promise.resolve()}}var K$={get available(){return xZ()!==null},open(Z){let $=()=>{if(typeof window<"u"&&Z.url)window.open(Z.url,Z.name);return{name:Z.name}},Y=xZ();if(!Y?.open)return Promise.resolve($());return Y.open(Z).then((J)=>({name:J?.name||Z.name})).catch($)},close:()=>f((Z)=>Z.close?.()),focus:()=>f((Z)=>Z.focus?.()),minimize:()=>f((Z)=>Z.minimize?.()),maximize:()=>f((Z)=>Z.maximize?.()),center:()=>f((Z)=>Z.center?.()),startDrag:()=>f((Z)=>Z.startDrag?.()),setTitle:(Z)=>f(($)=>$.setTitle?.(Z)),setSize:(Z,$)=>f((Y)=>Y.setSize?.(Z,$)),setAppearance:(Z)=>f(($)=>$.setAppearance?.(Z))};var F$={async addItem(Z){if(G("touchbar"))await window.craft.touchbar.addItem(Z)},async removeItem(Z){if(G("touchbar"))await window.craft.touchbar.removeItem(Z)},async updateItem(Z,$){if(G("touchbar"))await window.craft.touchbar.updateItem(Z,$)},async setLabel(Z,$){if(G("touchbar"))await window.craft.touchbar.setLabel(Z,$)},async setIcon(Z,$){if(G("touchbar"))await window.craft.touchbar.setIcon(Z,$)},async setEnabled(Z,$){if(G("touchbar"))await window.craft.touchbar.setEnabled(Z,$)},async setSliderValue(Z,$){if(G("touchbar"))await window.craft.touchbar.setSliderValue(Z,$)},async clear(){if(G("touchbar"))await window.craft.touchbar.clear()},async show(){if(G("touchbar"))await window.craft.touchbar.show()},async hide(){if(G("touchbar"))await window.craft.touchbar.hide()},onAction(Z){return P("craft:touchbar:action",Z)}};var R$=/^[\da-f]*$/i;function j$(Z,$){if(typeof $!=="string"||!R$.test($)||$.length%2!==0)throw Error(`${Z}: must be a hex string with even length, got ${JSON.stringify($)}`)}var O$={async isEnabled(){return G("bluetooth")?await window.craft.bluetooth.isEnabled():!1},async powerState(){return G("bluetooth")?await window.craft.bluetooth.powerState():"unknown"},async connectedDevices(){return G("bluetooth")?await window.craft.bluetooth.connectedDevices():[]},async pairedDevices(){return G("bluetooth")?await window.craft.bluetooth.pairedDevices():[]},async startDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.startDiscovery()},async stopDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.stopDiscovery()},async isDiscovering(){return G("bluetooth")?await window.craft.bluetooth.isDiscovering():!1},async connect(Z){if(G("bluetooth"))await window.craft.bluetooth.connect(Z)},async disconnect(Z){if(G("bluetooth"))await window.craft.bluetooth.disconnect(Z)},async openPreferences(){if(G("bluetooth"))await window.craft.bluetooth.openPreferences()},async discoverServices(Z){if(!Z)throw Error("bluetooth.discoverServices: deviceId is required");if(!G("bluetooth"))return[];let $=await window.craft.bluetooth.discoverServices(Z);return Array.isArray($)?$:[]},async discoverCharacteristics(Z,$){if(!Z||!$)throw Error("bluetooth.discoverCharacteristics: deviceId and serviceUuid are required");if(!G("bluetooth"))return[];let Y=await window.craft.bluetooth.discoverCharacteristics(Z,$);return Array.isArray(Y)?Y:[]},async readCharacteristic(Z,$,Y){if(!Z||!$||!Y)throw Error("bluetooth.readCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.readCharacteristic(Z,$,Y)},async writeCharacteristic(Z,$,Y,J,Q="with-response"){if(!Z||!$||!Y)throw Error("bluetooth.writeCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(j$("bluetooth.writeCharacteristic.valueHex",J),!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.writeCharacteristic(Z,$,Y,J,Q)},async setCharacteristicNotify(Z,$,Y,J){if(!Z||!$||!Y)throw Error("bluetooth.setCharacteristicNotify: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.setCharacteristicNotify(Z,$,Y,J)},onDeviceFound(Z){return P("craft:bluetooth:deviceFound",Z)},onDeviceConnected(Z){return P("craft:bluetooth:deviceConnected",Z)},onDeviceDisconnected(Z){return P("craft:bluetooth:deviceDisconnected",Z)},onCharacteristicValue(Z){return P("craft:bluetooth:characteristicValue",Z)}};var V$={async speak(Z,$){if(!Z)throw Error("speech.speak: text is required");if(G("speech")){await window.craft.speech.speak(Z,$);return}if(typeof window<"u"&&window.speechSynthesis){let Y=new window.SpeechSynthesisUtterance(Z);if($){if($.rate!=null)Y.rate=$.rate;if($.pitch!=null)Y.pitch=$.pitch;if($.volume!=null)Y.volume=$.volume;if($.voice){let Q=window.speechSynthesis.getVoices().find((X)=>X.voiceURI===$.voice||X.name===$.voice||X.lang===$.voice);if(Q)Y.voice=Q}}window.speechSynthesis.speak(Y)}},async stop(){if(G("speech")){await window.craft.speech.stop();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.cancel()},async pause(){if(G("speech")){await window.craft.speech.pause();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.pause()},async resume(){if(G("speech")){await window.craft.speech.resume();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.resume()},async isSpeaking(){if(G("speech"))return await window.craft.speech.isSpeaking();if(typeof window<"u"&&window.speechSynthesis)return!!window.speechSynthesis.speaking;return!1},async getVoices(){if(G("speech"))return await window.craft.speech.getVoices();if(typeof window<"u"&&window.speechSynthesis)return window.speechSynthesis.getVoices().map(($)=>({id:$.voiceURI||$.name,name:$.name,language:$.lang||"",quality:"default"}));return[]}};var i=[],CZ=!0,IZ,SZ,s={async report(Z){if(G("crashReporter")){await window.craft.crashReporter.report(Z);return}if(!CZ)return;let $=Z instanceof Error?{timestamp:Date.now(),severity:"error",message:Z.message,source:"js",stack:Z.stack||"",userId:IZ,appVersion:SZ}:{timestamp:Date.now(),severity:Z.severity||"error",message:Z.message||"",source:Z.source||"js",stack:Z.stack||"",userId:IZ,appVersion:SZ};if(i.length>=64)i.shift();i.push($)},async flush(){if(G("crashReporter"))return await window.craft.crashReporter.flush();return[...i]},async clear(){if(G("crashReporter")){await window.craft.crashReporter.clear();return}i.length=0},async setEnabled(Z){if(G("crashReporter")){await window.craft.crashReporter.setEnabled(Z);return}CZ=Z},async isEnabled(){if(G("crashReporter"))return await window.craft.crashReporter.isEnabled();return CZ},async setUser(Z){if(G("crashReporter")){await window.craft.crashReporter.setUser(Z);return}IZ=Z||void 0},async setAppVersion(Z){if(G("crashReporter")){await window.craft.crashReporter.setAppVersion(Z);return}SZ=Z||void 0},attachGlobalHandlers(){if(G("crashReporter")&&window.craft.crashReporter.attachGlobalHandlers)return window.craft.crashReporter.attachGlobalHandlers();if(typeof window>"u")return()=>{};let Z=(Y)=>{s.report({severity:"error",message:Y.message,source:"js",stack:Y.error?.stack||`${Y.message}
927
- at ${Y.filename}:${Y.lineno}:${Y.colno}`}).catch(()=>{})},$=(Y)=>{let J=Y.reason;s.report({severity:"error",message:J?.message||String(J),source:"js",stack:J?.stack||""}).catch(()=>{})};return window.addEventListener("error",Z),window.addEventListener("unhandledrejection",$),()=>{window.removeEventListener("error",Z),window.removeEventListener("unhandledrejection",$)}},forwardTo(Z){return D$(Z)}},q$="craft:crashReporter:pending",P$=/[\w.+-]+@[\w-]+\.[\w.-]+/g,U$=/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,W$=/\/(?:Users|home)\/[^\s/'"`]+/g;function C4(Z){let $=(Y)=>Y.replace(P$,"<email>").replace(U$,"<ip>").replace(W$,"/<home>");return{...Z,message:$(Z.message),stack:$(Z.stack)}}async function I4(Z,$){let Y=new TextEncoder,J=await crypto.subtle.importKey("raw",Y.encode(Z),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),Q=await crypto.subtle.sign("HMAC",J,Y.encode($));return[...new Uint8Array(Q)].map((X)=>X.toString(16).padStart(2,"0")).join("")}function L$(Z){if(!Z||typeof localStorage>"u")return[];try{let $=localStorage.getItem(Z);if(!$)return[];let Y=JSON.parse($);return Array.isArray(Y)?Y:[]}catch{return[]}}function x4(Z,$){if(!Z||typeof localStorage>"u")return;try{if($.length===0)localStorage.removeItem(Z);else localStorage.setItem(Z,JSON.stringify($))}catch{}}function D$(Z){let{endpoint:$,intervalMs:Y=60000,signingSecret:J,redact:Q=!0,headers:X={},maxRetries:K=5,persistKey:z}=Z,F=z===null?null:z??q$,R=L$(F),O=!1,V=null,j=null,U=typeof Q==="function"?Q:Q===!1?(N)=>N:C4;async function W(N){let E=JSON.stringify({entries:N}),S={"Content-Type":"application/json",...X};if(J)S["X-Craft-Signature"]=await I4(J,E);let e=0,w=1000;while(!O)try{let m=await fetch($,{method:"POST",headers:S,body:E});if(m.ok)return;if(m.status>=400&&m.status<500)return;throw Error(`HTTP ${m.status}`)}catch(m){if(e+=1,e>K)throw R=[...N,...R],x4(F,R),m;await new Promise((g4)=>{setTimeout(g4,w)}),w=Math.min(w*2,60000)}}async function T(){if(O||j)return j??void 0;let N=await s.flush();if(N.length>0)await s.clear();if(R=[...R,...N.map((S)=>U(S))],R.length===0)return;let E=R;return R=[],x4(F,R),j=W(E).catch(()=>{}).finally(()=>{j=null}),j}if(Y>0)V=setInterval(()=>{T().catch(()=>{})},Y);return{async flushNow(){await T()},stop(){if(O=!0,V)clearInterval(V);V=null},pending(){return[...R]}}}var M$={async isAvailable(){if(!G("iap"))return!1;return await window.craft.iap.isAvailable()},async getProducts(Z){if(!G("iap"))return[];let $=Array.isArray(Z)?Z:[String(Z)];return await window.craft.iap.getProducts($)},async purchase(Z){if(!G("iap"))return{queued:!1,productId:Z,reason:"IAP bridge not available"};let $=await window.craft.iap.purchase(Z);return{queued:!!($&&$.queued),productId:$?.productId,reason:$?.reason}},async restorePurchases(){if(!G("iap"))return{ok:!1};let Z=await window.craft.iap.restorePurchases();return{ok:!!(Z&&Z.ok)}},async finishTransaction(Z){if(!G("iap"))return;await window.craft.iap.finishTransaction(Z)},async getReceiptData(){if(!G("iap"))return null;let Z=await window.craft.iap.getReceiptData();return Z?String(Z):null},onPurchased(Z){return P("craft:iap:purchased",Z)},onFailed(Z){return P("craft:iap:failed",Z)},onRestored(Z){return P("craft:iap:restored",Z)},onProductsLoaded(Z){return P("craft:iap:productsLoaded",($)=>Z($.products||[]))},onRefunded(Z){return P("craft:iap:refunded",Z)},onSubscriptionStatusChanged(Z){return P("craft:iap:subscriptionStatusChanged",Z)},async getActiveSubscriptions(){if(!G("iap"))return[];let Z=window.craft.iap.getActiveSubscriptions;if(typeof Z!=="function")return[];let $=await Z();return Array.isArray($)?$:[]},async isEligibleForIntroOffer(Z){if(!G("iap"))return!1;let $=window.craft.iap.isEligibleForIntroOffer;if(typeof $!=="function")return!1;return!!await $(Z)}};var t={async startActivity(Z,$){if(!Z)throw Error("handoff.startActivity: type is required");if(!G("handoff"))return!1;let Y=await window.craft.handoff.startActivity(Z,$);return typeof Y==="boolean"?Y:!!(Y&&Y.ok)},async updateActivity(Z){if(!G("handoff"))return!1;let $=await window.craft.handoff.updateActivity(Z);return typeof $==="boolean"?$:!!($&&$.ok)},async stopActivity(){if(!G("handoff"))return;await window.craft.handoff.stopActivity()},async getCurrentActivity(){if(!G("handoff"))return null;let Z=await window.craft.handoff.getCurrentActivity();return Z&&typeof Z.type==="string"?Z:null},onIncoming(Z){return P("craft:handoff:incoming",Z)}};var _$={async start(Z,$){return t.startActivity(Z,{title:$?.title,webpageURL:$?.webpageURL,userInfo:$?.state})},async update(Z){return t.updateActivity({title:Z.title,webpageURL:Z.webpageURL,userInfo:Z.state})},async stop(){await t.stopActivity()}};var T$={async requestPermission(Z="whenInUse"){if(G("location"))return await window.craft.location.requestPermission(Z);if(typeof navigator<"u"&&navigator.geolocation)return"undetermined";return"not-supported"},async getAuthorization(){if(G("location"))return await window.craft.location.getAuthorization();return"unknown"},async getCurrentLocation(){if(G("location"))return await window.craft.location.getCurrentLocation();if(typeof navigator<"u"&&navigator.geolocation)return navigator.geolocation.getCurrentPosition((Z)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:Z.coords.latitude,longitude:Z.coords.longitude,altitude:Z.coords.altitude,horizontalAccuracy:Z.coords.accuracy,verticalAccuracy:Z.coords.altitudeAccuracy,speed:Z.coords.speed}}))},(Z)=>{window.dispatchEvent(new CustomEvent("craft:location:error",{detail:{message:Z.message||String(Z)}}))}),{requested:!0};return{requested:!1}},async startWatching(Z){if(G("location"))return await window.craft.location.startWatching(Z);if(typeof navigator<"u"&&navigator.geolocation){let $=navigator.geolocation.watchPosition((Y)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:Y.coords.latitude,longitude:Y.coords.longitude,altitude:Y.coords.altitude,horizontalAccuracy:Y.coords.accuracy,verticalAccuracy:Y.coords.altitudeAccuracy,speed:Y.coords.speed}}))});return window.__craftWebLocationWatchId=$,!0}return!1},async stopWatching(){if(G("location")){await window.craft.location.stopWatching();return}if(typeof navigator<"u"&&navigator.geolocation){let Z=window.__craftWebLocationWatchId;if(Z!=null)navigator.geolocation.clearWatch(Z),window.__craftWebLocationWatchId=null}},onUpdate(Z){return P("craft:location:update",Z)},onError(Z){return P("craft:location:error",Z)},onAuthChanged(Z){return P("craft:location:authChanged",Z)}};var N$={async captureScreen(){if(!G("screenCapture"))return null;let Z=await window.craft.screenCapture.captureScreen();return Z?String(Z):null},async captureWindow(Z){if(!G("screenCapture"))return null;if(!Number.isFinite(Z)||Z<=0)throw Error("captureWindow: id must be a positive number");let $=await window.craft.screenCapture.captureWindow(Z);return $?String($):null},async listWindows(){if(!G("screenCapture"))return[];return await window.craft.screenCapture.listWindows()}};var w4=250,B4=60000,wZ=2000,S4={sharing:!1,signals:{systemScreenShare:!1,remoteSession:!1,conferenceSharing:!1,screenRecording:!1},sources:[]};function E$(){return{...S4,signals:{...S4.signals},sources:[]}}var FZ={async getState(){if(!G("screenSharing"))return E$();return await window.craft.screenSharing.getState()},async watch(Z=wZ){let $=Math.min(B4,Math.max(w4,Math.round(Z)));if(!G("screenSharing"))return $;let Y=await window.craft.screenSharing.watch($);return Y&&Y.intervalMs||$},async stop(){if(!G("screenSharing"))return;await window.craft.screenSharing.unwatch()},onChange(Z){return P("craft:screenSharing:change",Z)}};async function A$(Z,$=wZ){let Y=FZ.onChange(Z);return await FZ.watch($),()=>{Y(),FZ.stop()}}var k$={supported:!1,isFocused:null,authorization:"unsupported"};function f4(){return{ok:!1,error:"Focus control is only available in a Craft window on macOS"}}var BZ={async getStatus(){if(!G("focus"))return{...k$};return await window.craft.focus.getStatus()},async requestAuthorization(){if(!G("focus"))return"unsupported";return await window.craft.focus.requestAuthorization()},async setEnabled(Z,$={}){if(!G("focus"))return f4();if(!(Z?$.onShortcut:$.offShortcut))return{ok:!1,error:`focus.setEnabled: no ${Z?"onShortcut":"offShortcut"} configured`};return await window.craft.focus.setEnabled(Z,$)},async runShortcut(Z){if(!G("focus"))return f4();if(!Z)throw Error("focus.runShortcut: name is required");return await window.craft.focus.runShortcut(Z)},async listShortcuts(){if(!G("focus"))return[];return await window.craft.focus.listShortcuts()},async listShortcutsResult(){if(!G("focus"))return{canList:!1,shortcuts:[]};let $=await window.craft.focus.listShortcutsResult?.();return{canList:Boolean($?.canList),shortcuts:$?.shortcuts??[]}}};async function H$(...Z){if(Z.length===0)return!1;let $=new Set(await BZ.listShortcuts());return Z.every((Y)=>$.has(Y))}async function x$(...Z){if(Z.length===0)return!1;let{canList:$,shortcuts:Y}=await BZ.listShortcutsResult();if(!$)return"unknown";let J=new Set(Y);return Z.every((Q)=>J.has(Q))}var C$={async start(Z=0,$="127.0.0.1"){if(!G("localServer"))return{port:0,started:!1,reason:"bridge unavailable"};return await window.craft.localServer.start(Z,$)},async stop(){if(!G("localServer"))return;await window.craft.localServer.stop()},async respond(Z){if(!G("localServer"))return;await window.craft.localServer.respond(Z||{status:200,body:"OK"})},onRequest(Z){return P("craft:localServer:request",Z)},async awaitOAuthCallback(Z={}){M("localServer");let{port:$=0,host:Y="127.0.0.1",timeoutMs:J=300000,successHTML:Q}=Z,X=await this.start($,Y);if(!X.started)throw Error(`localServer: start failed${X.reason?` \u2014 ${X.reason}`:""}`);return new Promise((K,z)=>{let F=setTimeout(()=>{R(),this.stop().catch(()=>{}),z(Error("localServer: OAuth callback timed out"))},J),R=this.onRequest(({url:O})=>{clearTimeout(F),R();let V=Q??`<!doctype html><meta charset="utf-8"><title>Done</title>
928
- <style>body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f5f5f7}</style>
929
- <div><h1>You can close this tab.</h1><p>Returning to the app\u2026</p></div>
930
- <script>setTimeout(()=>window.close(),1500)</script>`;this.respond({status:200,body:V,contentType:"text/html; charset=utf-8"}).catch(()=>{}).finally(()=>this.stop().catch(()=>{})),K({url:O,port:X.port})})})}};var I$={async isAvailable(){if(!G("biometric"))return!1;return await window.craft.biometric.isAvailable()},async getBiometryType(){if(!G("biometric"))return"none";return await window.craft.biometric.getBiometryType()},async evaluate(Z,$){if(!Z)throw Error("biometric.evaluate: reason is required");if(!G("biometric"))return{success:!1,errorCode:-1};return await window.craft.biometric.evaluate(Z,$)}};var k=null,S$={async play(Z,$){if(G("audio"))return await window.craft.audio.play(Z,$);if(typeof window>"u"||typeof Audio>"u")return!1;if(k)k.pause(),k=null;if(k=new Audio(Z),$?.volume!=null)k.volume=$.volume;if($?.loops)k.loop=!0;try{return await k.play(),!0}catch{return!1}},async playSystemSound(Z){if(G("audio"))return await window.craft.audio.playSystemSound(Z);if(typeof window>"u"||typeof Audio>"u")return!1;try{return k=new Audio(`/System/Library/Sounds/${Z}.aiff`),await k.play(),!0}catch{return!1}},async stop(){if(G("audio")){await window.craft.audio.stop();return}if(k)k.pause(),k.currentTime=0,k=null},async isPlaying(){if(G("audio"))return await window.craft.audio.isPlaying();return!!(k&&!k.paused)},async startRecording(Z,$){if(G("audio"))return await window.craft.audio.startRecording(Z,$);return!1},async stopRecording(){if(G("audio"))await window.craft.audio.stopRecording()},async isRecording(){if(G("audio"))return await window.craft.audio.isRecording();return!1}};var w$={async execute(Z){if(!Z)throw Error("appleScript.execute: source is required");if(!G("appleScript"))return{ok:!1};return await window.craft.appleScript.execute(Z)}};var B$={async getDefault(Z){if(!Z)throw Error("fileAssociations.getDefault: uti is required");if(!G("fileAssociations"))return null;let $=await window.craft.fileAssociations.getDefault(Z);return $?String($):null},async setDefault(Z,$){if(!Z||!$)throw Error("fileAssociations.setDefault: uti and bundleId are required");if(!G("fileAssociations"))return!1;return await window.craft.fileAssociations.setDefault(Z,$)}};var f$={async get(Z){if(!Z)throw Error("tags.get: path is required");if(!G("tags"))return[];return await window.craft.tags.get(Z)},async set(Z,$){if(!Z)throw Error("tags.set: path is required");if(!G("tags"))return!1;let Y=Array.isArray($)?$:[String($)];return await window.craft.tags.set(Z,Y)},async clear(Z){if(!Z)throw Error("tags.clear: path is required");if(!G("tags"))return!1;return await window.craft.tags.clear(Z)}};var v$={async countPages(Z){if(!Z)throw Error("pdf.countPages: path is required");if(!G("pdf"))return 0;return await window.craft.pdf.countPages(Z)},async extractText(Z){if(!Z)throw Error("pdf.extractText: path is required");if(!G("pdf"))return"";return await window.craft.pdf.extractText(Z)}};var y$={async debug(Z){if(G("log"))await window.craft.log.debug(Z);else console.debug(Z)},async info(Z){if(G("log"))await window.craft.log.info(Z);else console.info(Z)},async warn(Z){if(G("log"))await window.craft.log.warn(Z);else console.warn(Z)},async error(Z){if(G("log"))await window.craft.log.error(Z);else console.error(Z)}};var g$={async browse(Z){if(!G("bonjour"))return{started:!1,reason:"bridge unavailable"};return await window.craft.bonjour.browse(Z)},async stop(){if(G("bonjour"))await window.craft.bonjour.stop()},onFound(Z){return P("craft:bonjour:found",Z)},onLost(Z){return P("craft:bonjour:lost",Z)}};var b$={async index(Z){if(!G("spotlight"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.spotlight.index(Z)},async remove(Z){if(!G("spotlight"))return{ok:!1};return await window.craft.spotlight.remove(Z)},async removeAll(){if(!G("spotlight"))return{ok:!1};return await window.craft.spotlight.removeAll()}};var u$={async isAvailable(){if(!G("speechRecognition"))return!1;return await window.craft.speechRecognition.isAvailable()},async start(Z){if(!G("speechRecognition"))return{started:!1,reason:"bridge unavailable"};return await window.craft.speechRecognition.start(Z)},async stop(){if(G("speechRecognition"))await window.craft.speechRecognition.stop()},onPartial(Z){return P("craft:speechRecognition:partial",Z)},onFinal(Z){return P("craft:speechRecognition:final",Z)}};var m$={async recognizeText(Z){if(!Z)throw Error("vision.recognizeText: path is required");if(!G("vision"))return[];return await window.craft.vision.recognizeText(Z)},async detectFaces(Z){if(!Z)throw Error("vision.detectFaces: path is required");if(!G("vision"))return[];return await window.craft.vision.detectFaces(Z)},async detectBarcodes(Z){if(!Z)throw Error("vision.detectBarcodes: path is required");if(!G("vision"))return[];return await window.craft.vision.detectBarcodes(Z)}};var h$={async listSources(){if(!G("midi"))return[];return await window.craft.midi.listSources()},async listDestinations(){if(!G("midi"))return[];return await window.craft.midi.listDestinations()},async send(Z,$){if(!G("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.send(Z,$)},async subscribe(Z){if(!G("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.subscribe(Z)},async unsubscribe(Z){if(!G("midi"))return{ok:!1};return await window.craft.midi.unsubscribe(Z)},onMessage(Z){return P("craft:midi:message",Z)}};var c$={async loadModel(Z,$){if(!Z||!$)throw Error("coreml.loadModel: id and path are required");if(!G("coreml"))return!1;return await window.craft.coreml.loadModel(Z,$)},async unloadModel(Z){if(!G("coreml"))return;await window.craft.coreml.unloadModel(Z)},async predict(Z,$){if(!Z)throw Error("coreml.predict: id is required");if(!G("coreml"))return null;return await window.craft.coreml.predict(Z,$)}};var p$={async listCameras(){if(!G("continuityCamera"))return[];return await window.craft.continuityCamera.listCameras()}};var l$={async register(Z){if(!Z)throw Error("serviceMenu.register: name is required");if(!G("serviceMenu"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serviceMenu.register(Z)},async unregister(Z){if(!Z)throw Error("serviceMenu.unregister: name is required");if(!G("serviceMenu"))return;await window.craft.serviceMenu.unregister(Z)},onInvoked(Z){return P("craft:serviceMenu:invoked",Z)}};var d$={async list(){if(!G("serial"))return[];return await window.craft.serial.list()},async open(Z,$=9600){if(!Z)throw Error("serial.open: path is required");if(!G("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.open(Z,$)},async write(Z,$){if(!Z)throw Error("serial.write: id is required");if(!G("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.write(Z,$)},async close(Z){if(!G("serial"))return;await window.craft.serial.close(Z)},onData(Z){return P("craft:serial:data",Z)}};var v4=[{name:"fs",support:"native"},{name:"shell",support:"native"},{name:"system",support:"all"},{name:"clipboard",support:"all"},{name:"dialog",support:"all"},{name:"window",support:"native"},{name:"tray",support:"native"},{name:"menu",support:"native"},{name:"theme",support:"all"},{name:"screen",support:"all"},{name:"network",support:"all"},{name:"power",support:"all"},{name:"battery",support:"all"},{name:"notifications",support:"all"},{name:"globalShortcuts",support:"native"},{name:"autolaunch",support:"native"},{name:"appInfo",support:"all"},{name:"localServer",support:"native"},{name:"bluetooth",support:"native"},{name:"crashReporter",support:"all"},{name:"updater",support:"native"},{name:"iap",support:"macos"},{name:"keychain",support:"native"},{name:"log",support:"all"},{name:"biometric",support:"macos"},{name:"location",support:"macos"},{name:"audio",support:"macos"},{name:"deepLink",support:"native"},{name:"handoff",support:"macos"},{name:"liveActivities",support:"macos"},{name:"touchbar",support:"macos"},{name:"dragOut",support:"macos"},{name:"appleScript",support:"macos"},{name:"fileAssociations",support:"native"},{name:"tags",support:"macos"},{name:"pdf",support:"macos"},{name:"bonjour",support:"macos"},{name:"spotlight",support:"macos"},{name:"speechRecognition",support:"macos"},{name:"vision",support:"macos"},{name:"midi",support:"macos"},{name:"coreml",support:"macos"},{name:"continuityCamera",support:"macos"},{name:"serviceMenu",support:"macos"},{name:"serial",support:"native"}];function r$(){return v4.map(({name:Z,support:$})=>({name:Z,support:$,available:G(Z)}))}function y4(Z){let $=v4.find((Y)=>Y.name===Z);if(!$)return;return{...$,available:G(Z)}}function n$(Z){let $=y4(Z);return!!$&&$.available}export{n9 as windowEvents,A$ as watchScreenSharing,m$ as vision,c8 as verifyBundleTrust,r9 as updater,V4 as unregisterHotkey,M9 as unregisterAllHotkeys,Y8 as triggerTrayAction,F$ as touchbar,u9 as theme,f$ as tags,Z$ as system,h8 as swapBundle,a9 as standardMenus,b$ as spotlight,u$ as speechRecognition,V$ as speech,I4 as signPayload,A4 as sidebar,r4 as showWarningToast,m6 as showWarningModal,P8 as showWarningDialog,d as showToast,d4 as showSuccessToast,c6 as showSuccessModal,R8 as showSaveDialog,bZ as showQuestionModal,F8 as showOpenDialog,h as showModal,r as showMessageBox,l4 as showInfoToast,gZ as showInfoModal,n4 as showErrorToast,h6 as showErrorModal,q8 as showErrorDialog,V8 as showConfirmDialog,j8 as showColorPicker,O8 as showAlertDialog,jZ as showAlert,g9 as shell,_8 as setDesktopConfig,O9 as setAutoLaunch,l$ as serviceMenu,d$ as serial,FZ as screenSharing,N$ as screenCapture,$$ as screen,l8 as runningBundleTeamId,y8 as resolveCraftBinary,N8 as resetDesktopConfig,u4 as requestNotificationPermission,$4 as relaunchBundle,D9 as registerHotkey,C4 as redactPII,DZ as readBundleIdentity,Z4 as quitLauncher,d6 as prompt,X$ as printing,J$ as permissions,v$ as pdf,j4 as parseShortcut,f8 as packageApp,B8 as pack,C8 as openDevWindow,o4 as notify,C9 as notifications,d9 as network,K$ as nativeWindow,z$ as nativeAutoLaunch,h$ as midi,t9 as menu,y$ as log,T$ as location,C$ as localServer,_$ as liveActivities,Y$ as keychain,S8 as isWebviewAvailable,c9 as isDragOutAvailable,n8 as isCaffeinated,n$ as isAvailable,V9 as isAutoLaunchEnabled,M$ as iap,H$ as hasFocusShortcuts,t as handoff,b9 as globalShortcuts,tZ as githubReleaseAssetUrl,sZ as githubLatestAssetUrl,w8 as getWindowBridgeScript,k8 as getWindow,$8 as getTrayInstance,G8 as getTrayBridgeScript,J8 as getSimulatedTrayHTML,_9 as getRegisteredHotkeys,U8 as getDialogBridgeScript,T8 as getDesktopConfig,y4 as getCapability,r$ as getCapabilities,o8 as getCaffeinateStatus,A8 as getActiveWindowIds,Z8 as getActiveTrayInstances,r6 as getActiveModalCount,s4 as getActiveAlertCount,aZ as generateUpdateManifest,S9 as fs,A9 as formatTime,P9 as formatShortcut,a8 as formatRemainingTime,i8 as formatDuration,k9 as formatCompact,x$ as focusShortcutsReady,BZ as focus,B$ as fileAssociations,m8 as extractBundle,h9 as dragOut,i4 as dismissAllAlerts,a4 as dismissAlertById,E9 as delay,p9 as deepLinks,J4 as decaffeinate,I8 as createWindowWithHTML,x8 as createWindow,B6 as createWebView,k6 as createTreeView,L6 as createTooltip,T9 as createTimer,V6 as createTimePicker,Z6 as createTextInput,z6 as createTabs,A6 as createTable,lZ as createSystemTray,T6 as createStepper,M6 as createSplitView,Y6 as createSlider,d8 as createSelfUpdater,D6 as createScrollView,F6 as createRating,R6 as createRadioButton,J6 as createProgressBar,Q9 as createPreferences,N6 as createModalComponent,e6 as createMenubar,I6 as createMediaPlayer,E6 as createListView,P6 as createLabel,N9 as createInterval,U6 as createImageView,eZ as createGitHubUpdater,p8 as createGitHubUpdateManifest,w6 as createFileExplorer,K6 as createDropdown,O6 as createDatePicker,H6 as createDataGrid,j6 as createColorPicker,C6 as createCodeEditor,W6 as createChip,$6 as createCheckbox,x6 as createChart,X6 as createCard,e4 as createButton,G6 as createBadge,Q6 as createAvatar,q6 as createAutocomplete,_6 as createAccordion,s as crashReporter,LZ as craftWindowArguments,v8 as craftBinaryNotFoundMessage,c$ as coreml,p$ as continuityCamera,e9 as contextMenu,p6 as confirm,H8 as closeAllWindows,n6 as closeAllModals,H9 as clipboard,u8 as clearQuarantine,b8 as canReplaceBundle,r8 as caffeinate,GZ as bundlePathForExecutable,g$ as bonjour,O$ as bluetooth,I$ as biometric,l9 as battery,S$ as audio,w$ as appleScript,o9 as appInfo,l6 as alert,iZ as UPDATE_MANIFEST_ASSET,Q8 as TRAY_MENU_STYLES,t4 as TOAST_STYLES,o6 as MODAL_STYLES,w4 as MIN_WATCH_INTERVAL_MS,B4 as MAX_WATCH_INTERVAL_MS,wZ as DEFAULT_WATCH_INTERVAL_MS,v6 as COMPONENT_STYLES,oZ as AutoUpdater,f6 as AVAILABLE_COMPONENTS};