@jxsuite/studio 6.1.0 → 6.1.2

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 (645) hide show
  1. package/dist/chunks/2020-f2gkpy8d.js +4 -0
  2. package/dist/chunks/{action-group-2mqby73c.js → action-group-4aan7g6g.js} +3 -3
  3. package/dist/chunks/adapter-4912g339.js +4 -0
  4. package/dist/chunks/cf-account-picker-wccaenh6.js +4 -0
  5. package/dist/chunks/cf-settings-br6105tr.js +4 -0
  6. package/dist/chunks/color-28ksk2qm.js +4 -0
  7. package/dist/chunks/color-area-0fj8a4ga.js +4 -0
  8. package/dist/chunks/color-field-xch8kx2g.js +4 -0
  9. package/dist/chunks/color-slider-jxd8v350.js +4 -0
  10. package/dist/chunks/combobox-p0efwjke.js +4 -0
  11. package/dist/chunks/components-db68vsn7.js +4 -0
  12. package/dist/chunks/content-source-1449qesq.js +4 -0
  13. package/dist/chunks/convert-to-repeater-5h457egj.js +4 -0
  14. package/dist/chunks/dialog-c4x05vyx.js +4 -0
  15. package/dist/chunks/editor-x9jn86a7.js +4 -0
  16. package/dist/chunks/entry-commands-may24cpt.js +4 -0
  17. package/dist/chunks/extension-sections-pvr14vxr.js +4 -0
  18. package/dist/chunks/file-ops-x9v54pcj.js +4 -0
  19. package/dist/chunks/files-j3knqf0s.js +4 -0
  20. package/dist/chunks/format-host-tyre2trb.js +4 -0
  21. package/dist/chunks/fs-events-64ma9htc.js +4 -0
  22. package/dist/chunks/git-panel-84ps5dex.js +4 -0
  23. package/dist/chunks/grid-view-d2wq9ezg.js +51 -0
  24. package/dist/chunks/icons-pnfz478q.js +4 -0
  25. package/dist/chunks/iframe-entry-fvbk89gm.js +5 -0
  26. package/dist/chunks/iframe-entry-jdcktez8.js +5 -0
  27. package/dist/chunks/iframe-entry-x0ygf2yr.js +5 -0
  28. package/dist/chunks/iframe-entry-zap785cw.js +5 -0
  29. package/dist/chunks/iframe-host-ck6vejt5.js +4 -0
  30. package/dist/chunks/index-b8xw3vy9.js +4 -0
  31. package/dist/chunks/{index-gybvv7a6.js → index-zpjmzqfk.js} +3 -3
  32. package/dist/chunks/{javascript-rnvdp3k4.js → javascript-m54mnwp6.js} +3 -3
  33. package/dist/chunks/jsonMode-w15cmrcm.js +13 -0
  34. package/dist/chunks/jx-validate-at3zn8wa.js +4 -0
  35. package/dist/chunks/layers-h4xp1pss.js +4 -0
  36. package/dist/chunks/layers-panel-m5hw1d7g.js +4 -0
  37. package/dist/chunks/listbox-e74qjyq6.js +4 -0
  38. package/dist/chunks/lit-html-8t8t3dnr.js +4 -0
  39. package/dist/chunks/media-picker-2cweexc5.js +4 -0
  40. package/dist/chunks/menu-n6yzswmy.js +4 -0
  41. package/dist/chunks/menu-ynw13y0s.js +4 -0
  42. package/dist/chunks/monaco-binding-7gx83x3r.js +4 -0
  43. package/dist/chunks/monaco-buffer-qzxn567r.js +4 -0
  44. package/dist/chunks/monaco-setup-gxf6656g.js +4 -0
  45. package/dist/chunks/notify-cj5zbrs2.js +4 -0
  46. package/dist/chunks/number-field-y62xq0ty.js +4 -0
  47. package/dist/chunks/parse-b7ddhr8m.js +4 -0
  48. package/dist/chunks/platform-3dfws9js.js +4 -0
  49. package/dist/chunks/popover-jt2gxmzs.js +4 -0
  50. package/dist/chunks/publish-panel-1gvxbj21.js +4 -0
  51. package/dist/chunks/quick-search-0dajrwqg.js +4 -0
  52. package/dist/chunks/references-49qgt404.js +4 -0
  53. package/dist/chunks/right-panel-jm1bwe53.js +4 -0
  54. package/dist/chunks/section-registry-6kwc4fky.js +4 -0
  55. package/dist/chunks/select-rzds841e.js +4 -0
  56. package/dist/chunks/split-n2gfpm5m.js +4 -0
  57. package/dist/chunks/{studio-5g0ag7c0.js → studio-0q988f9w.js} +3 -3
  58. package/dist/chunks/studio-0rt52vpq.js +5 -0
  59. package/dist/chunks/studio-18vgbhs5.js +5 -0
  60. package/dist/chunks/{studio-pxg4ap1e.js → studio-1fxkaaea.js} +4 -4
  61. package/dist/chunks/studio-24mccdrj.js +5 -0
  62. package/dist/chunks/studio-2eh507zk.js +9 -0
  63. package/dist/chunks/studio-2hcbccfv.js +5 -0
  64. package/dist/chunks/studio-2j1cb95x.js +5 -0
  65. package/dist/chunks/studio-2jbs3rxv.js +5 -0
  66. package/dist/chunks/{studio-qbj760tx.js → studio-485046te.js} +7 -7
  67. package/dist/chunks/studio-4h8k4dw9.js +5 -0
  68. package/dist/chunks/studio-5f6n18kx.js +5 -0
  69. package/dist/chunks/studio-5gthpky6.js +5 -0
  70. package/dist/chunks/studio-5ve6bbep.js +5 -0
  71. package/dist/chunks/studio-6ep3js6b.js +9 -0
  72. package/dist/chunks/studio-6wkmf3wz.js +9 -0
  73. package/dist/chunks/studio-841rf3cg.js +5 -0
  74. package/dist/chunks/studio-8gmwgheg.js +5 -0
  75. package/dist/chunks/studio-8qm0ep50.js +5 -0
  76. package/dist/chunks/{studio-anyrgzvb.js → studio-90pq9km1.js} +4 -4
  77. package/dist/chunks/studio-924p1tm1.js +6 -0
  78. package/dist/chunks/{studio-v2bvmbjj.js → studio-a3g98wjr.js} +4 -4
  79. package/dist/chunks/studio-a3shpz9y.js +5 -0
  80. package/dist/chunks/studio-amsbaaar.js +6 -0
  81. package/dist/chunks/studio-at5spjbc.js +7 -0
  82. package/dist/chunks/studio-b2xv945e.js +5 -0
  83. package/dist/chunks/studio-bn5nkafw.js +5 -0
  84. package/dist/chunks/studio-bw6q5xjf.js +9 -0
  85. package/dist/chunks/studio-c7q0t9x1.js +5 -0
  86. package/dist/chunks/studio-camnhc96.js +6 -0
  87. package/dist/chunks/studio-cffqvnzd.js +5 -0
  88. package/dist/chunks/studio-d81xfh1g.js +5 -0
  89. package/dist/chunks/studio-dgz8d0c1.js +5 -0
  90. package/dist/chunks/studio-efvfrsf8.js +5 -0
  91. package/dist/chunks/studio-er30bpcx.js +5 -0
  92. package/dist/chunks/studio-ezscgr64.js +5 -0
  93. package/dist/chunks/studio-ffrrncvz.js +5 -0
  94. package/dist/chunks/studio-fpphgn8y.js +10 -0
  95. package/dist/chunks/studio-j1kvhdjk.js +4 -0
  96. package/dist/chunks/{studio-txjjzrsm.js → studio-j430n16g.js} +5 -5
  97. package/dist/chunks/studio-jjkg84nj.js +5 -0
  98. package/dist/chunks/studio-m0q32ars.js +4 -0
  99. package/dist/chunks/studio-m6bdst11.js +5 -0
  100. package/dist/chunks/studio-nv2cptd4.js +64 -0
  101. package/dist/chunks/studio-nwfrc98n.js +5 -0
  102. package/dist/chunks/studio-p1wgvp7r.js +5 -0
  103. package/dist/chunks/studio-pag2wncm.js +5 -0
  104. package/dist/chunks/studio-qvanvzfd.js +5 -0
  105. package/dist/chunks/studio-qwa64kt7.js +5 -0
  106. package/dist/chunks/studio-rk1zc4x3.js +928 -0
  107. package/dist/chunks/studio-se2r3ptc.js +5 -0
  108. package/dist/chunks/studio-sg2a0dh0.js +5 -0
  109. package/dist/chunks/studio-tjzjhe68.js +5 -0
  110. package/dist/chunks/{studio-0x3jyb8r.js → studio-tq0rtfwj.js} +4 -4
  111. package/dist/chunks/{studio-cpxkgjrj.js → studio-v0jzqdjm.js} +4 -4
  112. package/dist/chunks/studio-v2w7q8r1.js +7 -0
  113. package/dist/chunks/studio-v5vjq1h0.js +4 -0
  114. package/dist/chunks/studio-v8aga3vp.js +14 -0
  115. package/dist/chunks/studio-vfcdrfmv.js +5 -0
  116. package/dist/chunks/studio-vmfkgdjf.js +5 -0
  117. package/dist/chunks/studio-wt1816jj.js +5 -0
  118. package/dist/chunks/studio-wz73q5kq.js +4 -0
  119. package/dist/chunks/studio-y04qtxvp.js +7 -0
  120. package/dist/chunks/studio-y21g8zzg.js +5 -0
  121. package/dist/chunks/studio-y64hrt8p.js +12 -0
  122. package/dist/chunks/studio-ynn90f58.js +16 -0
  123. package/dist/chunks/studio-yxz682sx.js +5 -0
  124. package/dist/chunks/studio-zp7snvkq.js +5 -0
  125. package/dist/chunks/studio-zq4z6tm6.js +5 -0
  126. package/dist/chunks/swatch-group-ewh24n1f.js +4 -0
  127. package/dist/chunks/tabs-f5cw3tgp.js +4 -0
  128. package/dist/chunks/textfield-wewc8rq2.js +4 -0
  129. package/dist/chunks/toast-c9fn075p.js +4 -0
  130. package/dist/chunks/toast-host-ke5z4ng7.js +4 -0
  131. package/dist/chunks/{toolbar-2nnzqhrj.js → toolbar-44cm5cta.js} +3 -3
  132. package/dist/chunks/tooltip-5v8ngwj2.js +4 -0
  133. package/dist/chunks/tree-mdq3v5cw.js +4 -0
  134. package/dist/chunks/tsMode-sf49ee9x.js +14 -0
  135. package/dist/chunks/workspace-jtfahpee.js +4 -0
  136. package/dist/chunks/ws-client-nze0k6mv.js +4 -0
  137. package/dist/iframe-entry.js +16 -16
  138. package/dist/manifest.json +63 -63
  139. package/dist/studio.js +98 -98
  140. package/dist/workers/ts.worker.js +3 -3
  141. package/package.json +11 -11
  142. package/src/about/about-modal.ts +4 -3
  143. package/src/account/action-flow.ts +45 -38
  144. package/src/account-status.ts +7 -2
  145. package/src/browse/library-layouts.ts +8 -5
  146. package/src/browse/library-model.ts +18 -6
  147. package/src/browse/library-pane.ts +37 -21
  148. package/src/browse/library-preview.ts +14 -9
  149. package/src/browse/library-source.ts +1 -1
  150. package/src/canvas/asset-refs.ts +24 -9
  151. package/src/canvas/asset-resolve.ts +19 -23
  152. package/src/canvas/canvas-helpers.ts +7 -6
  153. package/src/canvas/canvas-live-render.ts +44 -53
  154. package/src/canvas/canvas-patcher.ts +30 -30
  155. package/src/canvas/canvas-perf.ts +11 -5
  156. package/src/canvas/canvas-render.ts +66 -42
  157. package/src/canvas/canvas-surface.ts +5 -3
  158. package/src/canvas/canvas-utils.ts +163 -64
  159. package/src/canvas/dialog-path.ts +9 -4
  160. package/src/canvas/dialog-state.ts +1 -2
  161. package/src/canvas/diff-marks.ts +9 -16
  162. package/src/canvas/diff-toolbar.ts +8 -7
  163. package/src/canvas/edit-width-drag.ts +4 -1
  164. package/src/canvas/edit-width.ts +1 -3
  165. package/src/canvas/iframe-channel.ts +27 -13
  166. package/src/canvas/iframe-drop.ts +13 -12
  167. package/src/canvas/iframe-editable-root.ts +29 -16
  168. package/src/canvas/iframe-entry.ts +80 -63
  169. package/src/canvas/iframe-eval.ts +73 -49
  170. package/src/canvas/iframe-host.ts +203 -118
  171. package/src/canvas/iframe-inline-edit.ts +69 -32
  172. package/src/canvas/iframe-insert.ts +5 -4
  173. package/src/canvas/iframe-interaction.ts +37 -26
  174. package/src/canvas/iframe-overlay.ts +1 -1
  175. package/src/canvas/iframe-patch.ts +18 -15
  176. package/src/canvas/iframe-position.ts +12 -6
  177. package/src/canvas/iframe-protocol.ts +15 -16
  178. package/src/canvas/iframe-render.ts +41 -36
  179. package/src/canvas/iframe-slash.ts +24 -11
  180. package/src/canvas/iframe-subtree.ts +6 -2
  181. package/src/canvas/path-mapping.ts +19 -12
  182. package/src/canvas/popover-path.ts +7 -3
  183. package/src/canvas/popover-state.ts +1 -2
  184. package/src/canvas/serialize-scope.ts +13 -5
  185. package/src/canvas/stage-scrollbar.ts +2 -1
  186. package/src/canvas/surface-registry.ts +21 -3
  187. package/src/collab/collab-commands.ts +7 -2
  188. package/src/collab/collab-session.ts +84 -45
  189. package/src/collab/collab-state.ts +4 -3
  190. package/src/collab/monaco-binding.ts +16 -13
  191. package/src/collab/monaco-cursors.ts +5 -2
  192. package/src/commands/budget.ts +3 -3
  193. package/src/commands/command-args.ts +103 -71
  194. package/src/commands/context.ts +22 -20
  195. package/src/commands/defaults.ts +4 -1
  196. package/src/commands/keymap.ts +47 -43
  197. package/src/commands/levels.ts +3 -3
  198. package/src/commands/live-context.ts +10 -8
  199. package/src/commands/reference.ts +2 -1
  200. package/src/commands/registry.ts +12 -10
  201. package/src/commands/run-reported.ts +15 -10
  202. package/src/component-props.ts +46 -30
  203. package/src/content/collection-match.ts +5 -4
  204. package/src/content/draft-state.ts +4 -3
  205. package/src/content/entry-commands.ts +3 -2
  206. package/src/content/entry-editor.ts +29 -17
  207. package/src/content/entry-fields.ts +12 -7
  208. package/src/content/entry-model.ts +21 -12
  209. package/src/editor/canvas-context-menu.ts +1 -2
  210. package/src/editor/canvas-slash-bridge.ts +3 -6
  211. package/src/editor/content-slice.ts +16 -14
  212. package/src/editor/context-menu.ts +35 -22
  213. package/src/editor/convert-targets.ts +30 -35
  214. package/src/editor/convert-to-component.ts +11 -5
  215. package/src/editor/convert-to-repeater.ts +34 -22
  216. package/src/editor/editable-tags.ts +17 -2
  217. package/src/editor/file-drop-action.ts +21 -22
  218. package/src/editor/inline-edit-apply.ts +35 -17
  219. package/src/editor/inline-edit.ts +66 -50
  220. package/src/editor/inline-format.ts +59 -56
  221. package/src/editor/inline-link.ts +40 -15
  222. package/src/editor/insert-zone-action.ts +1 -1
  223. package/src/editor/merge-tags.ts +58 -19
  224. package/src/editor/repeater-scope.ts +39 -28
  225. package/src/editor/shortcuts.ts +87 -47
  226. package/src/editor/slash-menu.ts +1 -6
  227. package/src/files/asset-versions.ts +4 -4
  228. package/src/files/components.ts +15 -10
  229. package/src/files/elements.ts +5 -6
  230. package/src/files/file-ops.ts +77 -36
  231. package/src/files/files.ts +90 -95
  232. package/src/files/media-meta.ts +2 -1
  233. package/src/files/media-paths.ts +6 -1
  234. package/src/files/serialize-document.ts +2 -2
  235. package/src/format/constraints.ts +1 -1
  236. package/src/format/convert-file.ts +27 -13
  237. package/src/format/format-choices.ts +2 -1
  238. package/src/format/format-host.ts +76 -50
  239. package/src/github/github-auth-status.ts +27 -3
  240. package/src/github/github-auth.ts +19 -9
  241. package/src/github/github-publish.ts +24 -20
  242. package/src/grid/cell-editors.ts +46 -31
  243. package/src/grid/cell-popovers.ts +5 -3
  244. package/src/grid/edit-buffer.ts +10 -9
  245. package/src/grid/grid-controller.ts +20 -22
  246. package/src/grid/grid-layout.ts +21 -5
  247. package/src/grid/grid-open.ts +3 -6
  248. package/src/grid/grid-panel.ts +11 -4
  249. package/src/grid/grid-source.ts +8 -8
  250. package/src/grid/grid-view.ts +14 -17
  251. package/src/grid/redirects-grid.ts +14 -5
  252. package/src/grid/redirects.ts +16 -14
  253. package/src/grid/schema-columns.ts +25 -19
  254. package/src/grid/sources/connector-source.ts +47 -20
  255. package/src/grid/sources/content-source.ts +25 -24
  256. package/src/grid/sources/csv-file-source.ts +2 -2
  257. package/src/grid/tabulator-tables.d.ts +55 -34
  258. package/src/hosting/stage.ts +7 -7
  259. package/src/i18n/i18n-commands.ts +1 -2
  260. package/src/media/media-pane.ts +4 -1
  261. package/src/new-project/add-repo-modal.ts +20 -19
  262. package/src/new-project/import-tab.ts +10 -14
  263. package/src/new-project/location-fields.ts +2 -1
  264. package/src/new-project/new-project-modal.ts +12 -9
  265. package/src/packages/jxsuite-update.ts +4 -3
  266. package/src/packages/pull-package-sync.ts +26 -25
  267. package/src/page-params.ts +97 -68
  268. package/src/panels/activity-panel.ts +17 -9
  269. package/src/panels/ai-chat/attached-context.ts +13 -7
  270. package/src/panels/ai-chat/chat-view.ts +80 -73
  271. package/src/panels/ai-chat/composer.ts +30 -33
  272. package/src/panels/ai-chat/sessions-view.ts +1 -2
  273. package/src/panels/ai-panel.ts +23 -20
  274. package/src/panels/block-action-bar.ts +46 -35
  275. package/src/panels/bottom-dock.ts +5 -3
  276. package/src/panels/canvas-dnd-bridge.ts +31 -24
  277. package/src/panels/data-explorer.ts +62 -25
  278. package/src/panels/data-grid.ts +14 -11
  279. package/src/panels/dnd.ts +108 -118
  280. package/src/panels/editors.ts +55 -22
  281. package/src/panels/elements-panel.ts +10 -3
  282. package/src/panels/events-panel.ts +84 -69
  283. package/src/panels/formula-workspace.ts +76 -51
  284. package/src/panels/frontmatter-fields.ts +24 -19
  285. package/src/panels/frontmatter-panel.ts +44 -34
  286. package/src/panels/git-diff-open.ts +4 -4
  287. package/src/panels/git-panel.ts +49 -61
  288. package/src/panels/head-panel.ts +131 -111
  289. package/src/panels/i18n-panel.ts +10 -3
  290. package/src/panels/imports-panel.ts +23 -47
  291. package/src/panels/jump-bar.ts +48 -29
  292. package/src/panels/layers-panel.ts +97 -74
  293. package/src/panels/left-panel.ts +3 -3
  294. package/src/panels/pane-context.ts +31 -22
  295. package/src/panels/pane-grid.ts +49 -20
  296. package/src/panels/panel-registry.ts +22 -37
  297. package/src/panels/properties-panel.ts +175 -121
  298. package/src/panels/quick-search.ts +53 -31
  299. package/src/panels/right-panel.ts +3 -3
  300. package/src/panels/seo-modal.ts +13 -17
  301. package/src/panels/settings-menu.ts +15 -15
  302. package/src/panels/signals-panel.ts +153 -131
  303. package/src/panels/statement-editor.ts +230 -140
  304. package/src/panels/style-panel.ts +254 -216
  305. package/src/panels/style-utils.ts +114 -51
  306. package/src/panels/stylebook-doc.ts +57 -54
  307. package/src/panels/stylebook-layers-panel.ts +9 -9
  308. package/src/panels/stylebook-panel.ts +13 -17
  309. package/src/panels/tab-drop.ts +27 -11
  310. package/src/panels/tab-strip.ts +36 -26
  311. package/src/platform-errors.ts +57 -43
  312. package/src/platform.ts +58 -30
  313. package/src/platforms/cloud.ts +345 -175
  314. package/src/platforms/default-platform.ts +10 -4
  315. package/src/platforms/devserver.ts +174 -127
  316. package/src/platforms/read-batcher.ts +16 -8
  317. package/src/project-list.ts +2 -1
  318. package/src/publish/deploy-checklist.ts +8 -2
  319. package/src/publish/pages-service.ts +28 -13
  320. package/src/publish/publish-commands.ts +5 -4
  321. package/src/publish/publish-panel.ts +10 -6
  322. package/src/recent-projects.ts +15 -8
  323. package/src/resize-edges.ts +26 -36
  324. package/src/services/a11y-report.ts +26 -19
  325. package/src/services/agent-seed.ts +23 -11
  326. package/src/services/ai-ask.ts +9 -12
  327. package/src/services/ai-command-tools.ts +68 -62
  328. package/src/services/ai-import-tools.ts +80 -67
  329. package/src/services/ai-models.ts +17 -13
  330. package/src/services/ai-project-tools.ts +68 -32
  331. package/src/services/ai-session-store.ts +19 -10
  332. package/src/services/ai-system-prompt.ts +46 -20
  333. package/src/services/ai-tools.ts +71 -27
  334. package/src/services/ai-write-report.ts +20 -12
  335. package/src/services/ai-writes.ts +4 -4
  336. package/src/services/automation.ts +58 -31
  337. package/src/services/cem-export.ts +149 -58
  338. package/src/services/clock.ts +6 -1
  339. package/src/services/code-services.ts +37 -31
  340. package/src/services/context-manager.ts +14 -10
  341. package/src/services/context-resolver.ts +20 -8
  342. package/src/services/data-service.ts +19 -15
  343. package/src/services/directory-picker.ts +18 -12
  344. package/src/services/document-assistant.ts +39 -19
  345. package/src/services/gated-registry.ts +10 -6
  346. package/src/services/harness/chat-reducer.ts +23 -1
  347. package/src/services/import-client.ts +91 -38
  348. package/src/services/import-seed.ts +8 -2
  349. package/src/services/jx-validate.ts +28 -31
  350. package/src/services/live-preview.ts +0 -0
  351. package/src/services/live-surfaces.ts +6 -3
  352. package/src/services/model-uri.ts +10 -2
  353. package/src/services/module-preloads.ts +12 -8
  354. package/src/services/monaco-buffer.ts +43 -24
  355. package/src/services/monaco-lazy.ts +7 -8
  356. package/src/services/monaco-setup.ts +23 -16
  357. package/src/services/notify.ts +44 -17
  358. package/src/services/popover-report.ts +25 -10
  359. package/src/services/preview-eval.ts +20 -8
  360. package/src/services/profile.ts +13 -6
  361. package/src/services/project-path.ts +13 -10
  362. package/src/services/references.ts +0 -0
  363. package/src/services/render-critic.ts +8 -7
  364. package/src/services/settings/kernel.ts +13 -4
  365. package/src/services/settings/write-queue.ts +9 -9
  366. package/src/services/token-lint.ts +12 -10
  367. package/src/services/tool-executor.ts +17 -5
  368. package/src/services/tool-outcomes.ts +44 -24
  369. package/src/services/trusted-types.ts +24 -7
  370. package/src/settings/contexts-section.ts +11 -8
  371. package/src/settings/contributed-section.ts +79 -60
  372. package/src/settings/css-vars-editor.ts +37 -16
  373. package/src/settings/defs-editor.ts +38 -35
  374. package/src/settings/extension-rows.ts +16 -8
  375. package/src/settings/extension-sections.ts +23 -13
  376. package/src/settings/extensions-section.ts +4 -1
  377. package/src/settings/general-settings.ts +11 -8
  378. package/src/settings/locales-section.ts +20 -12
  379. package/src/settings/preferences-dialog.ts +9 -6
  380. package/src/settings/preferences-keymap.ts +7 -5
  381. package/src/settings/preferences-sections.ts +11 -5
  382. package/src/settings/project-sections.ts +1 -1
  383. package/src/settings/schema-field-ui.ts +9 -0
  384. package/src/settings/settings-document.ts +5 -5
  385. package/src/shell/tree.ts +6 -5
  386. package/src/shell.ts +104 -81
  387. package/src/site-context.ts +37 -22
  388. package/src/state.ts +41 -49
  389. package/src/store.ts +54 -34
  390. package/src/studio.ts +39 -77
  391. package/src/style/live-preview.ts +1 -1
  392. package/src/style/project-styles.ts +6 -7
  393. package/src/style/token-ref.ts +5 -4
  394. package/src/surfaces/about.ts +18 -19
  395. package/src/surfaces/add-repo.ts +17 -19
  396. package/src/surfaces/ai-chat.ts +31 -36
  397. package/src/surfaces/ai-credentials-form.ts +6 -16
  398. package/src/surfaces/ai-managed-connect.ts +3 -4
  399. package/src/surfaces/ai-model-picker.ts +3 -5
  400. package/src/surfaces/block-action-bar.ts +22 -11
  401. package/src/surfaces/boot-failure.ts +4 -5
  402. package/src/surfaces/bottom-dock.ts +9 -18
  403. package/src/surfaces/canvas-stage.ts +12 -11
  404. package/src/surfaces/cf-account-picker.ts +17 -18
  405. package/src/surfaces/commandbar.ts +14 -9
  406. package/src/surfaces/convert-repeater.ts +17 -19
  407. package/src/surfaces/data-actions.ts +9 -7
  408. package/src/surfaces/dialog.ts +26 -28
  409. package/src/surfaces/diff-toolbar.ts +9 -7
  410. package/src/surfaces/doc-header.ts +10 -19
  411. package/src/surfaces/empty-state.ts +7 -10
  412. package/src/surfaces/entry-editor.ts +14 -11
  413. package/src/surfaces/expression-editor.ts +11 -25
  414. package/src/surfaces/files-panel.ts +27 -14
  415. package/src/surfaces/formula-palette.ts +4 -5
  416. package/src/surfaces/git-panel.ts +7 -15
  417. package/src/surfaces/github-auth.ts +16 -20
  418. package/src/surfaces/github-publish.ts +17 -22
  419. package/src/surfaces/grid-cell.ts +30 -31
  420. package/src/surfaces/grid-open.ts +10 -14
  421. package/src/surfaces/grid-panel.ts +13 -9
  422. package/src/surfaces/grid-replace.ts +13 -13
  423. package/src/surfaces/grid-views.ts +15 -18
  424. package/src/surfaces/inspector-dock.ts +13 -12
  425. package/src/surfaces/jump-bar.ts +5 -6
  426. package/src/surfaces/jxsuite-update.ts +16 -22
  427. package/src/surfaces/library-pane.ts +25 -20
  428. package/src/surfaces/logic-panel.ts +17 -30
  429. package/src/surfaces/logic-workspace.ts +13 -15
  430. package/src/surfaces/media-browser.ts +11 -10
  431. package/src/surfaces/media-field.ts +4 -5
  432. package/src/surfaces/media-pane.ts +8 -7
  433. package/src/surfaces/menu.ts +29 -23
  434. package/src/surfaces/navigator-dock.ts +11 -12
  435. package/src/surfaces/new-project.ts +27 -26
  436. package/src/surfaces/pane-context.ts +20 -25
  437. package/src/surfaces/pane-grid.ts +15 -10
  438. package/src/surfaces/panel-activity.ts +5 -6
  439. package/src/surfaces/panel-data.ts +3 -4
  440. package/src/surfaces/panel-deploy-checklist.ts +5 -6
  441. package/src/surfaces/panel-elements.ts +5 -7
  442. package/src/surfaces/panel-i18n.ts +5 -7
  443. package/src/surfaces/panel-imports.ts +6 -13
  444. package/src/surfaces/panel-outline.ts +25 -19
  445. package/src/surfaces/panel-page.ts +11 -18
  446. package/src/surfaces/panel-problems.ts +5 -7
  447. package/src/surfaces/panel-signals.ts +20 -34
  448. package/src/surfaces/panel-stylebook-layers.ts +5 -8
  449. package/src/surfaces/preferences.ts +21 -11
  450. package/src/surfaces/progress-modal.ts +15 -9
  451. package/src/surfaces/properties-panel.json +1 -1
  452. package/src/surfaces/properties-panel.ts +20 -42
  453. package/src/surfaces/publish.ts +18 -18
  454. package/src/surfaces/push-plan.ts +7 -8
  455. package/src/surfaces/rail.json +126 -73
  456. package/src/surfaces/rail.ts +38 -12
  457. package/src/surfaces/reference-field.ts +11 -15
  458. package/src/surfaces/schema-builder.ts +16 -22
  459. package/src/surfaces/schema-form.ts +15 -25
  460. package/src/surfaces/secret-field.ts +9 -6
  461. package/src/surfaces/seo.ts +21 -15
  462. package/src/surfaces/settings-contexts.ts +9 -7
  463. package/src/surfaces/settings-contributed.ts +14 -10
  464. package/src/surfaces/settings-css-vars.ts +5 -12
  465. package/src/surfaces/settings-defs.json +2 -2
  466. package/src/surfaces/settings-defs.ts +17 -21
  467. package/src/surfaces/settings-deploy.ts +8 -15
  468. package/src/surfaces/settings-extensions.ts +5 -6
  469. package/src/surfaces/settings-head.ts +33 -39
  470. package/src/surfaces/settings-locales.ts +8 -20
  471. package/src/surfaces/settings-overview.ts +5 -6
  472. package/src/surfaces/settings-packages.ts +8 -7
  473. package/src/surfaces/settings-pane.ts +9 -18
  474. package/src/surfaces/settings-rawjson.ts +5 -6
  475. package/src/surfaces/shell.ts +1 -2
  476. package/src/surfaces/slash-menu.ts +19 -9
  477. package/src/surfaces/statements.ts +13 -18
  478. package/src/surfaces/statusbar.ts +17 -14
  479. package/src/surfaces/style-panel.ts +18 -31
  480. package/src/surfaces/stylebook-chrome.ts +3 -5
  481. package/src/surfaces/tab-strip.ts +14 -13
  482. package/src/surfaces/target-line.ts +6 -7
  483. package/src/surfaces/welcome.ts +5 -7
  484. package/src/tabs/patch-ops.ts +4 -3
  485. package/src/tabs/project-config.ts +32 -21
  486. package/src/tabs/selection.ts +36 -8
  487. package/src/tabs/tab.ts +52 -41
  488. package/src/tabs/transact.ts +98 -53
  489. package/src/tabs/typing.ts +31 -0
  490. package/src/types.ts +32 -17
  491. package/src/ui/ai-credentials-form.ts +10 -13
  492. package/src/ui/ai-model-picker.ts +3 -3
  493. package/src/ui/cf-account-picker.ts +7 -9
  494. package/src/ui/color-selector.ts +9 -5
  495. package/src/ui/dynamic-slot.ts +7 -8
  496. package/src/ui/expression-editor.ts +112 -105
  497. package/src/ui/form-controls.ts +57 -48
  498. package/src/ui/formula-catalog.ts +239 -230
  499. package/src/ui/formula-chips.ts +33 -18
  500. package/src/ui/layers.ts +44 -31
  501. package/src/ui/media-picker.ts +18 -9
  502. package/src/ui/popover-surface.ts +20 -12
  503. package/src/ui/progress-modal.ts +13 -8
  504. package/src/ui/regions.ts +7 -6
  505. package/src/ui/schema-form.ts +113 -70
  506. package/src/ui/surface.ts +71 -8
  507. package/src/ui/timing.ts +9 -0
  508. package/src/ui/value-source.ts +44 -31
  509. package/src/ui/virtual-window.ts +3 -2
  510. package/src/utils/base64.ts +3 -1
  511. package/src/utils/edit-display.ts +103 -74
  512. package/src/utils/element-selectors.ts +3 -2
  513. package/src/utils/google-fonts.ts +15 -14
  514. package/src/utils/inherited-style.ts +18 -20
  515. package/src/utils/link-target.ts +1 -1
  516. package/src/utils/preview-format.ts +25 -3
  517. package/src/utils/strip-events.ts +49 -22
  518. package/src/utils/studio-utils.ts +29 -14
  519. package/src/view.ts +2 -3
  520. package/src/workspace/pane-derive.ts +10 -12
  521. package/src/workspace/session.ts +53 -43
  522. package/src/workspace/workspace.ts +47 -36
  523. package/dist/chunks/2020-nkxms0ay.js +0 -4
  524. package/dist/chunks/adapter-m948ab5f.js +0 -4
  525. package/dist/chunks/cf-account-picker-n8hr38v7.js +0 -4
  526. package/dist/chunks/cf-settings-356xdtne.js +0 -4
  527. package/dist/chunks/color-area-jqhna8zy.js +0 -4
  528. package/dist/chunks/color-field-embq5ctg.js +0 -4
  529. package/dist/chunks/color-fpezvnkt.js +0 -4
  530. package/dist/chunks/color-slider-1qmw7wqy.js +0 -4
  531. package/dist/chunks/combobox-773hdzyj.js +0 -4
  532. package/dist/chunks/components-yk3t844e.js +0 -4
  533. package/dist/chunks/content-source-bawmyc09.js +0 -4
  534. package/dist/chunks/convert-to-repeater-7wns8kf1.js +0 -4
  535. package/dist/chunks/dialog-mtm9fq5t.js +0 -4
  536. package/dist/chunks/editor-6sc8nacq.js +0 -4
  537. package/dist/chunks/entry-commands-8ay9fh81.js +0 -4
  538. package/dist/chunks/extension-sections-na7rj3nr.js +0 -4
  539. package/dist/chunks/file-ops-gye0qw56.js +0 -4
  540. package/dist/chunks/files-dmc2xvcq.js +0 -4
  541. package/dist/chunks/format-host-t76b53f8.js +0 -4
  542. package/dist/chunks/fs-events-cg4tpz06.js +0 -4
  543. package/dist/chunks/git-panel-yef7bshy.js +0 -4
  544. package/dist/chunks/grid-view-7tt4bxw1.js +0 -51
  545. package/dist/chunks/icons-qbh8akb1.js +0 -4
  546. package/dist/chunks/iframe-entry-f7mqjwpm.js +0 -5
  547. package/dist/chunks/iframe-entry-haw7jkvz.js +0 -5
  548. package/dist/chunks/iframe-entry-z6qrytv3.js +0 -5
  549. package/dist/chunks/iframe-host-tmz30gfp.js +0 -4
  550. package/dist/chunks/index-nag78a9h.js +0 -4
  551. package/dist/chunks/jsonMode-zhwsprqk.js +0 -13
  552. package/dist/chunks/jx-validate-3gbp5nkn.js +0 -4
  553. package/dist/chunks/layers-fvz99859.js +0 -4
  554. package/dist/chunks/layers-panel-gchmbf9p.js +0 -4
  555. package/dist/chunks/listbox-s8fkmnq8.js +0 -4
  556. package/dist/chunks/lit-html-9agdspkt.js +0 -4
  557. package/dist/chunks/media-picker-rhjvyy00.js +0 -4
  558. package/dist/chunks/menu-2e4y9j7b.js +0 -4
  559. package/dist/chunks/menu-37d07z9m.js +0 -4
  560. package/dist/chunks/monaco-binding-2jnhjjvr.js +0 -4
  561. package/dist/chunks/monaco-buffer-rp21359g.js +0 -4
  562. package/dist/chunks/monaco-setup-vhh7gayr.js +0 -4
  563. package/dist/chunks/notify-h3www560.js +0 -4
  564. package/dist/chunks/number-field-gw7sq8rn.js +0 -4
  565. package/dist/chunks/parse-897fvqah.js +0 -4
  566. package/dist/chunks/platform-hz34wcd7.js +0 -4
  567. package/dist/chunks/popover-8htra4er.js +0 -4
  568. package/dist/chunks/publish-panel-exsmjzyj.js +0 -4
  569. package/dist/chunks/quick-search-pgaqeh0m.js +0 -4
  570. package/dist/chunks/references-2cgdxnb8.js +0 -4
  571. package/dist/chunks/right-panel-jf856w5w.js +0 -4
  572. package/dist/chunks/section-registry-jnf8r5gy.js +0 -4
  573. package/dist/chunks/select-n3v7gwas.js +0 -4
  574. package/dist/chunks/split-pff8f3ze.js +0 -4
  575. package/dist/chunks/studio-0f55h9ye.js +0 -5
  576. package/dist/chunks/studio-0sqdhnew.js +0 -12
  577. package/dist/chunks/studio-19x1c75w.js +0 -5
  578. package/dist/chunks/studio-2sqcndak.js +0 -5
  579. package/dist/chunks/studio-3aey7dd3.js +0 -5
  580. package/dist/chunks/studio-3bpdkq2s.js +0 -5
  581. package/dist/chunks/studio-47y6fbpf.js +0 -5
  582. package/dist/chunks/studio-4m3826v2.js +0 -5
  583. package/dist/chunks/studio-4nx2dj1g.js +0 -4
  584. package/dist/chunks/studio-4xv5s47r.js +0 -9
  585. package/dist/chunks/studio-5g4t8v6w.js +0 -5
  586. package/dist/chunks/studio-5py436sf.js +0 -5
  587. package/dist/chunks/studio-77kt594t.js +0 -5
  588. package/dist/chunks/studio-8f87n763.js +0 -10
  589. package/dist/chunks/studio-8mb00b84.js +0 -5
  590. package/dist/chunks/studio-8p51gq2h.js +0 -6
  591. package/dist/chunks/studio-954ds834.js +0 -5
  592. package/dist/chunks/studio-9ft45c83.js +0 -9
  593. package/dist/chunks/studio-a2138x5k.js +0 -7
  594. package/dist/chunks/studio-a9yzstqj.js +0 -5
  595. package/dist/chunks/studio-acdksxx6.js +0 -5
  596. package/dist/chunks/studio-ar8jcf2y.js +0 -5
  597. package/dist/chunks/studio-bmn4mn9j.js +0 -7
  598. package/dist/chunks/studio-e7xxa0sj.js +0 -5
  599. package/dist/chunks/studio-ecaz25vk.js +0 -5
  600. package/dist/chunks/studio-ery42sqr.js +0 -4
  601. package/dist/chunks/studio-fzdywr6p.js +0 -9
  602. package/dist/chunks/studio-g5fmf0c1.js +0 -5
  603. package/dist/chunks/studio-g7nse7zb.js +0 -5
  604. package/dist/chunks/studio-geq1ea6k.js +0 -14
  605. package/dist/chunks/studio-ghkb32r8.js +0 -5
  606. package/dist/chunks/studio-ghrhy2y7.js +0 -5
  607. package/dist/chunks/studio-grawhey1.js +0 -5
  608. package/dist/chunks/studio-h0xgswew.js +0 -5
  609. package/dist/chunks/studio-h9c4p2tx.js +0 -5
  610. package/dist/chunks/studio-jyzj5cxs.js +0 -5
  611. package/dist/chunks/studio-mgx8yhnz.js +0 -64
  612. package/dist/chunks/studio-mpb04y1d.js +0 -6
  613. package/dist/chunks/studio-n17mty64.js +0 -5
  614. package/dist/chunks/studio-nwh2eqsk.js +0 -6
  615. package/dist/chunks/studio-q1h883bt.js +0 -16
  616. package/dist/chunks/studio-q4tv82h7.js +0 -9
  617. package/dist/chunks/studio-qpqa7vk3.js +0 -5
  618. package/dist/chunks/studio-qqz8e5gk.js +0 -5
  619. package/dist/chunks/studio-qvasen3f.js +0 -5
  620. package/dist/chunks/studio-rggdb3hm.js +0 -5
  621. package/dist/chunks/studio-sghy936h.js +0 -4
  622. package/dist/chunks/studio-skprc6ef.js +0 -5
  623. package/dist/chunks/studio-tt2nactf.js +0 -5
  624. package/dist/chunks/studio-tyasmc39.js +0 -5
  625. package/dist/chunks/studio-vk9ezads.js +0 -5
  626. package/dist/chunks/studio-vzacdfsc.js +0 -4
  627. package/dist/chunks/studio-w4c0xmrw.js +0 -5
  628. package/dist/chunks/studio-wfjqhhbk.js +0 -5
  629. package/dist/chunks/studio-wgh5kxpj.js +0 -5
  630. package/dist/chunks/studio-xasj0796.js +0 -5
  631. package/dist/chunks/studio-y78s8r2n.js +0 -5
  632. package/dist/chunks/studio-z8w183sh.js +0 -5
  633. package/dist/chunks/studio-zscd9ty4.js +0 -928
  634. package/dist/chunks/studio-zxp13sss.js +0 -7
  635. package/dist/chunks/studio-zygnmm01.js +0 -5
  636. package/dist/chunks/swatch-group-8qh9a3bm.js +0 -4
  637. package/dist/chunks/tabs-jwthg40w.js +0 -4
  638. package/dist/chunks/textfield-spy3hc77.js +0 -4
  639. package/dist/chunks/toast-4d35zd64.js +0 -4
  640. package/dist/chunks/toast-host-8sjmfed3.js +0 -4
  641. package/dist/chunks/tooltip-fd6g9xy3.js +0 -4
  642. package/dist/chunks/tree-h19v1jfz.js +0 -4
  643. package/dist/chunks/tsMode-gr0m4dzr.js +0 -14
  644. package/dist/chunks/workspace-m15qtcqp.js +0 -4
  645. package/dist/chunks/ws-client-nf61frr1.js +0 -4
