@stacksjs/stx 0.2.94 → 0.2.96

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 (614) hide show
  1. package/dist/a11y.js +598 -2
  2. package/dist/analytics.js +159 -2
  3. package/dist/analyzer.js +240 -2
  4. package/dist/animation.js +688 -2
  5. package/dist/app-shell.js +220 -2
  6. package/dist/app.js +79 -2
  7. package/dist/assets.js +155 -2
  8. package/dist/ast.js +630 -2
  9. package/dist/async-components.js +428 -2
  10. package/dist/auth.js +12 -2
  11. package/dist/broadcasting.js +102 -2
  12. package/dist/browser-composables.js +565 -2
  13. package/dist/build-assets.js +29 -2
  14. package/dist/build-mode-detector.js +50 -2
  15. package/dist/build-optimizer.js +433 -2
  16. package/dist/build-views.js +180 -2
  17. package/dist/build.js +33 -2
  18. package/dist/builtins/drawer.js +37 -2
  19. package/dist/builtins/escape.js +3 -2
  20. package/dist/builtins/icon.js +83 -2
  21. package/dist/builtins/index.js +34 -2
  22. package/dist/builtins/modal.js +38 -2
  23. package/dist/builtins/safe-image.js +51 -2
  24. package/dist/builtins/stx-image.js +200 -2
  25. package/dist/builtins/stx-link.js +41 -2
  26. package/dist/builtins/stx-loading-indicator.js +35 -2
  27. package/dist/builtins/suspense.js +24 -2
  28. package/dist/builtins/toast.js +42 -2
  29. package/dist/builtins/tooltip.js +106 -2
  30. package/dist/builtins/transition-group.js +22 -2
  31. package/dist/bundle-analyzer/collector.js +233 -2
  32. package/dist/bundle-analyzer/index.js +82 -2
  33. package/dist/bundle-analyzer/report.js +318 -2
  34. package/dist/bundle-analyzer/treemap.js +594 -2
  35. package/dist/caching.js +131 -2
  36. package/dist/cli.js +11317 -10982
  37. package/dist/client/directive.js +14 -2
  38. package/dist/client/index.js +2 -2
  39. package/dist/client-helpers.js +312 -2
  40. package/dist/client-script-bundler.js +216 -6
  41. package/dist/client-script.js +754 -2
  42. package/dist/client.js +73 -4
  43. package/dist/component-hmr.js +585 -2
  44. package/dist/component-library.d.ts +6 -0
  45. package/dist/component-library.js +683 -0
  46. package/dist/component-processing.js +613 -2
  47. package/dist/component-registry.js +90 -2
  48. package/dist/component-renderer.js +660 -2
  49. package/dist/components.js +213 -2
  50. package/dist/composables/index.js +220 -2
  51. package/dist/composables/use-battery.js +101 -2
  52. package/dist/composables/use-broadcast-channel.js +80 -2
  53. package/dist/composables/use-channel.js +124 -2
  54. package/dist/composables/use-clipboard.js +79 -2
  55. package/dist/composables/use-color-mode.js +131 -2
  56. package/dist/composables/use-cookie.js +86 -2
  57. package/dist/composables/use-device-orientation.js +181 -2
  58. package/dist/composables/use-event-listener.js +27 -2
  59. package/dist/composables/use-event-source.js +166 -2
  60. package/dist/composables/use-eye-dropper.js +142 -2
  61. package/dist/composables/use-fetch.js +223 -2
  62. package/dist/composables/use-fullscreen.js +110 -2
  63. package/dist/composables/use-geolocation.js +101 -2
  64. package/dist/composables/use-idle.js +182 -2
  65. package/dist/composables/use-intersection-observer.js +168 -2
  66. package/dist/composables/use-keyboard.js +224 -2
  67. package/dist/composables/use-media-query.js +62 -2
  68. package/dist/composables/use-meta.js +48 -2
  69. package/dist/composables/use-mouse.js +286 -2
  70. package/dist/composables/use-mutation-observer.js +129 -2
  71. package/dist/composables/use-network.js +85 -2
  72. package/dist/composables/use-notification.js +94 -2
  73. package/dist/composables/use-permissions.js +132 -2
  74. package/dist/composables/use-query.js +0 -1
  75. package/dist/composables/use-resize-observer.js +157 -2
  76. package/dist/composables/use-router.js +51 -2
  77. package/dist/composables/use-share.js +104 -2
  78. package/dist/composables/use-speech.js +294 -2
  79. package/dist/composables/use-storage.js +130 -2
  80. package/dist/composables/use-text-selection.js +205 -4
  81. package/dist/composables/use-timer.js +183 -2
  82. package/dist/composables/use-utilities.js +176 -2
  83. package/dist/composables/use-wake-lock.js +122 -2
  84. package/dist/composables/use-websocket.js +165 -2
  85. package/dist/composables/use-window.js +163 -2
  86. package/dist/composables.js +552 -2
  87. package/dist/composition-api.js +190 -2
  88. package/dist/computed.js +376 -8
  89. package/dist/conditionals.js +599 -2
  90. package/dist/config.js +751 -2
  91. package/dist/craft-bridge.js +432 -2
  92. package/dist/craft-compiler.js +810 -2
  93. package/dist/craft-components.js +945 -2
  94. package/dist/craft-entry.js +5 -2
  95. package/dist/craft-ssr.js +559 -2
  96. package/dist/csp.js +220 -2
  97. package/dist/csrf.js +38 -2
  98. package/dist/custom-directives.js +136 -2
  99. package/dist/defer.js +156 -2
  100. package/dist/deploy/config-generators.js +214 -2
  101. package/dist/deploy/index.js +203 -2
  102. package/dist/deploy/netlify.js +167 -2
  103. package/dist/dev-server/crosswind.js +379 -2
  104. package/dist/dev-server/index.js +7 -2
  105. package/dist/dev-server/keyboard-shortcuts.js +81 -2
  106. package/dist/dev-server/native-window.js +91 -2
  107. package/dist/dev-server/port-utils.js +40 -2
  108. package/dist/dev-server/serve-app.js +682 -7
  109. package/dist/dev-server/serve-file.js +439 -7
  110. package/dist/dev-server/serve-markdown.js +281 -2
  111. package/dist/dev-server/serve-multi.js +424 -17
  112. package/dist/dev-server/terminal-colors.js +45 -2
  113. package/dist/dev-server/theme-selector.js +111 -2
  114. package/dist/dev-server/types.js +43 -2
  115. package/dist/dev-server.js +4 -2
  116. package/dist/devtools.js +462 -18
  117. package/dist/directive-api.js +355 -2
  118. package/dist/docs.js +567 -2
  119. package/dist/doctor.js +123 -2
  120. package/dist/document-shell.js +105 -2
  121. package/dist/dynamic-components.js +78 -2
  122. package/dist/edge-runtime.js +539 -2
  123. package/dist/env.js +9 -2
  124. package/dist/error-boundaries.js +62 -12
  125. package/dist/error-handling.js +1 -2
  126. package/dist/errors/codes.js +97 -2
  127. package/dist/errors/formatter.js +196 -2
  128. package/dist/errors/index.js +44 -2
  129. package/dist/errors/logger.js +250 -2
  130. package/dist/errors/sanitizer.js +181 -2
  131. package/dist/errors/types.js +86 -2
  132. package/dist/events.js +382 -2
  133. package/dist/expressions.js +650 -2
  134. package/dist/formatter.js +265 -2
  135. package/dist/forms-validation.js +510 -4
  136. package/dist/forms.js +709 -2
  137. package/dist/head.js +224 -2
  138. package/dist/heatmap.js +566 -2
  139. package/dist/hot-reload.js +367 -2
  140. package/dist/html-masking.js +73 -2
  141. package/dist/hydration-runtime.js +195 -2
  142. package/dist/hydration.js +654 -2
  143. package/dist/i18n.js +633 -2
  144. package/dist/image-optimization/auto-sibling.js +88 -2
  145. package/dist/image-optimization/build-plugin.js +241 -2
  146. package/dist/image-optimization/component.js +244 -2
  147. package/dist/image-optimization/directive.js +203 -2
  148. package/dist/image-optimization/index.js +54 -2
  149. package/dist/image-optimization/processor.js +262 -2
  150. package/dist/image-optimization/serve.js +102 -2
  151. package/dist/includes.js +733 -2
  152. package/dist/index.d.ts +1 -0
  153. package/dist/index.js +134 -2
  154. package/dist/init.js +505 -2
  155. package/dist/inline-assets.js +82 -2
  156. package/dist/interactive.js +383 -2
  157. package/dist/internal-markdown.js +141 -2
  158. package/dist/island-chunking.js +52 -2
  159. package/dist/js-ts.js +57 -2
  160. package/dist/jsx-runtime.js +289 -2
  161. package/dist/keep-alive.js +421 -2
  162. package/dist/lazy-loader.js +245 -2
  163. package/dist/loading-indicator.js +322 -2
  164. package/dist/loops.js +643 -2
  165. package/dist/manifest.js +31 -2
  166. package/dist/markdown.js +68 -2
  167. package/dist/media/client/blur-up.js +217 -2
  168. package/dist/media/client/index.js +53 -2
  169. package/dist/media/client/lazy-load.js +283 -2
  170. package/dist/media/client/upload-handler.js +354 -2
  171. package/dist/media/image/component.js +574 -2
  172. package/dist/media/image/directive.js +160 -2
  173. package/dist/media/image/editing.js +193 -2
  174. package/dist/media/image/index.js +80 -2
  175. package/dist/media/image/placeholder.js +188 -2
  176. package/dist/media/image/processor/cache.js +51 -2
  177. package/dist/media/image/processor/index.js +3 -2
  178. package/dist/media/image/processor/optimizer.js +202 -2
  179. package/dist/media/image/processor/responsive.js +162 -2
  180. package/dist/media/image/srcset.js +194 -2
  181. package/dist/media/index.js +198 -2
  182. package/dist/media/manager/embed.js +253 -2
  183. package/dist/media/protected/component.js +235 -2
  184. package/dist/media/protected/index.js +20 -2
  185. package/dist/media/protected/signature.js +205 -2
  186. package/dist/media/shared/cache.js +132 -2
  187. package/dist/media/shared/hash.js +35 -2
  188. package/dist/media/shared/index.js +2 -2
  189. package/dist/media/types.js +0 -1
  190. package/dist/media/upload/component.js +320 -2
  191. package/dist/media/upload/index.js +1 -2
  192. package/dist/media/video/directive.js +142 -2
  193. package/dist/media/video/index.js +583 -2
  194. package/dist/media/video/processor/cache.js +52 -2
  195. package/dist/media/video/processor/index.js +4 -2
  196. package/dist/media/video/processor/streaming.js +197 -2
  197. package/dist/media/video/processor/thumbnail.js +134 -2
  198. package/dist/media/video/processor/transcoder.js +283 -2
  199. package/dist/method-spoofing.js +17 -2
  200. package/dist/middleware.js +40 -2
  201. package/dist/misc-directives.js +222 -2
  202. package/dist/native-build.js +511 -2
  203. package/dist/parser/directive-parser.js +239 -2
  204. package/dist/parser/expression-parser.js +358 -2
  205. package/dist/parser/index.js +23 -2
  206. package/dist/parser/tokenizer.js +534 -2
  207. package/dist/partial-hydration.js +427 -2
  208. package/dist/performance-utils.js +430 -2
  209. package/dist/placeholder.js +35 -2
  210. package/dist/plugin-system.js +214 -2
  211. package/dist/plugin.js +173 -2
  212. package/dist/precompiler.js +660 -81
  213. package/dist/process.js +711 -2
  214. package/dist/production-build.js +596 -2
  215. package/dist/production-builder.js +132 -2
  216. package/dist/production-server.js +188 -2
  217. package/dist/props.js +224 -2
  218. package/dist/public-env.js +19 -2
  219. package/dist/pwa/audit.js +255 -2
  220. package/dist/pwa/directives.js +332 -2
  221. package/dist/pwa/icons.js +109 -2
  222. package/dist/pwa/index.js +47 -2
  223. package/dist/pwa/inject.js +102 -2
  224. package/dist/pwa/manifest.js +186 -2
  225. package/dist/pwa/offline.js +259 -2
  226. package/dist/pwa/precache.js +116 -2
  227. package/dist/pwa/service-worker.js +860 -2
  228. package/dist/pwa/workbox-strategies.js +167 -2
  229. package/dist/pwa/workbox.js +382 -2
  230. package/dist/pwa.js +427 -427
  231. package/dist/reactive-bindings.js +266 -2
  232. package/dist/reactive.js +569 -2
  233. package/dist/reactivity.js +559 -2
  234. package/dist/release.js +1 -2
  235. package/dist/render.js +165 -2
  236. package/dist/route-middleware.js +17 -2
  237. package/dist/router.js +9 -2
  238. package/dist/routes.js +14 -2
  239. package/dist/runtime-injection.js +120 -2
  240. package/dist/runtime.js +94 -2
  241. package/dist/safe-evaluator.js +444 -2
  242. package/dist/scaffolding.js +897 -2
  243. package/dist/screenshot.js +87 -2
  244. package/dist/script-classifier.js +32 -2
  245. package/dist/script-validation.js +158 -2
  246. package/dist/seo.js +457 -2
  247. package/dist/serve.js +237 -2
  248. package/dist/server-bindings.js +108 -2
  249. package/dist/server-components.js +338 -11
  250. package/dist/signal-processing.js +946 -2
  251. package/dist/signals-api.js +154 -2
  252. package/dist/signals.js +5287 -2
  253. package/dist/site-builder/build.js +224 -2
  254. package/dist/site-builder/i18n.js +140 -2
  255. package/dist/site-builder/index.js +15 -2
  256. package/dist/site-builder/robots.js +26 -2
  257. package/dist/site-builder/router.js +27 -2
  258. package/dist/site-builder/seo.js +36 -2
  259. package/dist/site-builder/sitemap.js +26 -2
  260. package/dist/site-builder/theme.js +33 -2
  261. package/dist/site-builder/types.js +0 -1
  262. package/dist/slots.js +201 -2
  263. package/dist/source-maps.js +350 -2
  264. package/dist/spa-shell.js +34 -2
  265. package/dist/ssg.js +389 -389
  266. package/dist/ssr.js +355 -2
  267. package/dist/state-management.js +533 -2
  268. package/dist/store-imports.js +13 -2
  269. package/dist/store-loader.js +72 -5
  270. package/dist/stores-client.js +132 -2
  271. package/dist/story/addons.js +261 -2
  272. package/dist/story/analytics.js +235 -2
  273. package/dist/story/auto-stories.js +158 -2
  274. package/dist/story/bookmarks.js +277 -2
  275. package/dist/story/bun-test.js +102 -2
  276. package/dist/story/cli.js +155 -2
  277. package/dist/story/collect/analyzer.js +305 -2
  278. package/dist/story/collect/index.js +27 -2
  279. package/dist/story/collect/parser.js +129 -2
  280. package/dist/story/collect/scanner.js +101 -2
  281. package/dist/story/collect/tree.js +110 -2
  282. package/dist/story/commands/build.js +172 -2
  283. package/dist/story/commands/dev.js +78 -2
  284. package/dist/story/commands/index.js +3 -2
  285. package/dist/story/commands/preview.js +56 -2
  286. package/dist/story/compiled-output.js +151 -2
  287. package/dist/story/composition.js +261 -2
  288. package/dist/story/config-watcher.js +67 -2
  289. package/dist/story/config.js +64 -2
  290. package/dist/story/context.js +27 -2
  291. package/dist/story/controls/index.js +320 -2
  292. package/dist/story/crosswind.js +189 -2
  293. package/dist/story/desktop-preview.js +105 -2
  294. package/dist/story/docs-generator.js +186 -2
  295. package/dist/story/errors.js +239 -2
  296. package/dist/story/figma-export.js +224 -2
  297. package/dist/story/generator.js +165 -2
  298. package/dist/story/hmr.js +131 -2
  299. package/dist/story/hot-swap.js +207 -2
  300. package/dist/story/index.js +49 -2
  301. package/dist/story/interactions.js +225 -2
  302. package/dist/story/keyboard-shortcuts.js +345 -2
  303. package/dist/story/output.js +153 -2
  304. package/dist/story/performance.js +252 -2
  305. package/dist/story/presets.js +289 -2
  306. package/dist/story/props-validation.js +215 -2
  307. package/dist/story/renderer.js +209 -2
  308. package/dist/story/search-index.js +106 -2
  309. package/dist/story/search.js +140 -2
  310. package/dist/story/server.js +965 -2
  311. package/dist/story/setup.js +78 -2
  312. package/dist/story/snapshots.js +170 -2
  313. package/dist/story/testing.js +163 -2
  314. package/dist/story/theme.js +170 -2
  315. package/dist/story/types.js +0 -2
  316. package/dist/story/ui/code-panel.js +175 -2
  317. package/dist/story/ui/controls-panel.js +168 -2
  318. package/dist/story/ui/index.js +4 -2
  319. package/dist/story/ui/navigation.js +250 -2
  320. package/dist/story/ui/preview.js +251 -2
  321. package/dist/story/visual-testing.js +247 -2
  322. package/dist/streaming.js +537 -2
  323. package/dist/strict-lint.js +288 -2
  324. package/dist/style-scoping.js +50 -2
  325. package/dist/suspense.js +398 -2
  326. package/dist/teleport.js +109 -2
  327. package/dist/template-compiler.js +63 -2
  328. package/dist/template-hydrator.js +82 -2
  329. package/dist/template-tag-balance.js +93 -2
  330. package/dist/testing.js +581 -2
  331. package/dist/transitions.js +443 -2
  332. package/dist/type-checker.js +581 -2
  333. package/dist/types/component-types.d.ts +54 -0
  334. package/dist/types/component-types.js +0 -1
  335. package/dist/types/config-types.js +0 -1
  336. package/dist/types/context-types.js +0 -1
  337. package/dist/types/csp-types.js +0 -1
  338. package/dist/types/directive-types.js +3 -2
  339. package/dist/types/index.d.ts +5 -0
  340. package/dist/types/index.js +1 -2
  341. package/dist/types/pwa-types.js +0 -1
  342. package/dist/types.js +1 -2
  343. package/dist/typescript-templates.js +386 -4
  344. package/dist/utils.js +942 -2
  345. package/dist/validator.js +171 -2
  346. package/dist/variable-extractor.js +1094 -2
  347. package/dist/view-composers.js +29 -2
  348. package/dist/virtual-scrolling.js +454 -2
  349. package/dist/visual-editor.js +688 -28
  350. package/dist/vue-template.js +475 -2
  351. package/dist/web-components/css-scoping.js +177 -2
  352. package/dist/web-components/index.js +13 -2
  353. package/dist/web-components/reactive-generator.js +121 -56
  354. package/dist/web-components.js +1447 -2
  355. package/dist/x-element.js +17 -5
  356. package/package.json +6 -7
  357. package/dist/chunk-03c26pjz.js +0 -3
  358. package/dist/chunk-04mvcmcr.js +0 -106
  359. package/dist/chunk-05hgyyqc.js +0 -4
  360. package/dist/chunk-095s3972.js +0 -99
  361. package/dist/chunk-0b9w2w1y.js +0 -1
  362. package/dist/chunk-0dz85jrp.js +0 -3
  363. package/dist/chunk-0g4gece6.js +0 -4
  364. package/dist/chunk-0jd0pndq.js +0 -3
  365. package/dist/chunk-0jkwrcwj.js +0 -3
  366. package/dist/chunk-0m9tdm7t.js +0 -71
  367. package/dist/chunk-0qakwen3.js +0 -1
  368. package/dist/chunk-0qnz93q2.js +0 -3
  369. package/dist/chunk-0tatqxj2.js +0 -57
  370. package/dist/chunk-0wdar532.js +0 -102
  371. package/dist/chunk-13yz561y.js +0 -3
  372. package/dist/chunk-174z0cd0.js +0 -3
  373. package/dist/chunk-1mmykse5.js +0 -81
  374. package/dist/chunk-1z2yq9em.js +0 -3
  375. package/dist/chunk-1z5nhbjt.js +0 -90
  376. package/dist/chunk-1zgsgk4b.js +0 -1
  377. package/dist/chunk-25s7bckb.js +0 -171
  378. package/dist/chunk-268adc7r.js +0 -2230
  379. package/dist/chunk-26r6zh3t.js +0 -194
  380. package/dist/chunk-2w3302dh.js +0 -3
  381. package/dist/chunk-2xen423s.js +0 -3
  382. package/dist/chunk-39gm08bn.js +0 -39
  383. package/dist/chunk-3bjtemm6.js +0 -128
  384. package/dist/chunk-3jm3snz8.js +0 -3
  385. package/dist/chunk-3ngm57nt.js +0 -12
  386. package/dist/chunk-3rh7va1z.js +0 -3
  387. package/dist/chunk-3yg9hbmb.js +0 -4
  388. package/dist/chunk-44hd3kab.js +0 -1
  389. package/dist/chunk-46mkpbkk.js +0 -12
  390. package/dist/chunk-48cw2nde.js +0 -2
  391. package/dist/chunk-48r3qe0k.js +0 -3
  392. package/dist/chunk-4aj7ftqb.js +0 -1
  393. package/dist/chunk-4bt81cg3.js +0 -61
  394. package/dist/chunk-4j188175.js +0 -3
  395. package/dist/chunk-4k7d8p8d.js +0 -188
  396. package/dist/chunk-4qq8ffke.js +0 -28
  397. package/dist/chunk-50vqeesm.js +0 -142
  398. package/dist/chunk-52agge4n.js +0 -38
  399. package/dist/chunk-55yp0q8t.js +0 -201
  400. package/dist/chunk-57p201gb.js +0 -83
  401. package/dist/chunk-5ggw1dyv.js +0 -3
  402. package/dist/chunk-5kt3ay7x.js +0 -10
  403. package/dist/chunk-5p568px4.js +0 -1166
  404. package/dist/chunk-5ppkfyn2.js +0 -3
  405. package/dist/chunk-5q87fgkk.js +0 -3
  406. package/dist/chunk-5qb761h2.js +0 -3
  407. package/dist/chunk-5xvbq2gs.js +0 -30
  408. package/dist/chunk-647849kf.js +0 -34
  409. package/dist/chunk-6b5k6w2q.js +0 -7
  410. package/dist/chunk-6cr3eeh4.js +0 -23
  411. package/dist/chunk-6djgb0hr.js +0 -3
  412. package/dist/chunk-6dqzky7x.js +0 -35
  413. package/dist/chunk-6e4c6g46.js +0 -3
  414. package/dist/chunk-6w03t7h6.js +0 -3
  415. package/dist/chunk-6wn85hn6.js +0 -4
  416. package/dist/chunk-6y4gqs1q.js +0 -169
  417. package/dist/chunk-75rndzbd.js +0 -6
  418. package/dist/chunk-77tga15w.js +0 -3
  419. package/dist/chunk-7a51hkpf.js +0 -3
  420. package/dist/chunk-7b0xdy5h.js +0 -386
  421. package/dist/chunk-7cgmq685.js +0 -33
  422. package/dist/chunk-7dy588as.js +0 -6
  423. package/dist/chunk-7rvh2wwv.js +0 -721
  424. package/dist/chunk-7sm05m0j.js +0 -351
  425. package/dist/chunk-7sqdeqsw.js +0 -1
  426. package/dist/chunk-7xcfy2fn.js +0 -4
  427. package/dist/chunk-82t27pvd.js +0 -5
  428. package/dist/chunk-87kx8byz.js +0 -1115
  429. package/dist/chunk-8fgwhhb8.js +0 -6
  430. package/dist/chunk-8qbax8xn.js +0 -347
  431. package/dist/chunk-91s2hres.js +0 -8
  432. package/dist/chunk-94g3cahw.js +0 -11
  433. package/dist/chunk-957amb71.js +0 -8
  434. package/dist/chunk-95w08s8v.js +0 -3
  435. package/dist/chunk-9agvhp1x.js +0 -93
  436. package/dist/chunk-9tmbrwwx.js +0 -219
  437. package/dist/chunk-9yz5d003.js +0 -51
  438. package/dist/chunk-a3hyn4we.js +0 -79
  439. package/dist/chunk-a69tvya5.js +0 -53
  440. package/dist/chunk-adjcg6wa.js +0 -498
  441. package/dist/chunk-adqh2m9z.js +0 -45
  442. package/dist/chunk-asarebzq.js +0 -292
  443. package/dist/chunk-aw3rp9ac.js +0 -24
  444. package/dist/chunk-b0cyc09a.js +0 -109
  445. package/dist/chunk-b3kkjcdh.js +0 -3
  446. package/dist/chunk-b3prs7y0.js +0 -5
  447. package/dist/chunk-b5zc9y0y.js +0 -90
  448. package/dist/chunk-baa7h4yz.js +0 -3
  449. package/dist/chunk-bgec9r1v.js +0 -5224
  450. package/dist/chunk-bjnjpsgn.js +0 -3
  451. package/dist/chunk-bk8ew8ze.js +0 -24
  452. package/dist/chunk-bn08k7yy.js +0 -3
  453. package/dist/chunk-bpgg59wa.js +0 -3
  454. package/dist/chunk-bwxda6n1.js +0 -3
  455. package/dist/chunk-bykjk6vj.js +0 -4
  456. package/dist/chunk-c53hyw5c.js +0 -477
  457. package/dist/chunk-c7jg8w13.js +0 -3
  458. package/dist/chunk-ca6qd1dx.js +0 -3
  459. package/dist/chunk-cdbwprfv.js +0 -6
  460. package/dist/chunk-ceg2c2q2.js +0 -11
  461. package/dist/chunk-cn409b69.js +0 -3
  462. package/dist/chunk-cn8az1b4.js +0 -1
  463. package/dist/chunk-cp3kwv17.js +0 -8
  464. package/dist/chunk-cpcc11vp.js +0 -5
  465. package/dist/chunk-cr3wbrcr.js +0 -10
  466. package/dist/chunk-cygfdk1n.js +0 -3
  467. package/dist/chunk-cyp4m0vh.js +0 -16
  468. package/dist/chunk-cz25azze.js +0 -4
  469. package/dist/chunk-d77yxcds.js +0 -3
  470. package/dist/chunk-dvfs1h3c.js +0 -117
  471. package/dist/chunk-dyjnn5k8.js +0 -262
  472. package/dist/chunk-dzw95th7.js +0 -3
  473. package/dist/chunk-e0zytzdh.js +0 -179
  474. package/dist/chunk-e53h9qhd.js +0 -84
  475. package/dist/chunk-eds0f8f1.js +0 -3
  476. package/dist/chunk-eh8hact1.js +0 -5
  477. package/dist/chunk-epj957jf.js +0 -4
  478. package/dist/chunk-eqeyaq6g.js +0 -77
  479. package/dist/chunk-fbxt2mrx.js +0 -5
  480. package/dist/chunk-fch9tk1k.js +0 -3
  481. package/dist/chunk-fe7r1mq1.js +0 -9
  482. package/dist/chunk-fhawx87n.js +0 -8
  483. package/dist/chunk-fk51yyrw.js +0 -3
  484. package/dist/chunk-fms20x0n.js +0 -21
  485. package/dist/chunk-fs0qezn5.js +0 -341
  486. package/dist/chunk-fzm3y0r3.js +0 -267
  487. package/dist/chunk-g2hekckm.js +0 -161
  488. package/dist/chunk-g4ps1dj8.js +0 -140
  489. package/dist/chunk-g8b81pzc.js +0 -3
  490. package/dist/chunk-ganag9dm.js +0 -3
  491. package/dist/chunk-gc84b1d2.js +0 -58
  492. package/dist/chunk-gcf5v18y.js +0 -60
  493. package/dist/chunk-ghrx0hn1.js +0 -4
  494. package/dist/chunk-gqpkp459.js +0 -3
  495. package/dist/chunk-h45py5w5.js +0 -2
  496. package/dist/chunk-h5wa62ek.js +0 -145
  497. package/dist/chunk-h82kjdr4.js +0 -83
  498. package/dist/chunk-haecq01c.js +0 -3
  499. package/dist/chunk-hepg894w.js +0 -3
  500. package/dist/chunk-hjdc99kb.js +0 -3
  501. package/dist/chunk-hje9v2zh.js +0 -3
  502. package/dist/chunk-hjv76kcw.js +0 -1
  503. package/dist/chunk-hke99a0v.js +0 -3
  504. package/dist/chunk-hpqr9e3x.js +0 -3
  505. package/dist/chunk-hq5cem49.js +0 -236
  506. package/dist/chunk-hrampcrj.js +0 -3
  507. package/dist/chunk-ht4j68cs.js +0 -3
  508. package/dist/chunk-hxx3za24.js +0 -62
  509. package/dist/chunk-j4s5qwd7.js +0 -4
  510. package/dist/chunk-jbejwejg.js +0 -8
  511. package/dist/chunk-jc0fc4ht.js +0 -11
  512. package/dist/chunk-jcs0ymw7.js +0 -3
  513. package/dist/chunk-jfm69keq.js +0 -231
  514. package/dist/chunk-jfrn43vh.js +0 -2
  515. package/dist/chunk-jjamhxpm.js +0 -139
  516. package/dist/chunk-jjvp4t5w.js +0 -27
  517. package/dist/chunk-jt44av4j.js +0 -3
  518. package/dist/chunk-jt98jhpt.js +0 -10
  519. package/dist/chunk-k8440jxh.js +0 -6
  520. package/dist/chunk-kdxa9epn.js +0 -21
  521. package/dist/chunk-kfd2hf6f.js +0 -3
  522. package/dist/chunk-kgym7ch9.js +0 -8
  523. package/dist/chunk-kh6rfz2v.js +0 -4
  524. package/dist/chunk-kkp6rs2n.js +0 -36
  525. package/dist/chunk-ktkmvaa8.js +0 -1
  526. package/dist/chunk-m59y310j.js +0 -3
  527. package/dist/chunk-mgmyr1b9.js +0 -6
  528. package/dist/chunk-mqwbpamc.js +0 -3
  529. package/dist/chunk-mrehzhxv.js +0 -5
  530. package/dist/chunk-mv03qb75.js +0 -3
  531. package/dist/chunk-mv4fb50w.js +0 -1
  532. package/dist/chunk-mwbng54r.js +0 -2
  533. package/dist/chunk-n46a5g1g.js +0 -3
  534. package/dist/chunk-n944baxp.js +0 -3
  535. package/dist/chunk-nanw7yhz.js +0 -14
  536. package/dist/chunk-nap11ntr.js +0 -21
  537. package/dist/chunk-ncnfa8ae.js +0 -29
  538. package/dist/chunk-ngxfwzq3.js +0 -3
  539. package/dist/chunk-nvwb4x04.js +0 -3
  540. package/dist/chunk-nw34xajc.js +0 -8
  541. package/dist/chunk-payfb24w.js +0 -207
  542. package/dist/chunk-pc31m5x5.js +0 -398
  543. package/dist/chunk-pg1fvqb9.js +0 -167
  544. package/dist/chunk-q60knhjf.js +0 -3
  545. package/dist/chunk-q6h6yvzb.js +0 -10
  546. package/dist/chunk-qd5461tt.js +0 -3
  547. package/dist/chunk-qdc3aav1.js +0 -3
  548. package/dist/chunk-qfwzdffx.js +0 -3
  549. package/dist/chunk-qgxwmagw.js +0 -134
  550. package/dist/chunk-qhdtssn1.js +0 -19
  551. package/dist/chunk-qk584whs.js +0 -3
  552. package/dist/chunk-qm4yppj5.js +0 -57
  553. package/dist/chunk-qwyd9a1d.js +0 -2
  554. package/dist/chunk-qxs6et76.js +0 -196
  555. package/dist/chunk-rb1e4cnb.js +0 -3
  556. package/dist/chunk-rh80q1nd.js +0 -1
  557. package/dist/chunk-rkffm9sy.js +0 -128
  558. package/dist/chunk-rv002yn0.js +0 -14
  559. package/dist/chunk-s6ja2bdg.js +0 -66
  560. package/dist/chunk-sjagg9qz.js +0 -66
  561. package/dist/chunk-sn07azv3.js +0 -3
  562. package/dist/chunk-svahbw0w.js +0 -12
  563. package/dist/chunk-svhtdb0s.js +0 -6
  564. package/dist/chunk-t37dp99j.js +0 -3
  565. package/dist/chunk-tj6zfxeb.js +0 -64
  566. package/dist/chunk-tmgz5t2g.js +0 -3
  567. package/dist/chunk-tr0z0e1g.js +0 -3
  568. package/dist/chunk-tx6br9r4.js +0 -274
  569. package/dist/chunk-v97390pe.js +0 -1
  570. package/dist/chunk-vcr5pzpx.js +0 -233
  571. package/dist/chunk-vdfwv0fp.js +0 -6
  572. package/dist/chunk-vp2395eb.js +0 -3
  573. package/dist/chunk-vpe6napb.js +0 -28
  574. package/dist/chunk-vv9wfz1c.js +0 -12
  575. package/dist/chunk-vw6ejgmy.js +0 -21
  576. package/dist/chunk-vx22he47.js +0 -1
  577. package/dist/chunk-w01y57f5.js +0 -1539
  578. package/dist/chunk-w21mwxdd.js +0 -4
  579. package/dist/chunk-w4n8fqp7.js +0 -216
  580. package/dist/chunk-w959hm8j.js +0 -358
  581. package/dist/chunk-wf7zrjsw.js +0 -138
  582. package/dist/chunk-wk07pwtd.js +0 -321
  583. package/dist/chunk-wvef3ngh.js +0 -127
  584. package/dist/chunk-wxvyj65q.js +0 -2
  585. package/dist/chunk-x1hjv24z.js +0 -11
  586. package/dist/chunk-x39sfpvm.js +0 -302
  587. package/dist/chunk-x4fze3q2.js +0 -314
  588. package/dist/chunk-x64kb787.js +0 -15
  589. package/dist/chunk-xcb0pbr6.js +0 -4
  590. package/dist/chunk-xhkjhxsp.js +0 -3
  591. package/dist/chunk-xhnpsngj.js +0 -5
  592. package/dist/chunk-xsqbk4yk.js +0 -3
  593. package/dist/chunk-xygc53vr.js +0 -68
  594. package/dist/chunk-y0qg6rrv.js +0 -3
  595. package/dist/chunk-y25pr13j.js +0 -19
  596. package/dist/chunk-y4c744dk.js +0 -3
  597. package/dist/chunk-y4md9hp0.js +0 -3
  598. package/dist/chunk-y5wazw6j.js +0 -7
  599. package/dist/chunk-y5xz0jc4.js +0 -141
  600. package/dist/chunk-y86m1wr4.js +0 -4
  601. package/dist/chunk-yaan98dd.js +0 -3
  602. package/dist/chunk-yach037f.js +0 -32
  603. package/dist/chunk-yexjrg9d.js +0 -7
  604. package/dist/chunk-ygvyc6wv.js +0 -90
  605. package/dist/chunk-yj560gp8.js +0 -8
  606. package/dist/chunk-yn38c15w.js +0 -4
  607. package/dist/chunk-yr1gdceh.js +0 -3
  608. package/dist/chunk-yw2fzq86.js +0 -3
  609. package/dist/chunk-ywkrxp2h.js +0 -147
  610. package/dist/chunk-z37xq5rx.js +0 -3
  611. package/dist/chunk-z4djtgt0.js +0 -71
  612. package/dist/chunk-z8cjr9n9.js +0 -7
  613. package/dist/chunk-znxp3zha.js +0 -71
  614. package/dist/chunk-zt2yag10.js +0 -429
