@ohos-ports/stacksjs-stx 0.2.287-beta.0

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 (946) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +1042 -0
  3. package/dist/a11y.d.ts +256 -0
  4. package/dist/a11y.js +671 -0
  5. package/dist/analytics.d.ts +40 -0
  6. package/dist/analytics.js +159 -0
  7. package/dist/analyzer.d.ts +68 -0
  8. package/dist/analyzer.js +240 -0
  9. package/dist/animation.d.ts +123 -0
  10. package/dist/animation.js +688 -0
  11. package/dist/app-shell.d.ts +76 -0
  12. package/dist/app-shell.js +209 -0
  13. package/dist/app.d.ts +65 -0
  14. package/dist/app.js +79 -0
  15. package/dist/appearance-bootstrap.d.ts +54 -0
  16. package/dist/appearance-bootstrap.js +92 -0
  17. package/dist/asset-roots.d.ts +32 -0
  18. package/dist/asset-roots.js +7 -0
  19. package/dist/assets.d.ts +21 -0
  20. package/dist/assets.js +155 -0
  21. package/dist/ast.d.ts +265 -0
  22. package/dist/ast.js +630 -0
  23. package/dist/async-components.d.ts +123 -0
  24. package/dist/async-components.js +428 -0
  25. package/dist/auth.d.ts +13 -0
  26. package/dist/auth.js +12 -0
  27. package/dist/broadcasting.d.ts +77 -0
  28. package/dist/broadcasting.js +103 -0
  29. package/dist/browser-composables.d.ts +348 -0
  30. package/dist/browser-composables.js +606 -0
  31. package/dist/browser-core-imports.d.ts +12 -0
  32. package/dist/browser-core-imports.js +28 -0
  33. package/dist/build-assets.d.ts +32 -0
  34. package/dist/build-assets.js +29 -0
  35. package/dist/build-externalize-repeated.d.ts +34 -0
  36. package/dist/build-externalize-repeated.js +101 -0
  37. package/dist/build-externalize.d.ts +73 -0
  38. package/dist/build-externalize.js +80 -0
  39. package/dist/build-id.d.ts +57 -0
  40. package/dist/build-id.js +25 -0
  41. package/dist/build-message.d.ts +81 -0
  42. package/dist/build-message.js +65 -0
  43. package/dist/build-mode-detector.d.ts +26 -0
  44. package/dist/build-mode-detector.js +50 -0
  45. package/dist/build-optimizer.d.ts +101 -0
  46. package/dist/build-optimizer.js +433 -0
  47. package/dist/build-views.d.ts +56 -0
  48. package/dist/build-views.js +180 -0
  49. package/dist/build.d.ts +31 -0
  50. package/dist/build.js +34 -0
  51. package/dist/builtins/attrs.d.ts +49 -0
  52. package/dist/builtins/attrs.js +39 -0
  53. package/dist/builtins/drawer.d.ts +24 -0
  54. package/dist/builtins/drawer.js +37 -0
  55. package/dist/builtins/escape.d.ts +12 -0
  56. package/dist/builtins/escape.js +3 -0
  57. package/dist/builtins/icon.d.ts +45 -0
  58. package/dist/builtins/icon.js +100 -0
  59. package/dist/builtins/image-delivery.d.ts +16 -0
  60. package/dist/builtins/image-delivery.js +115 -0
  61. package/dist/builtins/image-placeholder.d.ts +78 -0
  62. package/dist/builtins/image-placeholder.js +137 -0
  63. package/dist/builtins/index.d.ts +26 -0
  64. package/dist/builtins/index.js +34 -0
  65. package/dist/builtins/modal.d.ts +26 -0
  66. package/dist/builtins/modal.js +38 -0
  67. package/dist/builtins/safe-image.d.ts +44 -0
  68. package/dist/builtins/safe-image.js +45 -0
  69. package/dist/builtins/stx-image.d.ts +29 -0
  70. package/dist/builtins/stx-image.js +222 -0
  71. package/dist/builtins/stx-link.d.ts +11 -0
  72. package/dist/builtins/stx-link.js +35 -0
  73. package/dist/builtins/stx-loading-indicator.d.ts +13 -0
  74. package/dist/builtins/stx-loading-indicator.js +35 -0
  75. package/dist/builtins/suspense.d.ts +30 -0
  76. package/dist/builtins/suspense.js +24 -0
  77. package/dist/builtins/toast.d.ts +19 -0
  78. package/dist/builtins/toast.js +42 -0
  79. package/dist/builtins/tooltip.d.ts +18 -0
  80. package/dist/builtins/tooltip.js +106 -0
  81. package/dist/builtins/transition-group.d.ts +27 -0
  82. package/dist/builtins/transition-group.js +22 -0
  83. package/dist/bun-shim.js +496 -0
  84. package/dist/bundle-analyzer/collector.d.ts +66 -0
  85. package/dist/bundle-analyzer/collector.js +233 -0
  86. package/dist/bundle-analyzer/index.d.ts +98 -0
  87. package/dist/bundle-analyzer/index.js +82 -0
  88. package/dist/bundle-analyzer/report.d.ts +39 -0
  89. package/dist/bundle-analyzer/report.js +318 -0
  90. package/dist/bundle-analyzer/treemap.d.ts +19 -0
  91. package/dist/bundle-analyzer/treemap.js +594 -0
  92. package/dist/bundle-analyzer.js +499 -0
  93. package/dist/caching.d.ts +69 -0
  94. package/dist/caching.js +135 -0
  95. package/dist/chunk-0y46fbkx.js +3 -0
  96. package/dist/chunk-122tyfre.js +2 -0
  97. package/dist/chunk-19nfvxfw.js +43 -0
  98. package/dist/chunk-1kah92n2.js +3 -0
  99. package/dist/chunk-1kms3b9d.js +2 -0
  100. package/dist/chunk-1q4y74mh.js +1194 -0
  101. package/dist/chunk-248e84r1.js +4 -0
  102. package/dist/chunk-24ps8kft.js +2 -0
  103. package/dist/chunk-2et5hxfv.js +2 -0
  104. package/dist/chunk-2r1rd8f0.js +2 -0
  105. package/dist/chunk-2tk1zkrz.js +2 -0
  106. package/dist/chunk-38ejahd9.js +3 -0
  107. package/dist/chunk-3zv4wz87.js +2 -0
  108. package/dist/chunk-4122k1bh.js +2 -0
  109. package/dist/chunk-45az9zht.js +2 -0
  110. package/dist/chunk-4qr85f07.js +2 -0
  111. package/dist/chunk-4ww3znrr.js +15 -0
  112. package/dist/chunk-54st8g2j.js +397 -0
  113. package/dist/chunk-58f0mthg.js +3 -0
  114. package/dist/chunk-5a19dhx5.js +2 -0
  115. package/dist/chunk-5kk8gsj2.js +3 -0
  116. package/dist/chunk-5w1e3yxs.js +499 -0
  117. package/dist/chunk-6gdycmxr.js +2 -0
  118. package/dist/chunk-6hmnaza7.js +4473 -0
  119. package/dist/chunk-71t0yan0.js +5 -0
  120. package/dist/chunk-74cv4ta1.js +3 -0
  121. package/dist/chunk-74v15e8z.js +2 -0
  122. package/dist/chunk-7b329e5v.js +3 -0
  123. package/dist/chunk-7q9mwh4v.js +84 -0
  124. package/dist/chunk-866y9d8b.js +8169 -0
  125. package/dist/chunk-8fwerspy.js +2 -0
  126. package/dist/chunk-8mjdpr94.js +147 -0
  127. package/dist/chunk-92mj1t26.js +60 -0
  128. package/dist/chunk-9b22663r.js +2 -0
  129. package/dist/chunk-9hjdgm4d.js +2 -0
  130. package/dist/chunk-9n0gvfrg.js +4 -0
  131. package/dist/chunk-9wr7zcad.js +18 -0
  132. package/dist/chunk-9y0g8kzt.js +358 -0
  133. package/dist/chunk-a0nfbmeh.js +3 -0
  134. package/dist/chunk-acn1b56m.js +1280 -0
  135. package/dist/chunk-awkq3xfx.js +2 -0
  136. package/dist/chunk-b6ej2fdf.js +1814 -0
  137. package/dist/chunk-b8rrnqry.js +2 -0
  138. package/dist/chunk-bfqfs07m.js +3022 -0
  139. package/dist/chunk-bs6kapy7.js +2 -0
  140. package/dist/chunk-btav940g.js +2 -0
  141. package/dist/chunk-bz820epz.js +3 -0
  142. package/dist/chunk-ccspd3mc.js +2 -0
  143. package/dist/chunk-csbgwaa5.js +2 -0
  144. package/dist/chunk-d8t4sjsp.js +2 -0
  145. package/dist/chunk-dap191q2.js +2 -0
  146. package/dist/chunk-de7fye10.js +4 -0
  147. package/dist/chunk-dgrt76d2.js +2 -0
  148. package/dist/chunk-dhh5q7qt.js +3 -0
  149. package/dist/chunk-dsffsqnt.js +2 -0
  150. package/dist/chunk-dtq7y5ym.js +2 -0
  151. package/dist/chunk-fed3xsp9.js +3 -0
  152. package/dist/chunk-ferav3bw.js +19 -0
  153. package/dist/chunk-fvhm8psm.js +3 -0
  154. package/dist/chunk-g4vpzv6b.js +2 -0
  155. package/dist/chunk-g9csmj0s.js +2 -0
  156. package/dist/chunk-gtcrpmz1.js +2 -0
  157. package/dist/chunk-h4xh8cms.js +4 -0
  158. package/dist/chunk-h8yqsz9m.js +2 -0
  159. package/dist/chunk-hcq5dw7a.js +2 -0
  160. package/dist/chunk-hm0xha6c.js +12 -0
  161. package/dist/chunk-hpybjwwf.js +8 -0
  162. package/dist/chunk-jegt35zh.js +2 -0
  163. package/dist/chunk-jr3jp3ev.js +8 -0
  164. package/dist/chunk-k56rjjc0.js +24 -0
  165. package/dist/chunk-kdh37tp8.js +194 -0
  166. package/dist/chunk-kxzb4et3.js +29 -0
  167. package/dist/chunk-mf4n3x1j.js +14 -0
  168. package/dist/chunk-mkd9kjgb.js +3 -0
  169. package/dist/chunk-mxfh1nxg.js +2 -0
  170. package/dist/chunk-n3ggrhb3.js +3 -0
  171. package/dist/chunk-nkb3scg6.js +8 -0
  172. package/dist/chunk-nnd4wq8j.js +231 -0
  173. package/dist/chunk-nsp1cw38.js +11 -0
  174. package/dist/chunk-nx5qkm8k.js +30 -0
  175. package/dist/chunk-p3242nck.js +2 -0
  176. package/dist/chunk-p98kfh94.js +2 -0
  177. package/dist/chunk-pkaabd8h.js +3 -0
  178. package/dist/chunk-pzm13sdc.js +3 -0
  179. package/dist/chunk-q4p5k2p3.js +2 -0
  180. package/dist/chunk-q9n5swx7.js +3 -0
  181. package/dist/chunk-qc1f74ek.js +3 -0
  182. package/dist/chunk-qpyjak7z.js +2 -0
  183. package/dist/chunk-qr82je1m.js +22 -0
  184. package/dist/chunk-qy73j6m4.js +288 -0
  185. package/dist/chunk-qzkhpsam.js +505 -0
  186. package/dist/chunk-r3ayvdz3.js +2 -0
  187. package/dist/chunk-r7r66978.js +2 -0
  188. package/dist/chunk-rbb7dvja.js +30 -0
  189. package/dist/chunk-refwkt87.js +71 -0
  190. package/dist/chunk-rj4kajww.js +2 -0
  191. package/dist/chunk-rp4rjjmf.js +2 -0
  192. package/dist/chunk-se0p17c2.js +898 -0
  193. package/dist/chunk-sj9pmene.js +2 -0
  194. package/dist/chunk-sscwkffs.js +2 -0
  195. package/dist/chunk-svpqxn2c.js +2 -0
  196. package/dist/chunk-t6nseeb9.js +351 -0
  197. package/dist/chunk-t8y1ggdy.js +2 -0
  198. package/dist/chunk-tndhnk9e.js +2 -0
  199. package/dist/chunk-v5e1gxwm.js +3 -0
  200. package/dist/chunk-vqxmxgaj.js +4 -0
  201. package/dist/chunk-vrrax298.js +2 -0
  202. package/dist/chunk-w3ycm4na.js +3 -0
  203. package/dist/chunk-wcm80anz.js +321 -0
  204. package/dist/chunk-wrzwgkbx.js +22 -0
  205. package/dist/chunk-x650vjcp.js +302 -0
  206. package/dist/chunk-xgnc1wy6.js +116 -0
  207. package/dist/chunk-xpp135ad.js +11 -0
  208. package/dist/chunk-xttsqmkm.js +216 -0
  209. package/dist/chunk-y11cxbxd.js +3757 -0
  210. package/dist/chunk-y7m2dpd3.js +341 -0
  211. package/dist/chunk-y98jsjqq.js +2 -0
  212. package/dist/chunk-ya386h70.js +2 -0
  213. package/dist/chunk-ydrz60kr.js +2 -0
  214. package/dist/chunk-ypmqf7tm.js +4 -0
  215. package/dist/chunk-z4jhj5e5.js +28 -0
  216. package/dist/chunk-zg75gjns.js +2 -0
  217. package/dist/chunk-zqqx1qaj.js +2 -0
  218. package/dist/cli-flags.d.ts +34 -0
  219. package/dist/cli-flags.js +20 -0
  220. package/dist/cli.js +174 -0
  221. package/dist/client/directive.d.ts +17 -0
  222. package/dist/client/directive.js +14 -0
  223. package/dist/client/index.d.ts +7 -0
  224. package/dist/client/index.js +2 -0
  225. package/dist/client-helpers.d.ts +317 -0
  226. package/dist/client-helpers.js +312 -0
  227. package/dist/client-script-bundler.d.ts +103 -0
  228. package/dist/client-script-bundler.js +390 -0
  229. package/dist/client-script.d.ts +215 -0
  230. package/dist/client-script.js +865 -0
  231. package/dist/client.d.ts +21 -0
  232. package/dist/client.js +73 -0
  233. package/dist/codemod.d.ts +33 -0
  234. package/dist/codemod.js +244 -0
  235. package/dist/color-mode-boot.d.ts +92 -0
  236. package/dist/color-mode-boot.js +72 -0
  237. package/dist/component-client-factories.d.ts +33 -0
  238. package/dist/component-client-factories.js +77 -0
  239. package/dist/component-hmr.d.ts +107 -0
  240. package/dist/component-hmr.js +585 -0
  241. package/dist/component-library.d.ts +38 -0
  242. package/dist/component-library.js +994 -0
  243. package/dist/component-processing.d.ts +198 -0
  244. package/dist/component-processing.js +677 -0
  245. package/dist/component-registry.d.ts +127 -0
  246. package/dist/component-registry.js +90 -0
  247. package/dist/component-renderer.d.ts +52 -0
  248. package/dist/component-renderer.js +790 -0
  249. package/dist/components/StxImage.stx +12 -0
  250. package/dist/components/StxLink.stx +18 -0
  251. package/dist/components.d.ts +28 -0
  252. package/dist/components.js +213 -0
  253. package/dist/composable-loader.d.ts +62 -0
  254. package/dist/composable-loader.js +190 -0
  255. package/dist/composables/index.d.ts +417 -0
  256. package/dist/composables/index.js +222 -0
  257. package/dist/composables/use-battery.d.ts +46 -0
  258. package/dist/composables/use-battery.js +101 -0
  259. package/dist/composables/use-broadcast-channel.d.ts +59 -0
  260. package/dist/composables/use-broadcast-channel.js +80 -0
  261. package/dist/composables/use-channel.d.ts +67 -0
  262. package/dist/composables/use-channel.js +124 -0
  263. package/dist/composables/use-clipboard.d.ts +30 -0
  264. package/dist/composables/use-clipboard.js +90 -0
  265. package/dist/composables/use-color-mode.d.ts +67 -0
  266. package/dist/composables/use-color-mode.js +152 -0
  267. package/dist/composables/use-cookie.d.ts +59 -0
  268. package/dist/composables/use-cookie.js +86 -0
  269. package/dist/composables/use-device-orientation.d.ts +116 -0
  270. package/dist/composables/use-device-orientation.js +181 -0
  271. package/dist/composables/use-event-listener.d.ts +35 -0
  272. package/dist/composables/use-event-listener.js +27 -0
  273. package/dist/composables/use-event-source.d.ts +90 -0
  274. package/dist/composables/use-event-source.js +166 -0
  275. package/dist/composables/use-eye-dropper.d.ts +117 -0
  276. package/dist/composables/use-eye-dropper.js +142 -0
  277. package/dist/composables/use-fetch.d.ts +59 -0
  278. package/dist/composables/use-fetch.js +273 -0
  279. package/dist/composables/use-form.d.ts +91 -0
  280. package/dist/composables/use-form.js +112 -0
  281. package/dist/composables/use-fullscreen.d.ts +47 -0
  282. package/dist/composables/use-fullscreen.js +110 -0
  283. package/dist/composables/use-geolocation.d.ts +62 -0
  284. package/dist/composables/use-geolocation.js +101 -0
  285. package/dist/composables/use-idle.d.ts +102 -0
  286. package/dist/composables/use-idle.js +182 -0
  287. package/dist/composables/use-intersection-observer.d.ts +83 -0
  288. package/dist/composables/use-intersection-observer.js +168 -0
  289. package/dist/composables/use-keyboard.d.ts +100 -0
  290. package/dist/composables/use-keyboard.js +224 -0
  291. package/dist/composables/use-media-query.d.ts +56 -0
  292. package/dist/composables/use-media-query.js +62 -0
  293. package/dist/composables/use-meta.d.ts +35 -0
  294. package/dist/composables/use-meta.js +48 -0
  295. package/dist/composables/use-mouse.d.ts +65 -0
  296. package/dist/composables/use-mouse.js +286 -0
  297. package/dist/composables/use-mutation-observer.d.ts +101 -0
  298. package/dist/composables/use-mutation-observer.js +129 -0
  299. package/dist/composables/use-network.d.ts +40 -0
  300. package/dist/composables/use-network.js +85 -0
  301. package/dist/composables/use-notification.d.ts +98 -0
  302. package/dist/composables/use-notification.js +94 -0
  303. package/dist/composables/use-permissions.d.ts +119 -0
  304. package/dist/composables/use-permissions.js +132 -0
  305. package/dist/composables/use-query.d.ts +48 -0
  306. package/dist/composables/use-query.js +0 -0
  307. package/dist/composables/use-resize-observer.d.ts +60 -0
  308. package/dist/composables/use-resize-observer.js +157 -0
  309. package/dist/composables/use-router.d.ts +80 -0
  310. package/dist/composables/use-router.js +105 -0
  311. package/dist/composables/use-scroll-lock.d.ts +13 -0
  312. package/dist/composables/use-scroll-lock.js +55 -0
  313. package/dist/composables/use-share.d.ts +74 -0
  314. package/dist/composables/use-share.js +104 -0
  315. package/dist/composables/use-speech.d.ts +117 -0
  316. package/dist/composables/use-speech.js +294 -0
  317. package/dist/composables/use-storage.d.ts +69 -0
  318. package/dist/composables/use-storage.js +196 -0
  319. package/dist/composables/use-text-selection.d.ts +121 -0
  320. package/dist/composables/use-text-selection.js +205 -0
  321. package/dist/composables/use-timer.d.ts +92 -0
  322. package/dist/composables/use-timer.js +193 -0
  323. package/dist/composables/use-utilities.d.ts +103 -0
  324. package/dist/composables/use-utilities.js +176 -0
  325. package/dist/composables/use-wake-lock.d.ts +85 -0
  326. package/dist/composables/use-wake-lock.js +122 -0
  327. package/dist/composables/use-websocket.d.ts +70 -0
  328. package/dist/composables/use-websocket.js +165 -0
  329. package/dist/composables/use-window.d.ts +84 -0
  330. package/dist/composables/use-window.js +163 -0
  331. package/dist/composables.d.ts +287 -0
  332. package/dist/composables.js +562 -0
  333. package/dist/composition-api.d.ts +197 -0
  334. package/dist/composition-api.js +199 -0
  335. package/dist/compression.d.ts +30 -0
  336. package/dist/compression.js +107 -0
  337. package/dist/computed.d.ts +138 -0
  338. package/dist/computed.js +382 -0
  339. package/dist/conditionals.d.ts +48 -0
  340. package/dist/conditionals.js +626 -0
  341. package/dist/config.d.ts +77 -0
  342. package/dist/config.js +828 -0
  343. package/dist/cookie-serialize.d.ts +40 -0
  344. package/dist/cookie-serialize.js +18 -0
  345. package/dist/craft-bridge.d.ts +525 -0
  346. package/dist/craft-bridge.js +511 -0
  347. package/dist/craft-compiler.d.ts +245 -0
  348. package/dist/craft-compiler.js +810 -0
  349. package/dist/craft-components.d.ts +739 -0
  350. package/dist/craft-components.js +1074 -0
  351. package/dist/craft-entry.d.ts +6 -0
  352. package/dist/craft-entry.js +9 -0
  353. package/dist/craft-ssr.d.ts +147 -0
  354. package/dist/craft-ssr.js +559 -0
  355. package/dist/craft.js +9 -0
  356. package/dist/csp.d.ts +295 -0
  357. package/dist/csp.js +220 -0
  358. package/dist/csrf.d.ts +38 -0
  359. package/dist/csrf.js +38 -0
  360. package/dist/custom-directives.d.ts +5 -0
  361. package/dist/custom-directives.js +136 -0
  362. package/dist/database.d.ts +391 -0
  363. package/dist/database.js +5 -0
  364. package/dist/defer.d.ts +28 -0
  365. package/dist/defer.js +156 -0
  366. package/dist/deploy/config-generators.d.ts +75 -0
  367. package/dist/deploy/config-generators.js +214 -0
  368. package/dist/deploy/index.d.ts +88 -0
  369. package/dist/deploy/index.js +203 -0
  370. package/dist/deploy/netlify.d.ts +109 -0
  371. package/dist/deploy/netlify.js +167 -0
  372. package/dist/desktop.d.ts +16 -0
  373. package/dist/desktop.js +1 -0
  374. package/dist/dev-server/index.d.ts +22 -0
  375. package/dist/dev-server/index.js +7 -0
  376. package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
  377. package/dist/dev-server/keyboard-shortcuts.js +81 -0
  378. package/dist/dev-server/native-window.d.ts +59 -0
  379. package/dist/dev-server/native-window.js +91 -0
  380. package/dist/dev-server/port-utils.d.ts +27 -0
  381. package/dist/dev-server/port-utils.js +40 -0
  382. package/dist/dev-server/serve-app.d.ts +15 -0
  383. package/dist/dev-server/serve-app.js +727 -0
  384. package/dist/dev-server/serve-file.d.ts +3 -0
  385. package/dist/dev-server/serve-file.js +443 -0
  386. package/dist/dev-server/serve-markdown.d.ts +3 -0
  387. package/dist/dev-server/serve-markdown.js +284 -0
  388. package/dist/dev-server/serve-multi.d.ts +5 -0
  389. package/dist/dev-server/serve-multi.js +596 -0
  390. package/dist/dev-server/terminal-colors.d.ts +56 -0
  391. package/dist/dev-server/terminal-colors.js +45 -0
  392. package/dist/dev-server/theme-selector.d.ts +32 -0
  393. package/dist/dev-server/theme-selector.js +111 -0
  394. package/dist/dev-server/ts-css.d.ts +108 -0
  395. package/dist/dev-server/ts-css.js +438 -0
  396. package/dist/dev-server/types.d.ts +99 -0
  397. package/dist/dev-server/types.js +43 -0
  398. package/dist/dev-server.d.ts +6 -0
  399. package/dist/dev-server.js +4 -0
  400. package/dist/devtools.d.ts +182 -0
  401. package/dist/devtools.js +593 -0
  402. package/dist/directive-api.d.ts +154 -0
  403. package/dist/directive-api.js +355 -0
  404. package/dist/docs.d.ts +56 -0
  405. package/dist/docs.js +567 -0
  406. package/dist/doctor.d.ts +29 -0
  407. package/dist/doctor.js +123 -0
  408. package/dist/document-shell.d.ts +218 -0
  409. package/dist/document-shell.js +338 -0
  410. package/dist/dynamic-components.d.ts +23 -0
  411. package/dist/dynamic-components.js +197 -0
  412. package/dist/edge-runtime.d.ts +193 -0
  413. package/dist/edge-runtime.js +525 -0
  414. package/dist/env.d.ts +3 -0
  415. package/dist/env.js +9 -0
  416. package/dist/error-boundaries.d.ts +78 -0
  417. package/dist/error-boundaries.js +281 -0
  418. package/dist/error-handling.d.ts +14 -0
  419. package/dist/error-handling.js +1 -0
  420. package/dist/errors/codes.d.ts +92 -0
  421. package/dist/errors/codes.js +97 -0
  422. package/dist/errors/formatter.d.ts +84 -0
  423. package/dist/errors/formatter.js +196 -0
  424. package/dist/errors/index.d.ts +12 -0
  425. package/dist/errors/index.js +44 -0
  426. package/dist/errors/logger.d.ts +135 -0
  427. package/dist/errors/logger.js +250 -0
  428. package/dist/errors/sanitizer.d.ts +73 -0
  429. package/dist/errors/sanitizer.js +181 -0
  430. package/dist/errors/types.d.ts +92 -0
  431. package/dist/errors/types.js +86 -0
  432. package/dist/events.d.ts +145 -0
  433. package/dist/events.js +396 -0
  434. package/dist/expressions.d.ts +180 -0
  435. package/dist/expressions.js +719 -0
  436. package/dist/find-body-tag.d.ts +50 -0
  437. package/dist/find-body-tag.js +57 -0
  438. package/dist/formatter.d.ts +19 -0
  439. package/dist/formatter.js +265 -0
  440. package/dist/forms-validation.d.ts +189 -0
  441. package/dist/forms-validation.js +421 -0
  442. package/dist/forms.d.ts +224 -0
  443. package/dist/forms.js +729 -0
  444. package/dist/fragment-container.d.ts +57 -0
  445. package/dist/fragment-container.js +123 -0
  446. package/dist/framework-composables.d.ts +73 -0
  447. package/dist/framework-composables.js +126 -0
  448. package/dist/head-injection.d.ts +61 -0
  449. package/dist/head-injection.js +28 -0
  450. package/dist/head.d.ts +282 -0
  451. package/dist/head.js +231 -0
  452. package/dist/heatmap.d.ts +206 -0
  453. package/dist/heatmap.js +566 -0
  454. package/dist/hot-reload.d.ts +87 -0
  455. package/dist/hot-reload.js +373 -0
  456. package/dist/html-masking.d.ts +125 -0
  457. package/dist/html-masking.js +196 -0
  458. package/dist/hydration-runtime.d.ts +44 -0
  459. package/dist/hydration-runtime.js +195 -0
  460. package/dist/hydration.d.ts +135 -0
  461. package/dist/hydration.js +654 -0
  462. package/dist/i18n.d.ts +342 -0
  463. package/dist/i18n.js +678 -0
  464. package/dist/image-optimization/auto-sibling.d.ts +42 -0
  465. package/dist/image-optimization/auto-sibling.js +88 -0
  466. package/dist/image-optimization/build-plugin.d.ts +54 -0
  467. package/dist/image-optimization/build-plugin.js +241 -0
  468. package/dist/image-optimization/component.d.ts +46 -0
  469. package/dist/image-optimization/component.js +244 -0
  470. package/dist/image-optimization/directive.d.ts +30 -0
  471. package/dist/image-optimization/directive.js +203 -0
  472. package/dist/image-optimization/index.d.ts +156 -0
  473. package/dist/image-optimization/index.js +54 -0
  474. package/dist/image-optimization/processor.d.ts +140 -0
  475. package/dist/image-optimization/processor.js +262 -0
  476. package/dist/image-optimization/serve.d.ts +54 -0
  477. package/dist/image-optimization/serve.js +102 -0
  478. package/dist/import-rebase.d.ts +16 -0
  479. package/dist/import-rebase.js +16 -0
  480. package/dist/imported-signals.d.ts +43 -0
  481. package/dist/imported-signals.js +35 -0
  482. package/dist/includes.d.ts +171 -0
  483. package/dist/includes.js +764 -0
  484. package/dist/index.d.ts +365 -0
  485. package/dist/index.js +202 -0
  486. package/dist/init.d.ts +39 -0
  487. package/dist/init.js +505 -0
  488. package/dist/inline-assets.d.ts +28 -0
  489. package/dist/inline-assets.js +82 -0
  490. package/dist/interactive.d.ts +14 -0
  491. package/dist/interactive.js +383 -0
  492. package/dist/internal-markdown.d.ts +22 -0
  493. package/dist/internal-markdown.js +141 -0
  494. package/dist/island-chunking.d.ts +48 -0
  495. package/dist/island-chunking.js +52 -0
  496. package/dist/isolated-build.d.ts +12 -0
  497. package/dist/isolated-build.js +18 -0
  498. package/dist/js-ts.d.ts +10 -0
  499. package/dist/js-ts.js +60 -0
  500. package/dist/jsx-runtime.d.ts +92 -0
  501. package/dist/jsx-runtime.js +289 -0
  502. package/dist/keep-alive.d.ts +108 -0
  503. package/dist/keep-alive.js +421 -0
  504. package/dist/layout-types.d.ts +45 -0
  505. package/dist/layout-types.js +56 -0
  506. package/dist/lazy-loader.d.ts +90 -0
  507. package/dist/lazy-loader.js +245 -0
  508. package/dist/lazy-module.d.ts +11 -0
  509. package/dist/lazy-module.js +18 -0
  510. package/dist/loading-indicator.d.ts +50 -0
  511. package/dist/loading-indicator.js +322 -0
  512. package/dist/loops.d.ts +91 -0
  513. package/dist/loops.js +690 -0
  514. package/dist/manifest.d.ts +41 -0
  515. package/dist/manifest.js +31 -0
  516. package/dist/markdown-view.d.ts +25 -0
  517. package/dist/markdown-view.js +39 -0
  518. package/dist/markdown.d.ts +10 -0
  519. package/dist/markdown.js +68 -0
  520. package/dist/media/client/blur-up.d.ts +66 -0
  521. package/dist/media/client/blur-up.js +217 -0
  522. package/dist/media/client/index.d.ts +93 -0
  523. package/dist/media/client/index.js +53 -0
  524. package/dist/media/client/lazy-load.d.ts +74 -0
  525. package/dist/media/client/lazy-load.js +283 -0
  526. package/dist/media/client/upload-handler.d.ts +80 -0
  527. package/dist/media/client/upload-handler.js +354 -0
  528. package/dist/media/image/component.d.ts +60 -0
  529. package/dist/media/image/component.js +574 -0
  530. package/dist/media/image/directive.d.ts +23 -0
  531. package/dist/media/image/directive.js +160 -0
  532. package/dist/media/image/editing.d.ts +212 -0
  533. package/dist/media/image/editing.js +193 -0
  534. package/dist/media/image/index.d.ts +142 -0
  535. package/dist/media/image/index.js +80 -0
  536. package/dist/media/image/placeholder.d.ts +89 -0
  537. package/dist/media/image/placeholder.js +188 -0
  538. package/dist/media/image/processor/cache.d.ts +53 -0
  539. package/dist/media/image/processor/cache.js +51 -0
  540. package/dist/media/image/processor/index.d.ts +11 -0
  541. package/dist/media/image/processor/index.js +3 -0
  542. package/dist/media/image/processor/optimizer.d.ts +24 -0
  543. package/dist/media/image/processor/optimizer.js +202 -0
  544. package/dist/media/image/processor/responsive.d.ts +28 -0
  545. package/dist/media/image/processor/responsive.js +162 -0
  546. package/dist/media/image/srcset.d.ts +157 -0
  547. package/dist/media/image/srcset.js +194 -0
  548. package/dist/media/index.d.ts +331 -0
  549. package/dist/media/index.js +198 -0
  550. package/dist/media/manager/embed.d.ts +25 -0
  551. package/dist/media/manager/embed.js +253 -0
  552. package/dist/media/protected/component.d.ts +33 -0
  553. package/dist/media/protected/component.js +235 -0
  554. package/dist/media/protected/index.d.ts +47 -0
  555. package/dist/media/protected/index.js +20 -0
  556. package/dist/media/protected/signature.d.ts +72 -0
  557. package/dist/media/protected/signature.js +205 -0
  558. package/dist/media/shared/cache.d.ts +76 -0
  559. package/dist/media/shared/cache.js +132 -0
  560. package/dist/media/shared/hash.d.ts +31 -0
  561. package/dist/media/shared/hash.js +35 -0
  562. package/dist/media/shared/index.d.ts +7 -0
  563. package/dist/media/shared/index.js +2 -0
  564. package/dist/media/types.d.ts +1477 -0
  565. package/dist/media/types.js +0 -0
  566. package/dist/media/upload/component.d.ts +9 -0
  567. package/dist/media/upload/component.js +320 -0
  568. package/dist/media/upload/index.d.ts +8 -0
  569. package/dist/media/upload/index.js +1 -0
  570. package/dist/media/video/directive.d.ts +23 -0
  571. package/dist/media/video/directive.js +142 -0
  572. package/dist/media/video/index.d.ts +76 -0
  573. package/dist/media/video/index.js +583 -0
  574. package/dist/media/video/processor/cache.d.ts +55 -0
  575. package/dist/media/video/processor/cache.js +52 -0
  576. package/dist/media/video/processor/index.d.ts +12 -0
  577. package/dist/media/video/processor/index.js +4 -0
  578. package/dist/media/video/processor/streaming.d.ts +26 -0
  579. package/dist/media/video/processor/streaming.js +197 -0
  580. package/dist/media/video/processor/thumbnail.d.ts +35 -0
  581. package/dist/media/video/processor/thumbnail.js +134 -0
  582. package/dist/media/video/processor/transcoder.d.ts +19 -0
  583. package/dist/media/video/processor/transcoder.js +283 -0
  584. package/dist/menubar.d.ts +65 -0
  585. package/dist/menubar.js +99 -0
  586. package/dist/method-spoofing.d.ts +20 -0
  587. package/dist/method-spoofing.js +17 -0
  588. package/dist/middleware.d.ts +112 -0
  589. package/dist/middleware.js +40 -0
  590. package/dist/misc-directives.d.ts +55 -0
  591. package/dist/misc-directives.js +328 -0
  592. package/dist/native-build.d.ts +88 -0
  593. package/dist/native-build.js +575 -0
  594. package/dist/owned-routes.d.ts +42 -0
  595. package/dist/owned-routes.js +26 -0
  596. package/dist/page-action.d.ts +73 -0
  597. package/dist/page-action.js +91 -0
  598. package/dist/page-meta.d.ts +38 -0
  599. package/dist/page-meta.js +16 -0
  600. package/dist/page-response.d.ts +120 -0
  601. package/dist/page-response.js +117 -0
  602. package/dist/parser/directive-parser.d.ts +119 -0
  603. package/dist/parser/directive-parser.js +249 -0
  604. package/dist/parser/expression-parser.d.ts +58 -0
  605. package/dist/parser/expression-parser.js +358 -0
  606. package/dist/parser/index.d.ts +13 -0
  607. package/dist/parser/index.js +23 -0
  608. package/dist/parser/tokenizer.d.ts +77 -0
  609. package/dist/parser/tokenizer.js +534 -0
  610. package/dist/partial-hydration.d.ts +123 -0
  611. package/dist/partial-hydration.js +427 -0
  612. package/dist/performance-utils.d.ts +318 -0
  613. package/dist/performance-utils.js +466 -0
  614. package/dist/placeholder.d.ts +54 -0
  615. package/dist/placeholder.js +35 -0
  616. package/dist/plugin-system.d.ts +301 -0
  617. package/dist/plugin-system.js +214 -0
  618. package/dist/plugin.d.ts +3 -0
  619. package/dist/plugin.js +174 -0
  620. package/dist/precompiler.d.ts +43 -0
  621. package/dist/precompiler.js +670 -0
  622. package/dist/process.d.ts +16 -0
  623. package/dist/process.js +879 -0
  624. package/dist/production-build.d.ts +163 -0
  625. package/dist/production-build.js +596 -0
  626. package/dist/production-builder.d.ts +42 -0
  627. package/dist/production-builder.js +146 -0
  628. package/dist/production-server.d.ts +19 -0
  629. package/dist/production-server.js +208 -0
  630. package/dist/prop-sentinels.d.ts +31 -0
  631. package/dist/prop-sentinels.js +7 -0
  632. package/dist/props.d.ts +216 -0
  633. package/dist/props.js +224 -0
  634. package/dist/public-env.d.ts +29 -0
  635. package/dist/public-env.js +19 -0
  636. package/dist/pwa/audit.d.ts +42 -0
  637. package/dist/pwa/audit.js +255 -0
  638. package/dist/pwa/directives.d.ts +38 -0
  639. package/dist/pwa/directives.js +332 -0
  640. package/dist/pwa/icons.d.ts +42 -0
  641. package/dist/pwa/icons.js +109 -0
  642. package/dist/pwa/index.d.ts +104 -0
  643. package/dist/pwa/index.js +47 -0
  644. package/dist/pwa/inject.d.ts +32 -0
  645. package/dist/pwa/inject.js +102 -0
  646. package/dist/pwa/manifest.d.ts +104 -0
  647. package/dist/pwa/manifest.js +186 -0
  648. package/dist/pwa/offline.d.ts +8 -0
  649. package/dist/pwa/offline.js +259 -0
  650. package/dist/pwa/precache.d.ts +35 -0
  651. package/dist/pwa/precache.js +116 -0
  652. package/dist/pwa/service-worker.d.ts +33 -0
  653. package/dist/pwa/service-worker.js +860 -0
  654. package/dist/pwa/workbox-strategies.d.ts +100 -0
  655. package/dist/pwa/workbox-strategies.js +167 -0
  656. package/dist/pwa/workbox.d.ts +51 -0
  657. package/dist/pwa/workbox.js +382 -0
  658. package/dist/pwa.d.ts +52 -0
  659. package/dist/pwa.js +236 -0
  660. package/dist/reactive-bindings.d.ts +47 -0
  661. package/dist/reactive-bindings.js +268 -0
  662. package/dist/reactive-tracking.d.ts +81 -0
  663. package/dist/reactive-tracking.js +49 -0
  664. package/dist/reactive.d.ts +117 -0
  665. package/dist/reactive.js +593 -0
  666. package/dist/reactivity.d.ts +206 -0
  667. package/dist/reactivity.js +574 -0
  668. package/dist/release.d.ts +1 -0
  669. package/dist/release.js +1 -0
  670. package/dist/render-memo.d.ts +40 -0
  671. package/dist/render-memo.js +33 -0
  672. package/dist/render.d.ts +54 -0
  673. package/dist/render.js +153 -0
  674. package/dist/resolve-stx-targets.d.ts +49 -0
  675. package/dist/resolve-stx-targets.js +38 -0
  676. package/dist/route-middleware.d.ts +2 -0
  677. package/dist/route-middleware.js +17 -0
  678. package/dist/route-types.d.ts +134 -0
  679. package/dist/route-types.js +24 -0
  680. package/dist/router.d.ts +9 -0
  681. package/dist/router.js +9 -0
  682. package/dist/routes.d.ts +6 -0
  683. package/dist/routes.js +14 -0
  684. package/dist/runtime-globals.d.ts +236 -0
  685. package/dist/runtime-globals.js +230 -0
  686. package/dist/runtime-injection.d.ts +113 -0
  687. package/dist/runtime-injection.js +156 -0
  688. package/dist/runtime.d.ts +140 -0
  689. package/dist/runtime.js +94 -0
  690. package/dist/safe-evaluator.d.ts +165 -0
  691. package/dist/safe-evaluator.js +461 -0
  692. package/dist/scaffolding.d.ts +113 -0
  693. package/dist/scaffolding.js +897 -0
  694. package/dist/screenshot.d.ts +22 -0
  695. package/dist/screenshot.js +100 -0
  696. package/dist/script-classifier.d.ts +41 -0
  697. package/dist/script-classifier.js +51 -0
  698. package/dist/script-emit.d.ts +50 -0
  699. package/dist/script-emit.js +11 -0
  700. package/dist/script-json.d.ts +36 -0
  701. package/dist/script-json.js +6 -0
  702. package/dist/script-validation.d.ts +26 -0
  703. package/dist/script-validation.js +179 -0
  704. package/dist/seo.d.ts +225 -0
  705. package/dist/seo.js +486 -0
  706. package/dist/serve.d.ts +44 -0
  707. package/dist/serve.js +233 -0
  708. package/dist/server-bindings.d.ts +39 -0
  709. package/dist/server-bindings.js +171 -0
  710. package/dist/server-components.d.ts +138 -0
  711. package/dist/server-components.js +427 -0
  712. package/dist/sfc-template.d.ts +17 -0
  713. package/dist/sfc-template.js +32 -0
  714. package/dist/signal-processing.d.ts +222 -0
  715. package/dist/signal-processing.js +1081 -0
  716. package/dist/signals-api.d.ts +459 -0
  717. package/dist/signals-api.js +172 -0
  718. package/dist/signals.d.ts +41 -0
  719. package/dist/signals.js +8233 -0
  720. package/dist/site-builder/build.d.ts +18 -0
  721. package/dist/site-builder/build.js +252 -0
  722. package/dist/site-builder/i18n.d.ts +104 -0
  723. package/dist/site-builder/i18n.js +150 -0
  724. package/dist/site-builder/index.d.ts +27 -0
  725. package/dist/site-builder/index.js +16 -0
  726. package/dist/site-builder/robots.d.ts +2 -0
  727. package/dist/site-builder/robots.js +26 -0
  728. package/dist/site-builder/router.d.ts +10 -0
  729. package/dist/site-builder/router.js +27 -0
  730. package/dist/site-builder/seo.d.ts +8 -0
  731. package/dist/site-builder/seo.js +67 -0
  732. package/dist/site-builder/sitemap.d.ts +10 -0
  733. package/dist/site-builder/sitemap.js +26 -0
  734. package/dist/site-builder/theme.d.ts +12 -0
  735. package/dist/site-builder/theme.js +38 -0
  736. package/dist/site-builder/types.d.ts +74 -0
  737. package/dist/site-builder/types.js +0 -0
  738. package/dist/site-url.d.ts +46 -0
  739. package/dist/site-url.js +70 -0
  740. package/dist/slots.d.ts +129 -0
  741. package/dist/slots.js +286 -0
  742. package/dist/source-maps.d.ts +98 -0
  743. package/dist/source-maps.js +350 -0
  744. package/dist/source-signature.d.ts +45 -0
  745. package/dist/source-signature.js +20 -0
  746. package/dist/spa-nav.d.ts +49 -0
  747. package/dist/spa-nav.js +12 -0
  748. package/dist/spa-shell.d.ts +21 -0
  749. package/dist/spa-shell.js +34 -0
  750. package/dist/ssg.d.ts +357 -0
  751. package/dist/ssg.js +94 -0
  752. package/dist/ssr.d.ts +116 -0
  753. package/dist/ssr.js +339 -0
  754. package/dist/state-dir.d.ts +36 -0
  755. package/dist/state-dir.js +22 -0
  756. package/dist/state-management.d.ts +299 -0
  757. package/dist/state-management.js +519 -0
  758. package/dist/store-imports.d.ts +47 -0
  759. package/dist/store-imports.js +16 -0
  760. package/dist/store-loader.d.ts +15 -0
  761. package/dist/store-loader.js +111 -0
  762. package/dist/stores-client.d.ts +70 -0
  763. package/dist/stores-client.js +132 -0
  764. package/dist/story/addons.d.ts +123 -0
  765. package/dist/story/addons.js +261 -0
  766. package/dist/story/analytics.d.ts +163 -0
  767. package/dist/story/analytics.js +235 -0
  768. package/dist/story/auto-stories.d.ts +38 -0
  769. package/dist/story/auto-stories.js +158 -0
  770. package/dist/story/bookmarks.d.ts +102 -0
  771. package/dist/story/bookmarks.js +277 -0
  772. package/dist/story/bun-test.d.ts +45 -0
  773. package/dist/story/bun-test.js +102 -0
  774. package/dist/story/cli.d.ts +132 -0
  775. package/dist/story/cli.js +155 -0
  776. package/dist/story/collect/analyzer.d.ts +33 -0
  777. package/dist/story/collect/analyzer.js +305 -0
  778. package/dist/story/collect/index.d.ts +31 -0
  779. package/dist/story/collect/index.js +27 -0
  780. package/dist/story/collect/parser.d.ts +17 -0
  781. package/dist/story/collect/parser.js +129 -0
  782. package/dist/story/collect/scanner.d.ts +17 -0
  783. package/dist/story/collect/scanner.js +101 -0
  784. package/dist/story/collect/tree.d.ts +24 -0
  785. package/dist/story/collect/tree.js +110 -0
  786. package/dist/story/commands/build.d.ts +19 -0
  787. package/dist/story/commands/build.js +172 -0
  788. package/dist/story/commands/dev.d.ts +23 -0
  789. package/dist/story/commands/dev.js +78 -0
  790. package/dist/story/commands/index.d.ts +9 -0
  791. package/dist/story/commands/index.js +3 -0
  792. package/dist/story/commands/preview.d.ts +21 -0
  793. package/dist/story/commands/preview.js +56 -0
  794. package/dist/story/compiled-output.d.ts +27 -0
  795. package/dist/story/compiled-output.js +151 -0
  796. package/dist/story/composition.d.ts +47 -0
  797. package/dist/story/composition.js +261 -0
  798. package/dist/story/config-watcher.d.ts +33 -0
  799. package/dist/story/config-watcher.js +67 -0
  800. package/dist/story/config.d.ts +29 -0
  801. package/dist/story/config.js +64 -0
  802. package/dist/story/context.d.ts +27 -0
  803. package/dist/story/context.js +27 -0
  804. package/dist/story/controls/index.d.ts +54 -0
  805. package/dist/story/controls/index.js +320 -0
  806. package/dist/story/desktop-preview.d.ts +34 -0
  807. package/dist/story/desktop-preview.js +105 -0
  808. package/dist/story/docs-generator.d.ts +30 -0
  809. package/dist/story/docs-generator.js +187 -0
  810. package/dist/story/errors.d.ts +47 -0
  811. package/dist/story/errors.js +239 -0
  812. package/dist/story/figma-export.d.ts +169 -0
  813. package/dist/story/figma-export.js +224 -0
  814. package/dist/story/generator.d.ts +21 -0
  815. package/dist/story/generator.js +165 -0
  816. package/dist/story/hmr.d.ts +62 -0
  817. package/dist/story/hmr.js +131 -0
  818. package/dist/story/hot-swap.d.ts +46 -0
  819. package/dist/story/hot-swap.js +207 -0
  820. package/dist/story/index.d.ts +99 -0
  821. package/dist/story/index.js +49 -0
  822. package/dist/story/interactions.d.ts +53 -0
  823. package/dist/story/interactions.js +225 -0
  824. package/dist/story/keyboard-shortcuts.d.ts +39 -0
  825. package/dist/story/keyboard-shortcuts.js +345 -0
  826. package/dist/story/output.d.ts +115 -0
  827. package/dist/story/output.js +153 -0
  828. package/dist/story/performance.d.ts +129 -0
  829. package/dist/story/performance.js +252 -0
  830. package/dist/story/presets.d.ts +123 -0
  831. package/dist/story/presets.js +289 -0
  832. package/dist/story/props-validation.d.ts +45 -0
  833. package/dist/story/props-validation.js +215 -0
  834. package/dist/story/renderer.d.ts +69 -0
  835. package/dist/story/renderer.js +209 -0
  836. package/dist/story/search-index.d.ts +47 -0
  837. package/dist/story/search-index.js +106 -0
  838. package/dist/story/search.d.ts +56 -0
  839. package/dist/story/search.js +140 -0
  840. package/dist/story/server.d.ts +31 -0
  841. package/dist/story/server.js +965 -0
  842. package/dist/story/setup.d.ts +56 -0
  843. package/dist/story/setup.js +78 -0
  844. package/dist/story/snapshots.d.ts +65 -0
  845. package/dist/story/snapshots.js +171 -0
  846. package/dist/story/testing.d.ts +83 -0
  847. package/dist/story/testing.js +164 -0
  848. package/dist/story/theme.d.ts +68 -0
  849. package/dist/story/theme.js +170 -0
  850. package/dist/story/ts-css.d.ts +29 -0
  851. package/dist/story/ts-css.js +189 -0
  852. package/dist/story/types.d.ts +342 -0
  853. package/dist/story/types.js +0 -0
  854. package/dist/story/ui/code-panel.d.ts +43 -0
  855. package/dist/story/ui/code-panel.js +175 -0
  856. package/dist/story/ui/controls-panel.d.ts +25 -0
  857. package/dist/story/ui/controls-panel.js +168 -0
  858. package/dist/story/ui/index.d.ts +8 -0
  859. package/dist/story/ui/index.js +4 -0
  860. package/dist/story/ui/navigation.d.ts +55 -0
  861. package/dist/story/ui/navigation.js +250 -0
  862. package/dist/story/ui/preview.d.ts +46 -0
  863. package/dist/story/ui/preview.js +251 -0
  864. package/dist/story/visual-testing.d.ts +45 -0
  865. package/dist/story/visual-testing.js +248 -0
  866. package/dist/streaming.d.ts +238 -0
  867. package/dist/streaming.js +537 -0
  868. package/dist/strict-lint.d.ts +52 -0
  869. package/dist/strict-lint.js +269 -0
  870. package/dist/strip-literals.d.ts +40 -0
  871. package/dist/strip-literals.js +149 -0
  872. package/dist/stx-virtual-ts.d.ts +358 -0
  873. package/dist/stx-virtual-ts.js +670 -0
  874. package/dist/stx.d.ts +924 -0
  875. package/dist/style-scoping.d.ts +42 -0
  876. package/dist/style-scoping.js +82 -0
  877. package/dist/suspense.d.ts +98 -0
  878. package/dist/suspense.js +398 -0
  879. package/dist/teleport.d.ts +31 -0
  880. package/dist/teleport.js +109 -0
  881. package/dist/template-compiler.d.ts +33 -0
  882. package/dist/template-compiler.js +68 -0
  883. package/dist/template-hydrator.d.ts +28 -0
  884. package/dist/template-hydrator.js +95 -0
  885. package/dist/template-tag-balance.d.ts +32 -0
  886. package/dist/template-tag-balance.js +93 -0
  887. package/dist/testing.d.ts +330 -0
  888. package/dist/testing.js +588 -0
  889. package/dist/theme-tokens.d.ts +88 -0
  890. package/dist/theme-tokens.js +71 -0
  891. package/dist/transitions.d.ts +99 -0
  892. package/dist/transitions.js +443 -0
  893. package/dist/ts-css-config.d.ts +71 -0
  894. package/dist/ts-css-config.js +44 -0
  895. package/dist/type-checker.d.ts +85 -0
  896. package/dist/type-checker.js +581 -0
  897. package/dist/typecheck.d.ts +70 -0
  898. package/dist/typecheck.js +365 -0
  899. package/dist/types/component-types.d.ts +248 -0
  900. package/dist/types/component-types.js +0 -0
  901. package/dist/types/config-types.d.ts +938 -0
  902. package/dist/types/config-types.js +0 -0
  903. package/dist/types/context-types.d.ts +122 -0
  904. package/dist/types/context-types.js +0 -0
  905. package/dist/types/csp-types.d.ts +83 -0
  906. package/dist/types/csp-types.js +0 -0
  907. package/dist/types/directive-types.d.ts +315 -0
  908. package/dist/types/directive-types.js +3 -0
  909. package/dist/types/index.d.ts +20 -0
  910. package/dist/types/index.js +1 -0
  911. package/dist/types/pwa-types.d.ts +338 -0
  912. package/dist/types/pwa-types.js +0 -0
  913. package/dist/types.d.ts +27 -0
  914. package/dist/types.js +1 -0
  915. package/dist/typescript-templates.d.ts +156 -0
  916. package/dist/typescript-templates.js +386 -0
  917. package/dist/unresolved-identifiers.d.ts +52 -0
  918. package/dist/unresolved-identifiers.js +148 -0
  919. package/dist/utils.d.ts +112 -0
  920. package/dist/utils.js +1170 -0
  921. package/dist/validator.d.ts +80 -0
  922. package/dist/validator.js +171 -0
  923. package/dist/variable-extractor.d.ts +142 -0
  924. package/dist/variable-extractor.js +1306 -0
  925. package/dist/view-composers.d.ts +171 -0
  926. package/dist/view-composers.js +29 -0
  927. package/dist/virtual-scrolling.d.ts +127 -0
  928. package/dist/virtual-scrolling.js +454 -0
  929. package/dist/visual-editor.d.ts +185 -0
  930. package/dist/visual-editor.js +735 -0
  931. package/dist/visual-testing.d.ts +135 -0
  932. package/dist/visual-testing.js +126 -0
  933. package/dist/vue-template.d.ts +39 -0
  934. package/dist/vue-template.js +476 -0
  935. package/dist/web-components/css-scoping.d.ts +64 -0
  936. package/dist/web-components/css-scoping.js +210 -0
  937. package/dist/web-components/index.d.ts +29 -0
  938. package/dist/web-components/index.js +13 -0
  939. package/dist/web-components/reactive-generator.d.ts +72 -0
  940. package/dist/web-components/reactive-generator.js +484 -0
  941. package/dist/web-components.d.ts +253 -0
  942. package/dist/web-components.js +1466 -0
  943. package/dist/x-element.d.ts +42 -0
  944. package/dist/x-element.js +301 -0
  945. package/package.json +107 -0
  946. package/stx.d.ts +924 -0
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{cj as a,dj as b}from"./chunk-refwkt87.js";import"./chunk-qc1f74ek.js";export{a as processTeleportDirectives,b as ensureTeleportTargets};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$f as k,Rf as a,Sf as b,Tf as c,Uf as d,Vf as e,Wf as f,Xf as g,Yf as h,Zf as i,_f as j,ag as l,bg as m,cg as n,dg as o}from"./chunk-nx5qkm8k.js";import"./chunk-qc1f74ek.js";export{k as writeNetlifyConfig,n as initNetlify,l as hasNetlifyConfig,g as getTotalSize,h as generateNetlifyToml,f as formatSize,e as filterRequiredFiles,i as detectProjectConfig,m as deploy,a as createNetlifyClient,d as createFileManifest,j as createDefaultNetlifyConfig,c as collectDeployFiles,b as calculateSha1,o as DeployError};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ function D(j){return j}class F{plugins=new Map;sortedPlugins=[];initialized=!1;async register(j,q){if(this.plugins.has(j.name))throw Error(`Plugin "${j.name}" is already registered`);if(j.dependencies){for(let w of j.dependencies)if(!this.plugins.has(w))throw Error(`Plugin "${j.name}" depends on "${w}" which is not registered`)}if(this.plugins.set(j.name,j),j.onRegister)await j.onRegister(q);this.sortPlugins()}async unregister(j){let q=this.plugins.get(j);if(!q)return!1;for(let[w,z]of this.plugins)if(z.dependencies?.includes(j))throw Error(`Cannot unregister "${j}" because "${w}" depends on it`);if(q.onUnregister)await q.onUnregister();return this.plugins.delete(j),this.sortPlugins(),!0}get(j){return this.plugins.get(j)}has(j){return this.plugins.has(j)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let j=[];for(let q of this.sortedPlugins)if(q.registerDirectives)j.push(...q.registerDirectives());return j}getAllFilters(){let j={};for(let q of this.sortedPlugins)if(q.registerFilters)Object.assign(j,q.registerFilters());return j}async runBeforeProcess(j){return this.runHooks("beforeProcess",j)}async runAfterParse(j){return this.runHooks("afterParse",j)}async runBeforeDirective(j,q){return this.runDirectiveHooks("beforeDirective",j,q)}async runAfterDirective(j,q){return this.runDirectiveHooks("afterDirective",j,q)}async runBeforeRender(j){return this.runHooks("beforeRender",j)}async runAfterRender(j){return this.runHooks("afterRender",j)}async runOnError(j){for(let q of this.sortedPlugins)if(q.onError)try{let w=await q.onError(j);if(w){if(w.template!==void 0)j.template=w.template;if(w.context)j.context={...j.context,...w.context};if(w.metadata)j.metadata={...j.metadata,...w.metadata};if(w.skip)return j}}catch(w){console.error(`Error in plugin "${q.name}" onError hook:`,w)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((j,q)=>(j.priority??100)-(q.priority??100))}async runHooks(j,q){let w={...q};for(let z of this.sortedPlugins){let B=z[j];if(B)try{let y=await B(w);if(y){if(y.template!==void 0)w.template=y.template;if(y.context)w.context={...w.context,...y.context};if(y.metadata)w.metadata={...w.metadata,...y.metadata};if(y.skip)break}}catch(y){console.error(`Error in plugin "${z.name}" ${j} hook:`,y)}}return w}async runDirectiveHooks(j,q,w){let z={...w};for(let B of this.sortedPlugins){let y=B[j];if(y)try{let A=await y(q,z);if(A){if(A.template!==void 0)z.template=A.template;if(A.context)z.context={...z.context,...A.context};if(A.metadata)z.metadata={...z.metadata,...A.metadata};if(A.skip)break}}catch(A){console.error(`Error in plugin "${B.name}" ${j} hook:`,A)}}return z}}var G=new F;function H(j,q,w={}){return{name:j,...w,registerDirectives:()=>q}}function I(j,q,w={}){return{name:j,...w,registerFilters:()=>q}}var J=D({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(j){console.log("[stx-debug] beforeProcess:",j.filePath)},afterParse(j){console.log("[stx-debug] afterParse:",j.template.length,"chars")},beforeDirective(j,q){console.log("[stx-debug] beforeDirective:",j)},afterDirective(j,q){console.log("[stx-debug] afterDirective:",j)},beforeRender(j){console.log("[stx-debug] beforeRender")},afterRender(j){console.log("[stx-debug] afterRender:",j.template.length,"chars")},onError(j){console.error("[stx-debug] onError:",j.error.message,"in phase:",j.phase)}}),K=D({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(j){j.metadata.startTime=performance.now()},afterRender(j){let q=j.metadata.startTime;if(q){let w=performance.now()-q;console.log(`[stx-timing] Processing took ${w.toFixed(2)}ms`)}}});function L(j){return D({name:"stx-variables",version:"1.0.0",description:"Adds predefined variables to template context",beforeProcess(q){return{context:{...q.context,...j}}}})}
3
+ export{D as pg,F as qg,G as rg,H as sg,I as tg,J as ug,K as vg,L as wg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-qc1f74ek.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$e as x,Xe as t,Ye as u,Ze as v,_e as w,af as y,bf as z,cf as A,df as B,ef as C,ff as D,gf as E}from"./chunk-19nfvxfw.js";import{Cf as r,Df as s}from"./chunk-mkd9kjgb.js";import{Ag as e,Bg as f,Cg as g,Dg as h,Fg as i,Gg as j,Hg as k,Ig as l,Jg as m,Kg as n,Lg as o,Mg as p,Ng as q,xg as b,yg as c,zg as d}from"./chunk-dhh5q7qt.js";import{Dh as a}from"./chunk-w3ycm4na.js";import"./chunk-8mjdpr94.js";import"./chunk-qc1f74ek.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{co as a,do as b,eo as c,fo as d,go as e,ho as f,io as g,jo as h,ko as i,lo as j,mo as k,no as l,oo as m}from"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{m as stripStxRuntimeImports,b as scanScriptTags,l as rewriteStxImportSpecifiers,j as processSignals,h as processScriptSetup,f as preEvalLiteralReactiveIfs,c as parseLoopExpression,d as hasSignalsSyntax,k as findMarkupIndexOutsideScripts,i as extractExports,g as convertSignalLoopsToAttributes,e as convertSignalDirectivesToAttributes,a as clearScriptScanCache};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Oj as a,Pj as b,Qj as c,Rj as d,Sj as e,Tj as f,Uj as g,Vj as h,Wj as i,Xj as j,Yj as k}from"./chunk-a0nfbmeh.js";import"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ var E=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),N=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function X(Q){return Q.replace(/[^\n]/g," ")}function R(Q){let H=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,X).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,X).replace(/<!--[\s\S]*?-->/g,X).replace(/\{\{\{[\s\S]*?\}\}\}/g,X).replace(/\{\{[\s\S]*?\}\}/g,X).replace(/\{!![\s\S]*?!!\}/g,X),F=new Map,J=new Map,Y=/<(\/?)([A-Za-z][\w-]*)\b(?:[^>"']|"[^"]*"|'[^']*')*?(\/?)>/g,z;while((z=Y.exec(H))!==null){let j=z[1]==="/",q=z[2],W=z[3]==="/";if(E.has(q.toLowerCase()))continue;if(W)continue;if(j)J.set(q,(J.get(q)??0)+1);else{let Z=F.get(q);if(Z)Z.count++;else{let B=H.slice(0,z.index).split(`
3
+ `).length;F.set(q,{count:1,firstLine:B})}}}let M=[];for(let j of new Set([...F.keys(),...J.keys()])){if(N.has(j.toLowerCase()))continue;let q=F.get(j)?.count??0,W=J.get(j)??0;if(q!==W)M.push({tag:j,opened:q,closed:W,firstOpenLine:F.get(j)?.firstLine??0})}return M}var $=new Set;function U(Q,H){let F;try{F=R(Q)}catch{return}if(F.length===0)return;let J=`${H}:${Q.length}`;if($.has(J))return;$.add(J);let Y=H?H.split(/[/\\]/).pop()||H:"template";for(let{tag:z,opened:M,closed:j,firstOpenLine:q}of F)if(M>j){let W=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${Y}: <${z}> ${M} opened, ${j} closed \u2014 an unclosed <${z}>${W} may swallow the content that follows it.`)}else console.warn(`[stx] ${Y}: <${z}> ${M} opened, ${j} closed \u2014 ${j-M} stray </${z}>.`)}
4
+ export{R as Tt,U as Ut};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Au as p,Bu as q,Cu as r,Du as s,Eu as t,Fu as u,Gu as v,Hu as w,Iu as x,Ju as y,Ku as z,Lu as A,Mu as B,Nu as C,Ou as D,Pu as E,Qu as F,Ru as G,Su as H,Tu as I,Uu as J,Wu as K,Yu as L,lu as a,mu as b,nu as c,ou as d,pu as e,qu as f,ru as g,su as h,tu as i,uu as j,vu as k,wu as l,xu as m,yu as n,zu as o}from"./chunk-b6ej2fdf.js";import"./chunk-qc1f74ek.js";L();export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{gv as l}from"./chunk-qc1f74ek.js";import U from"fs";import G from"path";import I from"os";import H from"crypto";import{generatePlaceholder as m,processImage as g}from"ts-images";var d=[320,640,768,1024,1280,1536,1920],h=["webp","jpeg"],b=80,u=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],P={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},N=null,W=!1;async function Y(){if(W)return N;W=!0;try{let J=await import("sharp");return N=J.default||J,N}catch{return null}}async function e(){return await Y()!==null}async function t(){return!0}async function JJ(J,K={}){let{widths:Z=d,formats:$=h,quality:q=b,fit:C="cover",placeholder:X="none",outputDir:Q=".stx/images",baseUrl:_="/images"}=K,j,x;if(typeof J==="string"){if(x=J,!await Bun.file(J).exists())throw new L(`Image not found: ${J}`,"NOT_FOUND");j=await Bun.file(J).arrayBuffer().then((V)=>Buffer.from(V))}else x="buffer-input",j=J;let w=H.createHash("sha256").update(j).digest("hex").slice(0,12),y=await O(j),{width:B,height:D}=y,A=B/D;await U.promises.mkdir(Q,{recursive:!0});let T=[],v=G.basename(x,G.extname(x)),z=Z.filter((V)=>V<=B);if(!z.includes(B)&&B<=Math.max(...Z))z.push(B);z.sort((V,R)=>V-R);for(let V of z){let R=Math.round(V/A);for(let F of $){let S=`${v}-${V}w-${w}.${F}`,k=G.join(Q,S),c=`${_}/${S}`,E=await n(j,{width:V,height:R,format:F,quality:q,fit:C});await Bun.write(k,E),T.push({path:k,url:c,width:V,height:R,format:F,size:E.length})}}let M;if(X!=="none")M=await o(j,X);return{src:x,variants:T,placeholder:M,width:B,height:D,aspectRatio:A,hash:w}}async function O(J){let K=typeof J==="string"?Buffer.from(await Bun.file(J).arrayBuffer()):J,Z=await Y();if(Z){let q=await Z(K).metadata();return{width:q.width||0,height:q.height||0,format:q.format||"unknown",hasAlpha:q.hasAlpha}}return p(K)}function p(J){if(J[0]===137&&J[1]===80&&J[2]===78&&J[3]===71){let K=J.readUInt32BE(16),Z=J.readUInt32BE(20);return{width:K,height:Z,format:"png",hasAlpha:!0}}if(J[0]===255&&J[1]===216){let K=2;while(K<J.length){if(J[K]!==255)break;let Z=J[K+1];if(Z>=192&&Z<=207&&Z!==196&&Z!==200&&Z!==204){let q=J.readUInt16BE(K+5);return{width:J.readUInt16BE(K+7),height:q,format:"jpeg",hasAlpha:!1}}let $=J.readUInt16BE(K+2);K+=2+$}}if(J.toString("utf8",0,4)==="RIFF"&&J.toString("utf8",8,12)==="WEBP"){let K=J.toString("utf8",12,16);if(K==="VP8 "){let Z=J.readUInt16LE(26)&16383,$=J.readUInt16LE(28)&16383;return{width:Z,height:$,format:"webp",hasAlpha:!1}}if(K==="VP8L"){let Z=J.readUInt32LE(21),$=(Z&16383)+1,q=(Z>>14&16383)+1;return{width:$,height:q,format:"webp",hasAlpha:!0}}}if(J.toString("utf8",0,3)==="GIF"){let K=J.readUInt16LE(6),Z=J.readUInt16LE(8);return{width:K,height:Z,format:"gif",hasAlpha:!0}}throw new L("Unable to parse image dimensions","PARSE_ERROR")}async function n(J,K){let Z=await Y();if(Z){let q=Z(J).resize(K.width,K.height,{fit:K.fit});switch(K.format){case"webp":q=q.webp({quality:K.quality});break;case"avif":q=q.avif({quality:K.quality});break;case"jpeg":q=q.jpeg({quality:K.quality});break;case"png":q=q.png({quality:K.quality});break}return q.toBuffer()}let $=G.join(I.tmpdir(),`stx-img-${H.randomBytes(8).toString("hex")}.${K.format}`);try{return await g({input:J,output:$,format:K.format,quality:K.quality,resize:{width:K.width,height:K.height,fit:K.fit}}),Buffer.from(await Bun.file($).arrayBuffer())}finally{await U.promises.unlink($).catch(()=>{})}}async function o(J,K){let Z=await Y();if(K==="blur"&&Z){let X=(await Z(J).resize(20).blur(10).toBuffer()).toString("base64"),Q=await O(J);return`data:${P[Q.format]||"image/jpeg"};base64,${X}`}if(K==="dominant-color"&&Z){let{dominant:C}=await Z(J).resize(1,1).toBuffer().then(async(X)=>{let Q=await Z(X).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${C.r}, ${C.g}, ${C.b})`}let $=await O(J),q=G.join(I.tmpdir(),`stx-ph-${H.randomBytes(8).toString("hex")}.${$.format==="unknown"?"bin":$.format}`);try{await Bun.write(q,J);let C=K==="blur"?"blur":K==="thumbhash"?"thumbhash":"dominant-color",Q=await m(q,{strategy:C,width:C==="thumbhash"?void 0:32});if(K==="dominant-color"&&Q.dominantColor)return Q.dominantColor;if(Q.dataURL)return Q.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await U.promises.unlink(q).catch(()=>{})}}function KJ(J,K){return(K?J.filter(($)=>$.format===K):J).sort(($,q)=>$.width-q.width).map(($)=>`${$.url} ${$.width}w`).join(", ")}function ZJ(J){if(!J||Object.keys(J).length===0)return"100vw";return Object.entries(J).sort((Z,$)=>{let q=Number.parseInt(Z[0].replace(/\D/g,""))||0;return(Number.parseInt($[0].replace(/\D/g,""))||0)-q}).map(([Z,$])=>`(max-width: ${Z}) ${$}`).join(", ")+", 100vw"}function $J(J){let K=J.filter(($)=>$.format==="jpeg");if(K.length===0)return J[Math.floor(J.length/2)];let Z=K.sort(($,q)=>$.width-q.width);return Z[Math.floor(Z.length/2)]}function qJ(J){let K=new Map;for(let Z of J){let $=K.get(Z.format)||[];$.push(Z),K.set(Z.format,$)}return K}function CJ(J){let K=G.extname(J).toLowerCase();return u.includes(K)}function QJ(J){return P[J]||"application/octet-stream"}function VJ(J){return J.reduce((K,Z)=>K+Z.size,0)}function XJ(J){if(J<1024)return`${J} B`;if(J<1048576)return`${(J/1024).toFixed(1)} KB`;return`${(J/1048576).toFixed(2)} MB`}class L extends Error{code;constructor(J,K){super(J);this.name="ImageProcessingError",this.code=K}}
3
+ export{d as xg,h as yg,b as zg,e as Ag,t as Bg,JJ as Cg,O as Dg,n as Eg,KJ as Fg,ZJ as Gg,$J as Hg,qJ as Ig,CJ as Jg,QJ as Kg,VJ as Lg,XJ as Mg,L as Ng};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Tt as a,Ut as b}from"./chunk-de7fye10.js";import"./chunk-qc1f74ek.js";export{b as warnUnbalancedTags,a as findUnbalancedTags};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ni as a,oi as b,pi as c,qi as d,ri as e}from"./chunk-9y0g8kzt.js";import"./chunk-qc1f74ek.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ var L=null,R=[],N=0,U=new Set;function X(){return L}function Y(j){let G=L;return R.push(j),L=j,G}function Z(j){R.pop(),L=j}function _(){return N>0}function $(j){U.add(j)}function B(j){N++;try{j()}finally{if(N--,N===0){let G=[...U];U.clear();for(let F of G)F()}}}function A(j){let G=L;L=null;try{return j()}finally{L=G}}var O=[],P=[];function q(j){let G=j,F=new Set,H=new Set,I=()=>{let z=X();if(z)H.add(z);return G};return I.set=(z)=>{if(!Object.is(z,G)){let J=G;if(G=z,F.forEach((K)=>K(G,J)),_())H.forEach((K)=>$(K));else H.forEach((K)=>K())}},I.update=(z)=>{I.set(z(G))},I.subscribe=(z)=>{return F.add(z),()=>F.delete(z)},Object.defineProperty(I,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(I,"value",{get:()=>I(),set:(z)=>I.set(z),configurable:!0}),I}function E(j){let G,F=!0,H=new Set,I=()=>{if(!F)if(F=!0,_())H.forEach((J)=>$(J));else H.forEach((J)=>J())},z=()=>{let J=X();if(J)H.add(J);if(F){let K=Y(I);try{G=j()}finally{Z(K)}F=!1}return G};return Object.defineProperty(z,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(z,"value",{get:()=>z(),configurable:!0}),z}function V(j,G={}){let F,H=!1,I=()=>{if(H)return;if(F)F(),F=void 0;let z=Y(I);try{let J=j();F=typeof J==="function"?J:void 0}finally{Z(z)}};if(G.immediate!==!1)I();return()=>{if(H=!0,F){let z=F;F=void 0,z()}}}function h(j){B(j)}function k(j){O.push(j)}function o(j){P.push(j)}function g(){W(O,"onMount",P)}function v(){W(P,"onDestroy")}function W(j,G,F){let H=j.splice(0,j.length);for(let I of H)try{let z=I();if(F&&typeof z==="function")F.push(z)}catch(z){console.error(`[stx] ${G} callback threw:`,z)}}function d(){return{mount:O.length,destroy:P.length}}function m(j){return typeof j==="function"&&j._isSignal===!0}function D(j){return typeof j==="function"&&j._isDerived===!0}function p(j){if(m(j)||D(j))return j();return j}function w(j){return A(j)}function f(j,G){let F=typeof j==="function"?j:()=>j,H=q([]),I=E(()=>H().reduce((K,M)=>G(K,M.action),F())),z=!1;return V(()=>{if(F(),!z){z=!0;return}if(w(()=>H().length))H.set([])}),[I,(K,M)=>{let T={action:K};H.set([...H(),T]);let Q=()=>{let x=H().filter((C)=>C!==T);if(x.length!==H().length)H.set(x)};if(M&&typeof M.then==="function")Promise.resolve(M).then(Q,Q);return Q}]}
3
+ export{X as vj,Y as wj,Z as xj,_ as yj,$ as zj,q as Aj,E as Bj,V as Cj,h as Dj,k as Ej,o as Fj,g as Gj,v as Hj,d as Ij,m as Jj,D as Kj,p as Lj,w as Mj,f as Nj};
@@ -0,0 +1,19 @@
1
+ // @bun
2
+ import{$g as KH,Ug as v,Vg as i,Wg as t,Zg as e,_g as HH,ah as QH,bh as YH,ch as ZH}from"./chunk-qr82je1m.js";import{Xi as s}from"./chunk-z4jhj5e5.js";import{Ql as a}from"./chunk-y11cxbxd.js";import{yt as h}from"./chunk-5kk8gsj2.js";import{Wt as f}from"./chunk-v5e1gxwm.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
3
+ `.repeat(K.startLine-1):"",N=t(i(K.code)),X=K.kind==="client"||K.kind==="plain"?HH(Q,K.code):"";return QH(`${L+N}
4
+ ${X}
5
+ export {}
6
+ `,V)}function WH(K){let Q=K.length>0?J.dirname(J.resolve(K[0])):process.cwd();try{Bun.resolveSync("@stacksjs/stx",Q)}catch{return""}return["// Generated \u2014 `stx` is the virtual specifier client-script.ts strips.","declare module 'stx' {"," export * from '@stacksjs/stx'","}"].join(`
7
+ `)}var AH=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function MH(K){if(K.length===0)return"";let Q=["// Generated \u2014 the composables the runtime publishes as bare globals."],V=new Set(f),L=[];for(let{file:N,names:X}of K){let W=JSON.stringify(N.replace(/\\/g,"/").replace(/\.ts$/,""));L.push(` export * from ${W}`);for(let q of X){if(V.has(q)||AH.has(q))continue;V.add(q),Q.push(`declare const ${q}: typeof import(${W})[${JSON.stringify(q)}]`)}}return Q.push("declare module '@composables' {",...L,"}"),Q.join(`
8
+ `)}function r(K,Q,V){return`${K}.__stx_${Q}${V}.ts`}function yH(K){return K.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function UH(){for(let K of[J.resolve(import.meta.dir,"..","stx.d.ts"),J.resolve(import.meta.dir,"..","..","stx.d.ts")])if($H(K))return K;return null}var IH=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function LH(K){return K>=1000&&K<2000}function NH(K){let Q=J.resolve(K),V;for(;;){let Z=J.join(Q,"tsconfig.json");if($H(Z)){V=Z;break}let $=J.dirname(Q);if($===Q)break;Q=$}if(!V)return{};let L=(Z)=>{let $="",A=!1,U=!1;for(let j=0;j<Z.length;j++){let M=Z[j];if(A){if($+=M,U)U=!1;else if(M==="\\")U=!0;else if(M==='"')A=!1;continue}if(M==='"'){A=!0,$+=M;continue}if(M==="/"&&Z[j+1]==="/"){while(j<Z.length&&Z[j]!==`
9
+ `)j++;$+=`
10
+ `;continue}if(M==="/"&&Z[j+1]==="*"){j+=2;while(j<Z.length&&!(Z[j]==="*"&&Z[j+1]==="/"))j++;j++;continue}$+=M}return $.replace(/,(\s*[}\]])/g,"$1")},N=new Set,X=V,W,q,B=V;while(X&&!N.has(X)){N.add(X);let Z;try{Z=JSON.parse(L(qH(X,"utf8")))}catch{break}let $=Z?.compilerOptions??{};if(!W&&$.paths&&typeof $.paths==="object")W=$.paths,B=X;if(!q&&typeof $.baseUrl==="string")q=J.resolve(J.dirname(X),$.baseUrl);if(W&&q)break;X=typeof Z?.extends==="string"?J.resolve(J.dirname(X),Z.extends.endsWith(".json")?Z.extends:`${Z.extends}.json`):void 0}if(!W)return{};let T=q??J.dirname(B),R={};for(let[Z,$]of Object.entries(W)){if(!Array.isArray($))continue;R[Z]=$.map((A)=>typeof A==="string"&&!J.isAbsolute(A)?J.resolve(T,A):A)}return{paths:R}}async function PH(K,Q={}){let V=Q.client!==!1,L=Q.server!==!1,N=Q.templates!==!1,X=new Map,W=new Map,q=[],B=0,T=0,R=UH();for(let H of K){let Y=await Bun.file(H).text(),G=v(Y).filter((z)=>{if(z.kind==="server")return L;return V}),I=v(Y).filter((z)=>z.kind==="server").map((z)=>z.code).join(`
11
+ `);if(V&&I){let z=G.filter((O)=>O.kind!=="server"),F=[...new Set(z.flatMap((O)=>KH(I,O.code)))];if(F.length>0)W.set(H,{names:F,line:z[0].startLine,kind:z[0].kind})}let _=J.dirname(J.resolve(H)),E=N?YH(Y,{runtimeGlobals:!R,originDir:_}):null,C=E?[...E.lineMap.values()].filter((z)=>z.expression).length:0;if(G.length===0&&C===0)continue;if(q.push(H),B+=G.length,T+=C,G.forEach((z,F)=>{X.set(r(H,z.kind,F),{source:GH(z,I,_),origin:H,kind:z.kind})}),E&&C>0)X.set(r(H,"template",0),{source:E.text,origin:H,kind:"template",virtual:E})}if(X.size===0)return{diagnostics:[],checkedFiles:q,blockCount:0,expressionCount:0};let Z=(Q.extraLibs??[]).map((H)=>J.resolve(H));if(R)Z.push(R);let $=`${h()}/typecheck/__stx_globals.d.ts`,A=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",e(),...R?[]:["declare const window: any",...f.map((H)=>`declare const ${H}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...a.map((H)=>`declare const ${H}: any`)].join(`
12
+ `),WH(K),MH(await s())].filter(Boolean).join(`
13
+ `),U=`${h()}/typecheck`;await Bun.$`rm -rf ${U}`.quiet().nothrow(),await Bun.$`mkdir -p ${U}`.quiet().nothrow(),await Bun.write($,A);let j=new Map,M=0;for(let[H,Y]of X){let G=`${M++}_${H.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${U}/${G}`,Y.source),j.set(G,Y)}let jH={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...NH(K.length>0?J.dirname(J.resolve(K[0])):process.cwd()),...Q.compilerOptions??{}},k=async(H,Y)=>{let G=`${U}/tsconfig${Y===1?"":`.${Y}`}.json`;await Bun.write(G,JSON.stringify({compilerOptions:jH,files:H.map((_)=>`${U}/${_}`).concat($,...Z)},null,2));let I=Bun.spawnSync(["bun","x","tsc","-p",G,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(I.stdout)+new TextDecoder().decode(I.stderr),exitCode:I.exitCode??0}},m=await k([...j.keys()],1),b=m.output,S=[],u=m.exitCode,d=0,zH=new Set(Z.map((H)=>H.split("/").pop())),p=0,y=new Set,l=(H)=>{for(let Y of H.split(`
14
+ `)){let G=Y.match(IH);if(!G)continue;if(d++,zH.has(G[1].split("/").pop()))p++;let[,I,_,E,C,z,F]=G,O=I.split("/").pop(),w=j.get(O);if(!w)continue;if(LH(Number(z)))y.add(O);let g=Number(_),x=Number(E),o;if(w.virtual){let P=ZH(w.virtual,g,x);if(!P?.expression)continue;if(Number(z)===2774)continue;g=P.line,x=P.column,o=P.expression.code.trim()}S.push({file:w.origin,line:g,column:x,code:Number(z),message:F,category:C==="error"?"error":"warning",blockKind:w.kind,expression:o})}};l(b);let JH=d,VH=p;if(y.size>0&&y.size<j.size){let H=[...j.keys()].filter((Y)=>!y.has(Y));l((await k(H,2)).output)}if(V)for(let[H,Y]of W){if(Y.names.length===0)continue;S.push({file:H,line:Y.line,column:1,code:0,message:`${Y.names.length===1?"1 value reaches":`${Y.names.length} values reach`} this block on the implicit bridge and ${Y.names.length===1?"is":"are"} untyped: ${Y.names.join(", ")}. Declare them with defineClientPayload({ ${Y.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:Y.kind})}let c=new Set,D=S.filter((H)=>{let Y=`${H.file}:${H.line}:${H.column}:${H.code}:${H.message}`;if(c.has(Y))return!1;return c.add(Y),!0});D.sort((H,Y)=>H.file.localeCompare(Y.file)||H.line-Y.line||H.column-Y.column);let n=VH>0&&D.length===0,XH=n||u!==0&&JH===0?`${n?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${u} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
15
+ ${b.trim().split(`
16
+ `).slice(0,12).join(`
17
+ `)||"(no output)"}`:void 0;return{diagnostics:D,checkedFiles:q,blockCount:B,expressionCount:T,failure:XH}}function vH(K){return K.map((Q)=>{let V=Q.blockKind==="template"?`[template: ${Q.expression??""}]`:`[${Q.blockKind==="plain"?"<script>":`<script ${Q.blockKind}>`}]`;return`${Q.file}:${Q.line}:${Q.column} ${Q.category} TS${Q.code} ${Q.message} ${V}`}).join(`
18
+ `)}
19
+ export{GH as hf,r as if,yH as jf,UH as kf,PH as lf,vH as mf};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Ds as Q}from"./chunk-92mj1t26.js";import"./chunk-pkaabd8h.js";import{yt as R}from"./chunk-5kk8gsj2.js";import"./chunk-qc1f74ek.js";import O from"fs";import U from"path";async function W(j,b={}){let q=Date.now(),z={total:0,passed:0,failed:0,new:0,failures:[],duration:0},K=b.snapshotDir||R(j.root,"story","snapshots");await O.promises.mkdir(K,{recursive:!0});let B=j.storyFiles;if(b.filter&&b.filter.length>0)B=B.filter((J)=>b.filter.some((G)=>J.fileName.toLowerCase().includes(G.toLowerCase())));for(let J of B)await X(J,K,b,z);return z.duration=Date.now()-q,z}async function X(j,b,q,z){let K=j.story;if(!K)return;for(let B of K.variants){z.total++;let J=U.join(b,`${j.id}-${B.id}.snap`),G=Y(B.source||""),L=await _(J);if(q.update||!L){let M={storyId:j.id,variantId:B.id,component:j.fileName,timestamp:Date.now(),hash:G};if(await O.promises.writeFile(J,JSON.stringify(M,null,2)),!L)z.new++;z.passed++}else try{let M=await O.promises.readFile(J,"utf-8"),N=JSON.parse(M);if(N.hash===G)z.passed++;else z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:"Snapshot mismatch",difference:Z(N.hash,G)})}catch(M){z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:`Error reading snapshot: ${M}`})}}}async function A(j,b={}){return(await W(j,{...b,update:!0})).total}function Y(j){let b=0;for(let q=0;q<j.length;q++){let z=j.charCodeAt(q);b=(b<<5)-b+z,b=b&b}return b.toString(16)}function Z(j,b){if(j===b)return 0;let q=Math.abs(Number.parseInt(j,16)-Number.parseInt(b,16));return Math.min(q/1e6,1)}async function _(j){try{return await O.promises.access(j),!0}catch{return!1}}function I(j){let b=[];if(b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(" STX Story Visual Regression Tests"),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),j.failures.length>0){b.push(" \u274C Failures:"),b.push("");for(let q of j.failures){if(b.push(` \u2022 ${q.component} / ${q.variantId}`),b.push(` ${q.message}`),q.difference!==void 0)b.push(` Difference: ${(q.difference*100).toFixed(2)}%`);b.push("")}}if(b.push(" Summary:"),b.push(` Total: ${j.total}`),b.push(` Passed: ${j.passed} \u2713`),b.push(` Failed: ${j.failed} \u2717`),j.new>0)b.push(` New: ${j.new} \u26A1`);return b.push(` Time: ${j.duration}ms`),b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),b.join(`
3
+ `)}async function S(j,b={}){let q=performance.now(),z=[],K=0,B=0;for(let G of j.storyFiles)try{let L=await Bun.file(G.path).text(),M=await Q(L,G.path);if(M.length>0){for(let N of M)z.push({storyId:G.id,variantId:"default",component:G.component,message:`A11y: ${N.message}`,expected:"No accessibility violations",actual:`${N.type}: ${N.message} (impact: ${N.impact})`});B++}else K++}catch(L){z.push({storyId:G.id,variantId:"default",component:G.component,message:`Failed to check a11y: ${L instanceof Error?L.message:String(L)}`,expected:"File readable for a11y check",actual:"File read error"}),B++}let J=performance.now()-q;return{total:j.storyFiles.length,passed:K,failed:B,new:0,failures:z,duration:J}}export{A as updateSnapshots,W as runVisualTests,S as runA11yTests,I as formatTestResults};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{eg as a,fg as b,gg as c,hg as d,ig as e,jg as f,kg as g,lg as h,mg as i,ng as j,og as k}from"./chunk-kxzb4et3.js";import"./chunk-74cv4ta1.js";import"./chunk-qc1f74ek.js";export{c as setCachedVideoResult,k as processVideo,b as getCachedVideoResult,f as generateThumbnails,g as generateSpriteSheet,e as generatePoster,h as generateHLSManifest,i as generateDASHManifest,d as clearVideoCache,j as analyzeVideo,a as VideoProcessorCache};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{jm as a,km as b,lm as c,mm as d,nm as e,om as f,pm as g,qm as h,rm as i,sm as j,tm as k,um as l,vm as m,wm as n,xm as o}from"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{h as usesSignalsInScript,o as unescapeHtml,c as registerFilters,b as registerFilter,l as processExpressions,k as interpolateScriptsInTemplate,i as interpolateScriptExpressions,j as interpolateScriptAttributes,d as getAllFilters,n as evaluateExpression,g as escapeHtmlValue,f as escapeHtml,a as defaultFilters,e as clearCustomFilters,m as applyFilters};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ef as a}from"./chunk-7b329e5v.js";import"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";export{a as buildApp};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{Yg as p}from"./chunk-qr82je1m.js";import{ph as a,rh as JF,sh as ZF,th as qF}from"./chunk-rbb7dvja.js";import{sj as C,tj as D}from"./chunk-866y9d8b.js";import{Ek as QF,Fk as XF,Gk as YF}from"./chunk-58f0mthg.js";import{Cp as FF,Gp as c,Jm as u,_n as o,bm as d,br as n,dm as l,dr as N,fp as e,up as t}from"./chunk-y11cxbxd.js";import{tt as r}from"./chunk-wrzwgkbx.js";import{Wu as S,Yu as WF}from"./chunk-b6ej2fdf.js";import G from"fs";import Z from"path";import{createHash as $F}from"crypto";WF();function g(J){return $F("sha256").update(J).digest("hex").slice(0,8)}function f(J=!1){let q=J?D():C(),z=g(q);return{content:q,filename:`runtime.${z}.js`,hash:z}}function m(){let J=S(),q=g(J);return{content:J,filename:`router.${q}.js`,hash:q}}function UF(J){return{runtimeTag:J.runtime?`<script src="/__stx/${J.runtime.filename}"></script>`:"",routerTag:J.router?`<script src="/__stx/${J.router.filename}"></script>`:"",cssTag:J.css?`<link rel="stylesheet" href="/__stx/${J.css.filename}">`:""}}import h from"path";import{createHash as GF}from"crypto";function VF(J={}){let q=new Set;return{context:new Proxy(J,{get(Q,X){if(X in Q)return Q[X];if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return},has(Q,X){if(X in Q)return!0;if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return!1}}),accessedKeys:q}}async function i(J,q,z={}){let Q=h.resolve(J),X=await Bun.file(Q).text(),I=GF("sha256").update(X).digest("hex").slice(0,16);d();let K={};try{K=await N()}catch{}let B=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(X))!==null){let $=k[1];if(/\bserver\b/.test($))B.push(k[2])}let W=new Set(B.flatMap(($)=>p($))),{context:w}=VF({__filename:Q,__dirname:h.dirname(Q),__stx_serverDeclared:W}),E=new Set,L={...n,...K,...z,buildMode:"compile",strict:!1},_=await c(X,w,Q,L,E),U=a(_),H=l();return{route:q,sourceFile:J,html:_,fragment:U,placeholders:H,hasServerScripts:B.length>0,serverScriptContent:B,dependencies:Array.from(E),contentHash:I,status:u(X),streamTemplates:w.__streamTemplates}}var kF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function s(J,q){let z=0,Q=0;if(!G.existsSync(J))return{copied:z,bytes:Q};G.mkdirSync(q,{recursive:!0});function X(I,K){let B=G.readdirSync(I,{withFileTypes:!0});for(let V of B){if(kF.has(V.name))continue;let k=Z.join(I,V.name),W=Z.join(K,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),X(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),z++,Q+=G.statSync(W).size}}}return X(J,q),{copied:z,bytes:Q}}async function dF(J={}){let q=Date.now(),z=Z.resolve(J.root||process.cwd()),Q=Z.resolve(z,J.outputDir||".output");console.log("[stx build] Starting production build...");let X={};try{X=await N()}catch{}let I=J.componentsDir??X.componentsDir??"components",K=J.partialsDir??X.partialsDir??"partials",B=J.layoutsDir??X.layoutsDir??"layouts",V=J.publicDir??X.publicDir??"public",k=X.app?.head||{},W=X.app?.colorMode,w=X.router?.container||"main";if(G.existsSync(Q))G.rmSync(Q,{recursive:!0});let E=[Z.join(Q,"public","__stx"),Z.join(Q,"public","assets"),Z.join(Q,"server","pages"),Z.join(Q,"server","fragments")];for(let Y of E)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let L=o(z),_=["components","layouts","partials"],U=L.filter((Y)=>{return!_.some((F)=>Y.pattern.startsWith(`/${F}/`)||Y.pattern===`/${F}`)});console.log(`[stx build] Found ${U.length} page routes (${L.length-U.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let H=f(J.debug),$=m();await Bun.write(Z.join(Q,"public","__stx",H.filename),H.content),await Bun.write(Z.join(Q,"public","__stx",$.filename),$.content),console.log(`[stx build] Runtime: ${H.filename} (${(H.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${$.filename} (${($.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let O=[],j=[];for(let Y of U)try{let F=await i(Y.filePath,Y.pattern,{componentsDir:I,partialsDir:K,layoutsDir:B,debug:J.debug});if(O.push(F),F.html=F.html.replace(/runtime\.__STX_HASH__\.js/g,H.filename).replace(/router\.__STX_HASH__\.js/g,$.filename),F.html=FF(F.html,k,{bodyScripts:[`<script src="/__stx/${$.filename}"></script>`],...W&&{colorMode:W}}),W)F.html=e(F.html,W);if(k.htmlAttrs)F.html=t(F.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(F.html)){let T=F.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(T&&T[1]){let P=T[1];F.html=F.html.replace(" "+P,""),F.html=F.html.replace(/<body([^>]*)>/,`<body$1 ${P}>`)}}F.html=F.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),F.html=await r(F.html),F.fragment=JF(F.html,w);let y=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),b=Z.join("server","pages",`${y}.compiled.json`),A=Z.join("server","fragments",`${y}.html`);await Bun.write(Z.join(Q,b),JSON.stringify(F,null,2)),await Bun.write(Z.join(Q,A),F.fragment),j.push({pattern:Y.pattern,compiledPath:b,fragmentPath:A,isDynamic:F.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("[")}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(F){console.error(`[stx build] \u2717 ${Y.pattern}:`,F instanceof Error?F.message:F)}let M=Z.resolve(z,V);if(G.existsSync(M)){let{copied:Y,bytes:F}=s(M,Z.join(Q,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${V}/`)}let v=YF(z);if(v){let{copied:Y,bytes:F}=s(v,Z.join(Q,"public",XF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${QF}/`)}let R={runtime:H.filename,router:$.filename},zF=ZF(j,R,Q);qF(zF,Q);let x=Date.now()-q;return console.log(`
3
+ [stx build] Done in ${x}ms \u2014 ${O.length} pages compiled`),{pageCount:O.length,assets:R,outputDir:Q,duration:x}}
4
+ export{g as Og,f as Pg,m as Qg,UF as Rg,i as Sg,dF as Tg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Vs as a,Ws as b}from"./chunk-pkaabd8h.js";import"./chunk-qc1f74ek.js";export{b as resolveStxTargets,a as looksLikeGlob};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Dt as a,Et as b,Ft as c,Gt as d,Ht as e,It as f,Jt as g,Kt as h,Lt as i,Mt as j,Nt as k,Ot as l,Pt as m,Qt as n,Rt as o,St as p}from"./chunk-ypmqf7tm.js";import"./chunk-qc1f74ek.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
@@ -0,0 +1,12 @@
1
+ // @bun
2
+ import{Op as M,Rl as x}from"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import{at as B,ct as P}from"./chunk-wrzwgkbx.js";import"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import"./chunk-qc1f74ek.js";import G from"path";var T=["broadcast","calculateDistance","canNotify","clearCookies","clearFetchCache","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],O=new Set(T);var K=new Map,U=B(64),V=new Set,D=0,N=new Set(T);function f(){K.clear(),U.clear()}function S(H){let J=new Map;for(let Q of H){let Z=G.basename(Q);if(Z.endsWith(".d.ts"))continue;let z=Z.replace(/\.[jt]s$/,"");if(z==="index")continue;if(z===Z)continue;let X=J.get(z);if(X&&!X.endsWith(".js"))continue;J.set(z,Q)}return[...J.values()].sort()}function g(H,J){let Q=J.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${Q}\\b`).test(H)}function y(H){if(!H)return[];let J=P(H,D),Q=U.get(J);if(Q)return Q.slice();let Z=H.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),z=[];for(let X of N){if(V.has(X))continue;let A=X.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${A}\\s*\\(`).test(Z))z.push(X)}return z.sort(),U.set(J,z),z.slice()}async function p(H,J){let Q=y(H);if(Q.length===0)return null;let Z=J??G.join(import.meta.dir,"composables"),z=`${Z}\x00${Q.join(",")}`,X=K.get(z);if(X!==void 0)return X||null;let A=M({loader:"ts",target:"browser",define:x()}),L=new Set(Q),W=[],C=new Set,F=[];try{let q=new Bun.Glob("*.{ts,js}");for await(let j of q.scan({cwd:Z,absolute:!0}))F.push(j)}catch{return K.set(z,""),null}F=S(F);for(let q of F){let j;try{j=await Bun.file(q).text()}catch{continue}let I=[];try{I=A.scan(j).exports.filter(($)=>$!=="default")}catch{continue}if(!I.some(($)=>L.has($)))continue;try{j=j.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^import\s+type\s+.*$/gm,""),j=j.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),j=j.replace(/^export\s+default\s+/gm,""),j=j.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),W.push(`// ${G.basename(q).replace(/\.[jt]s$/,"")}
3
+ ${A.transformSync(j).trim()}`);for(let $ of I)C.add($)}catch($){console.warn(`[stx] framework composable ${G.basename(q)} could not be bundled:`,$)}}let Y=Q.filter((q)=>!C.has(q)&&!g(H,q));if(Y.length>0)console.warn(`[stx] could not bundle ${Y.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(W.length===0)return K.set(z,""),null;let k=[...C].map((q)=>` try { if (!(${JSON.stringify(q)} in __s)) { __s[${JSON.stringify(q)}] = ${q}; if (!(${JSON.stringify(q)} in window)) window[${JSON.stringify(q)}] = ${q}; } } catch (e) {}`).join(`
4
+ `),w=`<script data-stx-framework-composables>
5
+ ;(function(){
6
+ var __s = window.stx = window.stx || {};
7
+ ${W.join(`
8
+
9
+ `)}
10
+ ${k}
11
+ })();
12
+ </script>`;return K.set(z,w),w}function l(H){V.clear();for(let J of H)V.add(J);D++}export{S as selectComposableFiles,y as referencedFrameworkComposables,p as getFrameworkComposableScript,f as clearFrameworkComposableCache,l as __setRuntimeOwnedForTest};
@@ -0,0 +1,8 @@
1
+ // @bun
2
+ import Q from"fs";import U from"path";function W(H){let v=[],j=H.pwa;if(v.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:j?.enabled===!0,message:j?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!j?.enabled)return v;v.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(j.manifest?.name),message:j.manifest?.name?`App name: "${j.manifest.name}"`:"Missing required manifest name"}),v.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(j.manifest?.shortName),message:j.manifest?.shortName?`Short name: "${j.manifest.shortName}"`:"Short name not set (will use full name)"}),v.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(j.manifest?.description),message:j.manifest?.description?"Description is set":"App description not provided"}),v.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(j.manifest?.themeColor),message:j.manifest?.themeColor?`Theme color: ${j.manifest.themeColor}`:"Theme color not set"}),v.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(j.manifest?.backgroundColor),message:j.manifest?.backgroundColor?`Background color: ${j.manifest.backgroundColor}`:"Background color not set"}),v.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(j.manifest?.display||""),message:j.manifest?.display?`Display mode: ${j.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),v.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(j.manifest?.startUrl),message:j.manifest?.startUrl?`Start URL: ${j.manifest.startUrl}`:"Start URL not set"}),v.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(j.icons?.src),message:j.icons?.src?`Icon source: ${j.icons.src}`:"No icon source configured"});let J=j.icons?.sizes||[];v.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:J.includes(192),message:J.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),v.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:J.includes(512),message:J.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),v.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:j.icons?.purpose?.includes("maskable")||!1,message:j.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),v.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(j.serviceWorker),message:j.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),v.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(j.serviceWorker?.cacheVersion),message:j.serviceWorker?.cacheVersion?`Cache version: ${j.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),v.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:j.offline?.enabled===!0,message:j.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let L=j.routes||[];return v.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:L.length>0,message:L.length>0?`${L.length} route caching strategies configured`:"No custom caching strategies defined"}),v.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!j.push?.enabled||Boolean(j.push?.vapidPublicKey),message:j.push?.enabled?j.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),v.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:j.shareTarget?.enabled?`Share target enabled at ${j.shareTarget.action}`:"Share target not enabled"}),v.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:j.autoInject!==!1,message:j.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),v}function X(H){let v=[],j=U.join(H,"manifest.json"),J=Q.existsSync(j);if(v.push({id:"build-manifest",name:"Manifest File",category:"required",passed:J,message:J?"manifest.json exists":"manifest.json not found in build output"}),J)try{let M=JSON.parse(Q.readFileSync(j,"utf-8"));v.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),v.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(M.icons)&&M.icons.length>0,message:M.icons?.length?`${M.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{v.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let L=U.join(H,"sw.js"),N=Q.existsSync(L);v.push({id:"build-sw",name:"Service Worker File",category:"required",passed:N,message:N?"Service worker (sw.js) exists":"Service worker not found in build output"});let K=U.join(H,"offline.html"),T=Q.existsSync(K);v.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:T,message:T?"Offline page exists":"No offline.html found"});let I=U.join(H,"pwa-icons");if(Q.existsSync(I)){let M=Q.readdirSync(I).filter((V)=>V.endsWith(".png")||V.endsWith(".webp"));v.push({id:"build-icons",name:"Generated Icons",category:"required",passed:M.length>0,message:M.length>0?`${M.length} icon files generated`:"No icon files found"})}else v.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return v}function Y(H){let v=H.filter((I)=>I.category==="required"),j=H.filter((I)=>I.category==="recommended"),J=v.filter((I)=>I.passed).length,L=j.filter((I)=>I.passed).length,N=v.length>0?J/v.length*70:70,K=j.length>0?L/j.length*30:30;return{score:Math.round(N+K),passed:H.filter((I)=>I.passed).length,failed:H.filter((I)=>!I.passed&&I.category==="required").length,warnings:H.filter((I)=>!I.passed&&I.category!=="required").length,checks:H}}function A(H,v){let j=W(H),J=v&&Q.existsSync(v)?X(v):[];return Y([...j,...J])}function B(H){let v=[];v.push(`
3
+ === PWA Audit Report ===
4
+ `);let j=H.score>=90?"32":H.score>=70?"33":"31";v.push(`Score: \x1B[${j}m${H.score}/100\x1B[0m`),v.push(`Passed: ${H.passed} | Failed: ${H.failed} | Warnings: ${H.warnings}
5
+ `);let J=["required","recommended","optional"];for(let L of J){let N=H.checks.filter((K)=>K.category===L);if(N.length===0)continue;v.push(`
6
+ ${L.toUpperCase()}:`);for(let K of N){let T=K.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(v.push(` ${T} ${K.name}: ${K.message}`),K.details)v.push(` ${K.details}`)}}return v.push(""),v.join(`
7
+ `)}
8
+ export{W as Hk,X as Ik,Y as Jk,A as Kk,B as Lk};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cf as a,Df as b}from"./chunk-mkd9kjgb.js";import"./chunk-dhh5q7qt.js";import"./chunk-qc1f74ek.js";export{a as handleImageRequest,b as createImageHandler};
@@ -0,0 +1,8 @@
1
+ // @bun
2
+ var P=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function k(j,q={}){let F=performance.now(),G={target:q.target||"universal",format:q.format||"zig",optimize:q.optimize??!0,treeShake:q.treeShake??!0,hotReload:q.hotReload??!1,debug:q.debug??!1,sourceMaps:q.sourceMaps??!1,bundle:q.bundle??!0,minify:q.minify??!1,components:q.components||P},Q=typeof j==="string"?I(j):j,U=z(Q.tree,G),W=f(U),K=G.treeShake?m(U,W):U,X=new Map;if(G.target==="universal"){let $=["macos","windows","linux","ios","android"];for(let _ of $){let R=J(K,{...G,target:_});X.set(_,R)}}else{let $=J(K,G);X.set(G.target,$)}let Y=s(K,G,X),x=r(Q,K,G),M={compilationTime:performance.now()-F,totalComponents:B(Q.tree),nativeComponents:b(K),webComponents:B(Q.tree)-b(K),bundleSize:Y.length,treeShakenSize:G.treeShake?g(U,K):Y.length,warnings:[],errors:[]},L;if(G.sourceMaps)L=p(Q,K);return{code:Y,platformCode:X,dependencies:W,manifest:x,sourceMaps:L,stats:M}}function I(j){let q={type:"fragment",children:[]},F=j.match(/<body[^>]*>([\s\S]*?)<\/body>/i),G=F?F[1]:j;return A(G,q),{id:E(),hash:D(j),tree:q,scripts:i(j),styles:a(j),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:j.includes("{{"),hasEventHandlers:j.includes("onclick")||j.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:j.length}}}function A(j,q){let F=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,G;while((G=F.exec(j))!==null){let[,Q,U,W]=G,K=Q.startsWith("@craft-"),X={type:K?"component":"element",tag:K?Q.slice(1):Q,props:S(U),children:[],componentName:K?Q.slice(1):void 0};if(W){let Y=W.replace(/<[^>]+>/g,"").trim();if(Y)X.children=X.children??[],X.children.push({type:"text",text:Y});A(W,X)}q.children=q.children??[],q.children.push(X)}}function S(j){let q={},F=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,G;while((G=F.exec(j))!==null){let[,Q,U]=G;q[Q]=U??!0}return q}function z(j,q){return Z(j,q)}function Z(j,q){let F=j.componentName?q.components?.get(j.componentName):void 0,G="craft.View";if(F)G=F.zigType;else if(j.type==="text")G="craft.Text";else if(j.tag)G=T(j.tag);let Q={};if(j.props)for(let[X,Y]of Object.entries(j.props))Q[X]=N(Y);let U=[];if(j.children)for(let X of j.children)U.push(Z(X,q));let W=new Map;if(j.props){for(let[X,Y]of Object.entries(j.props))if(X.startsWith("on")&&typeof Y==="string")W.set(X.slice(2).toLowerCase(),Y)}let K=C(j);return{type:y(j,F),zigType:G,props:Q,children:U,events:W,styles:K,id:j.hydrationKey,key:j.props?.key}}function T(j){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[j.toLowerCase()]||"craft.View"}function N(j){if(typeof j==="string"){if(j.startsWith("{{")&&j.endsWith("}}"))return{type:"binding",path:j.slice(2,-2).trim()};if(j.includes("(")&&j.includes(")"))return{type:"callback",handler:j};return{type:"literal",value:j}}if(typeof j==="number"||typeof j==="boolean")return{type:"literal",value:j};return{type:"literal",value:String(j)}}function y(j,q){if(q){let G=q.name.toLowerCase();if(G.includes("button"))return"button";if(G.includes("input")||G.includes("text"))return"input";if(G.includes("image")||G.includes("avatar"))return"image";if(G.includes("list")||G.includes("table"))return"list";if(G.includes("scroll"))return"scroll";return"custom"}if(j.type==="text")return"text";let F=j.tag?.toLowerCase();if(F==="button")return"button";if(F==="input"||F==="textarea")return"input";if(F==="img")return"image";if(F==="ul"||F==="ol")return"list";return"view"}function C(j){let q=j.props?.style,F={},G={};if(q){let Q=q.split(";").filter(Boolean);for(let U of Q){let[W,K]=U.split(":").map((X)=>X.trim());if(!W||!K)continue;switch(W){case"display":F.display=K;break;case"flex-direction":F.flexDirection=K;break;case"justify-content":F.justifyContent=h(K);break;case"align-items":F.alignItems=v(K);break;case"gap":F.gap=Number.parseInt(K,10);break;case"padding":F.padding=Number.parseInt(K,10);break;case"margin":F.margin=Number.parseInt(K,10);break;case"width":F.width=K==="auto"?"auto":Number.parseInt(K,10);break;case"height":F.height=K==="auto"?"auto":Number.parseInt(K,10);break;case"background-color":case"background":G.backgroundColor=K;break;case"border-color":G.borderColor=K;break;case"border-width":G.borderWidth=Number.parseInt(K,10);break;case"border-radius":G.borderRadius=Number.parseInt(K,10);break;case"opacity":G.opacity=Number.parseFloat(K);break}}}return{layout:F,appearance:G}}function h(j){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[j]||"start"}function v(j){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[j]||"start"}function f(j){let q=[],F=new Set;function G(Q,U){let W=Q.id||E();if(F.has(W))return;F.add(W);let K={id:W,type:"component",path:Q.zigType,dependencies:U?[U]:[],size:w(Q),isStatic:u(Q)};q.push(K);for(let X of Q.children)G(X,W)}return G(j),q}function w(j){let q=100;return q+=Object.keys(j.props).length*20,q+=j.events.size*50,q}function u(j){for(let q of Object.values(j.props))if(q.type!=="literal")return!1;return j.events.size===0}function m(j,q){return j}function g(j,q){let F=0;function G(Q){F+=w(Q);for(let U of Q.children)G(U)}return G(q),F}function J(j,q){switch(q.format){case"zig":return H(j,q);case"typescript":return c(j,q);case"json":return JSON.stringify(j,null,q.minify?0:2);default:return H(j,q)}}function H(j,q){let F=[];return F.push("// Auto-generated by stx compiler"),F.push("// Target: "+q.target),F.push(""),F.push('const std = @import("std");'),F.push('const craft = @import("craft");'),F.push(""),F.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),F.push(" return try build(allocator);"),F.push("}"),F.push(""),O(j,F,0),F.join(`
3
+ `)}function O(j,q,F){let G=" ".repeat(F);if(F===0)q.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let Q=`node_${F}`;q.push(`${G} var ${Q} = try ${j.zigType}.init(allocator);`);for(let[U,W]of Object.entries(j.props))if(W.type==="literal"){let K=typeof W.value==="string"?`"${W.value}"`:String(W.value);q.push(`${G} ${Q}.set${l(U)}(${K});`)}for(let U=0;U<j.children.length;U++){let W=j.children[U];if(W.type==="text"){let K=W.props.text?.type==="literal"?String(W.props.text.value):"";q.push(`${G} try ${Q}.addChild(try craft.Text.init(allocator, "${K}"));`)}else O(W,q,F+1),q.push(`${G} try ${Q}.addChild(node_${F+1});`)}if(F===0)q.push(` return ${Q}.element();`),q.push("}")}function c(j,q){let F=[];return F.push("// Auto-generated by stx compiler"),F.push("// Target: "+q.target),F.push(""),F.push('import { Craft } from "@stacksjs/craft";'),F.push(""),F.push("export function render(): Craft.Element {"),F.push(" return "+V(j,1)+";"),F.push("}"),F.join(`
4
+ `)}function V(j,q){let F=" ".repeat(q),G=[];for(let[K,X]of Object.entries(j.props))if(X.type==="literal"){let Y=typeof X.value==="string"?`"${X.value}"`:String(X.value);G.push(`${K}: ${Y}`)}let Q=G.length>0?`{ ${G.join(", ")} }`:"{}",U=j.children.map((K)=>K.type==="text"?`"${K.props.text?.type==="literal"?K.props.text.value:""}"`:V(K,q+1)),W=U.length>0?`,
5
+ ${F} [${U.join(`,
6
+ ${F} `)}]`:"";return`Craft.create("${j.zigType}", ${Q}${W})`}function s(j,q,F){if(q.target==="universal"){let G=[];G.push("// Universal entry point"),G.push("");for(let[Q,U]of F)G.push(`// --- ${Q.toUpperCase()} ---`),G.push(`#if ${Q.toUpperCase()}`),G.push(U),G.push("#endif"),G.push("");return G.join(`
7
+ `)}return F.get(q.target)||J(j,q)}function r(j,q,F){let G=[];function Q(U){G.push({name:U.zigType,hash:D(JSON.stringify(U.props)),props:Object.keys(U.props),events:Array.from(U.events.keys()),slots:[],isNative:U.zigType.startsWith("craft.")});for(let W of U.children)Q(W)}return Q(q),{version:"1.0.0",components:G,entry:j.id,assets:[],styles:j.styles}}function p(j,q){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var d=0;function E(){return`id_${++d}`}function D(j){let q=0;for(let F=0;F<j.length;F++){let G=j.charCodeAt(F);q=(q<<5)-q+G,q=q&q}return Math.abs(q).toString(36)}function l(j){return j.charAt(0).toUpperCase()+j.slice(1)}function i(j){let q=[],F=/<script[^>]*>([\s\S]*?)<\/script>/gi,G;while((G=F.exec(j))!==null)q.push(G[1]);return q}function a(j){let q=[],F=/<style[^>]*>([\s\S]*?)<\/style>/gi,G;while((G=F.exec(j))!==null)q.push(G[1]);return q}function B(j){let q=j.type==="component"?1:0;if(j.children)for(let F of j.children)q+=B(F);return q}function b(j){let q=j.zigType.startsWith("craft.")?1:0;for(let F of j.children)q+=b(F);return q}function o(j){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(q)=>{console.log(`[craft-compiler] File changed: ${q}`)}}}var t={compileToNative:k,createHotReloadServer:o,NATIVE_COMPONENTS:P},e=t;
8
+ export{P as Zj,k as _j,o as $j,e as ak};
@@ -0,0 +1,24 @@
1
+ // @bun
2
+ import{Gp as X,um as W}from"./chunk-y11cxbxd.js";import V from"fs";import M from"path";import*as Y from"readline";var j={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},Q={help:{description:"Show available commands",usage:"help [command]",handler:async(q,z)=>{if(q[0]&&Q[q[0]]){let A=Q[q[0]];console.log(`
3
+ ${j.bold}${q[0]}${j.reset} - ${A.description}`),console.log(` Usage: ${j.cyan}${A.usage}${j.reset}
4
+ `)}else{console.log(`
5
+ ${j.bold}Available Commands:${j.reset}
6
+ `);for(let[A,B]of Object.entries(Q))console.log(` ${j.cyan}${A.padEnd(12)}${j.reset} ${B.description}`);console.log(`
7
+ ${j.dim}Type 'help <command>' for more details${j.reset}
8
+ `)}}},render:{description:"Render a template file",usage:"render <file> [--raw]",handler:async(q,z)=>{if(!q[0]){console.log(`${j.red}Error: Please specify a file to render${j.reset}`);return}let A=M.resolve(z.cwd,q[0]);if(!await Bun.file(A).exists()){console.log(`${j.red}Error: File not found: ${A}${j.reset}`);return}try{let B=await Bun.file(A).text(),G=q.includes("--raw");console.log(`
9
+ ${j.dim}Rendering ${A}...${j.reset}
10
+ `);let I=await X(B,z.context,A,{},new Set);if(z.lastResult=I,G)console.log(I);else I.split(`
11
+ `).forEach((L,J)=>{let O=String(J+1).padStart(3," ");console.log(`${j.dim}${O}${j.reset} ${L}`)});console.log()}catch(B){console.log(`${j.red}Error rendering template:${j.reset}`,B)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(q,z)=>{if(!q.length){console.log(`${j.red}Error: Please provide an expression to evaluate${j.reset}`);return}let A=q.join(" ");try{let B=`{{ ${A} }}`,I=(await W(B,z.context,"eval")).trim();z.lastResult=I,console.log(`${j.green}\u2192${j.reset} ${I}`)}catch(B){console.log(`${j.red}Error:${j.reset}`,B)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(q,z)=>{if(q.length<2){console.log(`${j.red}Error: Usage: set <key> <value>${j.reset}`);return}let A=q[0],B=q.slice(1).join(" "),G;try{G=JSON.parse(B)}catch{G=B}z.context[A]=G,console.log(`${j.green}\u2713${j.reset} ${A} = ${JSON.stringify(G)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(q,z)=>{if(!q[0]){console.log(`${j.red}Error: Please specify a variable to remove${j.reset}`);return}if(q[0]in z.context)delete z.context[q[0]],console.log(`${j.green}\u2713${j.reset} Removed ${q[0]}`);else console.log(`${j.yellow}Variable not found: ${q[0]}${j.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(q,z)=>{let A=Object.keys(z.context);if(A.length===0){console.log(`${j.dim}Context is empty${j.reset}`);return}console.log(`
12
+ ${j.bold}Context Variables:${j.reset}
13
+ `);for(let B of A){let G=z.context[B],I=Array.isArray(G)?"array":typeof G,K=JSON.stringify(G).slice(0,50);console.log(` ${j.cyan}${B}${j.reset} ${j.dim}(${I})${j.reset}: ${K}${K.length>=50?"...":""}`)}console.log()}},clear:{description:"Clear context or screen",usage:"clear [context|screen]",handler:async(q,z)=>{if(q[0]==="context"||!q[0])z.context={},console.log(`${j.green}\u2713${j.reset} Context cleared`);if(q[0]==="screen"||!q[0])console.clear()}},cd:{description:"Change working directory",usage:"cd <directory>",handler:async(q,z)=>{if(!q[0]){console.log(`${j.cyan}${z.cwd}${j.reset}`);return}let A=M.resolve(z.cwd,q[0]);if(!V.existsSync(A)){console.log(`${j.red}Error: Directory not found: ${A}${j.reset}`);return}if(!V.statSync(A).isDirectory()){console.log(`${j.red}Error: Not a directory: ${A}${j.reset}`);return}z.cwd=A,console.log(`${j.green}\u2713${j.reset} ${A}`)}},ls:{description:"List files in current directory",usage:"ls [pattern]",handler:async(q,z)=>{let A=q[0]||"*",B=new Bun.Glob(A),G=[];for await(let J of B.scan({cwd:z.cwd,onlyFiles:!1}))G.push(J);if(G.length===0){console.log(`${j.dim}No files found${j.reset}`);return}G.sort();let I=G.filter((J)=>J.endsWith(".stx")),K=G.filter((J)=>J.endsWith(".md")),L=G.filter((J)=>!J.endsWith(".stx")&&!J.endsWith(".md"));if(I.length>0)console.log(`
14
+ ${j.bold}Templates:${j.reset}`),I.forEach((J)=>console.log(` ${j.green}${J}${j.reset}`));if(K.length>0)console.log(`
15
+ ${j.bold}Markdown:${j.reset}`),K.forEach((J)=>console.log(` ${j.blue}${J}${j.reset}`));if(L.length>0)console.log(`
16
+ ${j.bold}Other:${j.reset}`),L.forEach((J)=>console.log(` ${j.dim}${J}${j.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(q,z)=>{if(!q[0]){console.log(`${j.red}Error: Please specify a file${j.reset}`);return}let A=M.resolve(z.cwd,q[0]);if(!await Bun.file(A).exists()){console.log(`${j.red}Error: File not found: ${A}${j.reset}`);return}let G=(await Bun.file(A).text()).split(`
17
+ `);console.log(),G.forEach((I,K)=>{let L=String(K+1).padStart(3," ");console.log(`${j.dim}${L}${j.reset} ${I}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(q,z)=>{if(!q[0]){console.log(`${j.red}Error: Please specify a JSON file${j.reset}`);return}let A=M.resolve(z.cwd,q[0]);if(!await Bun.file(A).exists()){console.log(`${j.red}Error: File not found: ${A}${j.reset}`);return}try{let B=await Bun.file(A).text(),G=JSON.parse(B);z.context={...z.context,...G},console.log(`${j.green}\u2713${j.reset} Loaded ${Object.keys(G).length} variables from ${q[0]}`)}catch(B){console.log(`${j.red}Error parsing JSON:${j.reset}`,B)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(q,z)=>{if(!q[0]){console.log(`${j.red}Error: Please specify a file name${j.reset}`);return}let A=M.resolve(z.cwd,q[0]);try{await Bun.write(A,JSON.stringify(z.context,null,2)),console.log(`${j.green}\u2713${j.reset} Context saved to ${q[0]}`)}catch(B){console.log(`${j.red}Error saving file:${j.reset}`,B)}}},history:{description:"Show command history",usage:"history [count]",handler:async(q,z)=>{let A=q[0]?Number.parseInt(q[0],10):20,B=z.history.slice(-A);if(B.length===0){console.log(`${j.dim}No history${j.reset}`);return}console.log(),B.forEach((G,I)=>{let K=String(z.history.length-B.length+I+1).padStart(3," ");console.log(`${j.dim}${K}${j.reset} ${G}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(q,z)=>{z.running=!1,console.log(`
18
+ ${j.dim}Goodbye!${j.reset}
19
+ `)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(q,z)=>Q.exit.handler(q,z)}};function Z(q,z){let A=q.split(" "),B=A[0];if(A.length===1)return Object.keys(Q).filter((G)=>G.startsWith(B));if(["render","cat","load","cd"].includes(B)){let G=A.slice(1).join(" "),I=M.dirname(G)||".",K=M.basename(G),L=M.resolve(z.cwd,I);if(V.existsSync(L)&&V.statSync(L).isDirectory())try{return V.readdirSync(L).filter((O)=>O.startsWith(K)).map((O)=>`${B} ${I==="."?"":`${I}/`}${O}`)}catch{return[]}}if(["unset","eval","set"].includes(B)){let G=A[1]||"";return Object.keys(z.context).filter((I)=>I.startsWith(G)).map((I)=>`${B} ${I}`)}return[]}async function R(q={}){let z={context:q.context||{},cwd:q.cwd||process.cwd(),history:[],running:!0,lastResult:null},A=Y.createInterface({input:process.stdin,output:process.stdout,completer:(G)=>{return[Z(G,z),G]},historySize:q.maxHistory||100});console.log(`
20
+ ${j.bold}${j.blue}stx Interactive Mode${j.reset}
21
+ ${j.dim}Type 'help' for available commands, 'exit' to quit${j.reset}
22
+ `);let B=()=>{let G=z.cwd.replace(process.env.HOME||"","~");A.question(`${j.cyan}stx${j.reset} ${j.dim}${G}${j.reset} ${j.green}>${j.reset} `,async(I)=>{let K=I.trim();if(!K){if(z.running)B();return}z.history.push(K);let L=K.match(/(?:[^\s"]|"[^"]*")+/g)||[],J=L[0]?.toLowerCase(),O=L.slice(1).map((U)=>U.replace(/^"|"$/g,""));if(J&&Q[J])try{await Q[J].handler(O,z)}catch(U){console.log(`${j.red}Error:${j.reset}`,U)}else if(J)if(K.includes("{{")||K.includes("}}"))try{let U=await W(K,z.context,"eval");console.log(`${j.green}\u2192${j.reset} ${U}`)}catch{console.log(`${j.red}Unknown command: ${J}${j.reset}`),console.log(`${j.dim}Type 'help' for available commands${j.reset}`)}else console.log(`${j.red}Unknown command: ${J}${j.reset}`),console.log(`${j.dim}Type 'help' for available commands${j.reset}`);if(z.running)B();else A.close()})};A.on("SIGINT",()=>{console.log(`
23
+ ${j.dim}(Use 'exit' to quit)${j.reset}`),B()}),B()}
24
+ export{R as pf};
@@ -0,0 +1,194 @@
1
+ // @bun
2
+ import{Gp as H,Yp as x,br as g,om as O,to as R}from"./chunk-y11cxbxd.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
3
+ <template data-suspense-fallback>Loading...</template>
4
+ </div>`),w.set(Z.name,H(Z.content,j,q,G,$))}K.enqueue(`
5
+ <script>
6
+ (function() {
7
+ window.__stxSuspense = window.__stxSuspense || {
8
+ resolve: function(name, content) {
9
+ var el = document.querySelector('[data-suspense="' + name + '"]');
10
+ if (el) {
11
+ // Create a template to parse the HTML
12
+ var template = document.createElement('template');
13
+ template.innerHTML = content;
14
+ // Replace placeholder with actual content
15
+ el.replaceWith(template.content);
16
+ }
17
+ }
18
+ };
19
+ })();
20
+ </script>`);let U=Array.from(w.entries()).map(async([Z,F])=>{K.enqueue(await N(Z,F))});await Promise.all(U)}K.close()}catch(X){K.error(X)}}})}async function N(q,B){try{let G=(await B).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
+ <script>
22
+ window.__stxSuspense.resolve('${q}', \`${G}\`);
23
+ </script>`}catch(Q){let G=Q instanceof Error?Q.message:String(Q);return`
24
+ <script>
25
+ window.__stxSuspense.resolve('${q}', '<div class="stx-error">Error loading content: ${O(G)}</div>');
26
+ </script>`}}var C=`
27
+ <script>
28
+ (function(){
29
+ window.__stxSuspense = window.__stxSuspense || {
30
+ resolve: function(name, content){
31
+ var el = document.querySelector('[data-suspense="' + name + '"]');
32
+ if (!el) return;
33
+ var t = document.createElement('template');
34
+ t.innerHTML = content;
35
+ // Keep handles to the inserted nodes \u2014 the fragment is emptied on insert.
36
+ var nodes = Array.prototype.slice.call(t.content.childNodes);
37
+ el.replaceWith(t.content);
38
+ // Hydrate the streamed content so interactive islands/directives inside
39
+ // it come alive (no-op when the signals runtime isn't on the page).
40
+ if (window.stx && typeof window.stx.hydrate === 'function') {
41
+ nodes.forEach(function(n){ if (n.nodeType === 1) window.stx.hydrate(n); });
42
+ }
43
+ }
44
+ };
45
+ })();
46
+ </script>`;function P(q,B,Q){if(!B||B<=0)return q;let G,J=new Promise((K,X)=>{G=setTimeout(()=>X(Error(`streaming boundary "${Q}" timed out after ${B}ms`)),B)});return Promise.race([q,J]).finally(()=>clearTimeout(G))}function s(q,B=[],Q={}){let G=Q.timeoutMs??0;return new ReadableStream({async start(J){try{if(J.enqueue(q),B.length>0)J.enqueue(C),await Promise.all(B.map(async(K)=>{let X=P(K.render(),G,K.id);J.enqueue(await N(K.id,X))}));J.close()}catch(K){J.error(K)}}})}var u=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function a(q,B){return q.replace(u,(Q,G,J)=>{let K=G.trim(),X=J.split(/@fallback/i),z=X[0].trim(),L=X.length>1?X.slice(1).join("@fallback").trim():"";if(!B.__streamTemplates)B.__streamTemplates={};return B.__streamTemplates[K]=z,`<div data-suspense="${K}">${L}</div>`})}function o(q){let B=q?.streamBoundaries;if(!B||typeof B!=="object")return;let Q=Object.entries(B).filter(([,G])=>typeof G==="function");return Q.length>0?Q.map(([G,J])=>({id:G,render:J})):void 0}async function n(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=new Set,$=G.streaming?.strategy||"auto",_=new RegExp(M.source,"g");if(!($!=="manual"&&_.test(Y))){let U=await H(Y,j,q,G,D);for(let Z=0;Z<U.length;Z+=J)K.enqueue(U.slice(Z,Z+J))}else{let U=[],Z=new RegExp(M.source,"g"),F;while((F=Z.exec(Y))!==null)U.push({name:F[1],content:F[2],start:F.index,end:F.index+F[0].length});let V=0;for(let W of U){if(W.start>V){let A=Y.slice(V,W.start);if(A.trim()){let I=await H(A,j,q,G,D);K.enqueue(I)}}let y=await H(W.content,j,q,G,D);K.enqueue(y),V=W.end}if(V<Y.length){let W=Y.slice(V);if(W.trim()){let y=await H(W,j,q,G,D);K.enqueue(y)}}}K.close()}catch(X){K.error(X)}}})}async function e(q,B={}){let Q={...g,...B,streaming:{...v,...B.streaming}},G=await Bun.file(q).text(),J=G.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),K=J?J[1]:"",X=G.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),z=X,L={},Y;M.lastIndex=0;while((Y=M.exec(X))!==null){let $=Y[1],_=Y[2];L[$]=_}let j=X.replace(M,"");return{renderShell:async($={})=>{let _={...$,__filename:q,__dirname:b.dirname(q)};return await R(K,_,q),H(j,_,q,Q,new Set)},renderSection:async($,_={})=>{try{if(!L[$])return`<div class="error-message">Section "${O($)}" not found in template "${O(q)}"</div>`;let w={..._,__filename:q,__dirname:b.dirname(q)};await R(K,w,q);let U=new Set;return await H(L[$],w,q,Q,U)}catch(w){let U=w instanceof Error?w.message:String(w);return x("Expression",U,q,L[$]||"",0,L[$]||"")}},getSections:()=>{return Object.keys(L)},getTemplate:()=>{return z}}}var d={name:"suspense",hasEndTag:!0,handler:(q,B,Q,G)=>{if(!B||B.length===0)throw Error("Suspense directive requires a name parameter");let J=B[0].replace(/['"`]/g,"");return`<!-- @suspense:${J} -->${q}<!-- @endsuspense:${J} -->`}},h={name:"island",hasEndTag:!0,handler:(q,B,Q,G)=>{if(!B||B.length===0)throw Error("Island directive requires a name parameter");let J=B[0].replace(/['"`]/g,""),K=B[1]?B[1].replace(/['"`]/g,""):"lazy",X=`island-${J}-${Math.random().toString(36).substring(2,9)}`,z=q.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),L=z?z[1].trim():"",Y=z?q.replace(z[0],""):q;return`<div data-island="${J}" data-island-id="${X}" data-priority="${K}">
47
+ ${Y}
48
+ <script type="application/json" data-island-props="${X}">
49
+ ${L?`{${L}}`:"{}"}
50
+ </script>
51
+ </div>`}};function t(q={}){let B=[];if(q.streaming?.enabled)B.push(d);if(q.hydration?.enabled)B.push(h);return B}async function qq(q,B,Q,G={}){return q}function Bq(q,B={}){let Q=new TextEncoder,G=q.pipeThrough(new TransformStream({transform(K,X){X.enqueue(Q.encode(K))}})),J=new Headers(B.headers);if(!J.has("Content-Type"))J.set("Content-Type","text/html; charset=utf-8");if(!J.has("Transfer-Encoding"))J.set("Transfer-Encoding","chunked");if(!J.has("X-Content-Type-Options"))J.set("X-Content-Type-Options","nosniff");if(!J.has("X-Accel-Buffering"))J.set("X-Accel-Buffering","no");return new Response(G,{...B,headers:J})}function Gq(q={mode:"full"}){let{mode:B,components:Q={},dynamicImports:G=!0}=q,J=Object.entries(Q).map(([K,X])=>`'${K}': ${G?`() => import('${X}')`:`require('${X}')`}`).join(`,
52
+ `);if(B==="loader")return`
53
+ (function() {
54
+ window.__stx = window.__stx || {};
55
+ window.__stx.islands = new Map();
56
+ window.__stx.registerComponent = function(name, component) {
57
+ window.__stx.islands.set(name, component);
58
+ };
59
+ })();`;return`
60
+ (function() {
61
+ 'use strict';
62
+
63
+ // Hydration runtime for stx islands
64
+ const stx = {
65
+ // Component registry
66
+ components: {
67
+ ${J}
68
+ },
69
+
70
+ // Loaded island instances
71
+ islands: new Map(),
72
+
73
+ // Register a component for hydration
74
+ registerComponent: function(name, loader) {
75
+ this.components[name] = loader;
76
+ },
77
+
78
+ // Get props for an island by ID
79
+ getIslandProps: function(id) {
80
+ const propsScript = document.querySelector('[data-island-props="' + id + '"]');
81
+ if (!propsScript) return {};
82
+ try {
83
+ return JSON.parse(propsScript.textContent || '{}');
84
+ }
85
+ catch (e) {
86
+ console.warn('[stx] Failed to parse island props:', id, e);
87
+ return {};
88
+ }
89
+ },
90
+
91
+ // Hydrate a single island
92
+ hydrateIsland: async function(element) {
93
+ const name = element.dataset.island;
94
+ const id = element.dataset.islandId;
95
+
96
+ if (!name || this.islands.has(id)) return;
97
+
98
+ const loader = this.components[name];
99
+ if (!loader) {
100
+ console.warn('[stx] Unknown island component:', name);
101
+ return;
102
+ }
103
+
104
+ try {
105
+ const component = typeof loader === 'function' ? await loader() : loader;
106
+ const props = this.getIslandProps(id);
107
+
108
+ // Mark as hydrating
109
+ element.dataset.hydrating = 'true';
110
+
111
+ // Call component's hydrate method if available
112
+ if (component.hydrate) {
113
+ await component.hydrate(element, props);
114
+ }
115
+ else if (component.default && component.default.hydrate) {
116
+ await component.default.hydrate(element, props);
117
+ }
118
+
119
+ // Mark as hydrated
120
+ delete element.dataset.hydrating;
121
+ element.dataset.hydrated = 'true';
122
+ this.islands.set(id, { element, component, props });
123
+
124
+ }
125
+ catch (error) {
126
+ console.error('[stx] Failed to hydrate island:', name, error);
127
+ element.dataset.hydrateError = 'true';
128
+ }
129
+ },
130
+
131
+ // Hydrate all islands based on priority
132
+ hydrate: function() {
133
+ const islands = document.querySelectorAll('[data-island]');
134
+
135
+ // Group by priority
136
+ const eager = [];
137
+ const lazy = [];
138
+ const idle = [];
139
+
140
+ islands.forEach(function(el) {
141
+ const priority = el.dataset.priority || 'lazy';
142
+ if (priority === 'eager') eager.push(el);
143
+ else if (priority === 'idle') idle.push(el);
144
+ else lazy.push(el);
145
+ });
146
+
147
+ // Hydrate eager immediately
148
+ eager.forEach(function(el) { stx.hydrateIsland(el); });
149
+
150
+ // Hydrate lazy on intersection
151
+ if (lazy.length > 0 && 'IntersectionObserver' in window) {
152
+ const observer = new IntersectionObserver(function(entries) {
153
+ entries.forEach(function(entry) {
154
+ if (entry.isIntersecting) {
155
+ observer.unobserve(entry.target);
156
+ stx.hydrateIsland(entry.target);
157
+ }
158
+ });
159
+ }, { rootMargin: '50px' });
160
+
161
+ lazy.forEach(function(el) { observer.observe(el); });
162
+ }
163
+ else {
164
+ // Fallback: hydrate all lazy immediately
165
+ lazy.forEach(function(el) { stx.hydrateIsland(el); });
166
+ }
167
+
168
+ // Hydrate idle during browser idle time
169
+ if (idle.length > 0 && 'requestIdleCallback' in window) {
170
+ requestIdleCallback(function() {
171
+ idle.forEach(function(el) { stx.hydrateIsland(el); });
172
+ });
173
+ }
174
+ else {
175
+ // Fallback: hydrate after a delay
176
+ setTimeout(function() {
177
+ idle.forEach(function(el) { stx.hydrateIsland(el); });
178
+ }, 200);
179
+ }
180
+ }
181
+ };
182
+
183
+ // Expose to window
184
+ window.__stx = stx;
185
+
186
+ // Auto-hydrate on DOMContentLoaded if not SSR
187
+ if (document.readyState === 'loading') {
188
+ document.addEventListener('DOMContentLoaded', function() { stx.hydrate(); });
189
+ }
190
+ else {
191
+ stx.hydrate();
192
+ }
193
+ })();`}
194
+ export{r as ej,N as fj,C as gj,s as hj,a as ij,o as jj,n as kj,e as lj,d as mj,h as nj,t as oj,qq as pj,Bq as qj,Gq as rj};