@@ -1,5 +0,0 @@
1
- import{p,We}from"./studio-qpqa7vk3.js";import{ge,Q,re,k}from"./studio-vzacdfsc.js";import{Je,Yi,Yu,Hl}from"./studio-z8w183sh.js";import{vL,Le,ms,hv,q,Hs,Ji,Uu,pa,Ue,qu,xn,ot,wv,yi,li,Se,Do,KC,oo,He,Qn,m,u,Hn,$r,kp}from"./studio-3aey7dd3.js";import{Fd,wi}from"./studio-tt2nactf.js";import{st,hm,_c}from"./studio-vk9ezads.js";import{BC,$d}from"./studio-3bpdkq2s.js";import{Av,Dp,Pm,Vl,Kr,ro,Jr,Gs,ih,Za,jm,_I,Qo,Hd,Hm,ne}from"./studio-geq1ea6k.js";import{ga,gr,zs,Ws,gs}from"./studio-qbj760tx.js";import{Di,ZT,Ub,XT,ps,Dl,qb,QT,y,PC}from"./studio-q1h883bt.js";import{fm,pp,mm}from"./studio-grawhey1.js";import{K,_o,ht,_n,Yo,Ga,D,Qu,eh,Ai}from"./studio-wgh5kxpj.js";import{Oe,$v}from"./studio-a9yzstqj.js";import{qe,Pp}from"./studio-8mb00b84.js";import{Wv}from"./studio-anyrgzvb.js";function xt(e){let{target:t,source:n,targetOrigin:o,acceptOrigin:r,token:i}=e,s=new Set,a=(l)=>{if(r!=="*"&&l.origin!==r)return;let c=l.data;if(!c||typeof c!=="object"||c["jx:canvas"]!==i)return;for(let d of s)d(c.payload)};return n.addEventListener("message",a),{dispose(){s.clear(),n.removeEventListener("message",a)},onMessage(l){return s.add(l),()=>s.delete(l)},post(l){t.postMessage({["jx:canvas"]:i,payload:l},o)}}}var Yn=null;function ex(){return Yn}function Uo(){return Yi(m.activePaneId)}function lt(e){let t=Hn(e),n=t?.derived,o=n?.kind==="lens"?Hn(n.sourcePaneId)?.activeTabId:t?.activeTabId;return o?m.tabs.get(o)??null:null}function ur(e){return Hn(e)?.derived??null}function Qw(e){if(!e)return[];let t=[];for(let n of m.panes)if(lt(n.id)?.id===e.id)t.push(Yi(n.id));return t}function _(e){for(let t of Yu()){let n=t.panels.find((o)=>o.canvas===e);if(n)return{panel:n,surface:t}}return null}function wt(e){let t=e.canvas,n=t?_(t):null;return n?lt(n.surface.paneId):null}function Ll(e){let t=e?.session.ui,n=t?.canvasMode??"design";return t?.preview&&(n==="edit"||n==="design")?"preview":n}function wo(e){let t=ur(e);if(t?.kind==="lens"){let n=t.mode;return lt(e)?.session.ui?.preview&&(n==="edit"||n==="design")?"preview":n}return Ll(lt(e))}function Ou(e){let t=ur(e);if(t?.kind==="lens"&&t.preset==="breakpoint")return t.media;return lt(e)?.session.ui.activeMedia??null}function Db(e){return Hl(e)?.paneId??Qn}function om(e){return lt(Db(e))}var ce=new Set(["img","video","source","iframe","audio"]),ue="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",eo="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E",to=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function no(e){return to.test(e)}var io=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),ao=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]);function so(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(io.has(qe(e.tagName)))return"empty-text-placeholder";if(ao.has(qe(e.tagName)))return"empty-container-placeholder";return null}function De(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function lo(e){let t=e.map;return{children:t&&typeof t==="object"?[A(t)]:[],className:"repeater-perimeter",tagName:"div"}}function A(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((s)=>A(s));if(e.$prototype==="Array")return lo(e);let t=e,n={},o=!1,r=ce.has(t.tagName||"");if(r){let{attributes:s,src:a}=t,l=s?.src,c=t.poster,d=s?.poster;if(!(a&&a!==""||l&&l!=="")&&!(c&&c!==""||d&&d!==""))o=!0}for(let[s,a]of Object.entries(t))if(s==="state"||s==="$media"||s==="$elements")n[s]=a;else if(s==="$props"&&a&&typeof a==="object"){let l={};for(let[c,d]of Object.entries(a))if(typeof d==="string"&&d.includes("${"))if(no(c))l[c]=eo;else if(c==="href"||c==="action")l[c]="";else l[c]=De(d);else if(d&&typeof d==="object"&&d.$ref){let f=d.$ref,h=f.startsWith("#/state/")?f.slice(8):f;l[c]=`{${h}}`}else l[c]=d;n[s]=l}else if(s==="children")if(Array.isArray(a))n.children=a.map((l)=>A(l));else if(a&&typeof a==="object"&&a.$prototype==="Array")n.children=[A(a)];else n.children=A(a);else if(s==="cases"&&t.$switch&&a&&typeof a==="object"){let l=Object.keys(a);if(l.length>0){let c=a[l[0]];n.children=c&&typeof c==="object"&&!c.$ref?[A(c)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${l.join(" | ")}]`}]}}else if(s==="attributes"&&r&&a&&typeof a==="object"){let l=a,c={};for(let[d,f]of Object.entries(l))if(d==="src"||d==="poster")if(typeof f==="string"&&f!==""&&!f.includes("${"))c[d]=f;else o=!0,c[d]=ue;else if(typeof f==="string"&&f.includes("${")){let h=d==="href"||d==="action";c[d]=h?"":De(f)}else if(f&&typeof f==="object"&&f.$ref){let h=f.$ref,b=h.startsWith("#/state/")?h.slice(8):h;c[d]=`{${b}}`}else c[d]=f;n.attributes=c}else if(s==="style")if(a&&typeof a==="object"){let l={};for(let[c,d]of Object.entries(a))if(typeof d!=="string"||!d.includes("${"))l[c]=d;n.style=l}else n.style=a;else if(typeof a==="string"&&a.includes("${"))if((s==="src"||s==="poster")&&ce.has(t.tagName||""))o=!0,n[s]=ue;else{let c=s==="src"||s==="href"||s==="poster"||s==="action";n[s]=c?"":De(a)}else if(a&&typeof a==="object"&&a.$ref){let l=a.$ref,c=l.startsWith("#/state/")?l.slice(8):l;if((s==="src"||s==="poster")&&ce.has(t.tagName||""))o=!0,n[s]=ue;else n[s]=`{${c}}`}else if((s==="src"||s==="poster")&&a===""&&ce.has(t.tagName||""))o=!0,n[s]=ue;else n[s]=A(a);let i=so(n);if(i)n.className=n.className?`${n.className} ${i}`:i;if(o){let s=n.className||"";if(!s.includes("empty-media-placeholder"))n.className=s?`${s} empty-media-placeholder`:"empty-media-placeholder"}return n}var co=/\[\.\.\.(\w+)\]|\[(\w+)\]/g;function uo(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function Ct(e){let t=uo(e),n=t.slice(t.lastIndexOf("/")+1),o=n.lastIndexOf(".");if(o>0)t=t.slice(0,t.length-(n.length-o));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let r=[],i=!1,s=!1,a=t.replaceAll(co,(l,c,d)=>{if(i=!0,c)return s=!0,r.push(c),"*";return r.push(d),`:${d}`});return{isCatchAll:s,isDynamic:i,params:r,urlPattern:a}}function Ab(e){if(!e)return"/";return Ct(e).urlPattern}function Il(e){if(!e)return[];return Ct(e).params}function xT(e){let t=e.document?.$paths,n=e.frontmatter?.$paths;return t??n??null}var pe=new Map;function _T(){pe.clear()}function CT(e,t){if(!t)return Promise.resolve({});let n=`${e??""}::${JSON.stringify(t)}`,o=pe.get(n);if(!o)o=po(t).catch((r)=>(pe.delete(n),console.warn("page-params: failed to enumerate $paths values:",r),{})),pe.set(n,o);return o}async function po(e){if(Array.isArray(e)){let t={};for(let n of e)for(let[o,r]of Object.entries(n))de(t,o,r);return t}if("contentType"in e&&typeof e.contentType==="string"&&e.contentType){let t=e.param??"slug",n=e.field??"id",o=await mo(e.contentType),r={[t]:[]};if(!Array.isArray(o))return r;for(let i of o)de(r,t,n==="id"?i.id:i.data?.[n]??i.id);return r}if("values"in e&&Array.isArray(e.values)){let t=e.param??"value",n={[t]:[]};for(let o of e.values)de(n,t,o);return n}if("$ref"in e&&typeof e.$ref==="string"&&e.$ref){let t=e.param??"id",n=e.field??"id",o=await p().readFile(e.$ref.replace(/^\.\//,"")),r=JSON.parse(o),i={[t]:[]};if(!Array.isArray(r))return i;for(let s of r)de(i,t,s?.[n]??s?.id??s);return i}return{}}async function fo(){let e=await Fd();for(let t of e){let n=t.classes?.find((o)=>o.name==="ContentCollection");if(n)return n.path}return"@jxsuite/parser/ContentCollection.class.json"}async function mo(e){let t={$prototype:"ContentCollection",$src:await fo(),contentType:e},n=p();if(n.resolveClass)return n.resolveClass(t);return fetch("/__jx_resolve__",{body:JSON.stringify(t),headers:{"content-type":"application/json"},method:"POST"}).then((o)=>{if(!o.ok)throw Error(`Class resolution failed: ${o.status}`);return o.json()})}function de(e,t,n){if(n===null||n===void 0||n==="")return;let o=String(n);e[t]??=[];let r=e[t];if(!r.includes(o))r.push(o)}function Pt(e,t,n){if(Object.keys(t).length===0)return e;let o=_e(e,t);return o.state??={},o.state.$page={params:{...t},title:typeof o.title==="string"?o.title:"",url:Ab(n)},o}function St(e){if(!e)return[];return Object.keys(e).filter((t)=>{let n=e[t];return n&&typeof n==="object"&&typeof n.$prototype==="string"&&typeof n.$src==="string"&&JSON.stringify(n).includes('"#/$params/')})}async function Et(e,t,n){if(t.length===0)return;let o=p();if(!o.resolveClass)return;let{state:r}=e;if(!r)return;await Promise.all(t.map(async(i)=>{let s=r[i];if(!s||typeof s!=="object")return;try{r[i]=await o.resolveClass({...s,...n?{$base:n}:{}})}catch(a){console.warn(`page-params: failed to resolve state.${i} for preview:`,a)}}))}function _e(e,t){let n=ho(e,t);if(n!==null)return n;if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((r)=>_e(r,t));let o={};for(let[r,i]of Object.entries(e))o[r]=_e(i,t);return o}function ho(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return null;let n=e.$ref;if(typeof n!=="string"||!n.startsWith("#/$params/"))return null;return t[n.slice(10)]??null}function tx(e){return typeof e?.tagName==="string"&&e.tagName.includes("-")}function Tt(e){if(e===null||typeof e==="number"||typeof e==="boolean")return"literal";if(typeof e==="string")return e.includes("${")?null:"literal";if(Array.isArray(e))return"literal";if(typeof e==="object"){let t=e;if(t.$expression||t.$compute||t.$prototype||t.$handler)return null;return"default"in t||"type"in t?"signal":"literal"}return null}function kT(e){let t=e?.state??{},n=[];for(let[o,r]of Object.entries(t)){if(Pp(o))continue;let i=Tt(r);if(!i)continue;let s=i==="signal"?r.default:r;n.push({name:o,value:s})}return n}function Mt(e,t){let n={...e.state??{}},o=!1;for(let[r,i]of Object.entries(t)){let s=Tt(n[r]);if(!s)continue;n[r]=s==="signal"?{...n[r],default:i}:i,o=!0}if(!o)return e;return{...e,state:n}}function Nt(e,t=[]){if(!e||typeof e!=="object")return null;if(Array.isArray(e.children)){let n=e.children.findIndex((o)=>o&&typeof o==="object"&&!o.$__layout);if(n!==-1)return{offset:n,prefix:[...t,"children"]};for(let o=0;o<e.children.length;o++){let r=e.children[o];if(r&&typeof r==="object"&&r.$__layout){let i=Nt(r,[...t,"children",o]);if(i)return i}}}return null}function je(e,t,n=[]){if(!e||typeof e!=="object")return;if(e.$__layout={file:t,path:n},Array.isArray(e.children))for(let[o,r]of e.children.entries()){if(typeof r==="string")continue;je(r,t,[...n,"children",o])}if(Array.isArray(e.$elements)){for(let[o,r]of e.$elements.entries())if(typeof r!=="string")je(r,t,[...n,"$elements",o])}}async function kt(e,t,n=null){let o={documentPath:t?.documentPath,mode:t?.doc.mode},r=n??Ll(t),i=r==="preview"?structuredClone(re(e)):A(Qu(e)),s=!1,a=o.documentPath&&D?.isSiteProject&&(o.documentPath.startsWith("pages/")||o.documentPath.startsWith("./pages/")),l=null,c=0;if(a&&t?.session.ui.showLayout!==!1){let w=Dl(e.$layout);if(w){let v=await qb(w);if(v){je(v,w.replace(/^\.\//,""));let C=r==="preview"?structuredClone(re(e)):i,x=QT(v,C);i=r==="preview"?x:A(Qu(x)),s=!0;let E=Nt(x);l=E?.prefix??null,c=E?.offset??0}}}let d=pp(D?.projectRoot),f=o.documentPath?new URL(o.documentPath,d).href:void 0,h=mm(o.documentPath,{fileBaseUrl:d,...We()?{space:p().assetSpace}:{}});if(a&&t){let{previewParams:w}=t.session.ui;if(w&&Object.keys(w).length>0){let v=St(e.state??null);i=Pt(i,w,o.documentPath),await Et(i,v,f)}}if(!a&&t&&tx(i)){let{previewProps:w}=t.session.ui;if(w&&Object.keys(w).length>0)i=Mt(i,w)}let b=new Set;if(r!=="preview")(function w(v,C){if(!v||typeof v!=="object")return;if(v.$prototype==="Array"){b.add(C.join("/"));let x=v.map;if(x&&typeof x==="object")w(x,[...C,"map"]);return}if(Array.isArray(v.children))for(let x=0;x<v.children.length;x++){let E=v.children[x];if(typeof E==="string")continue;w(E,[...C,"children",x])}else if(v.children&&typeof v.children==="object"&&v.children.$prototype==="Array")w(v.children,[...C,"children"]);if(v.$switch&&v.cases)for(let[x,E]of Object.entries(v.cases))w(E,[...C,"cases",x])})(e,[]);let T=o.documentPath!=null&&(o.documentPath.startsWith("layouts/")||o.documentPath.startsWith("./layouts/")),R=Ub(i.$elements);if((o.mode==="content"||s||T)&&st.length>0){let w=new Set(R.map((C)=>typeof C==="string"?C:C?.$ref)),v=(C)=>{let x=new Set;if(!C||typeof C!=="object")return x;if(C.tagName)x.add(qe(C.tagName));if(Array.isArray(C.children)){for(let E of C.children)if(typeof E!=="string")for(let Xn of v(E))x.add(Xn)}return x};for(let C of v(i)){let x=st.find((E)=>E.tagName===C);if(x&&x.source!=="npm"&&x.path){let E=_c(o.documentPath??null,x.path);if(!w.has(E))R.push({$ref:E}),w.add(E)}}}if(R.length>0)i.$elements=R;i.imports=ZT(i.imports);let O=Di(i.$media);if(O===void 0)delete i.$media;else i.$media=O;let U=XT(i.$head);if(U===void 0)delete i.$head;else i.$head=U;return{assets:h,docBase:f,mapperCtx:{arrayPaths:[...b],canvasMode:r,layoutWrapped:s,pageContentOffset:c,pageContentPrefix:l},renderDoc:i,siteStyle:D?.projectConfig?.style??null}}var ST="fullRender",ET="mountCanvas",TT="patchBatch",At="prepareRender",xo={derivedResolves:0,derivedRetargets:0,escalations:0,fullRenders:0,hostRenderPosts:0,lastEscalationReason:"",lastFullRenderMs:0,p95FullRenderMs:0,panelRenders:0,patchedOps:0,renderPreparations:0,skippedFullRenders:0,timings:{}};globalThis.__jxCanvasPerf=xo;var Rt=new Map;function $t(){try{return typeof localStorage<"u"&&Boolean(localStorage.getItem("jx-canvas-debug"))}catch{return!1}}function Ot(){return typeof performance<"u"&&typeof performance.now==="function"?performance.now():0}function It(e,t){if($t())console.debug(`[jx-canvas] ${e}`,t??"")}function Nb(e){xo.escalations+=1,xo.lastEscalationReason=e,It("escalation",e)}function go(e){if(e.length===0)return 0;let t=e.toSorted((o,r)=>o-r),n=Math.min(t.length-1,Math.ceil(t.length*0.95)-1);return t[Math.max(0,n)]??0}function vo(e,t){let n=Number.isFinite(t)&&t>0?t:0,o=Rt.get(e);if(!o)o=[],Rt.set(e,o);if(o.push(n),o.length>128)o.shift();let r=xo.timings[e],i={count:(r?.count??0)+1,lastMs:n,maxMs:Math.max(r?.maxMs??0,n),p95Ms:go(o),totalMs:(r?.totalMs??0)+n};if(xo.timings[e]=i,e==="fullRender")xo.lastFullRenderMs=i.lastMs,xo.p95FullRenderMs=i.p95Ms;It(`span:${e}`,`${n.toFixed(2)}ms`)}function Dt(e){let t=Ot(),n=$t(),o=`jx-${e}-start`;if(n)try{performance.mark(o)}catch{}let r=!1;return()=>{if(r)return xo.timings[e]?.lastMs??0;r=!0;let i=Ot()-t;if(n)try{performance.measure(`jx-${e}`,o),performance.clearMarks(o)}catch{}return vo(e,i),i}}function nx(e,t){let n=Dt(e);try{return t()}finally{n()}}async function ix(e,t){let n=Dt(e);try{return await t()}finally{n()}}function bi(e){if(e==="--")return"Base";return e.replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}var Ht=new Set(["script","style","link","iframe","object","embed"]);function wd(e){let t={tagName:e};if(/^h[1-6]$/.test(e))t.textContent="Heading";else if(e==="p")t.textContent="Paragraph text";else if(e==="span"||e==="strong"||e==="em"||e==="small"||e==="mark"||e==="code"||e==="abbr"||e==="q"||e==="sub"||e==="sup"||e==="time")t.textContent="Text";else if(e==="a")t.textContent="Link",t.attributes={href:"#"};else if(e==="button")t.textContent="Button";else if(e==="label")t.textContent="Label";else if(e==="legend")t.textContent="Legend";else if(e==="caption")t.textContent="Caption";else if(e==="summary")t.textContent="Summary";else if(e==="li"||e==="dt"||e==="dd"||e==="th"||e==="td"||e==="option")t.textContent="Item";else if(e==="blockquote")t.textContent="Quote";else if(e==="pre")t.textContent="Preformatted text";else if(e==="input")t.attributes={placeholder:"Enter text...",type:"text"};else if(e==="img")t.attributes={alt:"Image"};else if(e==="iframe")t.attributes={src:""};else if(e==="slot")t.children=[{tagName:"p",textContent:"Slot content"}];else if(e==="select")t.children=[{tagName:"option",textContent:"Option 1"}];else if(e==="ul"||e==="ol")t.children=[{tagName:"li",textContent:"Item"}];else if(e==="dl")t.children=[{tagName:"dt",textContent:"Term"},{tagName:"dd",textContent:"Definition"}];else if(e==="table")t.children=[{children:[{children:[{tagName:"th",textContent:"Header"}],tagName:"tr"}],tagName:"thead"},{children:[{children:[{tagName:"td",textContent:"Cell"}],tagName:"tr"}],tagName:"tbody"}];else if(e==="details")t.children=[{tagName:"summary",textContent:"Summary"},{tagName:"p",textContent:"Detail content"}];return t}function j(e){if(!e)return[];if(Array.isArray(e.children))return e.children;return typeof e.textContent==="string"&&e.textContent.length>0?[e.textContent]:[]}function Y(e){let t=0;for(let n of e)t+=typeof n==="string"?n.length:Y(j(n));return t}function Fe(e,t,n){let o=[],r=0;for(let i of e){if(r>=n)break;if(typeof i==="string"){let c=r+i.length;if(c>t){let d=i.slice(Math.max(0,t-r),Math.max(0,Math.min(n,c)-r));if(d)o.push(d)}r=c;continue}let s=j(i),a=Y(s),l=r+a;if(a===0){if(r>=t&&r<n)o.push({...i})}else if(l>t){let c=Fe(s,Math.max(0,t-r),Math.min(n,l)-r);if(c.length>0)o.push(yo(i,c))}r=l}return o}function yo(e,t){let{children:n,textContent:o,...r}=e;if(t.length===0)return{...r,textContent:""};if(t.length===1&&typeof t[0]==="string")return{...r,textContent:t[0]};return{...r,children:t}}function Jt(e){let t=[];for(let n of e){if(typeof n==="string"){if(n.length===0)continue;let o=t.at(-1);if(typeof o==="string"){t[t.length-1]=o+n;continue}}t.push(n)}return t}function Lt(e,t,n,o,r=""){return Jt([...Fe(e,0,t),...r?[r]:[],...Fe(n,o,Y(n))])}function Ve(e){let t=Jt(e);if(t.length===0)return{textContent:""};if(t.length===1&&typeof t[0]==="string")return{textContent:t[0]};return{children:t}}function bo(e){if(!e)return!0;if(e.textContent!=null&&e.textContent.trim()==="")return!0;let t=e.children;if(!t)return!1;if(t.length===0)return!0;if(t.length===1&&typeof t[0]==="string"&&t[0].trim()==="")return!0;return t.length===1&&typeof t[0]==="object"&&t[0]?.tagName==="br"}function _t(e,t,n,o,r={}){if(!e)return;let i=K(e.doc.document,t);if(n){if(i&&JSON.stringify(i.children)===JSON.stringify(n))return;q(e,(s)=>{if(i?.textContent!=null)Ue(s,t,"textContent");Ue(s,t,"children",n)},{coalesceKey:r.coalesceKey??null})}else if(o!=null){if(i&&i.textContent===o&&!i.children)return;q(e,(s)=>{if(i?.children)Ue(s,t,"children");Ue(s,t,"textContent",o)},{coalesceKey:r.coalesceKey??null})}}function jt(e,t,n,o){if(!e)return!1;let r=K(e.doc.document,t);if(!r)return!1;if(`${r.$props?.[n]??""}`===o)return!1;return q(e,(s)=>{qu(s,t,n,o)}),!0}function qt(e,t,n){if(!e)return null;let o=K(e.doc.document,t),r=K(e.doc.document,n);if(!o||!r)return null;if(Ga(t,n)||Ga(n,t))return null;let i=j(r),s=j(o),a=Y(i),l=Ve([...i,...s]);return q(e,(c)=>{if(l.children){if(r.textContent!=null)Ue(c,n,"textContent");Ue(c,n,"children",l.children)}else{if(r.children)Ue(c,n,"children");Ue(c,n,"textContent",l.textContent??"")}if(Uu(c,t),Ft(c,ht(t)),kp(e))c.session.selection=[n]}),{offset:a,path:n}}function Ft(e,t){let n=t;while(n.length>0){let o=K(e.doc.document,n),r=o?.children;if(!o||!Array.isArray(r)||r.length>0)return;let i=ht(n);if(Uu(e,n),!i)return;n=i}}function Wt(e,t,n,o){let r=ht(t),i=_n(t),s=[...r,"children",i+1];if(!e)return s;let a={tagName:"p"};if(o.textContent!=null)a.textContent=o.textContent;else if(o.children)a.children=o.children;else a.textContent="";return q(e,(l)=>{if(n.textContent!=null)Ue(l,t,"children"),Ue(l,t,"textContent",n.textContent);else if(n.children)Ue(l,t,"textContent"),Ue(l,t,"children",n.children);if(Ji(l,r,i+1,a),kp(e))l.session.selection=[s]}),s}function Vt(e,t,n,o){if(bo(o)){if(!e)return t;return q(e,(l)=>{Ue(l,t,"tagName",n.tag),Ue(l,t,"children");let c=wd(n.tag);if(c.textContent&&c.textContent!=="Paragraph text")Ue(l,t,"textContent",c.textContent);else Ue(l,t,"textContent");if(kp(e))l.session.selection=[t]}),t}let r=ht(t),i=_n(t),s=[...r,"children",i+1];if(!e)return s;let a=wd(n.tag);return q(e,(l)=>{if(o?.children)Ue(l,t,"textContent"),Ue(l,t,"children",o.children);else if(o?.textContent!=null)Ue(l,t,"children"),Ue(l,t,"textContent",o.textContent);if(Ji(l,r,i+1,structuredClone(a)),kp(e))l.session.selection=[s]}),s}function Bt(e,t,n,o,r){if(!e)return null;let i=K(e.doc.document,t.path),s=K(e.doc.document,n.path);if(!i||!s)return null;if(Ga(t.path,n.path)||Ga(n.path,t.path))return null;let a=Ve(Lt(j(i),t.offset,j(s),n.offset,r)),l=[...o,n.path].toSorted(Co);return q(e,(c)=>{if(a.children){if(i.textContent!=null)Ue(c,t.path,"textContent");Ue(c,t.path,"children",a.children)}else{if(i.children)Ue(c,t.path,"children");Ue(c,t.path,"textContent",a.textContent??"")}for(let d of l)if(K(c.doc.document,d))Uu(c,d),Ft(c,ht(d));if(kp(e))c.session.selection=[t.path]}),{offset:t.offset+r.length,path:t.path}}function Co(e,t){let n=Math.min(e.length,t.length);for(let o=0;o<n;o++){let r=e[o],i=t[o];if(r===i)continue;if(typeof r==="number"&&typeof i==="number")return i-r;return String(i).localeCompare(String(r))}return t.length-e.length}function M(e,t=1){return{height:e.height*t,left:e.x*t,top:e.y*t,width:e.width*t}}function LT(e,t,n=1){return{x:(e.x-t.left)/n,y:(e.y-t.top)/n}}function fe(e,t){if(!t){e.style.display="none";return}e.style.display="block",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}function zt(e=document){let t=e.createElement("div");t.className="jx-canvas-iframe-overlay",t.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2";let n=e.createElement("div");n.className="overlay-box overlay-selection",n.style.display="none";let o=e.createElement("div");o.className="overlay-label",o.style.display="none",n.append(o);let r=e.createElement("div");r.className="overlay-box overlay-hover",r.style.display="none";let i=e.createElement("div");i.className="canvas-drop-indicator",i.style.display="none";let s=e.createElement("button");s.className="insertion-helper",s.textContent="+",s.style.pointerEvents="auto",s.style.display="none";let a=e.createElement("div");a.className="canvas-replace-target",a.style.display="none";let l=e.createElement("div");l.className="overlay-presence-group";let c=e.createElement("div");return c.className="overlay-coselection-group",t.append(r,n,c,i,a,s,l),{dispose:()=>t.remove(),insertButton:s,root:t,setDropIndicator:(d,f="inside")=>So(i,d,f),setHover:(d)=>fe(r,d),setInsertZone:(d,f="center")=>Po(s,d,f),setReplaceTarget:(d)=>fe(a,d),setSuppressed:(d)=>{t.style.display=d?"none":""},setCoSelection:(d)=>{c.replaceChildren();for(let f of d){let h=e.createElement("div");h.className="overlay-box overlay-selection overlay-coselection",fe(h,f),c.append(h)}},setPresence:(d)=>{l.replaceChildren();for(let f of d){let h=e.createElement("div");h.className="overlay-box overlay-presence",h.style.cssText=`position:absolute;display:block;pointer-events:none;outline:1.5px solid ${f.color};outline-offset:1px;left:${f.placement.left}px;top:${f.placement.top}px;width:${f.placement.width}px;height:${f.placement.height}px`;let b=e.createElement("div");b.className="overlay-presence-tag",b.textContent=f.label,b.style.cssText=`position:absolute;top:-18px;left:-2px;padding:1px 5px;border-radius:3px;font:10px/1.4 sans-serif;color:#fff;white-space:nowrap;background:${f.color}`,h.append(b),l.append(h)}},setSelection:(d,f=null)=>{if(fe(n,d),d&&f)o.textContent=f,o.style.display="block";else o.style.display="none"}}}function Po(e,t,n){if(!t){e.style.display="none",e.classList.remove("visible");return}e.dataset.edge=n,e.classList.add("visible"),e.style.display="grid",e.style.left=`${t.left+t.width/2}px`,e.style.top=`${t.top+t.height/2}px`,e.style.translate="-50% -50%"}function So(e,t,n){if(!t){e.style.display="none";return}if(e.style.display="block",e.style.left=`${t.left}px`,e.style.width=`${t.width}px`,n==="inside"){e.className="canvas-drop-indicator inside",e.style.top=`${t.top}px`,e.style.height=`${t.height}px`;return}e.className="canvas-drop-indicator line",e.style.height="",e.style.top=`${n==="top"?t.top:t.top+t.height}px`}function Rl(e){return JSON.stringify(e)}var xd={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var To=new Set(["pre"]),na=new Set(Object.entries(xd.$defs).filter(([e,t])=>!To.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));var Kt=new Set(["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"]);function Be(e,t){if(!t)return Kt.has(e);let n=xd.$defs[t];if(!n||!n.$inlineChildren)return!1;return n.$inlineChildren.includes(e)}function IT(e){let t=xd.$defs[e];if(!t)return null;let n=t.$inlineActions;if(typeof n==="string")n=xd.$defs[n]?.$inlineActions??void 0;if(!Array.isArray(n))return null;return n}var Mo=null;function ox(e,t){if(!e||typeof e!=="object")return!1;let n=(qe(e.tagName)||"div").toLowerCase();if(t){let o=(qe(t.tagName)||"div").toLowerCase();return Be(n,o)}return Kt.has(n)}function RT(){return Mo!==null}function me(e){return!e||e==="base"?null:e}function Ob(e){let t=e.panels;if(t.length===0)return null;if(t.length===1)return t[0];let n=Ou(e.paneId);for(let o of t){if(n===null&&(o.mediaName==="base"||o.mediaName===null))return o;if(o.mediaName===n)return o}return t[0]}function Ut(){return Ob(Uo())}function $T(e,t){if(!e)return t;let n=t;while(n.length>=2){let o=K(e,n),r=ht(n),i=r?K(e,r):null;if(!o||!i)break;let s=(qe(o.tagName)||"div").toLowerCase(),a=(qe(i.tagName)||"div").toLowerCase();if(!Be(s,a))break;n=r}return n}function Mb(e){return Av(e)!==null}function Mu(e){return Av(e)}function hr(e){if(!e)return{baseWidth:320,featureQueries:[],sizeBreakpoints:[]};let t=[],n=[],o=320;for(let[r,i]of Object.entries(e)){if(r==="--"){let l=String(i).match(/^(\d+)\s*px$/);o=l?Number(l[1]):320;continue}let s=i.match(/min-width:\s*([\d.]+)px/),a=i.match(/max-width:\s*([\d.]+)px/);if(s)n.push({name:r,query:i,type:"min",width:Number(s[1])});else if(a)n.push({name:r,query:i,type:"max",width:Number(a[1])});else t.push({name:r,query:i})}return n.sort((r,i)=>r.type==="min"?r.width-i.width:i.width-r.width),{baseWidth:o,featureQueries:t,sizeBreakpoints:n}}function No(e,t){let n=new Set;for(let o of e)if(o.type==="min"&&t>=o.width)n.add(o.name);else if(o.type==="max"&&t<=o.width)n.add(o.name);return n}function Gt(e,t){let n=No(e,t),o=null;for(let r of e){if(!n.has(r.name))continue;let i=Math.abs(r.width-t);if(o===null){o=r;continue}let s=Math.abs(o.width-t);if(i<s||i===s&&r.width<o.width)o=r}return o?.name??null}function DT(e,t,n=8){let o=null;for(let r of t){let i=Math.abs(r-e);if(i>n)continue;if(o===null||i<Math.abs(o-e))o=r}return o??e}var dp=240,AT=8,NT=16,he=new Map;function ze(e){return hr(Di(e.doc.document?.$media))}function rx(e){let{baseWidth:t,sizeBreakpoints:n}=ze(e),o=e.session.ui.activeMedia;return n.find((r)=>r.name===o)?.width??t}function ko(e,t){let n=he.get(e);if(!n)return null;if(!t||n.tabId!==t.id||n.media!==t.session.ui.activeMedia)return he.delete(e),null;return n.width}function OT(e,t){let n=t?rx(t):0;return ko(e.paneId,t)??n}function sx(e){he.delete(e)}function MT(e){let{baseWidth:t,sizeBreakpoints:n}=ze(e);return[t,...n.map((o)=>o.width)]}function ax(e,t,n){let{sizeBreakpoints:o}=ze(t),r=Gt(o,n);return t.session.ui.activeMedia=r,he.set(e,{media:r,tabId:t.id,width:n}),r}var Ke={invokerTags:Hm,popoverTags:Hd};function J1(e,t){if(!e||!t)return null;for(let n=t.length;n>=0;n-=1){let o=t.slice(0,n),r=K(e,o);if(r&&typeof r==="object"&&Gs(r,Ke))return o}return null}function Zt(e,t){let n=e.doc.document;if(!n)return null;if(t){let o=K(n,t);return o&&typeof o==="object"&&Gs(o,Ke)?t:null}return J1(n,Le(e.session.selection))}function Xt(){let e=u.value?.doc.document;return e?_I(e,Ke):!1}var Yt=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],Ge=new Set(["show-modal","close","request-close"]),Ze=new Set(["toggle-popover","show-popover","hide-popover"]),Ro=["any","closerequest","none"],Oo=new Set(["button"]),I="See docs/framework/concepts/overlays.";function H(e){return ro(e)==="dialog"}function Qt(e){return e.startsWith("--")}function Ao(e){let t=[];for(let{node:n}of Za(e)){let o=ih(n);if(H(n)&&o!==null&&!t.includes(o))t.push(o)}return t}function en(e){for(let{node:t}of Za(e))if(H(t))return!0;return!1}function $o(e){let t=e.oncommand;return t!==void 0&&t!==null}function Io(e,t){for(let{node:n}of Za(e)){if(n===e)continue;let o=ro(n);if(o==="button"){let r=Kr(n,"command"),i=Kr(n,"commandfor");if(r!==null&&(r==="close"||r==="request-close")&&(i===null||i===t))return!0}if(o==="form"&&Kr(n,"method")?.toLowerCase()==="dialog")return!0}return!1}function wT(e,t){let n=[...Za(e,[],null,t)],o=Ao(e),r=jm(e,t),i=o.length>0||r.length>0,s=new Map,a=new Map;for(let{node:c}of n){let d=ih(c);if(d!==null&&!s.has(d))s.set(d,c);if(ro(c)==="button"){let f=Kr(c,"commandfor"),h=Kr(c,"command");if(f!==null){let b=a.get(f)??new Set;b.add(h??""),a.set(f,b)}}}let l=[];for(let{node:c,path:d}of n)if(l.push(...Ho(c,d,s,o,r,i,t)),H(c))l.push(...Jo(c,d,a));return l}function Ho(e,t,n,o,r,i,s){let a=[],l=ro(e),c=s?.invokerTags?.has(l)??!1,d=Kr(e,"command"),f=Kr(e,"commandfor");if(!(d!==null||f!==null||("command"in Vl(e))||("commandfor"in Vl(e))))return a;let b=Jr(e,"the element");if(!Oo.has(l)&&!c)return a.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${I}`,fix:"invoker",message:`<${l||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),a;if(d!==null&&!Yt.includes(d)&&!Qt(d))return a.push({detail:`\`command\` is an enumerated attribute taking ${Yt.map((T)=>`\`${T}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${I}`,message:`${b} declares command="${d}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),a;if(f!==null){let T=n.get(f),R=o.includes(f),O=r.includes(f);if(!T&&i){let U=[...o,...r].map((w)=>`"${w}"`).join(", ");return a.push({detail:`No element in this document has the id "${f}". The dialogs and popovers here are: ${U}. A commandfor that names nothing does nothing, silently. ${I}`,message:`commandfor="${f}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),a}if(d!==null&&T){if(Ge.has(d)&&!H(T))a.push({detail:`\`${d}\` acts on a <dialog>, and "${f}" is ${O?"a popover":`a <${ro(T)||"element"}>`}. The click is ignored. ${O?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${I}`,message:`${b} sends ${d} to "${f}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(Ze.has(d)&&!Gs(T,s))a.push({detail:`\`${d}\` acts on a popover, and "${f}" is ${R?"a dialog":`a <${ro(T)||"element"}>`} that declares no \`popover\`. The click is ignored. ${R?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${I}`,message:`${b} sends ${d} to "${f}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(Qt(d)&&!$o(T))a.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${f}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${I}`,message:`${b} sends ${d} to "${f}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return a}function Jo(e,t,n){let o=[],r=Jr(e,"the dialog"),i=ih(e),{style:s}=e,a=Kr(e,"closedby");if(a!==null&&!Ro.includes(a))o.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${I}`,message:`${r} declares closedby="${a}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(Qo(s,"display")!==null)o.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${I}`,fix:"display",message:`${r} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let l=i===null?void 0:n.get(i),c=Kr(e,"open")!==null||Vl(e).open===!0||e.open===!0;if(i!==null&&!l?.has("show-modal")&&!c)o.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${I}`,message:`${r} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(l?.has("show-modal")&&a==="none"&&!Io(e,i))o.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${I}`,message:`${r} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return o}function Y1(e,t){if(!e||!t)return null;for(let n=t.length;n>=0;n-=1){let o=t.slice(0,n),r=K(e,o);if(r&&typeof r==="object"&&H(r))return o}return null}function lx(e,t){let n=e.doc.document;if(!n)return null;if(t){let o=K(n,t);return o&&typeof o==="object"&&H(o)?t:null}return Y1(n,Le(e.session.selection))}function tn(){let e=u.value?.doc.document;return e?en(e):!1}function V(e){return lt(e.paneId)}function ee(e){let t=ur(e.paneId);if(t?.kind==="lens")return t.zoom;return V(e)?.session.ui.zoom??1}function cx(e=Uo()){return ee(e)}function ve(e,t){let n=ur(e.paneId);if(n?.kind==="lens"){n.zoom=t;return}let o=V(e);if(o)o.session.ui.zoom=t}function Pu(e,t,n,o=null){let r={_width:o||null,canvas:null,element:null,mediaName:e||"",ready:!1,renderScope:null,scrollContainer:null,viewport:null},i=[];if(o&&!n)i.push(`--panel-viewport-w:${o}px`);if(o)i.push(`--panel-canvas-w:${o}px`);return{item:{fullWidth:n,header:t?"shown":"hidden",key:e??"",label:t??"",mediaAttr:e,widthVars:i.join(";")},panel:r}}function PT(e,t){for(let{item:n,panel:o}of e)o.element=t.panelNode(n.key,"panel"),o.viewport=t.panelNode(n.key,"panel-viewport"),o.canvas=t.panelNode(n.key,"panel-canvas")}function FT(e,t){let n=e.find((r)=>r.item.key===t);if(!n)return;let o=wt(n.panel);if(o)o.session.ui.activeMedia=me(n.item.mediaAttr)}function Qe(e){if(!e.panzoomWrap)return;let t=e.wrap.clientWidth,n=e.panzoomWrap.scrollWidth,o=ee(e),r=n*o;e.panX=Math.max(16,(t-r)/2),e.panY=0}function Pb(e){if(e.centerObserver)e.centerObserver.disconnect(),e.centerObserver=null;if(!e.panzoomWrap)return;e.needsCenter=!0,e.centerObserver=new ResizeObserver(()=>{if(!e.needsCenter){e.centerObserver?.disconnect(),e.centerObserver=null;return}Qe(e),us(e)}),e.centerObserver.observe(e.panzoomWrap),Qe(e)}function us(e){if(!e.panzoomWrap)return;let t=ee(e);e.panzoomWrap.style.transform=`translate(${e.panX}px, ${e.panY}px) scale(${t})`,Ai("overlays")}var et=0.25,tt=3;function rn(e){return Math.min(tt,Math.max(et,e))}function _d(e=Uo()){if(wo(e.paneId)!=="edit")return;let[t]=e.panels;if(!t?.canvas||!t.viewport)return;let n=t.canvas,o=n.querySelector("iframe"),r=V(e)?.session.ui.editZoom??1;if(r===1){if(t._width=null,n.style.width="",n.style.transform="",n.style.transformOrigin="",o)o.style.width="100%";t.viewport.style.height=""}else{let i=e.wrap.querySelector('[part="edit-column"]');if(!i)return;let s=Oe(i).width;if(s<=0)return;let a=s/r;if(t._width=a,n.style.width=`${a}px`,n.style.transform=`scale(${r})`,n.style.transformOrigin="top left",o)o.style.width=`${a}px`,t.viewport.style.height=`${o.offsetHeight*r}px`}Ai("overlays")}function Fu(e,t=Uo()){let n=V(t);if(!n)return;n.session.ui.editZoom=rn(e),_d(t)}var Xe=new Map;function jT(e,t=Uo()){let n=V(t);if(!n)return;if(n.session.ui.editZoom=rn(e),Xe.has(t.paneId))return;Xe.set(t.paneId,requestAnimationFrame(()=>{Xe.delete(t.paneId),_d(t)}))}function an(e,t,n){if(!e.panzoomWrap)return;let o=e.wrap.clientWidth,r=e.wrap.clientHeight,i=24,s=32,a=0,{panels:l}=e;for(let v of l)a+=v._width||800;a+=i*Math.max(0,l.length-1)+s;let c=ee(e),h=Oe(e.panzoomWrap).height/c+s,b=o/a,T=r/h,R=t==="width"?b:Math.min(b,T),O=Math.min(n,Math.max(F,R));ve(e,O);let U=a*O,w=h*O;e.panX=Math.max(0,(o-U)/2),e.panY=Math.max(0,(r-w)/2),us(e)}function HT({maxZoom:e=W,surface:t=Uo()}={}){te("page",t),an(t,"page",e)}var F=0.05,W=5;function rt(e){return Math.min(W,Math.max(F,e))}var Lo="page",nt=["width","page","none"];function jo(e,t,n){let o=t[n];if(typeof o==="string"&&nt.includes(o))return o;if(typeof o==="number"&&o>=F&&o<=W)return o;throw RangeError(`command "${e}" argument "${n}": expected ${nt.map((r)=>`"${r}"`).join(" | ")} or a number in [${F}, ${W}], got ${JSON.stringify(o)}`)}var sn=new Map;function ln(e){let t=V(e);if(!t)return null;let n=ur(e.paneId)?.kind==="lens"?`::${e.paneId}`:"";return`${t.id}::${t.documentPath??""}${n}`}function te(e,t){let n=ln(t);if(n)sn.set(n,e)}function dx(e=Uo()){let t=ln(e);return(t===null?void 0:sn.get(t))??Lo}function cn(e,t=Uo()){let n=e??dx(t);if(n==="none"){us(t);return}if(typeof n==="number"){ve(t,rt(n)),us(t);return}an(t,n,1)}function Z1(e,t=Uo()){te(e,t),cn(e,t)}function BT(e=Uo()){te(rt(ee(e)),e)}function ux(e,t=Uo()){if(!V(t))return;let o=rt(e);te(o,t),ve(t,o),us(t)}function hx(e){if(e.wrap.clientWidth<=0){us(e);return}cn(dx(e),e)}function zT(e=Uo()){if(te(1,e),!e.panzoomWrap)return;ve(e,1),Qe(e),us(e)}function qo(e,t){let n=Oe(un(e)??e.wrap),o=t.top+t.height/2-n.top;return n.height/2-o}function un(e){return Ob(e)?.scrollContainer??null}function Fo(e,t,n){let o=un(e);if(!o){Wo(e,t);return}let r=o.scrollTop-t;if(n){o.scrollTo({behavior:"smooth",top:r});return}o.scrollTop=r}function Fb(e,t=Uo()){Fo(t,qo(t,e),!1)}function Wo(e,t){let n=e.panY,o=n+t,r=performance.now(),i=250,s=(a)=>{let l=Math.min((a-r)/250,1),c=l*(2-l);if(e.panY=n+(o-n)*c,us(e),l<1)requestAnimationFrame(s)};requestAnimationFrame(s)}var Ye=["edit","design","preview","source","stylebook","grid","git-diff"],ye=new Set(["edit","design"]),Vo=["edit","design","preview"];function Bo(e){return Vo.filter((t)=>e.capabilities.modes.includes(t))}function WT(e){return Bo(e).filter((t)=>t!=="preview")}function X1(e){let t=e.session.ui.canvasMode;return ye.has(t)?t:null}function Q1(e){return{available:e.capabilities.modes.includes("preview")&&ye.has(e.session.ui.canvasMode),on:e.session.ui.preview===!0}}function eC(e,t,n){if(t==="preview"){if(ye.has(e.session.ui.canvasMode))e.session.ui.preview=!0;return}if(e.session.ui.preview=!1,e.session.ui.canvasMode!==t)n(e,t)}var nn=new Set(["design","stylebook","git-diff"]),N=(e)=>e.document.open,on=["auto","light","dark"];function zo(e){function t(s){let a=u.value;if(!a)throw RangeError(`command "${s}" needs an open document; no tab is active`);return a}function n(s,a){let{pane:l}=a;if(l===void 0)return t(s);let c=ot(s,a,"pane"),d=lt(c);if(!d)throw RangeError(`command "${s}" argument "pane": "${c}" has no open document`);return d}let o={pane:He("Which pane to render this way. Defaults to the focused one.")};function r(s){e.renderPane(i(s))}function i(s){let{pane:a}=s;return typeof a==="string"?a:m.activePaneId}return[{args:Se({mode:Do(Ye,"The canvas mode to switch the active pane to.")}),category:"View",id:"canvas.setMode",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:N,aiTool:{description:"Switch the active document's editor mode. edit and design put its element tree on the canvas, where the document tools work; preview renders it as a visitor sees it; source shows the JSON; stylebook, grid and git-diff open other editors. Use it to return a document to edit or design when the tree tools are refused.",name:"set_canvas_mode",report:({after:s,args:a})=>{let l=li("canvas.setMode",a,"mode",Ye),c=s.editor.kind==="canvas"?"the document tools address its element tree":"the tree-editing tools are unavailable until it returns to edit or design";return`The active document is in ${l} mode; ${c}.`}},run:(s,a)=>{let l=li("canvas.setMode",a,"mode",Ye),c=t("canvas.setMode"),{modes:d}=c.capabilities;if(!d.includes(l))throw RangeError(`command "canvas.setMode" argument "mode": "${l}" is not a mode this document `+`supports — it declares: ${d.join(", ")}`);if(l==="preview"){let f=c.session.ui.canvasMode;if(!ye.has(f))throw RangeError(`command "canvas.setMode" argument "mode": "preview" composes with the edit and design base modes; this pane is in "${f}"`);c.session.ui.preview=!0;return}c.session.ui.preview=!1,e.setCanvasMode(c,l)},title:"Set Canvas Mode"},{args:Se({zoom:KC("Pan-zoom scale, 1 = 100%.",{maximum:W,minimum:F})}),category:"View",id:"canvas.setZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:N,enablement:()=>nn.has(e.getCanvasMode()),run:(s,a)=>{t("canvas.setZoom"),ux(wv("canvas.setZoom",a,"zoom",F,W))},title:"Set Zoom"},{args:Se({fit:{description:'How the document is framed: "width" | "page" | "none", or a numeric pan-zoom scale.',oneOf:[{enum:[...nt],type:"string"},{maximum:W,minimum:F,type:"number"}]}}),category:"View",id:"canvas.setFit",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:N,enablement:()=>nn.has(e.getCanvasMode()),run:(s,a)=>{t("canvas.setFit"),Z1(jo("canvas.setFit",a,"fit"))},title:"Set Fit"},{args:Se({zoom:KC("Edit-mode content zoom, 1 = 100%.",{maximum:tt,minimum:et})}),category:"View",id:"canvas.setEditZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:N,enablement:()=>e.getCanvasMode()==="edit",run:(s,a)=>{t("canvas.setEditZoom"),Fu(wv("canvas.setEditZoom",a,"zoom",et,tt))},title:"Set Edit Zoom"},{args:{additionalProperties:!1,properties:{...o,width:{description:"How wide the Edit column should render, in CSS pixels, or null to go back to the chosen breakpoint's own width.",type:["number","null"]}},required:["width"],type:"object"},category:"View",id:"canvas.setEditWidth",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:N,enablement:()=>e.getCanvasMode()==="edit",run:(s,a)=>{let l=n("canvas.setEditWidth",a),{width:c}=a;if(c===null){sx(i(a)),r(a);return}ax(i(a),l,wv("canvas.setEditWidth",a,"width",dp,1e4)),r(a)},title:"Set Edit Width"},{args:{additionalProperties:!1,properties:{...o,media:{description:"A breakpoint key the document renders under, or null for the base rendering.",type:["string","null"]}},required:["media"],type:"object"},category:"View",id:"canvas.setBreakpoint",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:N,run:(s,a)=>{let l=n("canvas.setBreakpoint",a),{media:c}=a;if(c!==null&&typeof c!=="string")throw RangeError('command "canvas.setBreakpoint" argument "media": expected a breakpoint key or null');let d=Object.keys(Di(l.doc.document?.$media));if(c!==null&&!d.includes(c))throw RangeError(`command "canvas.setBreakpoint" argument "media": "${c}" is not a breakpoint this `+`document defines — it defines: ${d.length>0?d.join(", "):"nothing"}`);l.session.ui.activeMedia=c,r(a)},title:"Set Breakpoint"},{args:Se({...o,scheme:Do(on,"Which color scheme the canvas renders in.")},["scheme"]),category:"View",id:"canvas.setColorScheme",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:N,run:(s,a)=>{let l=n("canvas.setColorScheme",a);l.session.ui.previewColorScheme=li("canvas.setColorScheme",a,"scheme",on),r(a)},title:"Set Color Scheme"},{args:Se({...o,locale:He("BCP 47 tag this pane renders as.")},["locale"]),category:"View",id:"i18n.switchLocale",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document in a project that declares more than one locale",when:(s)=>s.document.open&&s.project.isMultilingual,run:(s,a)=>{let l=n("i18n.switchLocale",a),c=ot("i18n.switchLocale",a,"locale"),d=ps();if(d===null||!d.locales.includes(c))throw RangeError(`command "i18n.switchLocale" argument "locale": "${c}" is not a locale this `+`project declares — it declares: ${d===null?"nothing":d.locales.join(", ")}`);l.session.ui.previewLocale=c,r(a)},title:"Set Rendering Language"},{args:Se({...o,visible:oo("True to draw the page's layout elements, false to hide them.")},["visible"]),category:"View",id:"canvas.setLayoutVisible",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:N,run:(s,a)=>{let l=n("canvas.setLayoutVisible",a);l.session.ui.showLayout=yi("canvas.setLayoutVisible",a,"visible"),r(a)},title:"Show Layout Elements"},{args:Se({...o,open:oo("True to draw the popover open, false to close it."),path:{description:"Document path of the popover. Defaults to the popover the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>Xt(),group:"3_canvas",id:"canvas.setPopoverOpen",level:"document",menus:["palette"],requires:"a popover in the open document",run:(s,a)=>{let l=n("canvas.setPopoverOpen",a),c=a??{},d=c.open===void 0?!0:yi("canvas.setPopoverOpen",a,"open");if(!d&&c.path===void 0){e.setOpenPopover(l,null);return}let f=Zt(l,c.path);if(f===null)throw RangeError('command "canvas.setPopoverOpen" argument "path": names no popover in this document — '+"a popover is an element with a `popover` attribute, and <dialog> is not one");e.setOpenPopover(l,d?f:null)},title:"Show Popover",when:N},{args:Se({...o,open:oo("True to draw the dialog open, false to close it."),path:{description:"Document path of the dialog. Defaults to the dialog the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>tn(),group:"3_canvas",id:"canvas.setDialogOpen",level:"document",menus:["palette"],requires:"a dialog in the open document",run:(s,a)=>{let l=n("canvas.setDialogOpen",a),c=a??{},d=c.open===void 0?!0:yi("canvas.setDialogOpen",a,"open");if(!d&&c.path===void 0){e.setOpenDialog(l,null);return}let f=lx(l,c.path);if(f===null)throw RangeError('command "canvas.setDialogOpen" argument "path": names no dialog in this document — '+"a dialog is a <dialog> element, and a popover is not one");e.setOpenDialog(l,d?f:null)},title:"Show Dialog",when:N},{args:{additionalProperties:!1,properties:{...o,open:{default:!0,description:"True to open the resolving-with popover, false to close it.",type:"boolean"}},required:[],type:"object"},category:"View",id:"canvas.setResolvingOpen",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:N,run:(s,a)=>{n("canvas.setResolvingOpen",a);let{open:l,pane:c}=a;e.setResolvingOpen(typeof c==="string"?c:m.activePaneId,l===void 0||yi("canvas.setResolvingOpen",a,"open"))},title:"Show Resolving Values"},{args:{additionalProperties:!1,properties:{...o,name:He("The prop's name, as the component's state declares it."),value:{description:"The test value — any JSON. Null clears it and the prop returns to its default.",type:["string","number","boolean","array","object","null"]}},required:["name"],type:"object"},category:"View",id:"canvas.setTestProp",level:"document",menus:["palette"],group:"3_canvas",requires:"an open component document",when:N,run:(s,a)=>{let l=n("canvas.setTestProp",a),c=ot("canvas.setTestProp",a,"name"),d=Object.keys(l.doc.document?.state??{});if(!d.includes(c))throw RangeError(`command "canvas.setTestProp" argument "name": "${c}" is not a prop this component `+`declares — it declares: ${d.length>0?d.join(", "):"nothing"}`);let{value:f}=a,h={...l.session.ui.previewProps};if(f===null||f===void 0)delete h[c];else h[c]=f;l.session.ui.previewProps=Object.keys(h).length>0?h:null,r(a)},title:"Set Test Value"},{args:{additionalProperties:!1,properties:{...o,name:He("The route parameter's name, without brackets."),value:He("The value to preview the route with. Empty clears it.")},required:["name","value"],type:"object"},category:"View",id:"canvas.setRouteParam",level:"document",menus:["palette"],group:"3_canvas",requires:"an open page with a dynamic route",when:N,run:(s,a)=>{let l=n("canvas.setRouteParam",a),c=ot("canvas.setRouteParam",a,"name"),d=Il(l.documentPath);if(!d.includes(c))throw RangeError(`command "canvas.setRouteParam" argument "name": "${c}" is not a parameter of this `+`route — it has: ${d.length>0?d.join(", "):"none"}`);l.session.ui.previewParams={...l.session.ui.previewParams,[c]:ot("canvas.setRouteParam",a,"value")},r(a)},title:"Set Route Parameter"}]}function VT(e,t){e.registerAll(zo(t))}function jb(e=Uo()){let t=Ou(e.paneId);for(let n of e.panels){let o=n.element?.querySelector('[part="panel-header"]');if(o){let r=t===null&&n.mediaName==="base"||t===null&&n.mediaName===null||t===n.mediaName;o.toggleAttribute("data-active",r)}}}var J=null;function Ko(e){if(J?.isConnected)return J;let t=e.createElement("div");return t.className="jx-drag-ghost",t.style.cssText="position:fixed;left:0;top:0;z-index:9999;pointer-events:none;display:none;padding:2px 8px;border-radius:4px;font-size:12px;line-height:1.4;white-space:nowrap;background:var(--accent,#3b82f6);color:var(--accent-fg,#fff);box-shadow:0 2px 8px rgba(0,0,0,0.25);transform:translate(8px,8px)",e.body.append(t),J=t,t}function tC(e,t,n,o=document){let r=Ko(o);r.textContent=e,r.style.left=`${t}px`,r.style.top=`${n}px`,r.style.display="block"}function px(e,t){if(!J||J.style.display==="none")return;J.style.left=`${e}px`,J.style.top=`${t}px`}function Cd(){if(J)J.style.display="none"}var dn=function(){if(typeof window>"u")return null;var e=new Image;return e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",e}();function xc(e){var t=e.nativeSetDragImage;if(t&&dn)t(dn,0,0)}function pn(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function fn(e,t){if(e==null)return{};var n,o,r=pn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function be(e,t){var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;return n.every(function(r){return Object.is(e[r],t[r])})}function mn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:be,t=null;return function(n){if(t&&e(t.value,n))return t.value;return t={value:n},t.value}}var Go=["block"];function hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hn(Object(n),!0).forEach(function(o){ga(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Zo(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function it(e){var{client:t,borderBox:n}=e,o=n.height/4;if(t.y<=n.top+o)return"reorder-above";if(t.y>=n.bottom-o)return"reorder-below";return"make-child"}function Xo(e){var{element:t,input:n,currentLevel:o,indentPerLevel:r,mode:i}=e,s={x:n.clientX,y:n.clientY},a=t.getBoundingClientRect();if(i==="standard"){var l=it({borderBox:a,client:s});return{type:l,indentPerLevel:r,currentLevel:o}}var c=Zo(a);if(i==="expanded"){var d=it({borderBox:a,client:s});return{type:d==="reorder-above"?d:"make-child",indentPerLevel:r,currentLevel:o}}var f=r*o;if(s.x<a.left+f){if(s.y<c.y)return{type:"reorder-above",indentPerLevel:r,currentLevel:o};var h=(s.x-a.left)/r,b=Math.max(Math.floor(h),0);return{type:"reparent",desiredLevel:b,indentPerLevel:r,currentLevel:o}}return{type:it({borderBox:a,client:s}),indentPerLevel:r,currentLevel:o}}function vn(e,t){if(e.type!==t.type)return!1;if(e.type==="instruction-blocked"&&t.type==="instruction-blocked")return vn(e.desired,t.desired);return be(e,t)}var er=mn(vn);function tr(e){var{desired:t,block:n}=e;if(n!==null&&n!==void 0&&n.includes(t.type)&&t.type!=="instruction-blocked"){var o={type:"instruction-blocked",desired:t};return o}return t}function Hb(e,t){var n=t.block,o=fn(t,Go),r=Xo(o),i=tr({desired:r,block:n}),s=er(i);return gn(gn({},e),{},ga({},xe,s))}function ju(e){var t;return(t=e[xe])!==null&&t!==void 0?t:null}var xe=Symbol("tree-item-instruction");function at(e){return typeof e==="object"&&e!==null&&typeof e.$ref==="string"?e.$ref:null}function we(e){if(e.source!=="npm"||!e.package)return null;return e.modulePath?`${e.package}/${e.modulePath}`:e.package}function nr(e,t){let n=we(e);if(n)return n;return e.path?{$ref:_c(t,e.path)}:null}function nC(e,t,n){let o=we(t);if(o)return e.some((i)=>typeof i==="string"&&(i===o||i===t.package));if(!t.path)return!1;let r=G(_c(n,t.path));return e.some((i)=>{let s=at(i);return s!==null&&G(s)===r})}function G(e){return e.replace(/^(?:\.\/)+/,"")}function rm(e,t,n){let o=nr(t,n);if(!o)return[...e];let i=we(t)&&t.modulePath?e.filter((s)=>s!==t.package):[...e];return nC(i,t,n)?i:[...i,o]}function iC(e,t,n){let o=we(t);if(o)return e.filter((i)=>!(typeof i==="string"&&(i===o||i===t.package)));if(!t.path)return[...e];let r=G(_c(n,t.path));return e.filter((i)=>{let s=at(i);return s===null||G(s)!==r})}function UT(e,t){return e.filter((n)=>typeof n!=="string"||!(n===t||n.startsWith(`${t}/`)))}function qT(e,t){let n=G(t);return e.filter((o)=>{let r=at(o);return r===null||G(r)!==n})}async function fx(e){Dp(!0);try{if(e.source==="npm"){if(!customElements.get(e.tagName))return ct(e.tagName)}else{if(e.path&&!e.path.endsWith(".json"))return ct(e.tagName);let n=D?.projectRoot,o=`${location.origin}/${n?`${n}/`:""}${e.path}`;await Pm(o)}let t=document.createElement(e.tagName);for(let n of e.props||[])if(n.default!==void 0&&n.default!=="false"&&n.default!=="''"){let o=String(n.default).replaceAll(/^'|'$/g,"");t.setAttribute(n.name,o)}return t}catch(t){return console.warn("Component preview failed:",e.tagName,t),ct(e.tagName)}}function ct(e){let t=document.createElement("div");return t.style.cssText="padding:12px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--fg-dim)",t.textContent=`<${e}>`,t}var or='[part="outline"]',ut='[part="row"]',rr='[part="verbs"]',Ce=null;function GT(){if(Ce!==null)cancelAnimationFrame(Ce);for(let e of Je.dndCleanups)e();Je.dndCleanups=[],Ce=requestAnimationFrame(()=>{Ce=null;let e=eh?.querySelector(or);if(!e)return;for(let n of e.querySelectorAll("[data-dnd-row]")){let o=n.dataset.value.split("/").map((l)=>/^\d+$/.test(l)?Math.trunc(Number(l)):l),r=Math.trunc(Number(n.dataset.dndDepth))||0,i=Object.hasOwn(n.dataset,"dndVoid"),s=Object.hasOwn(n.dataset,"dndExpanded"),a=gr(gs({canDrag({element:l,input:c}){if($v(c.clientX,c.clientY)?.closest(rr))return!1;return!0},element:n,getInitialData(){return{path:o,type:"tree-node"}},onGenerateDragPreview({nativeSetDragImage:l}){xc({nativeSetDragImage:l})},onDragStart(){if(n.dataset.dragging="",Je.layerDragSourceHeight=n.offsetHeight,s)ir(n,e)},onDrop(){if(delete n.dataset.dragging,s)Ai("leftPanel")}}),zs({element:n,canDrop({source:l}){let c=l.data.path;if(c&&Ga(c,o))return!1;return!0},getData({input:l,element:c}){return Hb({path:o},{block:i?["make-child"]:[],currentLevel:r,element:c,indentPerLevel:16,input:l,mode:s?"expanded":"standard"})},onDragEnter({self:l}){yn(n,l.data,e)},onDrag({self:l}){yn(n,l.data,e)},onDrop(){oe(e)}}));Je.dndCleanups.push(a)}let t=Ws({onDrop({source:n,location:o}){oe(e);let[r]=o.current.dropTargets;if(!r)return;let i=ju(r.data);if(!i||i.type==="instruction-blocked")return;let s=n.data,a=r.data.path,l=s.type==="tree-node"&&n.element,c=l&&Object.hasOwn(l.dataset,"dndExpanded");if(sm(u.value,i,s,a),c){let d=u.value,f=Le(d?.session.selection);if(f)Je._layersCollapsed||=new Set,Je._layersCollapsed.add(f.join("/"))}},onDropTargetChange({location:n}){let[o]=n.current.dropTargets;if(o&&!ju(o.data))oe(e)}});Je.dndCleanups.push(t)})}function KT(){requestAnimationFrame(()=>{let e=eh?.querySelector(".components-section");if(!e)return;for(let t of e.querySelectorAll("[data-component-tag]")){let n=t.dataset.componentTag;if(!n)continue;let o=st.find((a)=>a.tagName===n);if(!o)continue;let r=t.querySelector(".element-card-preview");if(r&&!r.querySelector(n))fx(o).then((a)=>{r.textContent="",r.append(a)});let i=hm(o),s=gs({element:t,getInitialData(){return{fragment:structuredClone(i),type:"block"}},onGenerateDragPreview({nativeSetDragImage:a}){xc({nativeSetDragImage:a})}});Je.dndCleanups.push(s)}})}function JT(){requestAnimationFrame(()=>{let e=eh?.querySelector('[part="content"]');if(!e)return;for(let t of e.querySelectorAll("[data-block-tag]")){let n=t.dataset.blockTag,o=t.querySelector(".element-card-preview");if(o&&!o.firstChild){let s=document.createElement(Ht.has(n)?"span":n);s.textContent=n,o.append(s)}let r=wd(n),i=gs({element:t,getInitialData(){return{fragment:structuredClone(r),type:"block"}},onGenerateDragPreview({nativeSetDragImage:s}){xc({nativeSetDragImage:s})}});Je.dndCleanups.push(i)}})}function ir(e,t){let n=`${e.dataset.value}/`,o=t.querySelectorAll(ut);for(let r of o)if(r.dataset.value?.startsWith(n))r.style.display="none"}function yn(e,t,n){let o=ju(t);if(Je._currentDropTargetRow&&Je._currentDropTargetRow!==e)delete Je._currentDropTargetRow.dataset.drop;if(!o||o.type==="instruction-blocked"){oe(n);return}if(o.type==="make-child"){oe(n),e.dataset.drop="",Je._currentDropTargetRow=e;return}delete e.dataset.drop,Je._currentDropTargetRow=e;let r=[...n.querySelectorAll(ut)],i=r.indexOf(e),s=Je.layerDragSourceHeight;for(let a=0;a<r.length;a++){if(r[a].dataset.dragging!==void 0)continue;if(o.type==="reorder-above")r[a].style.transform=a>=i?`translateY(${s}px)`:"";else r[a].style.transform=a>i?`translateY(${s}px)`:""}}function oe(e){if(Je._currentDropTargetRow)delete Je._currentDropTargetRow.dataset.drop,Je._currentDropTargetRow=null;let t=e.querySelectorAll(ut);for(let n of t)n.style.transform="",n.style.display=""}function sm(e,t,n,o){if(!e)return;let r=e.doc.document;if(n.type==="tree-node"){let i=n.path,s=ht(o),a=_n(o);if(t.type!=="make-child"&&(!s||typeof a!=="number"))return;switch(t.type){case"reorder-above":{q(e,(l)=>pa(l,i,s,a));break}case"reorder-below":{q(e,(l)=>pa(l,i,s,a+1));break}case"make-child":{let l=K(r,o),c=_o(l).length;q(e,(d)=>pa(d,i,o,c));break}default:break}}else if(n.type==="block"){let i=ht(o),s=_n(o);if(t.type!=="make-child"&&(!i||typeof s!=="number"))return;switch(t.type){case"reorder-above":{q(e,(c)=>Ji(c,i,s,structuredClone(n.fragment)));break}case"reorder-below":{q(e,(c)=>Ji(c,i,s+1,structuredClone(n.fragment)));break}case"make-child":{let c=K(r,o),d=_o(c).length;q(e,(f)=>Ji(f,o,d,structuredClone(n.fragment)));break}default:break}let l=n.fragment?.tagName;if(qe(l).includes("-")){let c=st.find((h)=>h.tagName===l),d=e.doc.document?.$elements??[],f=c?rm(d,c,e.documentPath??null):d;if(f.length!==d.length)Hs(e,(h)=>{h.$elements=f})}}}function bn(e){let t={};for(let[n,o]of Object.entries(e?.nesting??{}))if(n!=="_root")t[n]=o?.inline===!0;for(let n of e?.inline??[])t[n]=!1;return t}var ke=new WeakMap,g=new Set,z=0,ae=new Map,An=-1,$n=0,ar=600;function oC(e){return An===e&&Date.now()-$n<=ar}var wn=0,In=new Set;function sr(e,t){let n;try{n=new URL(e,t.iframe.src||fm())}catch{return}if(!["http:","https:","mailto:","tel:"].includes(n.protocol))return;let o=n.href,r=ex();if(r){r(o);return}window.open(o,"_blank","noopener,noreferrer")}function rC(e){In.add(e)}function lr(e){return In.delete(e)}var L=new Map,Z=new Map,se=new Map,cr=300;function sC(e,t,n,o=cr){let r=null;for(let a of g){if(!a.iframe.isConnected){g.delete(a);continue}if(a.ready&&!a.stylebook&&e!==null&&a.tabId===e){r=a;break}}if(!r)return Promise.resolve(null);wn+=1;let i=wn,s=JSON.parse(JSON.stringify(t));return r.channel.post({contextPath:n?[...n]:null,exprs:s,gen:r.lastRenderedGen,kind:"evalExpr",reqId:i}),new Promise((a)=>{let l=setTimeout(()=>{L.delete(i),Z.delete(i),a(null)},o);Z.set(i,r),L.set(i,(c)=>{clearTimeout(l),Z.delete(i),a(c)})})}var Cn=0,X=new Map,dr=250;function aC(e,t=dr){let n=[];for(let o of g){if(!o.iframe.isConnected){g.delete(o);continue}if(o.ready&&!o.stylebook&&e!==null&&o.tabId===e)n.push(o)}if(n.length===0)return Promise.resolve();return new Promise((o)=>{let r=n.length,i=setTimeout(()=>{for(let l of a)X.delete(l),se.delete(l);o()},t),s=()=>{if(r-=1,r===0)clearTimeout(i),o()},a=[];for(let l of n){Cn+=1;let c=Cn;a.push(c),X.set(c,s),se.set(c,l),l.channel.post({kind:"flushEdits",reqId:c})}})}function lC(e){return ke.get(e)??null}function am(e){for(let t of g){if(!t.iframe.isConnected)continue;let n=Oe(t.iframe);if(e.x>=n.left&&e.x<=n.right&&e.y>=n.top&&e.y<=n.bottom)return t}return null}function lm(e,t,n){z+=1,ae.set(z,n);let o=t.type==="tree-node"?{path:[...t.path],type:"tree-node"}:{type:t.type};return e.channel.post({dragSeq:z,gen:e.lastRenderedGen,kind:"dragStart",src:o}),z}function mx(){return z}function Wa(e){let t=Oe(e.iframe),n=e.iframe.clientWidth>0?t.width/e.iframe.clientWidth:1;return{rect:t,scale:n}}function Dn(e){if(e.stylebook)return"stylebook";return e.tabId??"unbound"}function cC(){let e=[];for(let t of g){if(!t.iframe.isConnected){g.delete(t);continue}let n=`canvas[${Dn(t)}]`;if(!t.ready){e.push(`${n}: frame has not handshaked`);continue}let o=[...t.pendingTabIds.keys()];if(o.length>0)e.push(`${n}: gen ${o.join(", ")} unacked`);if(t.pendingPatches>0)e.push(`${n}: ${t.pendingPatches} unacked patch(es)`);if(t.pendingMeasures.size>0)e.push(`${n}: ${t.pendingMeasures.size} measure(s) in flight`);let{idle:r}=t;if(!r){e.push(`${n}: no quiescence report yet`);continue}if(r.gen!==t.lastRenderedGen)e.push(`${n}: quiescence is for gen ${r.gen}, DOM is gen ${t.lastRenderedGen}`);if(!r.fonts)e.push(`${n}: fonts still loading`);if(r.animations>0)e.push(`${n}: ${r.animations} running animation(s)`);if(r.images>0)e.push(`${n}: ${r.images} pending image retry(ies)`)}if(L.size>0)e.push(`canvas: ${L.size} expression eval(s) in flight`);return e}var pr=500,fr=2,mr=40;function Jn(){let e=u.value?.id??null,t=null;for(let n of g){if(!n.iframe.isConnected){g.delete(n);continue}if(!n.ready||n.stylebook)continue;if(n.tabId===e)return n;t??=n}return t}function vr(e,t){let{rect:n,scale:o}=Wa(e),r=n.left+t.x*o,i=n.top+t.y*o,s=t.width*o,a=t.height*o;return{height:a,left:r,top:i,width:s,x:r+s/2,y:i+a/2}}function Re(e,t){return new Promise((n)=>{e.selReqId+=1;let o=e.selReqId,r=setTimeout(()=>{e.pendingMeasures.delete(o),n(null)},pr);e.pendingMeasures.set(o,(i)=>{clearTimeout(r);let[s]=i;n(s?vr(e,s.rect):null)}),e.channel.post({kind:"measure",paths:[[...t]],reqId:o})})}function dC(e){let t=Jn();return t?Re(t,e):Promise.resolve(null)}function yr(e){return new Promise((t)=>{let n=Number.NaN,o=0,r=0,i=()=>{let{top:s}=Oe(e.iframe);if(o=s===n?o+1:0,n=s,r+=1,o>=fr||r>=mr){t();return}requestAnimationFrame(i)};requestAnimationFrame(i)})}async function cm(e){let t=Jn();return t?o$(t,e):null}async function o$(e,t){let n=await Re(e,t);if(!n)return null;let o=_(e.canvasEl)?.surface;return Fb({height:n.height,top:n.top},o),await yr(e),Re(e,t)}function y$(e,t){let n=lC(e);return n?Re(n,t):Promise.resolve(null)}function br(e){let t=e.canvasEl.parentElement;if(!t)return;let n=/scale\(([\d.]+)\)/.exec(e.canvasEl.style.transform),o=n?Number(n[1]):1;t.style.height=o===1?"":`${e.iframe.offsetHeight*o}px`}function Ln(e){if(e.preview){e.iframe.style.height="100%",e.iframe.style.minHeight="0px";return}if(e.contentHeight===null)return;e.iframe.style.height=`${e.contentHeight}px`,e.iframe.style.minHeight=e.contentFragment?"0px":"480px",br(e)}function gt(e,t){if(e.preview=t,e.overlay.setSuppressed(t),t)e.pendingEnterEdit=null;Ln(e)}function uC(e,t){gt(yt(e),t)}function $l(e,t){if(!e.iframe.isConnected)return;e.channel.post(t)}function Bb(e){ae.delete(e)}function zb(e){e.overlay.setDropIndicator(null)}var jn=null;function hC(e){jn=e}var xr=300,qn=null;function pC(e){qn=e}var vt=null;function fC(e){vt=e}function wr(e,t,n){if((t?Cr(t.tagName):!1)&&t){e.overlay.setDropIndicator(null),e.overlay.setReplaceTarget(M(t.rect));return}e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(n?M(n.referenceRect):null,n?.edge)}function Pn(e){e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(null)}function Cr(e){return e==="img"||e==="video"||e==="source"}function Pr(e,t){if(e.dataset.jxGutterDrop==="1")return;e.dataset.jxGutterDrop="1",e.addEventListener("dragover",(n)=>{if(![...n.dataTransfer?.types??[]].includes("Files"))return;if(n.preventDefault(),n.dataTransfer)n.dataTransfer.dropEffect="copy"}),e.addEventListener("drop",(n)=>{let o=n.dataTransfer?.files,r=t();if(!o?.length||!r||r.stylebook)return;n.preventDefault(),vt?.(P(r),[...o],null,null)})}var Te=null;function mC(e){Te=e}var Me=null;function gC(e){Me=e}var Fn=null;function bC(e){Fn=e}function Sn(e,t){let n=[...t];for(;;){let o=e.get(Rl(n));if(o)return o;if(n.length<2)return null;n=n.slice(0,-2)}}var S=null;function vC(){let e=S;return Boolean(e?.editing&&e.iframe.isConnected)}var Ne=null;function yC(e){Ne=e}var mt=null;function wC(e){mt=e}var En=null,Wn=null;function xC(e){Wn=e}function _C(e,t){for(let n of g){if(!n.iframe.isConnected){g.delete(n);continue}if(n.ready&&n.tabId===e.id&&!n.preview)n.popoverOpen=t,n.channel.post({kind:"setPopoverOpen",path:t})}}function CC(e,t){for(let n of g){if(!n.iframe.isConnected){g.delete(n);continue}if(n.ready&&n.tabId===e.id&&!n.preview)n.dialogOpen=t,n.channel.post({kind:"setDialogOpen",path:t})}}function gx(e,t){let n=0;for(let o of g){if(!o.iframe.isConnected){g.delete(o);continue}if(o.ready&&o.tabId===t){let r=_(o.canvasEl)?.surface;if(!r){Nb("host-stage-unresolved");continue}let i=r.renderGeneration,s=Ae?.host===o?Ae.paths:void 0;$e(o),o.channel.post(s?{echoPaths:s,forwardOps:e,gen:i,kind:"patch"}:{forwardOps:e,gen:i,kind:"patch"}),o.pendingPatches+=1,n+=1}}return n}var Ae=null,Sr=0;function Tn(e,t,n){Ae={host:e,paths:t};try{n()}finally{Ae=null}}var dt=null,pt=null;function Er(e,t,n){return!e&&t===n}function Tr(e,t){let n=P(e);if(!n)return;let o=K(n.doc.document,t);if(!o)return;gx([{key:"$props",op:"set-key",path:t,value:o.$props}],n.id)}function P(e){return e.tabId?m.tabs.get(e.tabId)??null:null}function kC(e){return P(e)}function Pe(e){let t=_(e.canvasEl)?.surface.paneId;if(t)$r(t)}var Mr=Object.freeze([]);function Nr(){let e=new Map;for(let t of m.panes){let n=t.activeTabId?m.tabs.get(t.activeTabId):null;if(!n)continue;let o=n.session.selection??[];o.map((r)=>r.join("/")).join("|"),e.set(n.id,o)}return e}function kr(){if(En)return;let e=ge(!0);e.run(()=>{Q(()=>{let t=Nr();y.stylebook.selection;for(let n of g)Ie(n,(n.tabId?t.get(n.tabId):null)??Mr)})}),En={stop:()=>e.stop()}}function $e(e){if(!e.ready)return;let t=$d();if(t===e.postedVersions)return;if(e.postedVersions===null&&Object.keys(t).length===0){e.postedVersions=t;return}e.postedVersions=t,e.channel.post({kind:"assetVersions",versions:t})}var Mn=!1,ft=!1;function Rr(){if(Mn)return;Mn=!0,ge(!0).run(()=>{Q(()=>{if(BC.value,ft)return;ft=!0,queueMicrotask(()=>{ft=!1,Or()})})})}function Or(){for(let e of g){if(!e.iframe.isConnected){g.delete(e);continue}$e(e)}}var Nn=!1,Ee=null;function Ar(){if(Nn)return;Nn=!0,ge(!0).run(()=>{Q(()=>{for(let t of m.panes){let n=t.activeTabId?m.tabs.get(t.activeTabId):null;if(!n)continue;let{peers:o}=xn(n);o.map((r)=>JSON.stringify(r.state.structuralSelection??null)).join("|")}if(Ee)clearTimeout(Ee);Ee=setTimeout(()=>{Ee=null;for(let t of g)Vn(t)},100)})})}function Vn(e){if(e.stylebook||!e.ready||!e.iframe.isConnected)return;let t=P(e),n=t?xn(t).peers:[];e.presenceMeta.clear();let o=[];for(let r of n){let{structuralSelection:i}=r.state;if(!i||r.state.focusedPath!==t?.documentPath)continue;for(let s of i){let a=[...s];o.push(a),e.presenceMeta.set(JSON.stringify(a),{color:r.state.user.color,label:r.state.user.name??r.state.user.login})}}if(o.length===0){e.presenceReqId=-1,e.overlay.setPresence([]);return}e.selReqId+=1,e.presenceReqId=e.selReqId,e.channel.post({kind:"measure",paths:o,reqId:e.presenceReqId})}function Ie(e,t){if(e.stylebook){Ir(e);return}let n=Le(t);if(e.selectionPath=n,e.selectionPaths=t,!e.iframe.isConnected){g.delete(e);return}if(!n){e.coSelectionKeys.clear(),e.overlay.setSelection(null),e.overlay.setCoSelection([]);return}if(!e.ready)return;let o=ms(t.slice(0,-1));e.coSelectionKeys=new Set(o.map((r)=>JSON.stringify(r))),e.selReqId+=1,e.channel.post({kind:"measure",paths:[[...n],...o],reqId:e.selReqId})}function Ir(e){if(!e.iframe.isConnected){g.delete(e);return}let t=y.stylebook.selection,n=t?e.stylebook?.tagToCardPath.get(t):void 0;if(!t||!n){e.overlay.setSelection(null);return}if(!e.ready)return;e.selReqId+=1,e.channel.post({kind:"measure",paths:[[...n]],reqId:e.selReqId})}function kn(){return Wv("../canvas.html")}var Dr="about:blank";function Bn(e){e.channel.dispose();for(let[t,n]of L)if(Z.get(t)===e)L.delete(t),Z.delete(t),n(null);for(let[t,n]of X)if(se.get(t)===e)X.delete(t),se.delete(t),n();for(let[,t]of e.pendingMeasures)t([]);if(e.pendingMeasures.clear(),e.pendingTabIds.clear(),le(e),S===e)S=null;e.overlay.root.remove(),e.iframe.remove(),ke.delete(e.canvasEl),g.delete(e)}function Hr(){if(!We())return kn();let e=p();if(e.canvasUrl)return e.canvasUrl;return e.canvasUrlDeferred?Dr:kn()}function dm(e){let t=0;for(let n of new Set(g))if(e.contains(n.canvasEl))Bn(n),t+=1;return t}function yt(e){let t=Hr(),n=ke.get(e);if(n){if(n.canvasUrl===t)return n;Bn(n)}let o=location.origin,r=crypto.randomUUID(),i=new URL(t,location.href).origin,s=document.createElement("iframe");s.className="jx-canvas-iframe",s.title="Canvas — live page render",s.style.cssText="width:100%;min-height:480px;height:100%;border:0;display:block;background:#fff";let a=new URL(t,location.href);if(a.searchParams.set("token",r),location.protocol==="http:"||location.protocol==="https:")a.searchParams.set("parentOrigin",o);if(s.src=i===o?`${a.pathname}${a.search}`:a.href,!e.style.position)e.style.position="relative";let l=zt(document);e.replaceChildren(s,l.root),Pr(e,()=>lC(e));let c=xt({acceptOrigin:i,source:window,target:{postMessage:(f,h)=>s.contentWindow?.postMessage(f,h)},targetOrigin:i,token:r}),d={canvasEl:e,canvasUrl:t,channel:c,contentFragment:!1,contentHeight:null,hiddenPaths:new Set,popoverOpen:null,dialogOpen:null,editing:!1,editingProp:null,iframe:s,insertHideTimer:null,insertHover:!1,coSelectionKeys:new Set,insertZone:null,lastRenderedGen:-1,lastSelectionRect:null,lastSnapshotSeq:0,overlay:l,panReqId:-1,pending:null,postedVersions:null,idle:null,pendingEnterEdit:null,pendingMeasures:new Map,pendingPatches:0,pendingTabIds:new Map,presenceMeta:new Map,presenceReqId:-1,preview:!1,ready:!1,selectionPath:null,selectionPaths:[],selReqId:0,snapshot:null,stylebook:null,tabId:null};return l.insertButton.addEventListener("click",(f)=>jr(d,f)),l.insertButton.addEventListener("mouseenter",()=>{d.insertHover=!0,le(d)}),l.insertButton.addEventListener("mouseleave",()=>{d.insertHover=!1,Kn(d)}),c.onMessage((f)=>Fr(d,f)),ke.set(e,d),g.add(d),kr(),Ar(),Rr(),d}function Lr(e,t){le(e),e.insertZone=t,e.overlay.setInsertZone(M(t.rect),t.edge)}function zn(e){le(e),e.insertZone=null,e.insertHover=!1,e.overlay.setInsertZone(null)}function _r(e){let t=e.overlay.insertButton;return e.insertHover||typeof t.matches==="function"&&t.matches(":hover")}function Kn(e){le(e),e.insertHideTimer=setTimeout(()=>{if(e.insertHideTimer=null,_r(e))return;zn(e)},xr)}function le(e){if(e.insertHideTimer!==null)clearTimeout(e.insertHideTimer),e.insertHideTimer=null}function jr(e,t){t.stopPropagation(),t.preventDefault();let n=e.insertZone;if(!n)return;qn?.(e.overlay.insertButton,n)}var qr=new Set(["contextMenu","dragOver","dropResult","editCommit","editCommitProp","editInsert","editMerge","editRangeReplace","editSplit","editStart","fileDragOver","fileDrop","hit","hover","insertZones","layoutHit","nativeDragEnter"]);function Fr(e,t){if(e.preview&&qr.has(t.kind))return;switch(t.kind){case"ready":{e.ready=!0;let n=bt?.();if(n)e.channel.post({chords:n.chords,kind:"keymap",mac:n.mac});if(e.postedVersions=null,$e(e),e.pending)e.channel.post(e.pending),e.pending=null;Ie(e,e.selectionPaths);return}case"paneFocus":{Pe(e),mt?.();return}case"popoverTargetClick":{let n=P(e);if(!n||e.preview)return;let o=JSON.stringify(n.session.ui.openPopover)===JSON.stringify(t.targetPath),r=t.action==="show"||t.action==="toggle"&&!o;if(r||o)ne()?.run("canvas.setPopoverOpen",{open:r,path:t.targetPath});return}case"commandTargetClick":{let n=P(e);if(!n||e.preview)return;let o=(i)=>JSON.stringify(i)===JSON.stringify(t.targetPath),r=K(n.doc.document,t.targetPath);if(!r||typeof r!=="object")return;if(Ze.has(t.command)){if(!Gs(r))return;let i=t.command==="show-popover"||t.command==="toggle-popover"&&!o(n.session.ui.openPopover);if(i||o(n.session.ui.openPopover))ne()?.run("canvas.setPopoverOpen",{open:i,path:t.targetPath})}else if(Ge.has(t.command)){if(!H(r))return;let i=t.command==="show-modal";if(i||o(n.session.ui.openDialog))ne()?.run("canvas.setDialogOpen",{open:i,path:t.targetPath})}return}case"hit":{Pe(e),mt?.(),PC(null);let n=null,o=_(e.canvasEl)?.panel;if(o?.mediaName&&!o.mediaName.startsWith("git-diff")){n=me(o.mediaName);let i=P(e);if(i)i.session.ui.activeMedia=n}if(Me?.dismiss(),e.stylebook){let i=Sn(e.stylebook.pathToTag,t.hit.path);if(Fn?.(i,n),i){let s=M(t.hit.rect);e.overlay.setSelection(s,`<${i}>`),e.lastSelectionRect=s}else e.overlay.setSelection(null);return}e.selectionPath=t.hit.path,e.selectionPaths=[t.hit.path];let r=P(e);if(r)r.session.selection=t.additive?hv(r.session.selection,t.hit.path):[t.hit.path];{let i=M(t.hit.rect);e.overlay.setSelection(i),e.lastSelectionRect=i}return}case"layoutHit":{if(e.stylebook)return;Pe(e),Me?.dismiss(),PC(t.hit),e.selectionPath=null,e.selectionPaths=[];let n=P(e);if(n)n.session.selection=[];let o=M(t.hit.rect);e.overlay.setSelection(o,`LAYOUT · ${t.hit.layoutFile}`),e.lastSelectionRect=o,Ai("rightPanel");return}case"hover":{if(e.stylebook){let n=t.hit?Sn(e.stylebook.pathToTag,t.hit.path):null,o=y.stylebook.selection;if(t.hit&&n&&n!==o)e.overlay.setHover(M(t.hit.rect));else e.overlay.setHover(null);return}zr(e,t.hit);return}case"insertZones":{if(e.stylebook)return;let n=t.zones?.[0]??null;if(n)Lr(e,n);else Kn(e);return}case"geometry":{let n=e.pendingMeasures.get(t.reqId);if(n){e.pendingMeasures.delete(t.reqId),n(t.hits);return}if(t.reqId===e.presenceReqId){e.presenceReqId=-1;let o=[];for(let r of t.hits){let i=e.presenceMeta.get(JSON.stringify(r.path));if(i)o.push({...i,placement:M(r.rect)})}e.overlay.setPresence(o);return}if(t.reqId===e.panReqId){e.panReqId=-1;let[o]=t.hits;if(o){let{rect:r,scale:i}=Wa(e);Fb({height:o.rect.height*i,top:o.rect.y*i+r.top})}return}if(t.reqId===e.selReqId){let o=JSON.stringify(e.selectionPath),r=[],i=null;if(e.stylebook){let[a]=t.hits;i=a?M(a.rect):null}else for(let a of t.hits){let l=JSON.stringify(a.path);if(l===o)i=M(a.rect);else if(e.coSelectionKeys.has(l))r.push(M(a.rect))}let s=e.stylebook?y.stylebook.selection:null;e.overlay.setSelection(i,s?`<${s}>`:null),e.overlay.setCoSelection(r),e.lastSelectionRect=i,e.hiddenPaths=new Set((t.hidden??[]).map((a)=>JSON.stringify(a)))}return}case"evalResult":{let n=L.get(t.reqId);if(!n)return;L.delete(t.reqId),Z.delete(t.reqId),n(t.gen===e.lastRenderedGen?t.results:null);return}case"renderComplete":{if(e.pendingTabIds.has(t.gen))e.tabId=e.pendingTabIds.get(t.gen)??null;for(let n of e.pendingTabIds.keys())if(n<=t.gen)e.pendingTabIds.delete(n);Rn(e,t.gen);return}case"patchComplete":{e.pendingPatches=Math.max(0,e.pendingPatches-1),Rn(e,t.gen);return}case"idle":{e.idle={animations:t.animations,fonts:t.fonts,gen:t.gen,images:t.images};return}case"renderError":{e.pendingTabIds.delete(t.gen);let n=P(e);if(n)n.session.canvas.refreshing=!1,Ai("leftPanel");k.error("The page could not be rendered.",{detail:t.message,key:`canvas.render:${Dn(e)}`,source:"Canvas"});return}case"dataScope":{if(t.gen!==e.lastRenderedGen)return;let n=P(e);if(n)n.session.canvas.scope=t.scope,n.session.canvas.refreshing=!1;Ai("leftPanel");return}case"contentHeight":{e.contentHeight=t.height,e.contentFragment=t.fragment,Ln(e);return}case"dragOver":{if(t.dragSeq!==z)return;if(t.cursor)An=t.dragSeq,$n=Date.now();if(t.gen!==e.lastRenderedGen)return;if(t.preview)e.overlay.setDropIndicator(M(t.preview.referenceRect),t.preview.edge);else e.overlay.setDropIndicator(null);if(t.cursor){let n=Wa(e);px(t.cursor.x*n.scale+n.rect.left,t.cursor.y*n.scale+n.rect.top)}return}case"nativeDragEnter":{if(e.stylebook)return;jn?.(e);return}case"dragEnd":{e.overlay.setDropIndicator(null),Cd(),ae.delete(t.dragSeq);return}case"dropResult":{if(t.dragSeq!==z||t.gen!==e.lastRenderedGen)return;if(t.instruction&&t.targetPath){let n=ae.get(t.dragSeq);if(n)sm(P(e),{type:t.instruction},n,t.targetPath)}ae.delete(t.dragSeq),e.overlay.setDropIndicator(null),Cd();return}case"fileDragOver":{if(e.stylebook)return;wr(e,t.hit,t.preview);return}case"fileDragLeave":{Pn(e);return}case"fileDrop":{if(Pn(e),e.stylebook)return;vt?.(P(e),t.files,t.hit,t.preview);return}case"patchError":{e.pendingPatches=Math.max(0,e.pendingPatches-1);let n=_(e.canvasEl)?.surface;if(n)Wn?.(n.paneId);return}case"forwardKey":{Br(t.event);return}case"forwardWheel":{Vr(e,t);return}case"editStart":{if(S&&S!==e)S.editing=!1,S.editingProp=null,S.snapshot=null;if(S=e,t.prop!==void 0&&pt===Rl(t.path))ie(e,t.path,void 0,t.prop);pt=null,Sr+=1,e.editing=!0,e.editingProp=t.prop??null,e.snapshot=null,e.lastSnapshotSeq=0,Ne?.();return}case"selectionChanged":{if(t.seq<=e.lastSnapshotSeq)return;if(e.lastSnapshotSeq=t.seq,e.snapshot=t,!e.editing)e.editing=!0,S=e;Ne?.();return}case"flushComplete":{let n=X.get(t.reqId);if(n)X.delete(t.reqId),se.delete(t.reqId),n();return}case"editCommit":{let n=()=>_t(P(e),t.path,t.children,t.textContent);if(t.inPlace)Tn(e,[t.path],n);else n();return}case"editCommitProp":{let n=()=>jt(P(e),t.path,t.prop,t.value);if(t.inPlace){Tn(e,[t.path],n),dt=Rl(t.path);return}let o=n();if(Er(o,dt,Rl(t.path)))Tr(e,t.path);dt=null,pt=o?Rl(t.path):null;return}case"editMerge":{let n=qt(P(e),t.fromPath,t.intoPath);if(n)ie(e,n.path,n.offset);return}case"editRangeReplace":{let n=Bt(P(e),t.from,t.to,t.between,t.text);if(n)ie(e,n.path,n.offset);return}case"editSplit":{ie(e,Wt(P(e),t.path,t.before,t.after));return}case"editInsert":{ie(e,Vt(P(e),t.path,t.cmd,t.commitData));return}case"slashShow":{let{rect:n,scale:o}=Wa(e),r=t.rect.x*o+n.left,i=t.rect.y*o+n.top;Te?.show({filter:t.filter,...t.showFilter===!0?{showFilter:!0}:{},onDismiss:()=>e.channel.post({kind:"slashDismissed"}),onSelect:(s)=>e.channel.post({cmd:{...s},kind:"slashSelect"}),rect:{bottom:i+t.rect.height*o,height:t.rect.height*o,left:r,top:i,width:t.rect.width*o}});return}case"slashNav":{Te?.nav(t.key);return}case"slashDismiss":{Te?.dismiss();return}case"previewNavigate":{sr(t.href,e);return}case"contextMenu":{if(e.stylebook)return;Pe(e);let{rect:n,scale:o}=Wa(e);Me?.show({clientX:t.x*o+n.left,clientY:t.y*o+n.top,path:t.path?[...t.path]:null});return}case"editEnd":{if(!e.editing)return;if(e.editing=!1,e.editingProp=null,e.snapshot=null,S===e)S=null;Ne?.();break}default:break}}function Rn(e,t){if(e.lastRenderedGen=t,Ie(e,e.selectionPaths),Vn(e),zn(e),e.pendingEnterEdit&&t>=e.pendingEnterEdit.minGen){let{offset:n,path:o,prop:r}=e.pendingEnterEdit;if(e.pendingEnterEdit=null,e.tabId!==null&&e.tabId===om(e.canvasEl)?.id)Wr(e,o,n,r)}}function ie(e,t,n,o){e.pendingEnterEdit={minGen:e.lastRenderedGen,path:[...t],...n===void 0?{}:{offset:n},...o===void 0?{}:{prop:o}}}function Wr(e,t,n,o){e.channel.post({kind:"enterEdit",path:[...t],...n===void 0?{}:{offset:n},...o===void 0?{}:{prop:o}})}function Vr(e,t){let{rect:n,scale:o}=Wa(e),r=Hl(e.canvasEl)?.wrap;if(!r)return;r.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:n.left+t.x*o,clientY:n.top+t.y*o,ctrlKey:t.ctrlKey,deltaX:t.deltaX,deltaY:t.deltaY,metaKey:t.metaKey,shiftKey:t.shiftKey}))}function Br(e){document.dispatchEvent(new KeyboardEvent("keydown",{altKey:e.altKey,bubbles:!0,cancelable:!0,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}))}function zr(e,t){if(!t||Yo(t.path,e.selectionPath)){e.overlay.setHover(null);return}e.overlay.setHover(M(t.rect))}var Ur=4,B=new Map;function Gr(e){let t=B.get(e);if(t)return B.delete(e),B.set(e,t),t;let n=new Map;B.set(e,n);for(let o of B.keys()){if(B.size<=Ur)break;B.delete(o)}return n}function Zr(e,t,n,o,r,i=null){let s=Gr(e),a=o?.id??null,l=s.get(t);if(l&&l.tabId===n&&l.viewTabId===a&&l.mode===i)return l.payload;let c=lr(r),d=ix(At,async()=>{xo.renderPreparations+=1;let f=await kt(t,o,i),h=JSON.parse(JSON.stringify(f.renderDoc)),b=JSON.parse(JSON.stringify(t)),T=n?m.tabs.get(n)??null:null,R=wi(T?.doc.sourceFormat)?.studio?.elements,O=R?bn(R):void 0;return{assets:f.assets,doc:h,docBase:f.docBase??`${fm()}/`,mapperCtx:f.mapperCtx,mode:f.mapperCtx.canvasMode,shadowDoc:b,siteStyle:f.siteStyle,...O?{editableTags:O}:{},...c?{allowAutoRequests:!0}:{}}});return s.set(t,{mode:i,payload:d,tabId:n,viewTabId:a}),d}async function SC(e,t,n,o,r=null,i=om(n),s=null,a=null){let l=yt(n);l.pendingTabIds.set(e,r),l.stylebook=null,l.iframe.style.width=o?`${o}px`:"100%";let d={...await Zr(e,t,r,i,Db(n),s),colorScheme:Gn(i),...a?{diffMarks:a}:{},gen:e,kind:"render",popoverOpen:i?.session.ui.openPopover??null,dialogOpen:i?.session.ui.openDialog??null};l.popoverOpen=d.popoverOpen??null,l.dialogOpen=d.dialogOpen??null,gt(l,d.mode==="preview"),Un(l,d)}function Un(e,t){if(xo.hostRenderPosts+=1,e.ready)$e(e),e.channel.post(t);else e.pending=t}function EC(e,t,n,o){let r=yt(n);r.pendingTabIds.set(e,null),r.stylebook={pathToTag:t.pathToTag,tagToCardPath:t.tagToCardPath},gt(r,!1),r.pendingEnterEdit=null,r.iframe.style.width=o?`${o}px`:"100%";let i=JSON.parse(JSON.stringify(t.doc)),s=JSON.parse(JSON.stringify(t.doc)),a={assets:null,colorScheme:Gn(om(n)),doc:i,docBase:`${fm()}/`,gen:e,kind:"render",mapperCtx:{arrayPaths:[],canvasMode:"stylebook",layoutWrapped:!1,pageContentOffset:null,pageContentPrefix:null},mode:"stylebook",shadowDoc:s,siteStyle:null};Un(r,a)}function Gn(e){let t=e?.session.ui.previewColorScheme;return t==="light"||t==="dark"?t:null}function TC(e,t){for(let n of g){if(!n.iframe.isConnected){g.delete(n);continue}if(t&&!t.contains(n.iframe))continue;if(n.ready)n.channel.post({kind:"setColorScheme",scheme:e})}}function LC(e,t){let n=vL(e);for(let o of g){if(!o.iframe.isConnected){g.delete(o);continue}if(t&&!t.contains(o.iframe))continue;if(o.ready)o.channel.post({dir:n,kind:"setLocale",locale:e})}}function IC(e,t){let n=JSON.parse(JSON.stringify(e)),o=0;for(let r of g){if(!r.iframe.isConnected){g.delete(r);continue}if(r.ready)r.channel.post({base:t,doc:n,kind:"redefineElement"}),o+=1}return o}function RC(){let e=D?.projectConfig;if(!e)return;let t=JSON.parse(JSON.stringify(e.style??null)),n=JSON.parse(JSON.stringify(e.$media??{}));for(let o of g){if(!o.iframe.isConnected){g.delete(o);continue}if(o.ready&&!o.stylebook)o.channel.post({kind:"siteStyleUpdate",media:n,siteStyle:t})}}function Wb(e){let t=0,n=JSON.parse(JSON.stringify(e));for(let o of g){if(!o.iframe.isConnected){g.delete(o);continue}if(o.ready&&o.stylebook)o.channel.post({gen:o.lastRenderedGen,kind:"styleUpdate",style:n}),t+=1,Ie(o,o.selectionPaths)}return t}function $C(e){let t=Zn();if(!t?.stylebook||!t.ready)return;let n=t.stylebook.tagToCardPath.get(e);if(!n)return;t.selReqId+=1,t.panReqId=t.selReqId,t.channel.post({kind:"measure",paths:[[...n]],reqId:t.selReqId})}function Va(){let e=S;if(!e||!e.iframe.isConnected)return{editing:!1,editingProp:null,snapshot:null};return{editing:e.editing,editingProp:e.editingProp,snapshot:e.snapshot}}var bt=null;function DC(e,t){bt=e,t?.(()=>On()),On()}function On(){let e=bt?.();if(!e)return;for(let t of g){if(!t.iframe.isConnected){g.delete(t);continue}if(t.ready)t.channel.post({chords:e.chords,kind:"keymap",mac:e.mac})}}function kd(e){let t=S;if(!t||!t.ready)return;t.channel.post({intent:e,kind:"applyFormat"})}function AC(){let e=S;if(!e||!e.ready)return;e.channel.post({kind:"openSlash"})}function Vb(){let e=S;if(e?.editing&&e.ready&&e.iframe.isConnected)e.channel.post({kind:"endEdit"})}function Zn(){let e=Ut();return e?lC(e.canvas):null}function bx(){let e=S,t=e??Zn();if(!t)return null;let{rect:n,scale:o}=Wa(t),r=t===e?t.snapshot?.rect:null;if(r)return{height:r.height*o,left:r.x*o+n.left,top:r.y*o+n.top,width:r.width*o};if(t.lastSelectionRect)return{height:t.lastSelectionRect.height*o,left:t.lastSelectionRect.left*o+n.left,top:t.lastSelectionRect.top*o+n.top,width:t.lastSelectionRect.width*o};return null}
2
- export{Uo,lt,ur,Qw,Ll,wo,Ou,Db,om,wT,ex,Ab,Il,xT,_T,CT,tx,kT,ST,ET,TT,xo,Nb,nx,ix,bi,wd,LT,Rl,xd,IT,ox,RT,Ob,$T,Mb,Mu,hr,DT,dp,AT,NT,rx,OT,sx,MT,ax,J1,Y1,lx,cx,Pu,PT,FT,Pb,us,_d,Fu,jT,HT,dx,Z1,BT,ux,hx,zT,Fb,WT,X1,Q1,eC,VT,jb,tC,px,Cd,xc,Hb,ju,nC,rm,iC,UT,qT,fx,GT,KT,JT,sm,oC,rC,sC,aC,lC,am,lm,mx,Wa,cC,dC,cm,o$,y$,uC,$l,Bb,zb,hC,pC,fC,mC,gC,bC,vC,yC,wC,xC,_C,CC,gx,kC,dm,SC,EC,TC,LC,IC,RC,Wb,$C,Va,DC,kd,AC,Vb,bx};
3
-
4
- //# debugId=A8F0F175AC0697EC64756E2164756E21
5
- //# sourceMappingURL=studio-47y6fbpf.js.map
@@ -1,5 +0,0 @@
1
- import{te}from"./studio-ery42sqr.js";import{p,We}from"./studio-qpqa7vk3.js";import{k}from"./studio-vzacdfsc.js";import{u}from"./studio-3aey7dd3.js";import{Op,di,Mv}from"./studio-g7nse7zb.js";import{Ir,bm,bL}from"./studio-3bpdkq2s.js";import{jC,nv,Sx,HC,gm}from"./studio-grawhey1.js";import{D}from"./studio-wgh5kxpj.js";var Nl=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),Id=new Set([...Nl,".mp4",".webm",".mp3",".wav",".ogg",".pdf",".woff",".woff2",".ttf",".otf"]);function m(e){let t=["B","KB","MB","GB"],n=e,r=0;while(n>=1024&&r<t.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${t[r]}`}var h=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function Cc(){return(We()?p().assetCapabilities?.accept:void 0)??h}function Gi(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function tv(e){return Nl.has(e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`)}function pm(e){return Id.has(Gi(e))}var x=new Set([".mp4",".webm",".mov",".m4v"]),w=new Set([".mp3",".wav",".ogg",".m4a",".flac"]);function hp(e){let t=e.type??"";if(t.startsWith("image/"))return"image";if(t.startsWith("video/"))return"video";if(t.startsWith("audio/"))return"audio";let n=Gi(e.name);if(Nl.has(n))return"image";if(x.has(n))return"video";if(w.has(n))return"audio";return"file"}var S=/^content\/([^/]+)\//;function v(e){let t=e?S.exec(e.replaceAll("\\","/")):null;return t?`content/${t[1]}/images`:"public"}function A(e){let t=e.replaceAll("\\","/");if(t.startsWith("public/"))return t.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(t);if(n)return`./${n[1]}`;return`./${t}`}function b(e,t){if(!t.has(e))return e;let n=Gi(e),r=n?e.slice(0,-n.length):e;for(let i=1;;i++){let s=`${r}-${i}${n}`;if(!t.has(s))return s}}function y(e,t){let n=e.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?t:`${n}/${t}`}var g=null;function fL(e){g=e}async function Ua(e,t={}){let n=[...e];if(n.length===0)return[];let r=p(),i=t.dir??v(u.value?.documentPath??null),s;try{let o=await Ir(()=>r.listDirectory(i));s=new Set(o.map((c)=>c.name))}catch{s=new Set}let f=We()?p().assetCapabilities?.maxUploadBytes:void 0,a=[];for(let o of n){if(f!==void 0&&o.size>f){k.error(`${o.name} is too large.`,{detail:`This backend accepts at most ${m(f)}; that file is ${m(o.size)}.`,source:"Media"});continue}let c=b(o.name,s);s.add(c);let d=y(i,c);try{let{path:l}=await r.uploadFile(d,o);bm([l]),a.push({kind:hp(o),name:c,path:l,ref:A(l)})}catch(l){k.error(`Could not upload ${o.name}.`,{detail:te(l),path:d,source:"Media"})}}if(a.length>0)k.success(a.length===1?`Uploaded ${a[0].name} to ${i}/`:`Uploaded ${a.length} files to ${i}/`),await g?.(i);return a}function mL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)}function gL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?".":t.slice(0,n)}function E(){return D?.projectConfig?.content??null}function C(e){return nv(e,E(),HC())}function I(e,t){return`${di(t.urlPrefix)}/${e.slice(t.dir.length+1)}`}function Rd(e){let t=di(e);if(t.startsWith(`${Op}/`))return`/${t.slice(Op.length+1)}`;let n=C(t);return n?`/${I(t,n)}`:`/${t}`}function zu(e){let t=di(e);if(t==="")return e;let{space:n,fileBaseUrl:r}=gm();if(n==="repo")return jC(`${r}${Mv(t)}`,bL(t));return Sx(Rd(t))}
2
- export{Nl,Id,Cc,Gi,tv,pm,hp,fL,Ua,mL,gL,Rd,zu};
3
-
4
- //# debugId=E6B8E9DB1DEA689464756E2164756E21
5
- //# sourceMappingURL=studio-4m3826v2.js.map
@@ -1,4 +0,0 @@
1
- var e=new Map,r=new Set;function o(){for(let t of r)t()}function Ha(){o()}function ub(t){return r.add(t),()=>{r.delete(t)}}function cs(t){e.set(t.key,t),o()}function C1(t){if(e.delete(t))o()}function Uf(){return[...e.values()].toSorted((t,s)=>t.order-s.order)}function Iw(){return Uf().map((t)=>t.key)}function Rw(t){return e.get(t)}var i=null,n="overview";function hb(){if(i!==null&&e.has(i))return n=i,i=null,n;if(e.has(n))return n;return Iw()[0]??n}function pb(t){if(e.has(t))n=t,i=null;else i=t;o()}export{Ha,ub,cs,C1,Uf,Iw,Rw,hb,pb};
2
-
3
- //# debugId=FD1254E4AB8C0BA764756E2164756E21
4
- //# sourceMappingURL=studio-4nx2dj1g.js.map
@@ -1,9 +0,0 @@
1
- import{Dv}from"./studio-geq1ea6k.js";import{v}from"./studio-vzacdfsc.js";import{Ol,kv,u}from"./studio-3aey7dd3.js";import{Di,qo,y}from"./studio-q1h883bt.js";import{st}from"./studio-vk9ezads.js";import{lt,bi,Rl,Mu,hr,EC,$C}from"./studio-47y6fbpf.js";import{D,Ic}from"./studio-wgh5kxpj.js";import{T,R}from"./studio-e7xxa0sj.js";import{me}from"./studio-v2bvmbjj.js";var Gg={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
2
- // to describe units of markup that
3
- // when composed together, form the
4
- // content or layout of a page.
5
- registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Vg(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if(Dv(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Rl(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Rl(p),a),o.set(Rl([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Rl(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Vg(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var Ug="Project Styles",US="stylebook",ew=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function B_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=ew.find((n)=>n.id===o);return kv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:B_(t),name:t,value:n})}return o}function qS(e){let o=U(e);return ew.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function GS(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=hr(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Mu(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function qg(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function z_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function KS(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&qg(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${Ug} catalogue`,title:Ug},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function JS(e,o){let t=e.wrap,n=lt(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Di(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=hr(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:bi("--"),name:"base",width:g});for(let l of d)S.push({displayName:bi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${bi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:st,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:qo(n?.doc.document?.style),filter:r,meta:Gg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),EC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function xu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Ic(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)$C(e)}var Q=8,tw=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function nw(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Ol(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Yh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("7wns8kf1"),import("./convert-to-repeater-7wns8kf1.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return tw.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
6
- export{Vg,Ug,US,ew,B_,qS,GS,qg,z_,KS,Gg,JS,xu,tw,nw,Yh};
7
-
8
- //# debugId=5EDF225B11B8A82B64756E2164756E21
9
- //# sourceMappingURL=studio-4xv5s47r.js.map
@@ -1,5 +0,0 @@
1
- import{p,We}from"./studio-qpqa7vk3.js";import{k}from"./studio-vzacdfsc.js";function h(e){return e.trim().replace(/\/+$/,"")}function u(e){return e.trim()}var _t={aiBaseUrl:{default:"",key:"jx.ai.baseUrl",normalize:h,scope:"user"},aiOpenAiKey:{default:"",key:"jx.ai.openaiKey",normalize:u,scope:"user",secret:!0},aiModel:{default:"gpt-4o",key:"jx.ai.model",normalize:u,scope:"user"},keybindings:{default:"",key:"jx.keybindings",normalize:(e)=>e.trim()==="{}"?"":e.trim(),scope:"user"},theme:{default:"",key:"jx-studio-theme",normalize:u,scope:"user"},showIgnoredFiles:{default:"",key:"jx.files.showIgnored",normalize:u,scope:"user"},cfAccountId:{default:"",key:"jx.cf.accountId",normalize:u,scope:"user"},cfToken:{default:"",key:"jx.cf.token",normalize:u,scope:"user",secret:!0}},S=Object.values(_t),l=S.filter((e)=>e.scope==="user"),P=l.map((e)=>e.key);function y(e){let t=e.schedule??queueMicrotask,n=null,i=Promise.resolve(),r=Promise.resolve();function s(){let o=n;if(n=null,!o)return i;return i=i.then(()=>e.send(o)).catch((a)=>{e.onError?.(a,o)}),i}return{enqueue(o){if(n){Object.assign(n,o);return}n={...o},r=new Promise((a)=>{t(()=>{s().then(a)})})},settled(){return r}}}var c=new Map;function v(e,t){try{if(t===null)globalThis.localStorage?.removeItem(e);else globalThis.localStorage?.setItem(e,t)}catch{}}try{for(let e of S){let t=globalThis.localStorage?.getItem(e.key);if(t!==null&&t!==void 0)c.set(e.key,t)}}catch{}function Lr(e){return c.get(e.key)??""}function cL(e){return(c.get(e.key)??"")!==""}var m=new Set;function Qb(e){return m.add(e),()=>{m.delete(e)}}function f(e){for(let t of m)t(e)}var g=y({onError(e){k("error","Your settings could not be saved.",{detail:e instanceof Error?e.message:String(e),key:"settings-write",source:"Settings"})},async send(e){if(!We())return;let t=p();if(!t.patchSettings)return;let n={},i=[];for(let[r,s]of Object.entries(e))if(s)n[r]=s;else i.push(r);await t.patchSettings({remove:i,set:n})}});function dL(){return g.settled()}function d(e){let t=[];for(let[n,i]of Object.entries(e)){if((c.get(n)??null)===i)continue;if(i===null)c.delete(n);else c.set(n,i);v(n,i),t.push(n)}return t}function ev(e,t){return e.normalize?e.normalize(t):t}function qr(e,t){let n=ev(e,t),i=d({[e.key]:n});if(i.length>0)g.enqueue({[e.key]:n}),f(i)}function uL(e){let t={};for(let[i,r]of e)t[i.key]=ev(i,r);let n=d(t);if(n.length>0)g.enqueue(t),f(n)}function Bu(e){let t={};for(let i of e)t[i.key]=null;let n=d(t);if(n.length>0)g.enqueue(t),f(n)}async function hL(){if(!We())return;let e=p();if(!e.getSettings)return;let t;try{t=await e.getSettings()}catch{return}let n={},i=!1;for(let s of l){let o=t[s.key];if(o)n[s.key]=o;else if(c.get(s.key))i=!0}let r=d(n);if(r.length>0)f(r);if(i){let s={};for(let o of l){let a=c.get(o.key);if(a&&!t[o.key])s[o.key]=a}g.enqueue(s)}}function x(e){let t={};for(let i of l)t[i.key]=e[i.key]??null;let n=d(t);if(n.length>0)f(n)}function pL(){if(!We())return;p().subscribeSettings?.(x)}
2
- export{_t,Lr,cL,Qb,dL,ev,qr,uL,Bu,hL,pL};
3
-
4
- //# debugId=A77F1FEF8FA8672A64756E2164756E21
5
- //# sourceMappingURL=studio-5g4t8v6w.js.map
@@ -1,5 +0,0 @@
1
- var e=new Set;function bE(r){return e.add(r),()=>e.delete(r)}function vE(){let r=[];for(let t of e)try{let o=t();if(o)r.push(o)}catch{}return r}
2
- export{bE,vE};
3
-
4
- //# debugId=B7CA6AC50D4B03CD64756E2164756E21
5
- //# sourceMappingURL=studio-5py436sf.js.map
@@ -1,5 +0,0 @@
1
- function Xy(o){if(o===null||typeof o!=="object")return{offer:[],refused:null};let e=o;if(e.collab===!1){let t=typeof e.detail==="string"?e.detail.trim():"";return{offer:[],refused:t||"This server has collaboration disabled."}}let{protocols:r}=e;if(!Array.isArray(r)||r.length===0)return{offer:[],refused:null};if(r.includes("jx.collab.v1"))return{offer:["jx.collab.v1"],refused:null};let n=r.filter((t)=>typeof t==="string").join(", ")||"none";return{offer:[],refused:`This server speaks collab envelope ${n}; this editor speaks jx.collab.v1.`}}
2
- export{Xy};
3
-
4
- //# debugId=B08485D2E7AF80C964756E2164756E21
5
- //# sourceMappingURL=studio-77kt594t.js.map
@@ -1,10 +0,0 @@
1
- import{v}from"./studio-vzacdfsc.js";import{$o,yL,ot,Jo,Se,He,Gu,m,No,ci}from"./studio-3aey7dd3.js";import{p}from"./studio-qpqa7vk3.js";import{qt,Zt}from"./studio-tt2nactf.js";import{T,R,bs,Ct}from"./studio-e7xxa0sj.js";import{te}from"./studio-ery42sqr.js";import{Ir}from"./studio-3bpdkq2s.js";import{Ps,gc}from"./studio-skprc6ef.js";import{jw,D1,A1}from"./studio-g5fmf0c1.js";import{Id,Gi}from"./studio-4m3826v2.js";import{ds,Jf,yb,wb,Ru,Io,$u}from"./studio-qvasen3f.js";import{D}from"./studio-wgh5kxpj.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridOpen",$description:"Every grid-able source a project has, grouped by where it comes from: the project's own pages and content collections first, then each connection's tables. It is the ISLAND of a confirm dialog rather than a dialog of its own — `ui/layers.ts`'s dialog owns the headline, the cancel button, modality and focus, and this document is only the list — because a second answer to \"what is a dialog\" is a defect (studio-ui-guidelines.md §12.5). Group headings are why it is not the kit menu: a menu row can carry a divider above it and cannot carry a name for the run it opens.",tagName:"div",attributes:{part:"sources"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"280px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="group-title"]':{margin:"0",fontSize:"var(--jx-text-xs)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"1px",marginTop:"var(--jx-space-1)"},'& [part="source"]':{textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-2) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer"},'& [part="source"]:hover':{background:"var(--bg-hover)"},'& [part="source"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="group-empty"]':{margin:"0",padding:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{$description:"One origin of grid-able sources. A connection with no tables says why it has none instead of drawing an empty box — an author who has not pushed a schema yet is exactly the reader who needs the sentence.",tagName:"section",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"h3",attributes:{part:"group-title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"rows"},$switch:{$ref:"$map/item/state"},cases:{listed:{tagName:"div",attributes:{part:"rows-list",role:"none"},style:{display:"contents"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/id"},map:{tagName:"button",attributes:{part:"source",type:"button","data-source":"${$map.item.id}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.label}"}}]},empty:{tagName:"p",attributes:{part:"group-empty"},textContent:"${$map.item.emptyMessage}"}}}]}}]};T("grid-open",I);function j(e,r,t){let n=v({groups:r,open:t}),o=null,i=!1,s=R("grid-open",n,e).then((l)=>{if(i)return l.dispose(),l.root;return o=l,l.root});return{dispose(){i=!0,o?.dispose(),o=null},ready:s}}function S(){try{return p()}catch{return null}}function $w(){return typeof S()?.dataRows==="function"}async function E(){let e=S();if(typeof e?.dataConnections!=="function")return null;return e.dataConnections()}async function TE(e){let r=S();if(typeof r?.dataConnectionTest!=="function")return{error:"Connection tests are not supported by this backend",ok:!1};try{return await r.dataConnectionTest(e)}catch(t){return{error:t instanceof Error?t.message:String(t),ok:!1}}}async function k1(e){let r=S();if(typeof r?.dataPush!=="function")return{applied:!1,errors:["Schema push is not supported by this backend"],plan:[]};try{return await r.dataPush(e)}catch(t){return{applied:!1,errors:[t instanceof Error?t.message:String(t)],plan:[]}}}function C(e){let t=S()?.[e];if(t===void 0||t===null)throw Error(`The ${String(e)} surface is not supported by this backend`);return t}function x(e){return C("dataRows")(e)}function M(e){return C("dataInsertRow")(e)}function A(e){return C("dataUpdateRow")(e)}function K(e){return C("dataDeleteRow")(e)}function LE(e,r,t){let n=(s)=>s.replaceAll(/([a-z0-9])([A-Z])/g,"$1_$2").replaceAll(/[^A-Za-z0-9]+/g,"_").replaceAll(/^_+|_+$/g,"").toUpperCase(),i=[r??e,t.replace(/Env$/,"")].map((s)=>n(s)).filter(Boolean).join("_")||"SECRET";return/^\d/.test(i)?`JX_${i}`:i}function W(e){let r=[],t=[],n="",o=!1,i=!1,s=()=>{t.push(n),n="",i=!1},l=()=>{if(s(),t.length===1&&t[0]===""){t=[];return}r.push(t),t=[]};for(let a=0;a<e.length;a++){let c=e[a];if(o){if(c==='"')if(e[a+1]==='"')n+='"',a+=1;else o=!1;else n+=c;continue}if(c==='"'&&!i)o=!0,i=!0;else if(c==='"')n+=c;else if(c===",")s();else if(c===`
2
- `)l();else if(c==="\r"){if(e[a+1]===`
3
- `)a+=1;l()}else n+=c,i=!0}if(n!==""||t.length>0)l();return r}function Dw(e){let r=(e.match(/\r\n/g)??[]).length,t=(e.match(/(?<!\r)\n/g)??[]).length,n=r>t?`\r
4
- `:`
5
- `,o=e.endsWith(`
6
- `),i=W(e),s=i[0]??[],l=i.slice(1),a=Math.max(s.length,...l.map((c)=>c.length),0);while(s.length<a)s.push("");for(let c of l)while(c.length<a)c.push("");return{eol:n,headers:s,rows:l,trailingNewline:o}}function U(e){if(/[",\n\r]/.test(e))return`"${e.replaceAll('"','""')}"`;return e}function k(e){return[e.headers,...e.rows].map((t)=>t.map((n)=>U(n)).join(",")).join(e.eol)+(e.trailingNewline?e.eol:"")}var Q=["id","sku","slug","Slug"];function q(e){let r=new Set;return e.map((t,n)=>{let o=t.trim()===""?`column${n+1}`:t;if(r.has(o))o=`${o}__${n+1}`;return r.add(o),o})}function J(e,r){for(let t of Q){let n=e.indexOf(t);if(n===-1)continue;let o=r.rows.map((i)=>i[n]??"");if(o.every((i)=>i!=="")&&new Set(o).size===o.length)return t}return null}function O(e,r){let t=Dw(e),n=q(t.headers),o=J(n,t),i=o?n.indexOf(o):-1,s=t.rows.map((d,u)=>i===-1?String(u):d[i]),l=new Map(s.map((d,u)=>[d,u])),a=Gu(r,D?.projectConfig),c=a?.schema?.properties??{},y=t.rows.slice(0,50).map((d)=>{let u={};for(let[h,w]of n.entries())u[w]=d[h]??"";return u}),f=new Map(wb(y).map((d)=>[d.field,d])),g=new Map(yb(a?.schema,{idField:o??void 0}).map((d)=>[d.field,d]));return{columns:n.map((d,u)=>{let w=(d in c?g.get(d):void 0)??f.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...w,pk:d===o,title:t.headers[u]?.trim()||w.title}}),doc:t,fields:n,keys:s,keyToIndex:l,loadText:e}}function X(e,r){let t={},n=e.doc.rows[r]??[];for(let[o,i]of e.fields.entries()){let s=e.columns[o],l=n[o]??"";t[i]=s.kind==="string"||s.kind==="text"||s.kind==="readonly"?l:Ru(l,s)}return t}function _(e,r){let t=e.doc.rows.map((i)=>[...i]),n=(i)=>e.fields.indexOf(i);for(let i of r.cells){let s=e.keyToIndex.get(i.rowKey),l=n(i.field);if(s===void 0||l===-1)continue;t[s][l]=Io(i.value)}for(let i of r.inserts){let s=e.fields.map((l)=>Io(i.cells[l]??null));t.push(s)}let o=r.deletes.map((i)=>e.keyToIndex.get(i.rowKey)).filter((i)=>i!==void 0).toSorted((i,s)=>s-i);for(let i of o)t.splice(i,1);return{...e.doc,rows:t}}function N(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function Aw(e){let r=null,t=(n=!1)=>{if(!n&&r)return r;return r=p().readFile(e).then((o)=>O(o,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(n){let o=await t(),i=p(),s=null;try{s=await i.readFile(e)}catch{s=null}if(s!==o.loadText&&!gc(e))return N(n,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let l=_(o,n),a=k(l);return Ps(e),await i.writeFile(e,a),r=Promise.resolve(O(a,e)),N(n,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let n=await t(),o=n.doc.rows.map((i,s)=>({cells:X(n,s),key:n.keys[s]}));return{rows:o,total:o.length}},async serializeForSource(n){let o=await t();return k(_(o,n))}}}var Z=50;function ee(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function re(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function ne(e){if(e===null||e===void 0)return null;if(typeof e==="string"||typeof e==="number"||typeof e==="boolean")return e;return JSON.stringify(e)}function B(e,r){let t=[],n="id",o=new Map,i=(a)=>{if(a.length>0)t=a,n=a.find((c)=>c.pk)?.name??"id"},s=(a)=>({table:r,...e?{connection:e}:{},limit:a?.limit??Z,offset:a?.offset??0,...a?.orderBy?{dir:a.dir??"asc",orderBy:a.orderBy}:{}}),l=(a,c)=>{let y=a[n];if(typeof y==="string"||typeof y==="number")return o.set(String(y),y),String(y);return`row-${c}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await x(s({limit:1,offset:0}));i(a.columns)}return t.map((a)=>{let c=re(a)?ee(a.type):"readonly";return{editable:c!=="readonly",field:a.name,kind:c,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let c={cells:[],deletes:[],inserts:[]},y=new Map;for(let f of a.cells){let g=y.get(f.rowKey)??[];g.push({field:f.field,value:f.value}),y.set(f.rowKey,g)}for(let[f,g]of y){let b=o.get(f),d=(u,h)=>{for(let w of g)c.cells.push({error:h,field:w.field,ok:u,rowKey:f})};if(b===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let h of g)u[h.field]=h.value;await A({pk:b,set:u,table:r,...e?{connection:e}:{}}),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let f of a.inserts)try{let g={};for(let[h,w]of Object.entries(f.cells))if(w!==null)g[h]=w;let{row:b}=await M({table:r,values:g,...e?{connection:e}:{}}),d=b[n],u=typeof d==="string"||typeof d==="number"?String(d):void 0;if(u!==void 0&&(typeof d==="string"||typeof d==="number"))o.set(u,d);c.inserts.push({newKey:u,ok:!0,tempKey:f.tempKey})}catch(g){c.inserts.push({error:g instanceof Error?g.message:String(g),ok:!1,tempKey:f.tempKey})}for(let f of a.deletes){let g=o.get(f.rowKey);if(g===void 0){c.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:f.rowKey});continue}try{await K({pk:g,table:r,...e?{connection:e}:{}}),c.deletes.push({ok:!0,rowKey:f.rowKey})}catch(b){c.deletes.push({error:b instanceof Error?b.message:String(b),ok:!1,rowKey:f.rowKey})}}return c},id:ds({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],o.clear()},async rows(a){let c=await x(s(a));return i(c.columns),{rows:c.rows.map((f,g)=>{let b=l(f,g),d={};for(let u of t)d[u.name]=ne(f[u.name]);return{cells:d,key:b}}),total:c.total}}}}var fb=[{key:"all",label:"All"},{dir:"pages",key:"pages",label:"Pages"},{dir:"layouts",key:"layouts",label:"Layouts"},{dir:"components",key:"components",label:"Components"},{dir:"content",key:"content",label:"Content"},{dir:"public",key:"media",label:"Media"}],S1=fb.map((e)=>e.key);function Nw(e){return fb.find((r)=>r.key===e)}function E1(e){return Nw(e)?.dir}function oe(e,r){if(r&&Id.has(r))return"Media";if(e.startsWith("pages"))return"Pages";if(e.startsWith("layouts"))return"Layouts";if(e.startsWith("components"))return"Components";if(e.startsWith("content"))return"Content";if(e.startsWith("public"))return"Media";if(e.startsWith("data"))return"Content";if(e.startsWith("styles"))return"Components";return"Other"}function ie(e){let r=D?.projectConfig?.content??{};for(let[t,n]of Object.entries(r)){if(!n.source)continue;let o=n.source.replace(/^\.\//,"").replace(/\/$/,"");if(e.startsWith(`${o}/`)||e===o)return t.charAt(0).toUpperCase()+t.slice(1)}return null}var se=new Set(["node_modules",".git",".jx","dist","build",".cache"]);async function H(e,r,t,n,o){let i;try{i=await Ir(()=>r.listDirectory(e))}catch(l){n.push({dir:e,error:te(l)});return}let s=[];for(let l of i){if(l.type==="directory"){if(!se.has(l.name))s.push(l.path);continue}let a=Gi(l.name),c=oe(l.path,a);t.push({category:c,ext:a,locale:yL(l.path,o)??void 0,modified:l.modified,name:l.name,path:l.path,size:l.size,type:c==="Content"?ie(l.path)??a??"file":a||"file"})}await Promise.all(s.map((l)=>H(l,r,t,n,o)))}async function qf(e,r){let t=[],n=[],{i18n:o}=$o(D?.projectConfig??{});return await Promise.all(e.map((i)=>H(i,r,t,n,o))),t.sort((i,s)=>i.path.localeCompare(s.path)),{failures:n,files:t}}function IE(e,r){let t=e,n=Nw(r.category);if(n&&n.key!=="all")t=t.filter((s)=>s.category===n.label);let o=r.query.trim().toLowerCase();if(o)t=t.filter((s)=>s.name.toLowerCase().includes(o)||s.path.toLowerCase().includes(o));let i=r.locale?.trim();if(i)t=t.filter((s)=>s.locale===i);return t}var Gf=["table","cards","media","calendar","board"],Ow={board:"Board",calendar:"Calendar",cards:"Cards",media:"Media",table:"Table"};var RE=new Set(["cards","media"]),ae=/^(\d{4}-\d{2}-\d{2})/;function le(e){let r=ae.exec(e.name);if(r)return r[1];if(e.modified){let t=new Date(e.modified);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,10)}return null}function T1(){return $o(D?.projectConfig??{}).i18n?.locales??[]}function $E(e){let r=new Set;for(let t of e)if(t.locale)r.add(t.locale);return T1().filter((t)=>r.has(t))}function DE(e){let r=new Map,t=[];for(let o of e){let i=le(o);if(i===null){t.push(o);continue}let s=r.get(i);if(s)s.push(o);else r.set(i,[o])}return{days:[...r.entries()].map(([o,i])=>({date:o,files:i})).toSorted((o,i)=>i.date.localeCompare(o.date)),undated:t}}function AE(e){let r=new Map;for(let n of e){let o=r.get(n.category);if(o)o.push(n);else r.set(n.category,[n])}let t=fb.map((n)=>n.label);return[...r.entries()].map(([n,o])=>({files:o,group:n})).toSorted((n,o)=>{let i=t.indexOf(n.group),s=t.indexOf(o.group);if(i===s)return n.group.localeCompare(o.group);return(i===-1?t.length:i)-(s===-1?t.length:s)})}var G="The Library lists files; it does not edit them. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Mw(){return[{editable:!1,field:"name",kind:"string",pk:!0,title:"Name",widthHint:260},{editable:!1,field:"category",kind:"string",title:"Category",widthHint:120},{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90},{editable:!1,field:"type",kind:"string",title:"Type",widthHint:120},{editable:!1,field:"size",kind:"number",title:"Size",widthHint:90},{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}]}function ce(e){return{cells:{category:e.category,locale:e.locale??null,modified:e.modified??null,name:e.name,path:e.path,size:e.size??null,type:e.type},key:e.path}}function L(){return ds({kind:"library"})}function NE(e){let r=null,t=null,n=e??(()=>D?.projectDirs??[]);async function o(){if(r)return r;return t??=qf(n(),p()).then((i)=>(r=i,t=null,i)),t}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(Mw()),commit(i){return Promise.resolve({cells:i.cells.map((s)=>({error:G,field:s.field,ok:!1,rowKey:s.rowKey})),deletes:i.deletes.map((s)=>({error:G,ok:!1,rowKey:s.rowKey})),inserts:i.inserts.map((s)=>({error:G,ok:!1,tempKey:s.tempKey}))})},failures:()=>r?.failures??[],files:()=>r?.files??[],id:L(),label:"Library",async refresh(){r=null,t=null,await o()},async rows(){let i=await o();return{rows:i.files.map((s)=>ce(s)),total:i.files.length}},scanned:()=>r!==null}}var P={children:[],tagName:"div"};async function OE(e,r={}){let t=m.tabs.get(e);if(t)return ci(e,{focus:r.focus!==!1}),t;try{await qt()}catch{}let n=Aw(e),o=No({capabilities:{modes:["grid","source"]},document:structuredClone(P),documentPath:e,id:e,sourceFormat:Zt(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return $u(o,n).load(),o}function F(e){let r=No({capabilities:{modes:["grid"]},document:structuredClone(P),documentPath:null,id:e.id});return $u(r,e).load(),r}function z(e){let r=ds({kind:"collection",name:e}),t=m.tabs.get(r);if(t)return ci(r),t;return F(D1(e))}function ME(){let e=L(),r=m.tabs.get(e);if(r)return ci(e),r;return No({capabilities:{modes:["manage"]},document:structuredClone(P),documentPath:null,id:e})}function L1(){let e=ds({kind:"pages"}),r=m.tabs.get(e);if(r)return ci(e),r;return F(A1())}function Y(e,r){let t=ds({connection:e??"default",kind:"data",table:r}),n=m.tabs.get(t);if(n)return ci(t),n;return F(B(e,r))}function de(e){let r=Jf(e);if(r?.kind==="pages")L1();else if(r?.kind==="collection")z(r.name);else if(r?.kind==="data")Y(r.connection,r.table)}function ue(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ds({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ds({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((n)=>({id:ds({connection:t.name,kind:"data",table:n}),label:n})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function PE(){let e=jw(),r=[];if($w())r=(await E().catch(()=>null))?.connections??[];let t=null,n=bs({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(o)=>{t=j(o,ue(e,r),(i)=>{n.close(),de(i)})},layer:Ct("dialog"),onCancel:()=>n.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});n.ready}function pe(){return[{args:Se({name:He("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=ot("collection.editInGrid",r,"name"),n=jw().map((o)=>o.name);if(!n.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${n.length>0?n.join(", "):"none"}`);z(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:He('The connection name from project.json. Defaults to "default".'),table:He("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=ot("data.openGrid",r,"table");Y(Jo("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function FE(e){e.registerAll(pe())}
7
- export{$w,TE,k1,LE,Dw,Aw,fb,S1,Nw,E1,qf,IE,Gf,Ow,RE,T1,$E,DE,AE,Mw,NE,OE,ME,L1,PE,FE};
8
-
9
- //# debugId=E975C172B650280F64756E2164756E21
10
- //# sourceMappingURL=studio-8f87n763.js.map
@@ -1,5 +0,0 @@
1
- function nt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ot(e){return nt(e)&&typeof e.$ref==="string"}function Xa(e){return nt(e)&&e.$prototype==="Function"}function ba(e){return nt(e)&&nt(e.$expression)}function Pv(e){return ba(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Ik(e){return Xa(e)&&Array.isArray(e.body)}function Rk(e){return nt(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function $k(e){return nt(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function qx(e){return nt(e)&&e.$prototype==="Array"}function Ks(e){return typeof e==="string"&&e.includes("${")}function Dk(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function oh(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function va(e,n){let t=e?.[n];return oh(t)?t:void 0}function rh(e,n){let t=e[n];if(oh(t))return t;let r={};return e[n]=r,r}function sh(e){return Ot(e)||Xa(e)||ba(e)}function Mp(e,n){let t=e[n];return sh(t)?t:void 0}function Fv(e){if(!e)return[];return e.map((n)=>typeof n==="string"?n:n.name)}function Bd(e){if(!nt(e)||!nt(e.$expression))return!1;let n=e.$expression;if(n.operator==="?:")return typeof n.value==="string"&&typeof n.initial==="string";if(n.operator==="switch")return nt(n.cases)&&Object.values(n.cases).every((t)=>typeof t==="string")&&typeof n.default==="string";return!1}function Ak(e){if(typeof e==="string")return[e];if(!Bd(e))return[];let n=e.$expression;if(n.operator==="?:")return[...new Set([n.value,n.initial])];return[...new Set([...Object.values(n.cases),n.default])]}function qe(e){return typeof e==="string"?e:Ak(e).join("|")}function Pp(e){return e.startsWith("#")}
2
- export{nt,Ot,Xa,ba,Pv,Ik,Rk,$k,qx,Ks,Dk,oh,va,rh,sh,Mp,Fv,Bd,Ak,qe,Pp};
3
-
4
- //# debugId=00B85B5B5E64A41964756E2164756E21
5
- //# sourceMappingURL=studio-8mb00b84.js.map
@@ -1,6 +0,0 @@
1
- import{p}from"./studio-qpqa7vk3.js";import{K,D}from"./studio-wgh5kxpj.js";import{nh}from"./studio-tt2nactf.js";import{nt,Fv}from"./studio-8mb00b84.js";async function _b(e,s){let o=p();if(!o.codeService)return null;return o.codeService(e,s)}var bc=new Map;async function Cb(e,s){let o=e.$prototype?D?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||o;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(bc.has(r))return bc.get(r);try{let n=p();if(!n.fetchPluginSchema)return bc.set(r,null),null;let i=!o&&s.documentPath?`${location.origin}/${s.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return bc.set(r,a),a}catch{return bc.set(r,null),null}}function F1(e,s){let o=e.getModel();if(!o)return;let t=nh();if(!t)return;let r=s.map((n)=>{let i=n.labels?.[0];if(!i)return null;let{line:a,column:l,length:c}=i.span;return{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:l+(c||1),endLineNumber:a,message:n.message+(n.help?`
2
- ${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:l,startLineNumber:a}}).filter(Boolean);t.editor.setModelMarkers(o,"oxlint",r)}function GE(e,s){let o=(t)=>{if(!nt(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return Fv(r)};if(e.type==="def"){let t=e.defName?o(s?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!s||!e.path)return["state","event"];let t=K(s,e.path),r=t&&e.eventKey?o(t[e.eventKey]):null;if(r)return r}return["state","event"]}
3
- export{_b,bc,Cb,F1,GE};
4
-
5
- //# debugId=E5B7B5855F07E31664756E2164756E21
6
- //# sourceMappingURL=studio-8p51gq2h.js.map
@@ -1,5 +0,0 @@
1
- import{p}from"./studio-qpqa7vk3.js";import{di}from"./studio-g7nse7zb.js";import{Ir}from"./studio-3bpdkq2s.js";import{Gi,hp,mL,gL}from"./studio-4m3826v2.js";var r=new Map,d=new Map,a=new Map;function l(e,t){let n=mL(e),i=a.get(e);return{bytes:typeof t?.size==="number"?t.size:null,ext:Gi(n),height:i?.height??null,kind:hp({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function ab(e){return r.get(di(e))??null}function yE(e){for(let t of e){if(t.type!=="file")continue;let n=di(t.path);if(!r.has(n))r.set(n,l(n,t))}}async function wE(e){let t=di(e),n=r.get(t);if(n)return n;let i=d.get(t);if(i)return i;let o=(async()=>{let u;try{u=(await Ir(()=>p().listDirectory(gL(t)))).find((f)=>di(f.path)===t)}catch{u=void 0}return l(t,u)})();d.set(t,o);let s=await o;return d.delete(t),r.set(t,s),s}function lb(e,t,n){if(!(t>0&&n>0))return!1;let i=di(e),o=a.get(i);if(o&&o.width===t&&o.height===n)return!1;a.set(i,{height:n,width:t});let s=r.get(i);if(s)r.set(i,{...s,height:n,width:t});return!0}function xE(){r.clear(),a.clear()}function b1(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function _E(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(b1(e.bytes));return t.join(" · ")}
2
- export{ab,yE,wE,lb,xE,b1,_E};
3
-
4
- //# debugId=AF9D29FBF9522AD364756E2164756E21
5
- //# sourceMappingURL=studio-954ds834.js.map
@@ -1,9 +0,0 @@
1
- import{br}from"./studio-5g0ag7c0.js";import{un,rn}from"./studio-geq1ea6k.js";import{ge,Q,v,Mo,k}from"./studio-vzacdfsc.js";import{di}from"./studio-g7nse7zb.js";import{rt,zt,T,R,An,Ct}from"./studio-e7xxa0sj.js";import{Ld}from"./studio-q1h883bt.js";import{tT}from"./studio-a2138x5k.js";import{qn}from"./studio-bmn4mn9j.js";import{wc,js,nm}from"./studio-19x1c75w.js";var y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelActivity",$description:'The Activity feed: one row per operation this session, newest last, drawn from the projection `panels/activity-panel.ts` hands in. A row is a glyph, a head line (what the operation is, who is running it, how long it has taken), the line it is doing now, the plan it declared, the log it captured and — only when the operation handed a callback over — its Cancel. Every conditional the row has is a boolean field on the projected item, because `$switch` over a value is the only conditional a document has and "is this entry cancellable" is a question the panel has already answered. Nothing here reads the activity store: the panel owns what an operation IS, and the surface owns what it looks like.',tagName:"div",attributes:{part:"panel"},style:{$description:"What `.activity-panel`, `.activity-actions`, `.activity-list`, `.activity-row`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-duration`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step-icon`, `.activity-log-toggle` and `.activity-log` said in `styles/panels.css`, keyed on `part`. Two rules were DELETED rather than moved: `.activity-clear` and `.activity-cancel` drew a small bordered button by hand, and `jx-button` is that button — so the sizes, the border, the hover fill and the disabled state are the kit's now. Three token names changed meaning on the way: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and this document is mounted into the Bottom dock's body where that element is not an ancestor — every one of them would silently have taken its px fallback. They are the kit's own scale here (`--jx-text-sm`, `--jx-text-md`, `--jx-radius-xs`), which is the step each of them was. The `.activity-*` rules stay in the stylesheet regardless: `publish/deploy-checklist.ts` still draws the checklist above this feed in that same vocabulary, and it is a lit template until it converts.",display:"flex",flexDirection:"column",gap:"8px",padding:"8px",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="feed"]':{display:"flex",flexDirection:"column",gap:"8px",minWidth:"0"},'& [part="actions"]':{display:"flex",justifyContent:"flex-end"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible in a column of twenty rows without reading any of them. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 8px",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="row"][data-state="failed"]':{borderLeftColor:"var(--danger)"},'& [part="row"][data-state="cancelled"]':{borderLeftColor:"var(--fg-dim)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] [part="icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] [part="icon"]':{color:"var(--success)"},'& [part="row"][data-state="failed"] [part="icon"]':{color:"var(--danger)"},'& [part="body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"8px",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"], & [part="duration"]':{flex:"none",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="duration"]':{$description:"Pushed to the far edge so a column of rows reads as a column of times.",marginLeft:"auto"},'& [part="status"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The plan, declared up front, so "which of the three steps is this on" is answered by looking rather than by reading the status line and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="running"]':{color:"var(--fg)"},'& [part="step"][data-state="done"] [part="step-icon"]':{color:"var(--success)"},'& [part="step"][data-state="failed"] [part="step-icon"]':{color:"var(--danger)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="log-toggle"]':{$description:"A plain button rather than a kit one, and the one element here that is not the kit's. The control has to carry `aria-expanded` on the node the reader actually focuses, and a `jx-button` forwards a fixed set of ARIA properties to the control inside its shadow root — an attribute written on the host would name the wrapper and not the button. Its wording is the disclosure's whole state (`docs/studio/interface/problems-and-progress.md` calls it the Show log disclosure), so nothing else has to draw one.",alignSelf:"flex-start",padding:"0",border:"none",background:"none",color:"var(--accent)",font:"inherit",fontSize:"var(--jx-text-sm)",cursor:"pointer",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="log"]':{$description:"The captured output the progress modal used to show once and then lose. It scrolls inside the row rather than growing it, so one 400-line `bun install` failure does not become the whole panel. It is selectable against the root's `user-select: none`, the one part of an activity row that is: the output is what a reader pastes into a bug report, and the row offers no copy action.",userSelect:"text",maxHeight:"180px",margin:"2px 0 0",padding:"6px",overflow:"auto",borderRadius:"var(--jx-radius-xs)",background:"var(--bg)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",whiteSpace:"pre-wrap"},'& [part="cancel"]':{flex:"none"},'& [part="empty"]':{$description:"The teaching empty state, drawn here rather than borrowed from `panels/empty-state.ts`: that helper is a lit template and a document cannot call one. What it says is what is kept — one sentence saying what the region is FOR, then where its content comes from — and this region's fill is an operation somebody else starts, so it offers no button.",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"24px",textAlign:"center",fontSize:"13px",color:"var(--fg-dim)"},'& [part="empty-message"], & [part="empty-detail"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{fontSize:"var(--jx-text-sm)",opacity:"0.8"}},children:[{tagName:"div",attributes:{part:"feed-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRows"},cases:{true:{tagName:"div",attributes:{part:"feed"},children:[{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFinished"},cases:{true:{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{size:"sm",quiet:!0},attributes:{part:"clear"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearFinished"}}]},children:[{tagName:"span",textContent:"${state.clearLabel}"}]}]}}},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"row","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSource"},cases:{true:{tagName:"span",attributes:{part:"source"},textContent:"${$map.item.source}"}}},{tagName:"span",attributes:{part:"duration"},textContent:"${$map.item.duration}"}]},{tagName:"div",attributes:{part:"status-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasStatus"},cases:{true:{tagName:"div",attributes:{part:"status"},textContent:"${$map.item.status}"}}},{tagName:"div",attributes:{part:"steps-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSteps"},cases:{true:{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}}},{tagName:"div",attributes:{part:"log-toggle-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasLog"},cases:{true:{tagName:"button",attributes:{part:"log-toggle",type:"button","aria-expanded":"${$map.item.expanded ? 'true' : 'false'}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleLog"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.logLabel}"}}},{tagName:"div",attributes:{part:"log-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/showLog"},cases:{true:{tagName:"pre",attributes:{part:"log"},textContent:"${$map.item.logText}"}}}]},{tagName:"div",attributes:{part:"cancel-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/cancellable"},cases:{true:{tagName:"jx-button",$props:{size:"sm"},attributes:{part:"cancel",title:"Stop this operation"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"Cancel"}]}}}]}}]}]},false:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Long operations show their progress, their log and their Cancel button here."},{tagName:"p",attributes:{part:"empty-detail"},textContent:"Installs, clones, publishes and imports report here while they run."}]}}}]};T("panel-activity",y);var g=null,h=null,p=null,d=null;function E(t,e){t.rows=e.rows,t.hasRows=e.hasRows,t.hasFinished=e.hasFinished,t.clearLabel=e.clearLabel}function j(t){if(g!==t)return!1;return d===null?p!==null:d.root.parentNode===t}function b(t,e){if(j(t))return;f(),g=t;let a=v({cancel:e.cancel,clearFinished:e.clearFinished,clearLabel:"",hasFinished:!1,hasRows:!1,rows:[],toggleLog:e.toggleLog});h=ge(),h.run(()=>{Q(()=>{E(a,e.project())})});let o=R("panel-activity",a,t);p=o,o.then((i)=>{if(p===o)d=i;else i.dispose()})}function f(){h?.stop(),h=null;let t=p;if(p=null,d)d.dispose(),d=null;else if(t)t.then((e)=>e.dispose());g=null}var s=v([]),I=20,u=new Map,w=0;function H(){return w+=1,`a${w}`}function c(t){return t.state!=="running"}function x(){let t=s.filter((e)=>c(e)).length-I;while(t>0){let e=s.findIndex((a)=>c(a));if(e===-1)return;u.delete(s[e].id),s.splice(e,1),t-=1}}function aa(t){let e={cancellable:t.cancel!==void 0,endedAt:null,expanded:!1,id:H(),log:[],startedAt:Mo(),state:"running",status:t.status??"",steps:(t.steps??[]).map((i)=>({label:i,state:"pending"})),title:t.title,...t.source===void 0?{}:{source:t.source}};if(t.cancel)u.set(e.id,t.cancel);s.push(e);let a=s.at(-1);x();let o=(i,r)=>{if(c(a))return;if(a.state=i,a.endedAt=Mo(),r!==void 0)a.status=r;for(let n of a.steps)n.state=n.state==="done"?"done":i==="done"?"done":"failed";a.cancellable=!1,u.delete(a.id),x()};return{done(i){o("done",i)},entry:a,fail(i,r={}){if(c(a))return;let n=a.log.join(`
2
- `);o("failed",i),k.error(i,{source:a.source??a.title,...n===""?{}:{detail:n},...r.action===void 0?{}:{action:r.action},...r.path===void 0?{}:{path:r.path}})},id:a.id,log(i){let r=i.replace(/\s+$/,"");if(r!=="")a.log.push(r)},setStatus(i){if(!c(a))a.status=i},step(i){let r=a.steps.findIndex((n)=>n.label===i);if(r===-1)a.steps.push({label:i,state:"pending"}),r=a.steps.length-1;for(let[n,l]of a.steps.entries())l.state=n<r?"done":n===r?"running":l.state;a.status=i}}}function S(t){return s.find((e)=>e.id===t)}function m(){return s.filter((t)=>!c(t))}function F(t){let e=S(t),a=u.get(t);if(!e||!a||c(e))return!1;return a(),u.delete(t),e.state="cancelled",e.endedAt=Mo(),e.cancellable=!1,e.status="Cancelled",!0}function P(){let t=s.filter((a)=>!c(a)),e=s.length-t.length;return s.splice(0,s.length,...t),e}function KE(){return m().map((t)=>`activity: ${t.title} — ${t.status||"running"}`)}var M={cancelled:"⊘",done:"✓",failed:"✕",running:"⋯"},D={done:"✓",failed:"✕",pending:"·",running:"⋯"};function V(t,e=Mo()){let a=Math.max(0,(t.endedAt??e)-t.startedAt);if(a<1000)return`${a}ms`;let o=Math.round(a/1000);return o<60?`${o}s`:`${Math.floor(o/60)}m ${o%60}s`}function z(t,e){return{icon:D[t.state],key:`${e}:${t.label}`,label:t.label,state:t.state}}function _(t){let e=t.log.length;return{cancellable:t.cancellable,duration:V(t),expanded:t.expanded,hasLog:e>0,hasSource:(t.source??"")!=="",hasStatus:t.status!=="",hasSteps:t.steps.length>0,icon:M[t.state],id:t.id,logLabel:t.expanded?"Hide log":`Show log (${e} line(s))`,logText:t.log.join(`
3
- `),showLog:t.expanded&&e>0,source:t.source??"",state:t.state,status:t.status,steps:t.steps.map((a,o)=>z(a,o)),title:t.title}}function O(){let t=s.filter((e)=>c(e)).length;return{clearLabel:`Clear ${t} finished`,hasFinished:t>0,hasRows:s.length>0,rows:s.map((e)=>_(e))}}var U={cancel:(t)=>{F(t)},clearFinished:()=>{P()},project:O,toggleLog:(t)=>{let e=S(t);if(e)e.expanded=!e.expanded}};function W(){return br`<div data-deploy-checklist></div>
4
- <div data-activity-surface></div>`}function B(t){let e=t.querySelector("[data-activity-surface]");if(!e){f();return}b(e,U)}function JE(){qn({id:"activity",title:"Activity",level:"project",dock:"bottom",icon:"clock-counter-clockwise",rail:!1,badge:()=>m().length>0?m().length:null,render:()=>W(),afterRender:(t,e)=>{tT(e),B(e)}})}var q={message:"no media file to look for",status:"failed"};function A(t){let e=di(t);return e===""?null:{path:e}}function YE(t){let e=A(t);return e===null?null:wc(e)}async function kb(t){let e=A(t);return e===null?q:js(e)}function ZE(t){if(t===null)return"Counting references…";switch(t.status){case"unsupported":return null;case"pending":return"Counting references…";case"failed":return"Usage unknown";default:return nm(t.result)}}var L={$schema:"https://jxsuite.com/schema/v1",$id:"StudioProgressModal",$description:"The one surface in Studio that blocks while it works: the operation's name, a spinner, the line under it, and the two ways out. A `jx-dialog`, so the platform owns modality, the backdrop, focus restoration and Escape — which is what retired the `sp-underlay` this surface used to paint beside itself, and with it the fixed box, the panel, the shadow and the `z-index: 1000` that box needed to climb back out from under its own scrim. The two answers are the dialog's own: confirm is `Run in the background`, which stops the BLOCKING and leaves the work running in Activity, and the secondary answer is Cancel, drawn only when the operation handed one over. It is the secondary rather than the cancel answer for a reason that is behavioural, not cosmetic: the platform raises one `cancel` for Escape, for a light dismissal and for the cancel button alike, and a surface that cannot tell them apart would stop a dependency install on a keystroke. Escape therefore means what confirm means — stop blocking, not stop working — and the answer that stops the work is a button and only a button.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/title"},confirmLabel:"Run in the background",secondaryLabel:{$ref:"#/state/cancelLabel"},cancelLabel:"",size:"sm"},attributes:{part:"progress"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What is left once `jx-dialog` has drawn the dialog. `.progress-modal` is gone rather than moved — it positioned a fixed box, painted its panel, border, radius and shadow, capped its height and then lifted itself above the scrim it rendered beside — and a modal `<dialog>` in the top layer is every one of those. `.progress-title` went the same way: the operation's name is the dialog's headline, which is also its accessible name, so nothing here draws a title.",'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="status"]':{$description:"`anywhere`, because a status line is usually a path or a package spec with no space in it, and one of those would otherwise be the thing that decides how wide the dialog is. `min-width: 0` is what lets it wrap at all: a flex item's automatic minimum is its content, so without this the row refuses to shrink and the text overflows instead.",minWidth:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",overflowWrap:"anywhere"}},children:[{tagName:"div",attributes:{part:"row"},children:[{tagName:"jx-spinner",attributes:{part:"busy"},$props:{size:"lg"}},{tagName:"span",attributes:{part:"status","aria-live":"polite"},textContent:"${state.status}"}]}]};T("progress-modal",L);function N(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("modal","progress")),t.layer.append(e);let a=!1,o=v({background:()=>{t.onBackground()},cancel:()=>{t.onCancel()},cancelLabel:t.cancellable?"Cancel":"",closed:()=>{t.onClosed()},status:t.status,title:t.title}),i=null,r=R("progress-modal",o,e).then(async(n)=>{let l=n.root;if(a)return n.dispose(),l;if(i=n,await An(l),a)return l;return un(l),l});return{close(){if(a)return;a=!0;let n=i?.root;if(n instanceof HTMLElement)rn(n);i?.dispose(),i=null,e.remove()},host:e,ready:r,setStatus(n){o.status=n}}}function la(t){let e=!1,a=aa({title:t.title,...t.status===void 0?{}:{status:t.status},...t.source===void 0?{}:{source:t.source},...t.cancel===void 0?{}:{cancel:t.cancel}}),o=()=>{if(e)return;e=!0,r.close()},i=()=>{o(),Ld("activity")},r=N({cancellable:t.cancel!==void 0,layer:Ct("modal"),onBackground:i,onCancel:()=>{o(),t.cancel?.()},onClosed:o,status:t.status??"",title:t.title});return{activity:a,done(){a.done(),o()},fail(n){let l=(n??"").trim();if(l===""||l.includes(`
5
- `))a.log(l),a.fail(`${t.title} failed`);else a.fail(l);o()},log(n){a.log(n)},setStatus(n){if(a.setStatus(n),!e)r.setStatus(n)}}}
6
- export{aa,KE,JE,la,YE,kb,ZE};
7
-
8
- //# debugId=9770191B6FB90C3064756E2164756E21
9
- //# sourceMappingURL=studio-9ft45c83.js.map
@@ -1,7 +0,0 @@
1
- import{p}from"./studio-qpqa7vk3.js";import{cp}from"./studio-ghrhy2y7.js";import{ge,Q,v,Bm}from"./studio-vzacdfsc.js";import{ne}from"./studio-geq1ea6k.js";import{T,R}from"./studio-e7xxa0sj.js";import{Bi,y}from"./studio-q1h883bt.js";import{D}from"./studio-wgh5kxpj.js";function k({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
2
- `}function m(e,{slug:t,adapter:o}){if(!e)return{content:k({adapter:o,slug:t}),patched:!0};let n;try{n=JSON.parse(e)}catch{return{content:e,patched:!1}}if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
3
- `,patched:!0}}function bd(){try{return typeof p().cfApi==="function"}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw cp(n),n}}async function XE(){return l("/accounts")}async function j(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function C(e){return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:{build_command:"bunx jx build",destination_dir:"dist",...e.rootDir?{root_dir:e.rootDir}:{}},source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}async function Xf(e){let t=await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`),[o]=t;if(!o)return null;return{id:o.id,url:o.url,environment:o.environment,stage:o.latest_stage?.name??"unknown",status:o.latest_stage?.status??"unknown",createdOn:o.created_on}}async function j1(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await Bi({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let w=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:x,patched:S}=m(i,{adapter:w,slug:t.projectName});if(S)await n.writeFile("wrangler.jsonc",x)}}async function QE(e,t){let n=await j(t.accountId,t.projectName)??await C(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName,...n.subdomain?{productionUrl:`https://${n.subdomain}`}:{}};return await j1(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};T("panel-deploy-checklist",h);var d=null,c=null,a=null,r=null;function A(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function N(e){if(d!==e)return!1;return r===null?a!==null:r.root.parentNode===e}function f(e,t){if(N(e))return;u(),d=e;let o=v({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=ge(),c.run(()=>{Q(()=>{A(o,t.project())})});let n=R("panel-deploy-checklist",o,e);a=n,n.then((i)=>{if(a===n)r=i;else i.dispose()})}function u(){c?.stop(),c=null;let e=a;if(a=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function I(){return D?.projectConfig??null}function ca(){return I()?.build?.deploy}var s=Bm({asked:!1,observed:null});function sp(e){s.observed=e,s.asked=!0}function _(){let{status:e}=y.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function L(){let{status:e}=y.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function O(){let e=ca();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return bd()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function E(){if(!ca())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!s.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(s.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=s;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function g(){return[_(),L(),O(),E()]}function b(){return g().find((e)=>e.state!=="done")??null}function eT(){if(!D)return null;let e=b();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:ca()?.productionUrl??"Everything this project needs to ship is in place."}}var W={done:"✓",todo:"·",unknown:"?"};function V(e){return{icon:W[e.state],id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function H(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ne(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function J(){if(!D)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=g(),t=e.find((o)=>o.state!=="done")??null;return{...H(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>V(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function B(){let e=b();if(!e)return;ne()?.run(e.command)}var F={project:J,runAction:B};function tT(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){u();return}f(t,F)}
4
- export{bd,XE,Xf,j1,QE,ca,sp,eT,tT};
5
-
6
- //# debugId=CAB26A675E8D8A2F64756E2164756E21
7
- //# sourceMappingURL=studio-a2138x5k.js.map