@@ -1,6 +0,0 @@
1
- // @bun
2
- import{existsSync as _,readFileSync as $}from"fs";var A={strict:!1,allowAny:!0,checkPropertyAccess:!0,checkFunctionCalls:!0,includeBuiltins:!0},X={console:{kind:"object",properties:{log:{kind:"function",params:[{name:"message",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"void"}},error:{kind:"function",params:[{name:"message",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"void"}},warn:{kind:"function",params:[{name:"message",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"void"}}}},Math:{kind:"object",properties:{abs:{kind:"function",params:[{name:"x",type:{kind:"primitive",value:"number"}}],returnType:{kind:"primitive",value:"number"}},floor:{kind:"function",params:[{name:"x",type:{kind:"primitive",value:"number"}}],returnType:{kind:"primitive",value:"number"}},ceil:{kind:"function",params:[{name:"x",type:{kind:"primitive",value:"number"}}],returnType:{kind:"primitive",value:"number"}},round:{kind:"function",params:[{name:"x",type:{kind:"primitive",value:"number"}}],returnType:{kind:"primitive",value:"number"}},max:{kind:"function",params:[{name:"values",type:{kind:"primitive",value:"number"}}],returnType:{kind:"primitive",value:"number"}},min:{kind:"function",params:[{name:"values",type:{kind:"primitive",value:"number"}}],returnType:{kind:"primitive",value:"number"}},random:{kind:"function",params:[],returnType:{kind:"primitive",value:"number"}},PI:{kind:"primitive",value:"number"},E:{kind:"primitive",value:"number"}}},JSON:{kind:"object",properties:{stringify:{kind:"function",params:[{name:"value",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"string"}},parse:{kind:"function",params:[{name:"text",type:{kind:"primitive",value:"string"}}],returnType:{kind:"primitive",value:"any"}}}},Date:{kind:"function",returnType:{kind:"object",properties:{getTime:{kind:"function",params:[],returnType:{kind:"primitive",value:"number"}},toISOString:{kind:"function",params:[],returnType:{kind:"primitive",value:"string"}},toLocaleDateString:{kind:"function",params:[],returnType:{kind:"primitive",value:"string"}}}}},Array:{kind:"object",properties:{isArray:{kind:"function",params:[{name:"value",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"boolean"}},from:{kind:"function",params:[{name:"arrayLike",type:{kind:"primitive",value:"any"}}],returnType:{kind:"array",elementType:{kind:"primitive",value:"any"}}}}},Object:{kind:"object",properties:{keys:{kind:"function",params:[{name:"obj",type:{kind:"primitive",value:"any"}}],returnType:{kind:"array",elementType:{kind:"primitive",value:"string"}}},values:{kind:"function",params:[{name:"obj",type:{kind:"primitive",value:"any"}}],returnType:{kind:"array",elementType:{kind:"primitive",value:"any"}}},entries:{kind:"function",params:[{name:"obj",type:{kind:"primitive",value:"any"}}],returnType:{kind:"array",elementType:{kind:"primitive",value:"any"}}}}},String:{kind:"function",params:[{name:"value",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"string"}},Number:{kind:"function",params:[{name:"value",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"number"}},Boolean:{kind:"function",params:[{name:"value",type:{kind:"primitive",value:"any"}}],returnType:{kind:"primitive",value:"boolean"}},props:{kind:"object",properties:{}},slot:{kind:"primitive",value:"string"},loop:{kind:"object",properties:{index:{kind:"primitive",value:"number"},iteration:{kind:"primitive",value:"number"},first:{kind:"primitive",value:"boolean"},last:{kind:"primitive",value:"boolean"},even:{kind:"primitive",value:"boolean"},odd:{kind:"primitive",value:"boolean"},count:{kind:"primitive",value:"number"},remaining:{kind:"primitive",value:"number"},depth:{kind:"primitive",value:"number"},parent:{kind:"object",properties:{}}}}};class Y{options;variables=new Map;errors=[];warnings=[];currentFile="";constructor(z={}){if(this.options={...A,...z},this.options.includeBuiltins)Object.entries(X).forEach(([j,q])=>{this.variables.set(j,q)});if(this.options.customTypes)Object.entries(this.options.customTypes).forEach(([j,q])=>{this.variables.set(j,q)})}checkFile(z){if(this.currentFile=z,this.errors=[],this.warnings=[],!_(z))return this.errors.push({message:`File not found: ${z}`,file:z,line:0,column:0,expression:"",severity:"error"}),this.getResult();let j=$(z,"utf-8");return this.checkTemplate(j,z)}checkTemplate(z,j="<inline>"){this.currentFile=j,this.errors=[],this.warnings=[];let q=z.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(q)this.analyzeScript(q[1],z.indexOf(q[0]));return this.checkDirectives(z),this.checkExpressions(z),this.getResult()}analyzeScript(z,j){let q=z.split(`
3
- `),H=this.getLineNumber(j);for(let B=0;B<q.length;B++){let D=q[B],G=H+B;this.extractTypedVariables(D,G),this.extractInterfaces(D,q,B,G),this.extractTypeAliases(D,G)}}extractTypedVariables(z,j){let q=z.match(/(?:export\s+)?(?:const|let|var)\s+(\w+)\s*:\s*([^=]+?)\s*=/);if(q){let[,D,G]=q,J=this.parseTypeAnnotation(G.trim());this.variables.set(D,J);return}let H=z.match(/(?:export\s+)?(?:const|let|var)\s+(\w+)\s*=\s*(.+)/);if(H){let[,D,G]=H,J=this.inferType(G.trim());this.variables.set(D,J);return}let B=z.match(/(?:export\s+)?function\s+(\w+)\s*\(([^)]*)\)(?:\s*:\s*(\w+))?/);if(B){let[,D,G,J]=B,K=this.parseParams(G),Q=J?this.parseTypeAnnotation(J):{kind:"primitive",value:"any"};this.variables.set(D,{kind:"function",params:K,returnType:Q})}}extractInterfaces(z,j,q,H){let B=z.match(/(?:export\s+)?interface\s+(\w+)\s*\{/);if(B){let[,D]=B,G={},J=1,K=q+1;while(K<j.length&&J>0){let Q=j[K].trim();if(Q.includes("{"))J++;if(Q.includes("}"))J--;let U=Q.match(/(\w+)\??\s*:\s*([^;]+)/);if(U&&J>0){let[,W,V]=U;G[W]=this.parseTypeAnnotation(V.trim())}K++}this.variables.set(D,{kind:"object",name:D,properties:G})}}extractTypeAliases(z,j){let q=z.match(/(?:export\s+)?type\s+(\w+)\s*=\s*(.+)/);if(q){let[,H,B]=q,D=this.parseTypeAnnotation(B.trim());D.name=H,this.variables.set(H,D)}}parseTypeAnnotation(z){let j=z.trim();if(j.includes("|"))return{kind:"union",types:j.split("|").map((D)=>this.parseTypeAnnotation(D.trim()))};if(j.includes("&"))return{kind:"intersection",types:j.split("&").map((D)=>this.parseTypeAnnotation(D.trim()))};if(j.endsWith("[]"))return{kind:"array",elementType:this.parseTypeAnnotation(j.slice(0,-2))};let q=j.match(/^Array<(.+)>$/);if(q)return{kind:"array",elementType:this.parseTypeAnnotation(q[1])};if(j.startsWith("{")&&j.endsWith("}")){let B={},D=j.slice(1,-1).trim();if(D){let G=this.splitByComma(D);for(let J of G){let K=J.match(/(\w+)\??\s*:\s*(.+)/);if(K){let[,Q,U]=K;B[Q]=this.parseTypeAnnotation(U.trim())}}}return{kind:"object",properties:B}}if(j.startsWith('"')||j.startsWith("'"))return{kind:"literal",value:j.slice(1,-1)};if(/^\d+$/.test(j))return{kind:"literal",value:j};if(j==="true"||j==="false")return{kind:"literal",value:j};if(["string","number","boolean","null","undefined","any","unknown","void","never"].includes(j))return{kind:"primitive",value:j};if(this.variables.has(j))return this.variables.get(j);return{kind:"primitive",value:"any"}}inferType(z){let j=z.trim().replace(/;$/,"");if(j.startsWith('"')&&j.endsWith('"')||j.startsWith("'")&&j.endsWith("'")||j.startsWith("`")&&j.endsWith("`"))return{kind:"primitive",value:"string"};if(/^-?\d+(\.\d+)?$/.test(j))return{kind:"primitive",value:"number"};if(j==="true"||j==="false")return{kind:"primitive",value:"boolean"};if(j==="null")return{kind:"primitive",value:"null"};if(j==="undefined")return{kind:"primitive",value:"undefined"};if(j.startsWith("[")){let q=j.slice(1,-1).trim();if(q){let H=this.splitByComma(q)[0];if(H)return{kind:"array",elementType:this.inferType(H.trim())}}return{kind:"array",elementType:{kind:"primitive",value:"any"}}}if(j.startsWith("{")){let q={},H=this.extractObjectLiteral(j);for(let[B,D]of Object.entries(H))q[B]=this.inferType(D);return{kind:"object",properties:q}}if(j.includes("=>")){let q=j.match(/^\(([^)]*)\)\s*(?::\s*(\w+))?\s*=>/);if(q){let H=this.parseParams(q[1]),B=q[2]?this.parseTypeAnnotation(q[2]):{kind:"primitive",value:"any"};return{kind:"function",params:H,returnType:B}}}if(/^\w+$/.test(j)&&this.variables.has(j))return this.variables.get(j);if(j.includes("."))return this.resolvePropertyAccess(j);if(j.includes("(")){let q=j.split("(")[0],H=this.variables.get(q);if(H?.kind==="function"&&H.returnType)return H.returnType}return{kind:"primitive",value:"any"}}parseParams(z){if(!z.trim())return[];let j=[],q=this.splitByComma(z);for(let H of q){let B=H.trim(),D=B.includes("?"),G=B.match(/(\w+)\??\s*(?::\s*([^=]+))?(?:\s*=)?/);if(G){let[,J,K]=G,Q=K?this.parseTypeAnnotation(K.trim()):{kind:"primitive",value:"any"};j.push({name:J,type:Q,optional:D})}}return j}checkExpressions(z){let j=/\{\{([\s\S]*?)\}\}/g,q;while((q=j.exec(z))!==null){let B=q[1].trim(),D=q.index,G=this.getLineNumber(D,z),J=this.getColumn(D,z);if(!B)continue;if(B.startsWith("!")||B.endsWith("!"))continue;this.checkExpression(B,G,J)}let H=/\{!!([\s\S]*?)!!\}/g;while((q=H.exec(z))!==null){let B=q[1].trim(),D=q.index,G=this.getLineNumber(D,z),J=this.getColumn(D,z);if(!B)continue;this.checkExpression(B,G,J)}}checkExpression(z,j,q){if(z.includes("?")&&z.includes(":")){let D=z.split("?");this.checkExpression(D[0].trim(),j,q);let G=D.slice(1).join("?").split(":");if(G.length>=2)this.checkExpression(G[0].trim(),j,q),this.checkExpression(G.slice(1).join(":").trim(),j,q);return}for(let D of["&&","||","??"])if(z.includes(D)){z.split(D).forEach((J)=>this.checkExpression(J.trim(),j,q));return}for(let D of["===","!==","==","!=",">=","<=",">","<"])if(z.includes(D)){z.split(D).forEach((J)=>this.checkExpression(J.trim(),j,q));return}if(z.startsWith("!")){this.checkExpression(z.slice(1).trim(),j,q);return}if(this.isLiteral(z))return;let H=z.match(/^(\w+(?:\.\w+)*)\s*\(/);if(H){let D=H[1],G=this.resolvePropertyAccess(D);if(G.kind!=="function"&&G.value!=="any")this.addWarning(`'${D}' is not a function`,j,q,z);return}if(z.includes(".")){if(this.resolvePropertyAccess(z).value==="undefined"&&this.options.checkPropertyAccess)this.addWarning(`Property access '${z}' may be undefined`,j,q,z);return}let B=z.match(/^\w+/)?.[0];if(B&&!this.variables.has(B))this.addError(`Variable '${B}' is not defined`,j,q,z)}checkDirectives(z){let j=/@if\s*\(([^)]+)\)/g,q;while((q=j.exec(z))!==null){let G=q[1].trim(),J=q.index,K=this.getLineNumber(J,z),Q=this.getColumn(J,z);this.checkExpression(G,K,Q)}let H=/@foreach\s*\((\w+)\s+(?:as|in)\s+(\w+)(?:\s*,\s*(\w+))?\)/g;while((q=H.exec(z))!==null){let[,G,J,K]=q,Q=q.index,U=this.getLineNumber(Q,z),W=this.getColumn(Q,z);if(!this.variables.has(G))this.addError(`Collection '${G}' is not defined`,U,W,q[0]);else{let V=this.variables.get(G);if(V.kind==="array"&&V.elementType)this.variables.set(J,V.elementType);else this.variables.set(J,{kind:"primitive",value:"any"});if(K)this.variables.set(K,{kind:"primitive",value:"number"})}}let B=/@unless\s*\(([^)]+)\)/g;while((q=B.exec(z))!==null){let G=q[1].trim(),J=q.index,K=this.getLineNumber(J,z),Q=this.getColumn(J,z);this.checkExpression(G,K,Q)}let D=/@switch\s*\(([^)]+)\)/g;while((q=D.exec(z))!==null){let G=q[1].trim(),J=q.index,K=this.getLineNumber(J,z),Q=this.getColumn(J,z);this.checkExpression(G,K,Q)}}resolvePropertyAccess(z){let j=z.split("."),q=this.variables.get(j[0])||{kind:"primitive",value:"any"};for(let H=1;H<j.length;H++){let B=j[H].replace(/\(\)$/,"");if(q.kind==="object"&&q.properties)if(q.properties[B])q=q.properties[B];else if(!this.options.allowAny)return{kind:"primitive",value:"undefined"};else q={kind:"primitive",value:"any"};else if(q.kind==="array"&&q.elementType)if(["length"].includes(B))q={kind:"primitive",value:"number"};else if(["map","filter","find","forEach","some","every","reduce"].includes(B))q={kind:"function",returnType:{kind:"primitive",value:"any"}};else if(["join"].includes(B))q={kind:"function",returnType:{kind:"primitive",value:"string"}};else q={kind:"primitive",value:"any"};else if(q.kind==="primitive"&&q.value==="string")if(["length"].includes(B))q={kind:"primitive",value:"number"};else if(["toUpperCase","toLowerCase","trim","slice","substring"].includes(B))q={kind:"function",returnType:{kind:"primitive",value:"string"}};else if(["split"].includes(B))q={kind:"function",returnType:{kind:"array",elementType:{kind:"primitive",value:"string"}}};else q={kind:"primitive",value:"any"};else q={kind:"primitive",value:"any"}}return q}isLiteral(z){let j=z.trim();if(j.startsWith('"')&&j.endsWith('"')||j.startsWith("'")&&j.endsWith("'")||j.startsWith("`")&&j.endsWith("`"))return!0;if(/^-?\d+(\.\d+)?$/.test(j))return!0;if(j==="true"||j==="false")return!0;if(j==="null"||j==="undefined")return!0;return!1}extractObjectLiteral(z){let j={},q=z.slice(1,-1).trim();if(!q)return j;let H=this.splitByComma(q);for(let B of H){let D=B.indexOf(":");if(D>0){let G=B.slice(0,D).trim(),J=B.slice(D+1).trim();j[G]=J}}return j}splitByComma(z){let j=[],q="",H=0,B=null;for(let D=0;D<z.length;D++){let G=z[D],J=D>0?z[D-1]:"";if((G==='"'||G==="'"||G==="`")&&J!=="\\"){if(B===G)B=null;else if(!B)B=G}if(!B){if(G==="{"||G==="["||G==="(")H++;if(G==="}"||G==="]"||G===")")H--;if(G===","&&H===0){j.push(q.trim()),q="";continue}}q+=G}if(q.trim())j.push(q.trim());return j}getLineNumber(z,j){return((j||"").slice(0,z).match(/\n/g)||[]).length+1}getColumn(z,j){let H=j.slice(0,z).lastIndexOf(`
4
- `);return z-H}addError(z,j,q,H,B,D){this.errors.push({message:z,file:this.currentFile,line:j,column:q,expression:H,expected:B,received:D,severity:"error"})}addWarning(z,j,q,H,B,D){let G={message:z,file:this.currentFile,line:j,column:q,expression:H,expected:B,received:D,severity:"warning"};if(this.options.strict)this.errors.push(G);else this.warnings.push(G)}getResult(){return{valid:this.errors.length===0,errors:this.errors,warnings:this.warnings,variables:new Map(this.variables)}}addVariable(z,j){this.variables.set(z,j)}reset(){if(this.errors=[],this.warnings=[],this.variables.clear(),this.options.includeBuiltins)Object.entries(X).forEach(([z,j])=>{this.variables.set(z,j)})}}function Z(z){return new Y(z)}function E(z,j){return Z(j).checkFile(z)}function I(z,j){return Z(j).checkTemplate(z)}function L(z){let j=[];for(let q of z.errors){if(j.push(`\x1B[31merror\x1B[0m: ${q.message}`),j.push(` --> ${q.file}:${q.line}:${q.column}`),q.expression)j.push(" |"),j.push(` | ${q.expression}`),j.push(" |");if(q.expected&&q.received)j.push(` expected: ${q.expected}`),j.push(` received: ${q.received}`);j.push("")}for(let q of z.warnings){if(j.push(`\x1B[33mwarning\x1B[0m: ${q.message}`),j.push(` --> ${q.file}:${q.line}:${q.column}`),q.expression)j.push(" |"),j.push(` | ${q.expression}`),j.push(" |");j.push("")}if(z.valid)j.push("\x1B[32m\u2713 No type errors found\x1B[0m");else j.push(`\x1B[31m\u2717 Found ${z.errors.length} error(s) and ${z.warnings.length} warning(s)\x1B[0m`);return j.join(`
5
- `)}
6
- export{Y as Af,Z as Bf,E as Cf,I as Df,L as Ef};
@@ -1,3 +0,0 @@
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 lj,F as mj,G as nj,H as oj,I as pj,J as qj,K as rj,L as sj};
@@ -1,5 +0,0 @@
1
- // @bun
2
- class J{source;pos=0;line=1;column=0;tokens=[];constructor(b){this.source=b}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let b=this.nextToken();if(b)this.tokens.push(b)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let b=this.pos,w=this.line,j=this.column,v=this.source[this.pos];if(/\s/.test(v))return this.readWhitespace(b,w,j);if(v==="/"&&this.peek(1)==="/")return this.readLineComment(b,w,j);if(v==="/"&&this.peek(1)==="*")return this.readBlockComment(b,w,j);if(v==='"'||v==="'")return this.readString(v,b,w,j);if(v==="`")return this.readTemplateString(b,w,j);if(/\d/.test(v)||v==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(b,w,j);if(/[a-z_$]/i.test(v))return this.readIdentifier(b,w,j);if(v==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:b,end:this.pos,line:w,column:j}}if(v==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:b,end:this.pos,line:w,column:j}}if(v==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:b,end:this.pos,line:w,column:j};if(v==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(b,w,j);let z=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let B of z)if(this.source.slice(this.pos,this.pos+B.length)===B)return this.advance(B.length),{type:"OPERATOR",value:B,start:b,end:this.pos,line:w,column:j};if(/[+\-*/%<>=!&|^~?:]/.test(v))return this.advance(),{type:"OPERATOR",value:v,start:b,end:this.pos,line:w,column:j};if(/[()[\]{},;.]/.test(v))return this.advance(),{type:"PUNCTUATION",value:v,start:b,end:this.pos,line:w,column:j};return this.advance(),{type:"PUNCTUATION",value:v,start:b,end:this.pos,line:w,column:j}}readWhitespace(b,w,j){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readLineComment(b,w,j){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3
- `)this.advance();return{type:"COMMENT",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readBlockComment(b,w,j){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readString(b,w,j,v){this.advance();while(this.pos<this.source.length){let z=this.source[this.pos];if(z==="\\"){this.advance(2);continue}if(z===b){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(w,this.pos),start:w,end:this.pos,line:j,column:v}}readTemplateString(b,w,j){this.advance();let v=0,z=256;while(this.pos<this.source.length){let B=this.source[this.pos];if(B==="\\"){this.advance(2);continue}if(B==="$"&&this.peek(1)==="{"){if(v>=z){this.pos=this.source.length;break}this.advance(2),v++;continue}if(B==="{"&&v>0){v++,this.advance();continue}if(B==="}"&&v>0){v--,this.advance();continue}if(B==="`"&&v===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readNumber(b,w,j){if(this.source[this.pos]==="0"){let v=this.peek(1)?.toLowerCase();if(v==="x"||v==="o"||v==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readIdentifier(b,w,j){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readDirective(b,w,j){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}advance(b=1){for(let w=0;w<b&&this.pos<this.source.length;w++){if(this.source[this.pos]===`
4
- `)this.line++,this.column=0;else this.column++;this.pos++}}peek(b){return this.source[this.pos+b]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(b){this.pos=b.pos,this.line=b.line,this.column=b.column}}function K(b,w,j,v=0){let z=0,B=v,y=null,D=0,H=!1;while(B<b.length){let F=b[B];if(y&&H){H=!1,B++;continue}if(y&&F==="\\"){H=!0,B++;continue}if(H=!1,(F==='"'||F==="'"||F==="`")&&!y){y=F,B++;continue}if(F===y&&y!=="`"){y=null,B++;continue}if(y==="`"&&F==="$"&&b[B+1]==="{"){D++,B+=2;continue}if(D>0&&F==="}"){D--,B++;continue}if(F==="`"&&y==="`"&&D===0){y=null,B++;continue}if(y){B++;continue}if(F===w)z++;else if(F===j){if(z--,z===0)return B}B++}return-1}function O(b,w){let j=w,v={paren:0,bracket:0,brace:0},z=null,B=0;while(j<b.length){let y=b[j];if((j>0?b[j-1]:"")==="\\"&&z){j++;continue}if((y==='"'||y==="'")&&!z){z=y,j++;continue}if(y===z&&z!=="`"){z=null,j++;continue}if(y==="`"&&!z){z="`",j++;continue}if(y==="`"&&z==="`"&&B===0){z=null,j++;continue}if(z==="`"&&y==="$"&&b[j+1]==="{"){B++,j+=2;continue}if(B>0){if(y==="{")B++;else if(y==="}")B--;j++;continue}if(z){j++;continue}if(v.paren===0&&v.bracket===0&&v.brace===0){if(b.slice(j,j+2)==="}}"||b.slice(j,j+3)==="!!}")break;if(y===","||y===";")break}if(y==="(")v.paren++;else if(y===")"){if(v.paren--,v.paren<0)break}else if(y==="[")v.bracket++;else if(y==="]"){if(v.bracket--,v.bracket<0)break}else if(y==="{")v.brace++;else if(y==="}"){if(v.brace--,v.brace<0)break}j++}return{expression:b.slice(w,j),endPos:j}}function Q(b){let w=[],j="",v={paren:0,bracket:0,brace:0},z=null,B=0;for(let y=0;y<b.length;y++){let D=b[y];if((y>0?b[y-1]:"")==="\\"&&z){j+=D;continue}if((D==='"'||D==="'")&&!z){z=D,j+=D;continue}if(D===z&&z!=="`"){z=null,j+=D;continue}if(D==="`"&&!z){z="`",j+=D;continue}if(D==="`"&&z==="`"&&B===0){z=null,j+=D;continue}if(z==="`"&&D==="$"&&b[y+1]==="{"){B++,j+=D+b[y+1],y++;continue}if(B>0&&D==="{"){B++,j+=D;continue}if(B>0&&D==="}"){B--,j+=D;continue}if(z){j+=D;continue}if(D==="(")v.paren++;else if(D===")")v.paren--;else if(D==="[")v.bracket++;else if(D==="]")v.bracket--;else if(D==="{")v.brace++;else if(D==="}")v.brace--;if(D==="|"&&b[y+1]!=="|"&&(y===0||b[y-1]!=="|")&&b[y-1]!=="\\"&&v.paren===0&&v.bracket===0&&v.brace===0){w.push(j.trim()),j="";continue}if(D==="|"&&b[y-1]==="\\"&&!z){j=j.slice(0,-1)+D;continue}j+=D}if(j.trim())w.push(j.trim());return w}
5
- export{J as gy,K as hy,O as iy,Q as jy};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import y from"net";async function z(j){return new Promise((q)=>{let k=y.createServer();k.once("error",()=>q(!1)),k.once("listening",()=>{k.close(()=>q(!0))}),k.listen(j,"0.0.0.0")})}async function B(j){return new Promise((q)=>{let k=y.createServer();k.once("error",()=>q(!1)),k.once("listening",()=>{k.close(()=>q(!0))}),k.listen(j,"::")})}async function C(j){if(!await z(j))return!1;return await B(j)}async function D(j,q=20){j=Number(j);for(let k=0;k<q;k++){let u=j+k;if(await C(u))return u}throw Error(`Could not find an available port between ${j} and ${j+q-1}`)}var H=3000;async function J(j){let q=j.end-j.start+1;return D(j.start,q)}
3
- export{C as jo,D as ko,H as lo,J as mo};
@@ -1 +0,0 @@
1
- // @bun
@@ -1,2 +0,0 @@
1
- // @bun
2
- export{g as Vx};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function u(b,...x){for(let j of x){if(b.serverDynamic[j]!==void 0)return String(b.serverDynamic[j]);let q=b.static[j];if(typeof q==="string")return q}return}var E={name:"TransitionGroup",aliases:["transition-group"],render(b,x,j){let q=(u(b,"name")||"v").replace(/["'<>]/g,""),z=(u(b,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",A=u(b,"class"),B=u(b,"id"),D=[`data-stx-transition-group="${q}"`,A?`class="${A}"`:"",B?`id="${B}"`:""].filter(Boolean).join(" ");return`<${z} ${D}>${x}</${z}>`}};
3
- export{E as dz};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import G from"path";var L=new Set([".jpg",".jpeg",".png",".gif"]),O=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function M(j,z){let H=z.formats??O;if(!z.publicDir)return j;let C=N(j),J=[],Y=/<img\b[^>]*?>/gi,K=[],Q;while((Q=Y.exec(j))!==null){let q=Q[0],y=q.match(/\bsrc=["']([^"']+)["']/i);if(!y)continue;if(_(Q.index,C))continue;K.push({idx:Q.index,length:q.length,src:y[1],raw:q})}if(K.length===0)return j;let Z=await Promise.all(K.map(async(q)=>{let y=await X(q.src,z.publicDir,H);return{match:q,sources:y}}));for(let{match:q,sources:y}of Z){if(y.length===0)continue;let I=`<picture>${y.map(($)=>`<source type="${$.mime}" srcset="${w($.url)}">`).join("")}${q.raw}</picture>`;J.push({start:q.idx,end:q.idx+q.length,replacement:I})}if(J.length===0)return j;let V="",W=0;for(let q of J)V+=j.slice(W,q.start),V+=q.replacement,W=q.end;return V+=j.slice(W),V}async function X(j,z,H){if(!F(j))return[];let C=G.extname(j).toLowerCase();if(!L.has(C))return[];if(!j.startsWith("/"))return[];let J=G.join(z,j.slice(1)),Y=G.dirname(J),K=G.basename(J,C),Q=G.resolve(Y),Z=G.resolve(z);if(!Q.startsWith(Z))return[];let V=G.posix.dirname(j),W=H.map(async(y)=>{let k=G.join(Y,`${K}${y.ext}`);if(!await Bun.file(k).exists())return null;return{url:G.posix.join(V,`${K}${y.ext}`),mime:y.mime}});return(await Promise.all(W)).filter((y)=>y!==null)}function F(j){if(!j)return!1;if(j.startsWith("http://")||j.startsWith("https://"))return!1;if(j.startsWith("//"))return!1;if(j.startsWith("data:"))return!1;return!0}function N(j){let z=[],H=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,C;while((C=H.exec(j))!==null)z.push([C.index,C.index+C[0].length]);return z}function _(j,z){for(let[H,C]of z)if(j>=H&&j<C)return!0;return!1}function w(j){return j.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
- export{M as Am};
@@ -1,14 +0,0 @@
1
- // @bun
2
- function w(j,z=""){let J=`${j}${z}`,q=0;for(let F=0;F<J.length;F++){let G=J.charCodeAt(F);q=(q<<5)-q+G,q=q&q}return`stx-${Math.abs(q).toString(36)}`}function K(j,z,J={}){let{prefix:q="",preserveHost:F=!0,scopeKeyframes:G=!0,scopeCustomProperties:E=!1}=J;if(!j.trim())return"";let U=Z(j),Q=[],O=new Map;if(G)for(let L of U){let V=L.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(V){let X=V[1],Y=`${z}_${X}`;O.set(X,Y)}}for(let L of U){let V=$(L,z,q,F,O,E);Q.push(V)}return Q.join(`
3
-
4
- `)}function Z(j){let z=[],J=j.replace(/\/\*[\s\S]*?\*\//g,""),q=0,F="",G=!1,E="";for(let U=0;U<J.length;U++){let Q=J[U];if(Q==="@"&&q===0)G=!0;if(Q==="{")q++;else if(Q==="}"){if(q--,q===0){if(G){E+=Q;let O=E.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(O){let[,L,V,X]=O;if(L==="keyframes")z.push({selector:`@keyframes ${V.trim()}`,declarations:X.trim()});else if(L==="media"||L==="supports"||L==="container"){let Y=Z(X);z.push({selector:`@${L} ${V.trim()}`,declarations:Y.map((_)=>`${_.selector} { ${_.declarations} }`).join(`
5
- `)})}else z.push({selector:`@${L} ${V.trim()}`,declarations:X.trim()})}E="",G=!1}else if(F.trim()){F+=Q;let O=F.match(/([^{]+)\{([^}]*)\}/);if(O)z.push({selector:O[1].trim(),declarations:O[2].trim()});F=""}continue}}if(G)E+=Q;else F+=Q}return z}function $(j,z,J,q,F,G){let{selector:E,declarations:U}=j;if(E.startsWith("@")){if(E.startsWith("@keyframes")){let L=E.replace("@keyframes ","").trim();return`@keyframes ${F.get(L)||L} { ${U} }`}if(E.startsWith("@media")||E.startsWith("@supports")||E.startsWith("@container")){let V=Z(`x { ${U} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((X)=>$(X,z,J,q,F,G)).join(`
6
- `);return`${E} {
7
- ${V}
8
- }`}return`${E} { ${U} }`}let Q=b(E,z,J,q),O=U;for(let[L,V]of F)O=O.replace(new RegExp(`\\b${L}\\b`,"g"),V);if(G)O=O.replace(/--([a-z-]+)/gi,`--${z}-$1`);return`${Q} { ${O} }`}function b(j,z,J,q){let F=j.split(",").map((E)=>E.trim()),G=[];for(let E of F){if(E.startsWith(":host")){if(q)G.push(E);else{let Q=E.replace(/:host(\([^)]*\))?/,`.${z}$1`);G.push(Q)}continue}if(E.includes("::slotted")){G.push(E);continue}if(E===":root"){G.push(`:root .${z}`);continue}let U=J?`${J} .${z}`:`.${z}`;G.push(`${U} ${E}`)}return G.join(", ")}function W(j){let z=j.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),J=z?z[1]:"",q=z?j.replace(/<style\b[^>]*>[\s\S]*?<\/style>/i,""):j;return{css:J,templateWithoutStyle:q}}function B(j,z,J="head"){if(!z.trim())return j;let q=`<style data-stx-scoped>
9
- ${z}
10
- </style>`;switch(J){case"head":if(j.includes("</head>"))return j.replace("</head>",`${q}
11
- </head>`);return q+j;case"body-start":if(j.includes("<body"))return j.replace(/(<body[^>]*>)/,`$1
12
- ${q}`);return q+j;case"body-end":{let F=j.lastIndexOf("</body>");if(F!==-1)return j.slice(0,F)+q+`
13
- `+j.slice(F);return j+q}default:return j}}function A(j){return j.trim()}
14
- export{w as nt,K as ot,W as pt,B as qt,A as rt};
@@ -1,21 +0,0 @@
1
- // @bun
2
- import{aw as s,dw as a,ew as i}from"./chunk-bykjk6vj.js";import{hy as I}from"./chunk-mrehzhxv.js";import{Vy as c}from"./chunk-q60knhjf.js";import{rz as v}from"./chunk-adqh2m9z.js";import{rB as f}from"./chunk-3jm3snz8.js";import k from"path";import y from"process";function NQ(H){let Q=[],Z=0,z=H.split(`
3
- `);for(let X of z){let Y=Z,$=null,_=!1;for(let J=0;J<X.length;J++){let G=X[J];if(_){_=!1;continue}if(G==="\\"){_=!0;continue}if($){if(G===$)$=null;continue}if(G==="'"||G==='"'||G==="`"){$=G;continue}if(G==="/"&&J+1<X.length&&X[J+1]==="/")break;if(G==="{")Z++;else if(G==="}")Z--}if(Y===0){let J=X.match(/(?:const|let|var)\s+(\w+)\s*=/);if(J)Q.push(J[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(X)){let G=X.match(/(?:const|let|var)\s+(\w+)/);if(G)Q.push(G[1])}else{let G=X.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(G){let B=G[1].slice(1,-1).split(",").map((R)=>{let F=R.split(":");return(F.length>1?F[1]:F[0]).trim()}).filter((R)=>/^\w+$/.test(R));Q.push(...B)}}}}return[...new Set(Q)]}function EQ(H){let Q=H;Q=Q.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Q=Q.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Q=Q.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Q=Q.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Q=Q.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function Z(z){if(!z.includes(":"))return z;let X=[],Y="",$=0,_=0,J=null;for(let G=0;G<z.length;G++){let W=z[G];if(J){if(Y+=W,W===J)J=null;continue}if(W==='"'||W==="'"||W==="`"){J=W,Y+=W;continue}if(W==="<")$++;else if(W===">"&&$>0)$--;else if(W==="(")_++;else if(W===")")_--;if(W===","&&$===0&&_===0){X.push(Y),Y="";continue}Y+=W}if(Y)X.push(Y);return X.map((G)=>{let W=G.trim(),B=W.startsWith("..."),R=B?W.slice(3):W,F=-1,q=0;for(let N=0;N<R.length;N++)if(R[N]==="<")q++;else if(R[N]===">")q--;else if(R[N]===":"&&q===0){F=N;break}if(F===-1)return G;let M=R.substring(0,F).trim().replace(/\?$/,""),V=R.substring(F+1),b=-1,L=0;for(let N=0;N<V.length;N++)if(V[N]==="<")L++;else if(V[N]===">")L--;else if(V[N]==="="&&L===0){b=N;break}let D=B?"...":"";if(b!==-1)return`${D}${M} = ${V.substring(b+1).trim()}`;return`${D}${M}`}).join(", ")}Q=Q.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(z,X,Y)=>{if(!Y.includes(":"))return z;return`${X}(${Z(Y)})`});{let z=/\b(function\s+\w*\s*)\(/g,X,Y=[];while((X=z.exec(Q))!==null){let $=X.index+X[0].length-1,_=1,J=$+1,G=0,W=null;while(J<Q.length&&_>0){let F=Q[J];if(W){if(F===W)W=null;J++;continue}if(F==='"'||F==="'"||F==="`"){W=F,J++;continue}if(F==="<")G++;else if(F===">"&&G>0)G--;else if(G===0){if(F==="(")_++;else if(F===")")_--}if(_>0)J++}if(_!==0)continue;let B=Q.substring($+1,J);if(!B.includes(":"))continue;let R=Z(B);Y.push({start:$+1,end:J,replacement:R})}for(let $=Y.length-1;$>=0;$--){let{start:_,end:J,replacement:G}=Y[$];Q=Q.substring(0,_)+G+Q.substring(J)}}return Q=Q.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(z,X)=>{if(!X.includes(":"))return z;if(X.includes("{")||X.includes("}"))return z;return`(${X.split(",").map(($)=>{let[_,...J]=$.split("="),G=_.split(":")[0].trim();if(J.length>0)return`${G} = ${J.join("=").trim()}`;return G}).join(", ")}) =>`}),Q=Q.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Q=Q.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Q=Q.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Q=Q.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Q=Q.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Q=Q.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Q=Q.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Q=Q.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Q=Q.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Q=Q.replace(/\n\s*\n\s*\n/g,`
4
-
5
- `),Q}async function xQ(H,Q,Z,z={}){if(!H.trim())return;let X;try{let U=new Bun.Transpiler({loader:"ts",target:"browser",define:c()}),A=H.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");A=A.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),X=U.transformSync(A)}catch{X=EQ(H)}let Y={exports:{}},$=Y.exports,_=y.cwd(),J={},G=[...X.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((U)=>U[1]).filter((U)=>!U.startsWith("node:")&&!U.startsWith(".")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(U));for(let U of G)try{let A=k.resolve(_,"node_modules",U),O=k.join(A,"package.json"),T=JSON.parse(f("fs").readFileSync(O,"utf8")),w=T.main||"index.js";if(T.exports){let j=typeof T.exports==="string"?T.exports:T.exports["."];if(typeof j==="string")w=j;else if(j?.bun)w=j.bun;else if(j?.import)w=j.import;else if(j?.default)w=j.default}J[U]=await import(k.resolve(A,w))}catch{}let W=(U)=>{if(J[U])return J[U];return f(U)},B=Q.props||{},R=(U)=>{if(!U)return B;let A={};for(let[O,T]of Object.entries(U)){let w=B[O];if(w!==void 0)A[O]=w;else if(typeof T==="function")A[O]=T();else A[O]=T}return A};for(let[U,A]of Object.entries(B))Object.defineProperty(R,U,{value:A,enumerable:!0,configurable:!0,writable:!0});let F=(U)=>{if(!U)return B;let A={...B};for(let[O,T]of Object.entries(U)){let w=T&&typeof T==="object"&&!Array.isArray(T)?T:{type:T};if(A[O]===void 0&&w.default!==void 0)A[O]=typeof w.default==="function"?w.default():w.default}return A},q=()=>Q.slots||{},E=(U,A)=>{let O={...U};for(let[T,w]of Object.entries(A))if(O[T]===void 0)if(typeof w==="function")O[T]=w();else O[T]=w;return O},M=(U)=>{let A=()=>U;return A.set=(O)=>{},A.update=(O)=>{},A},V=(U)=>{let A,O=!1;return()=>{if(!O)try{A=U(),O=!0}catch{A=void 0}return A}},b=(U)=>{},L=(U)=>U(),D=(U)=>{},N=(U)=>{},S=(U)=>{},e=()=>{let U=Q.__stxServeContext,A=Q.__stxServeSearch??U?.search??"",O=U?.path??"";return{params:Q.params??{},query:Object.fromEntries(new URLSearchParams(A)),path:O,name:"",fullPath:O+A,hash:"",matched:[]}},QQ=()=>({push:(U)=>{},replace:(U)=>{},back:()=>{},forward:()=>{},go:(U)=>{}}),XQ=(U)=>{a(U);let A=Q.__stx_runtime_head||{},O=U||{};Q.__stx_runtime_head={...A,...O.title&&{title:O.title},meta:[...A.meta||[],...O.meta||[]],link:[...A.link||[],...O.link||[]],script:[...A.script||[],...O.script||[]],htmlAttrs:{...A.htmlAttrs||{},...O.htmlAttrs||{}},bodyAttrs:{...A.bodyAttrs||{},...O.bodyAttrs||{}}}},YQ=(U)=>{i(U);let A=s();Q.__stx_runtime_head={...Q.__stx_runtime_head||{},...A.title&&{title:A.title},meta:A.meta?[...A.meta]:[]}},ZQ=(U)=>({value:U}),zQ=(U)=>U,GQ=(U)=>({value:typeof U==="function"?U():U}),$Q=(U,A)=>{},HQ=(U)=>{},UQ=(U)=>{},_Q=(U)=>U?U():Promise.resolve(),JQ=(U)=>(A,...O)=>{},WQ=(U)=>{},AQ=(U,A)=>{},BQ=(U,A)=>A,FQ=()=>({value:"light"}),OQ=()=>({value:!1}),C={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},RQ=new Proxy(C,{get(U,A){if(A in U)return U[A];return},set(U,A,O){return U[A]=O,!0}}),KQ={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},qQ=console;try{let U=MQ(X,Z),A=new Set(Object.keys(B)),O=Object.keys(Q).filter((K)=>!A.has(K)&&K!=="props"),T=O.map((K)=>Q[K]),w=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","let","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","await","async","module","exports","require","params","window","document","console","state","derived","effect"]),j=[],x=[];for(let[K,P]of Object.entries(B)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(K))continue;if(w.has(K))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${K}\\b`).test(U))continue;j.push(K),x.push(P)}let TQ=NQ(U).map((K)=>`module.exports.${K} = typeof ${K} !== 'undefined' ? ${K} : module.exports.${K};`).join(`
6
- `),wQ=Q.params??{},h=[],m=[];for(let K=0;K<O.length;K++){if(O[K]==="params")continue;h.push(O[K]),m.push(T[K])}let d=await Function("module","exports","require","props","$props","defineProps","withDefaults","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","window","document","console","confirm","alert","fetch","params",...j,...h,`return (async () => {
7
- ${U}
8
- ${TQ}
9
- return module.exports
10
- })()`)(Y,$,W,B,R,F,E,M,V,b,L,D,N,S,e,QQ,XQ,YQ,ZQ,zQ,GQ,$Q,HQ,UQ,_Q,JQ,WQ,q,AQ,BQ,FQ,OQ,RQ,KQ,qQ,C.confirm,C.alert,C.fetch,wQ,...x,...m);if(z.preserveExisting){for(let[K,P]of Object.entries(d))if(!(K in Q)||Q[K]===void 0)Q[K]=P}else Object.assign(Q,d);for(let[K,P]of Object.entries(B))if(!(K in Q))Q[K]=P}catch(U){if(y.env.STX_DEBUG){let A=U instanceof Error?U.message:String(U);console.warn(`[stx] server <script> did not execute in ${Z??"<unknown>"} \u2014 falling back to static extraction. Cause: ${A}`)}try{await DQ(X,Q,Z)}catch(A){if(y.env.STX_DEBUG){let O=A instanceof Error?A.message:String(A);console.warn(`[stx] fallback extraction also failed in ${Z??"<unknown>"}: ${O}`)}}}}function MQ(H,Q){let Z=Q?k.dirname(Q):y.cwd(),z=H.split(`
11
- `),X=[],Y=0;while(Y<z.length){let $=z[Y].trim();if($.startsWith("interface ")||$.startsWith("export interface ")||$.startsWith("type ")||$.startsWith("export type ")){if($.includes("{")&&!$.includes("}")){let _=0;for(;Y<z.length;Y++){for(let J of z[Y])if(J==="{")_++;else if(J==="}")_--;if(_<=0)break}}Y++;continue}if($.startsWith("definePageMeta(")){let _=0,J=!1;for(let G=Y;G<z.length&&!J;G++){let W=null,B=!1,R=z[G];for(let F=0;F<R.length;F++){let q=R[F];if(B){B=!1;continue}if(q==="\\"){B=!0;continue}if(W){if(q===W)W=null;continue}if(q==='"'||q==="'"||q==="`"){W=q;continue}if(q==="(")_++;else if(q===")"){if(_--,_===0){Y=G+1,J=!0;break}}}}if(!J)Y=z.length;continue}if($.startsWith("import ")){let _=$.match(/^import\s+(\w+)\s+from\s+['"](.+)['"]/),J=$.match(/^import\s+\{([^}]+)\}\s+from\s+['"](.+)['"]/),G=$.match(/^import\s+['"](.+)['"]/),W=(B)=>{if(B.startsWith("."))return k.resolve(Z,B);return B};if(_){let[,B,R]=_,F=W(R);X.push(`const ${B} = await import('${F}')`),X.push(`module.exports.${B} = ${B};`)}else if(J){let[,B,R]=J,F=B.trim(),q=W(R);X.push(`const { ${F} } = await import('${q}')`);for(let E of F.split(",")){let M=E.trim().split(/\s+as\s+/).pop()?.trim();if(M)X.push(`module.exports.${M} = ${M};`)}}else if(G){let B=W(G[1]);X.push(`await import('${B}')`)}else X.push($);Y++;continue}if(($.startsWith("const ")||$.startsWith("let ")||$.startsWith("var ")||$.startsWith("export const ")||$.startsWith("export let ")||$.startsWith("export var "))&&!$.includes("="))X.push(z[Y]),Y++;else if($.startsWith("export const ")||$.startsWith("export let ")||$.startsWith("export var ")){let _=u(z,Y),{type:J,name:G,value:W}=_;X.push(`${J} ${G} = ${W};`),X.push(`module.exports.${G} = ${G};`),Y=_.nextIndex}else if($.startsWith("export function ")||$.startsWith("export async function ")){let _=g(z,Y);X.push(_.functionCode),X.push(`module.exports.${_.name} = ${_.name};`),Y=_.nextIndex}else if($.startsWith("const ")||$.startsWith("let ")||$.startsWith("var ")){let _=u(z,Y),{type:J,name:G,value:W}=_;X.push(`${J} ${G} = ${W};`),X.push(`module.exports.${G} = ${G};`),Y=_.nextIndex}else if($.startsWith("function ")||$.startsWith("async function ")){let _=g(z,Y);X.push(_.functionCode),X.push(`module.exports.${_.name} = ${_.name};`),Y=_.nextIndex}else if($.startsWith("export default function ")||$.startsWith("export default async function ")){let _=z[Y].replace(/^(\s*)export\s+default\s+/,"$1"),J=[...z];J[Y]=_;let G=g(J,Y);if(X.push(G.functionCode),G.name)X.push(`module.exports.default = ${G.name};`);Y=G.nextIndex}else if($.startsWith("export default ")){let _=$.replace(/^export\s+default\s+/,"").replace(/;$/,"");X.push(`module.exports.default = ${_};`),Y++}else if($.startsWith("class ")||$.startsWith("export class ")){let _=$.match(/(?:export\s+)?class\s+(\w+)/);if(_){let J=_[1],G=z[Y].replace(/^export\s+/,""),W=0,B=Y;for(;B<z.length;B++){let R=z[B];for(let F of R)if(F==="{")W++;else if(F==="}")W--;if(B>Y)G+=`
12
- `+R;if(W<=0&&B>=Y)break}X.push(G),X.push(`module.exports.${J} = ${J};`),Y=B+1}else X.push($),Y++}else if($.includes("module.exports"))X.push($),Y++;else if($.trim()&&!$.startsWith("//"))X.push($),Y++;else Y++}return VQ(X.join(`
13
- `),Z)}function VQ(H,Q){let Z=H.length,z="",X=0,Y=null,$=!1,_=!1,J=0;while(X<Z){let G=H[X],W=H[X+1];if($){if(z+=G,G===`
14
- `)$=!1;X++;continue}if(_){if(z+=G,G==="*"&&W==="/"){z+=W,X+=2,_=!1;continue}X++;continue}if(!Y&&G==="/"&&W==="/"){$=!0,z+=G,X++;continue}if(!Y&&G==="/"&&W==="*"){_=!0,z+=G,X++;continue}if(Y){if(z+=G,G==="\\"){z+=W,X+=2;continue}if(G===Y&&Y!=="`"){Y=null,X++;continue}if(Y==="`"){if(G==="$"&&W==="{"){J++,z+=W,X+=2;continue}if(G==="`"){Y=null,X++;continue}}X++;continue}if(J>0){if(G==="{")J++;else if(G==="}")J--}if(G==='"'||G==="'"||G==="`"){Y=G,z+=G,X++;continue}if(G==="a"&&H.startsWith("await",X)){let B=bQ(H,X);if(B){let{quote:R,path:F,end:q}=B;if(F.startsWith(".")){let E=k.resolve(Q,F);z+=`await import(${R}${E}${R})`,X=q;continue}}}z+=G,X++}return z}function bQ(H,Q){let Z=Q+5;if(Z>=H.length)return null;if(!/\s/.test(H[Z]))return null;while(Z<H.length&&/\s/.test(H[Z]))Z++;if(!H.startsWith("import",Z))return null;Z+=6;while(Z<H.length&&/\s/.test(H[Z]))Z++;if(H[Z]!=="(")return null;Z++;while(Z<H.length&&/\s/.test(H[Z]))Z++;let z=H[Z];if(z!=="'"&&z!=='"')return null;Z++;let X=Z;while(Z<H.length&&H[Z]!==z)if(H[Z]==="\\")Z+=2;else Z++;if(Z>=H.length)return null;let Y=H.slice(X,Z);Z++;while(Z<H.length&&/\s/.test(H[Z]))Z++;if(H[Z]!==")")return null;return{quote:z,path:Y,end:Z+1}}function r(H,Q){let Z=H[Q];if(Z!=="{"&&Z!=="[")return null;let X=I(H,Z,Z==="{"?"}":"]",Q);if(X===-1)return null;return{pattern:H.slice(Q,X+1),endPos:X+1}}function n(H){let Q=[],Z=H.slice(1,-1).trim();if(!Z)return Q;let z=0,X=0,Y="";while(z<Z.length){let $=Z[z];if($==="{"||$==="["){if(X++,X===1){let _=r(Z,z);if(_){let J=n(_.pattern);Q.push(...J),z=_.endPos,Y="";continue}}}else if($==="}"||$==="]")X--;if(X>0){z++;continue}if($===","){if(Y.trim())Q.push(Y.trim());Y="",z++;continue}if($===":"){Y="",z++;continue}if($==="="){if(Y.trim())Q.push(Y.trim());Y="",z++;while(z<Z.length&&Z[z]!==","&&X===0){if(Z[z]==="{"||Z[z]==="[")X++;else if(Z[z]==="}"||Z[z]==="]")X--;z++}continue}if(/[\w$]/.test($))Y+=$;z++}if(Y.trim())Q.push(Y.trim());return Q}function u(H,Q){let Z=H[Q].trim(),z=Z.match(/^(?:export\s+)?(const|let|var)\s+(\w+)\s*=\s*(.*)$/);if(!z){let G=Z.match(/^(?:export\s+)?(const|let|var)\s+/);if(G){let W=Z.slice(G[0].length),B=Q;if((W.startsWith("{")||W.startsWith("["))&&!W.includes(W.startsWith("{")?"}":"]")){let F=W.startsWith("{")?"}":"]",q=W;for(let E=Q+1;E<H.length;E++)if(q+=" "+H[E].trim(),B=E,H[E].includes(F))break;W=q}let R=r(W,0);if(R){let F=G[1],q=R.pattern,E=W.slice(R.endPos).trim();if(E.startsWith("=")){let M=E.slice(1).trim(),V=M,b=Math.max(B,Q);if(p(M)){let S=l(H,b,M);V=S.value,b=S.nextIndex}else b=b+1;V=V.trim().replace(/;$/,"");let L=n(q),D=`__stx_src_${Q}`,N=L.map((S)=>`module.exports.${S} = ${S};`).join(`
15
- `);return{type:F,name:D,value:`${V}; ${F} ${q} = ${D};
16
- ${N}`,nextIndex:b}}}}throw Error(`Failed to parse variable declaration: ${Z}`)}let[,X,Y,$]=z,_=$,J=Q;if(p($)){let G=l(H,Q,$);_=G.value,J=G.nextIndex}else J=Q+1;while(J<H.length){let G=H[J].trim();if(G.startsWith(".")||G.startsWith("?."))_+=`
17
- ${H[J]}`,J++;else break}return _=_.trim().replace(/;$/,""),{type:X,name:Y,value:_,nextIndex:J}}function g(H,Q){let Z=H[Q].trim(),z=Z.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!z)throw Error(`Failed to parse function declaration: ${Z}`);let[,X]=z,Y=Z.replace(/^export\s+/,""),$=Q;if(jQ(Z)){let _=LQ(H,Q,Y);Y=_.functionCode,$=_.nextIndex}else $=Q+1;return{name:X,functionCode:Y,nextIndex:$}}function p(H){let Q=H.trim();if(Q.startsWith("{"))return I(Q,"{","}",0)===-1;if(Q.startsWith("["))return I(Q,"[","]",0)===-1;return!t(Q)}function t(H){let Q={paren:0,bracket:0,brace:0},Z=null,z=0;for(let X=0;X<H.length;X++){let Y=H[X];if((X>0?H[X-1]:"")==="\\"&&Z)continue;if((Y==='"'||Y==="'")&&!Z){Z=Y;continue}if(Y===Z&&Z!=="`"){Z=null;continue}if(Y==="`"&&!Z){Z="`";continue}if(Y==="`"&&Z==="`"&&z===0){Z=null;continue}if(Z==="`"&&Y==="$"&&H[X+1]==="{"){z++,X++;continue}if(z>0&&Y==="{"){z++;continue}if(z>0&&Y==="}"){z--;continue}if(Z)continue;if(Y==="(")Q.paren++;else if(Y===")")Q.paren--;else if(Y==="[")Q.bracket++;else if(Y==="]")Q.bracket--;else if(Y==="{")Q.brace++;else if(Y==="}")Q.brace--}return Q.paren===0&&Q.bracket===0&&Q.brace===0&&Z===null}function jQ(H){let Q=H.indexOf("{");if(Q===-1)return!0;return I(H,"{","}",Q)===-1}function l(H,Q,Z){let z=Z,X=Q+1;while(X<H.length&&!t(z)){let Y=H[X];z+=`
18
- ${Y}`,X++}while(X<H.length){let Y=H[X].trim();if(Y.startsWith(".")||Y.startsWith("?."))z+=`
19
- ${H[X]}`,X++;else break}return{value:z,nextIndex:X}}function LQ(H,Q,Z){let z=Z,X=Q+1;while(X<H.length){let Y=z.indexOf("{");if(Y!==-1){if(I(z,"{","}",Y)!==-1)break}let $=H[X];z+=`
20
- ${$}`,X++}return{functionCode:z,nextIndex:X}}function o(H,Q){let Z=v(H,Q)??v(`(${H})`,Q);if(Z!==void 0)return Z;if(!/\bprocess\b/.test(H))return;let z={...Q,process:Object.freeze({env:{...y.env}})};try{return Function(...Object.keys(z),`'use strict'; return (${H});`)(...Object.values(z))}catch{try{return Function(...Object.keys(z),`'use strict'; return ${H};`)(...Object.values(z))}catch{return}}}async function DQ(H,Q,Z){let z=H.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Y of z){let[,,$,_]=Y;try{let J=_.trim().replace(/;$/,""),G=o(J,Q);if(G!==void 0)Q[$]=G}catch(J){console.warn(`Failed to parse export ${$} in fallback:`,J)}}let X=H.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Y of X){let[,,$,_]=Y;if(!($ in Q))try{let J=_.trim().replace(/;$/,""),G=o(J,Q);if(G!==void 0)Q[$]=G}catch{}}}function hQ(H){let Q=H.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),Z=Q?Q[1]:"",z=Q?H.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):H;return{scriptContent:Z,templateWithoutScript:z}}function mQ(H){let Q=H.trim();if(!Q)return!1;return/(?:const|let|var|function)\s+\w+/.test(Q)}
21
- export{EQ as dt,xQ as et,MQ as ft,hQ as gt,mQ as ht};
@@ -1,29 +0,0 @@
1
- // @bun
2
- import{Rq as E}from"./chunk-6djgb0hr.js";import{rB as f}from"./chunk-3jm3snz8.js";import D from"path";import{extractLayoutMetadata as p}from"stx-router/layout-metadata";var P="stx-page-head:",R=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,H=null;function M(){if(H!==null)return H;try{let{getRouterScript:z}=f("stx-router");H=`<script>${z()}</script>`}catch{H=""}return H}async function x(z,X){if(X===!1)return null;if(X&&typeof X==="string"){let J=D.resolve(z,X);if(await Bun.file(J).exists())return J;return null}let w=D.join(z,"app.stx");if(await Bun.file(w).exists())return w;return null}async function y(z,X){try{let w=await Bun.file(z).text(),J=w,Y=w.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(Y)J=Y[1].trim();let N=E(w),V=[...N.client.map((Q)=>Q.fullTag),...N.signals.map((Q)=>Q.fullTag)],F=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,$;while(($=Z.exec(w))!==null)F.push($[0]);let B=J;for(let Q of N.server)B=B.replace(Q.fullTag,"");for(let Q of N.client)B=B.replace(Q.fullTag,"");B=B.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let j="<!--__STX_PAGE_SLOT__-->";if(B=B.replace(/<slot\s*\/>/gi,j).replace(/<slot\s*>\s*<\/slot>/gi,j),!B.includes(j))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:I,defaultConfig:W,loadStxConfig:K}=await import("././index.js"),A=await K(),q={__filename:z,__dirname:D.dirname(z)};for(let Q of V){let k=Q.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(k&&!Q.includes("client")&&!Q.includes('type="module"'))await I(k[1],q,z)}let U=await G(B,q,z,{...W,...A,...X},new Set),v=U.indexOf(j);if(v===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:U.substring(0,v),afterSlot:U.substring(v+j.length),filePath:z,shellScripts:V,shellStyles:F}}catch(w){return console.error(`[stx] Error processing shell ${z}:`,w),null}}function S(z,X,w){let J,Y="",N=X.match(R);if(N){X=X.replace(N[0],"");try{let B=Buffer.from(N[1],"base64").toString("utf8"),j=B.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(j)J=j[1].trim();Y=B.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let V=w||J||"stx App",F=M(),Z="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>${V}</title>
8
- ${Y?` ${Y}
9
- `:""} ${z.shellStyles.join(`
10
- `)}
11
- </head>
12
- <body>
13
- ${z.beforeSlot}
14
- <div data-stx-content>${X}</div>
15
- ${z.afterSlot}
16
- ${z.shellScripts.filter((B)=>!B.includes("server")).join(`
17
- `)}
18
- ${Z}
19
- ${F}
20
- </body>
21
- </html>`}function b(z,X={}){let w=z.trim();if(!/<!DOCTYPE\b/i.test(w)&&!/^<html[\s>]/i.test(w))return z;let J=[],Y=w.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(Y){let Z=Y[1],$=/<style\b[^>]*>[\s\S]*?<\/style>/gi,B;while((B=$.exec(Z))!==null)J.push(B[0])}if(X.preserveHead&&Y){let Z=[],$=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,B;while((B=$.exec(Y[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(B[0]))continue;Z.push(B[0])}if(Z.length>0)J.unshift(`<!--${P}${Buffer.from(Z.join(`
22
- `),"utf8").toString("base64")}-->`)}let N=w.match(/<body\b[^>]*>/i),V=w.lastIndexOf("</body>");if(N&&V!==-1){let Z=N.index+N[0].length,$=w.slice(Z,V).trim();if(J.length>0)return J.join(`
23
- `)+`
24
- `+$;return $}let F=w;if(F=F.replace(/<!DOCTYPE\b[^>]*>/i,""),F=F.replace(/<html\b[^>]*>/i,""),F=F.replace(/<\/html\s*>/i,""),Y)F=F.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,J.join(`
25
- `));return F=F.replace(/<body\b[^>]*>/i,""),F=F.replace(/<\/body\s*>/i,""),F.trim()}function C(z){return z.headers.get("X-STX-Router")==="true"}function g(z,X="main"){let w=z.trim(),J=[],Y=w.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(Y){let U=Y[1],v=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Q;while((Q=v.exec(U))!==null)J.push(Q[0])}let N=X.replace(/^[.#]/,"").toLowerCase(),V=new RegExp(`<${N}\\b[^>]*>`,"i"),F=w.match(V);if(!F||F.index===void 0)return b(z);let Z=F.index+F[0].length,$=new RegExp(`<${N}\\b[^>]*>`,"gi"),B=new RegExp(`</${N}\\s*>`,"gi");$.lastIndex=Z,B.lastIndex=Z;let j=1,G=-1;while(j>0){let U=$.exec(w),v=B.exec(w);if(!v)break;if(U&&U.index<v.index)j++,B.lastIndex=U.index+U[0].length;else if(j--,G=v.index,j>0)$.lastIndex=v.index+v[0].length}if(G===-1)return b(z);let I=w.slice(Z,G).trim(),W=[],K=w.match(/<body\b[^>]*>/i),A=w.lastIndexOf("</body>");if(K&&K.index!==void 0&&A!==-1){let v=[[K.index+K[0].length,F.index],[G+`</${N}>`.length,A]],Q=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[k,_]of v){if(k>=_)continue;let O=w.slice(k,_),L;Q.lastIndex=0;while((L=Q.exec(O))!==null)W.push(L[0])}}let q=[];if(J.length>0)q.push(J.join(`
26
- `));if(W.length>0)q.push(W.join(`
27
- `));return q.push(I),q.join(`
28
- `)}
29
- export{x as Jq,y as Kq,S as Lq,b as Mq,C as Nq,g as Oq,p as Pq};
@@ -1,3 +0,0 @@
1
- // @bun
2
- var j=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],q=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],w={file:"title",order:"asc",groups:[]},z={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:w,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:j,backgroundPresets:q,autoApplyContrastColor:!1,port:6006};function D(A){let b={...z,...A};return{enabled:b.enabled??!0,outDir:b.outDir??".stx/dist/story",storyMatch:b.storyMatch??["**/*.story.stx"],storyIgnored:b.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...w,...b.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...b.theme},responsivePresets:b.responsivePresets??j,backgroundPresets:b.backgroundPresets??q,autoApplyContrastColor:b.autoApplyContrastColor??!1,setupFile:b.setupFile,port:b.port??6006}}function E(){return{...z}}
3
- export{j as ie,q as je,w as ke,z as le,D as me,E as ne};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import E from"fs";async function j(B){let q=await E.promises.readFile(B,"utf-8");return F(q,B)}function F(B,q){let H=B.match(/<Story\s+([^>]*)>([\s\S]*?)<\/Story>/i);if(!H)return null;let G=H[1],J=H[2],Q=K(G,"title")||V(q),U=z(Q),W=K(G,"group"),Y=K(G,"icon"),Z=K(G,"icon-color")||K(G,"iconColor"),_=K(G,"docs-only")==="true"||K(G,"docsOnly")==="true",X=w(G),$=T(J);return{id:U,title:Q,group:W,variants:$,layout:X,icon:Y,iconColor:Z,docsOnly:_}}function T(B){let q=[],H=/<Variant\s+([^>]*)>([\s\S]*?)<\/Variant>/gi,G=H.exec(B);while(G!==null){let J=G[1],Q=G[2],U=K(J,"title")||"Default",W=z(U),Y=K(J,"icon"),Z=K(J,"icon-color")||K(J,"iconColor"),_=K(J,"responsive-disabled")==="true",X=K(J,":init-state")||K(J,"init-state"),$=X?I(B,X):{},D=O(Q);q.push({id:W,title:U,icon:Y,iconColor:Z,state:$,source:D,responsiveDisabled:_}),G=H.exec(B)}if(q.length===0)q.push({id:"default",title:"Default",state:{}});return q}function K(B,q){let H=[new RegExp(`:${q}\\s*=\\s*["']([^"']+)["']`,"i"),new RegExp(`${q}\\s*=\\s*["']([^"']+)["']`,"i"),new RegExp(`:${q}\\s*=\\s*"([^"]+)"`,"i"),new RegExp(`${q}\\s*=\\s*"([^"]+)"`,"i")];for(let G of H){let J=B.match(G);if(J)return J[1]}return}function w(B){let q=K(B,":layout")||K(B,"layout");if(!q)return;try{let H=q.replace(/'/g,'"').replace(/(\w+):/g,'"$1":');return JSON.parse(H)}catch{return{type:"single"}}}function I(B,q){let H=B.match(/<script[^>]*>([\s\S]*?)<\/script>/i);if(!H)return{};let G=H[1],J=new RegExp(`function\\s+${q}\\s*\\(\\)\\s*\\{([\\s\\S]*?)\\breturn\\s*\\{([\\s\\S]*?)\\}`,"i"),Q=G.match(J);if(!Q){let U=new RegExp(`(?:const|let|var)\\s+${q}\\s*=\\s*\\(\\)\\s*=>\\s*\\(\\{([\\s\\S]*?)\\}\\)`,"i"),W=G.match(U);if(W)return k(W[1]);return{}}return k(Q[2])}function k(B){let q={},H=/(\w+)\s*:\s*([^,\n]+)/g,G=H.exec(B);while(G!==null){let J=G[1],Q=G[2].trim();q[J]=L(Q),G=H.exec(B)}return q}function L(B){let q=B.trim();if(q==="true")return!0;if(q==="false")return!1;if(q==="null")return null;if(q==="undefined")return;if(/^-?\d+(?:\.\d+)?$/.test(q))return Number(q);if(/^['"].*['"]$/.test(q))return q.slice(1,-1);return q}function O(B){let q=B;return q=q.replace(/<template\s+#default[^>]*>([\s\S]*?)<\/template>/gi,"$1"),q=q.replace(/<template\s+#controls[^>]*>[\s\S]*?<\/template>/gi,""),q=q.trim(),q}function V(B){return(B.split("/").pop()||B).replace(/\.story\.stx$/i,"").replace(/([A-Z])/g," $1").trim()}function z(B){return B.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function R(B){let q=B.match(/<script[^>]*>([\s\S]*?)<\/script>/i);return q?q[1]:""}function C(B){return B.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").trim()}
3
- export{j as vb,F as wb,R as xb,C as yb};
@@ -1,8 +0,0 @@
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 we,X as xe,Y as ye,A as ze,B as Ae};
@@ -1,207 +0,0 @@
1
- // @bun
2
- function N(){return{viewportWidth:null,viewportHeight:null,zoom:1,background:"#ffffff",showGrid:!1,showRuler:!1,showOutline:!1,props:{}}}function Q(q,B,A,j){let D=q.story?.variants.find((U)=>U.id===B);if(!D)return"";let{theme:F}=j.config,J=F.darkClass||"dark",K={...D.state,...A.props};return`
3
- <!DOCTYPE html>
4
- <html lang="en">
5
- <head>
6
- <meta charset="UTF-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
- <style>
9
- * { box-sizing: border-box; }
10
- body {
11
- margin: 0;
12
- padding: 16px;
13
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
14
- background: ${A.background};
15
- }
16
- ${A.showGrid?V():""}
17
- ${A.showOutline?X():""}
18
- </style>
19
- </head>
20
- <body class="${F.defaultColorScheme==="dark"?J:""}">
21
- <div id="preview-root">
22
- ${D.source||"<!-- No source -->"}
23
- </div>
24
- <script>
25
- // Props available to the component
26
- window.__stxProps = ${JSON.stringify(K)};
27
-
28
- // Notify parent of render complete
29
- window.parent.postMessage({ type: 'preview-ready' }, '*');
30
- </script>
31
- </body>
32
- </html>
33
- `}function V(){return`
34
- body::before {
35
- content: '';
36
- position: fixed;
37
- top: 0;
38
- left: 0;
39
- right: 0;
40
- bottom: 0;
41
- pointer-events: none;
42
- background-image:
43
- linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
44
- linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
45
- background-size: 8px 8px;
46
- z-index: 9999;
47
- }
48
- `}function X(){return`
49
- * {
50
- outline: 1px solid rgba(59, 130, 246, 0.3) !important;
51
- }
52
- `}function Y(q,B){return`
53
- <select class="stx-viewport-select" onchange="window.__stxStory.setViewport(this.value)">
54
- <option value="">Responsive</option>
55
- ${q.map((j)=>`<option value="${j.width}" ${j.width===B?"selected":""}>${j.label}</option>`).join("")}
56
- </select>
57
- `}function _(q){return`
58
- <div class="stx-zoom-controls">
59
- <button onclick="window.__stxStory.zoomOut()" title="Zoom out">\u2212</button>
60
- <select onchange="window.__stxStory.setZoom(this.value)">
61
- ${[0.5,0.75,1,1.25,1.5,2].map((j)=>`<option value="${j}" ${j===q?"selected":""}>${Math.round(j*100)}%</option>`).join("")}
62
- </select>
63
- <button onclick="window.__stxStory.zoomIn()" title="Zoom in">+</button>
64
- </div>
65
- `}function $(q,B){return`
66
- <div class="stx-background-selector">
67
- ${q.map((j)=>`
68
- <button
69
- class="stx-bg-btn ${j.color===B?"active":""}"
70
- style="background: ${j.color}"
71
- onclick="window.__stxStory.setBackground('${j.color}')"
72
- title="${j.label}"
73
- ></button>
74
- `).join("")}
75
- </div>
76
- `}function b(q){return`
77
- <div class="stx-overlay-buttons">
78
- <button
79
- class="${q.showGrid?"active":""}"
80
- onclick="window.__stxStory.toggleGrid()"
81
- title="Toggle grid"
82
- >\u229E</button>
83
- <button
84
- class="${q.showRuler?"active":""}"
85
- onclick="window.__stxStory.toggleRuler()"
86
- title="Toggle ruler"
87
- >\uD83D\uDCCF</button>
88
- <button
89
- class="${q.showOutline?"active":""}"
90
- onclick="window.__stxStory.toggleOutline()"
91
- title="Toggle outline"
92
- >\u25A2</button>
93
- </div>
94
- `}function k(q,B,A,j){let D=N(),F=N(),J=Q(q,B,D,j),K=Q(q,A,F,j);return`
95
- <div class="stx-comparison-view">
96
- <div class="stx-comparison-pane">
97
- <div class="stx-comparison-label">Variant A</div>
98
- <iframe srcdoc="${R(J)}"></iframe>
99
- </div>
100
- <div class="stx-comparison-divider"></div>
101
- <div class="stx-comparison-pane">
102
- <div class="stx-comparison-label">Variant B</div>
103
- <iframe srcdoc="${R(K)}"></iframe>
104
- </div>
105
- </div>
106
- `}function E(){return`
107
- .stx-preview-container {
108
- position: relative;
109
- width: 100%;
110
- height: 100%;
111
- overflow: auto;
112
- display: flex;
113
- align-items: center;
114
- justify-content: center;
115
- }
116
- .stx-preview-iframe {
117
- border: 1px solid var(--border);
118
- border-radius: 4px;
119
- background: white;
120
- transition: width 0.2s, height 0.2s, transform 0.2s;
121
- }
122
- .stx-viewport-select,
123
- .stx-zoom-controls select {
124
- padding: 4px 8px;
125
- border: 1px solid var(--border);
126
- border-radius: 4px;
127
- background: var(--bg);
128
- color: var(--text);
129
- font-size: 12px;
130
- }
131
- .stx-zoom-controls {
132
- display: flex;
133
- align-items: center;
134
- gap: 4px;
135
- }
136
- .stx-zoom-controls button {
137
- width: 24px;
138
- height: 24px;
139
- border: 1px solid var(--border);
140
- border-radius: 4px;
141
- background: var(--bg);
142
- color: var(--text);
143
- cursor: pointer;
144
- }
145
- .stx-zoom-controls button:hover {
146
- background: var(--bg-secondary);
147
- }
148
- .stx-background-selector {
149
- display: flex;
150
- gap: 4px;
151
- }
152
- .stx-bg-btn {
153
- width: 24px;
154
- height: 24px;
155
- border: 2px solid var(--border);
156
- border-radius: 4px;
157
- cursor: pointer;
158
- }
159
- .stx-bg-btn.active {
160
- border-color: var(--primary);
161
- }
162
- .stx-overlay-buttons {
163
- display: flex;
164
- gap: 4px;
165
- }
166
- .stx-overlay-buttons button {
167
- width: 28px;
168
- height: 28px;
169
- border: 1px solid var(--border);
170
- border-radius: 4px;
171
- background: var(--bg);
172
- cursor: pointer;
173
- }
174
- .stx-overlay-buttons button.active {
175
- background: var(--primary);
176
- color: white;
177
- border-color: var(--primary);
178
- }
179
- .stx-comparison-view {
180
- display: flex;
181
- width: 100%;
182
- height: 100%;
183
- }
184
- .stx-comparison-pane {
185
- flex: 1;
186
- display: flex;
187
- flex-direction: column;
188
- }
189
- .stx-comparison-label {
190
- padding: 8px;
191
- text-align: center;
192
- font-size: 12px;
193
- font-weight: 500;
194
- background: var(--bg-secondary);
195
- border-bottom: 1px solid var(--border);
196
- }
197
- .stx-comparison-pane iframe {
198
- flex: 1;
199
- border: none;
200
- }
201
- .stx-comparison-divider {
202
- width: 4px;
203
- background: var(--border);
204
- cursor: col-resize;
205
- }
206
- `}function R(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
207
- export{N as x,Q as y,Y as z,_ as A,$ as B,b as C,k as D,E};