@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,16 +0,0 @@
1
- import{ge,Q,v,re,AI,k}from"./studio-vzacdfsc.js";import{ov,$o,ai,dv,mp,q,ot,yi,li,Se,Do,oo,He,Qn,yp,m,$r,qa}from"./studio-3aey7dd3.js";import{p}from"./studio-qpqa7vk3.js";import{nh}from"./studio-tt2nactf.js";import{_t,Lr,qr}from"./studio-5g4t8v6w.js";import{te}from"./studio-ery42sqr.js";import{D,Bl,vt}from"./studio-wgh5kxpj.js";import{me}from"./studio-v2bvmbjj.js";function G(e){return e.replaceAll("~","~0").replaceAll("/","~1")}var Oe=100;function H(e){let t={blankAfter:new Set,escaped:new Map,inline:new Map},o=0,n=()=>{let a=0;while(o<e.length&&(e[o]===" "||e[o]==="\t"||e[o]==="\r"||e[o]===`
2
- `)){if(e[o]===`
3
- `)a+=1;o+=1}return a},r=()=>{let a=o,f=new Set;o+=1;while(o<e.length&&e[o]!=='"')if(e[o]==="\\")if(e[o+1]==="u"){let u=Number.parseInt(e.slice(o+2,o+6),16);if(u>=128)f.add(u);o+=6}else o+=2;else o+=1;return o+=1,{escaped:f,raw:e.slice(a,o)}},i=(a,f)=>{let u=n();if(e[o]===f)return o+=1,!0;if(o+=1,u+=n(),u>=2)t.blankAfter.add(a);return!1},s=(a)=>{n();let f=e[o];if(f==="{"){o+=1;let u=n()>0;if(e[o]==="}"){o+=1;return}t.inline.set(a,!u);while(o<e.length){let l=JSON.parse(r().raw);n(),o+=1;let c=`${a}/${G(l)}`;if(s(c),i(c,"}"))return}}else if(f==="["){if(o+=1,n(),e[o]==="]"){o+=1;return}for(let u=0;o<e.length;u+=1){let l=`${a}/${u}`;if(s(l),i(l,"]"))return}}else if(f==='"'){let{escaped:u}=r();if(u.size>0)t.escaped.set(a,u)}else while(o<e.length&&!`,]} \r
4
- `.includes(e[o]))o+=1};return s(""),t}function hs(e){return{document:JSON.parse(e),layout:H(e)}}var Me=/[^\u0020-\u007E]/,Je=/^[\p{Mn}\p{Me}\p{Cf}]$/u,ze=/^\p{Emoji_Presentation}$/u;function Fe(e){return e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=12871&&e!==12351||e>=12880&&e<=19903||e>=19968&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510||e>=110592&&e<=110593||e>=127488&&e<=127569||e>=131072&&e<=262141)}function ae(e){if(!Me.test(e))return e.length;let t=0;for(let o of e){if(Je.test(o))continue;t+=Fe(o.codePointAt(0))||ze.test(o)?2:1}return t}function Be(e){return e===void 0||typeof e==="function"||typeof e==="symbol"}function V(e){return Object.entries(e).filter(([,t])=>!Be(t))}function M(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ue(e){if(e.length<2)return!1;let t=Array.isArray(e[0])?"array":M(e[0])?"object":null;if(t===null)return!1;return e.every((o)=>t==="array"?Array.isArray(o)&&o.length>1:M(o)&&V(o).length>1)}function Ge(e){return e.length>1&&e.every((t)=>typeof t==="number")}function le(e,t){let o=JSON.stringify(e)??"null";return t===void 0?o:o.replaceAll(/[\u0080-\uFFFF]/g,(n)=>{let r=n.codePointAt(0);return t.has(r)?`\\u${r.toString(16).padStart(4,"0")}`:n})}function pr(e,t,o=Oe){let n=t?.inline??new Map,r=t?.blankAfter??new Set,i=t?.escaped??new Map,s=(l,c)=>n.get(l)??c,a=(l,c,d)=>{if(Array.isArray(l)){if(l.length===0)return"[]";if(Ue(l))return null;let g=[];for(let[b,h]of l.entries()){let w=`${c}/${b}`,x=r.has(w)?null:a(h,w,d);if(x===null)return null;g.push(x)}return`[${g.join(", ")}]`}if(M(l)){let g=V(l);if(g.length===0)return"{}";if(!s(c,d))return null;let b=[];for(let[h,w]of g){let x=`${c}/${G(h)}`,S=r.has(x)?null:a(w,x,!0);if(S===null)return null;b.push(`${JSON.stringify(h)}: ${S}`)}return`{ ${b.join(", ")} }`}return le(l,i.get(c))},f=(l)=>l.map(({path:c,text:d},g)=>g===l.length-1?d:`${d},
5
- ${r.has(c)?`
6
- `:""}`).join(""),u=(l,c,d,g,b,h)=>{let w=a(l,c,b),x=Array.isArray(l)||M(l);if(w!==null&&(!x||g+ae(w)+h<=o))return w;let S=" ".repeat(d+2),B=`
7
- ${" ".repeat(d)}`;if(Array.isArray(l)){if(Ge(l))return`[
8
- ${Ve(l,S,o,(_)=>r.has(`${c}/${_}`))}${B}]`;let E=l.map((N,_)=>{let A=`${c}/${_}`,O=_===l.length-1,U=u(N,A,d+2,S.length,b,O?0:1);return{path:A,text:`${S}${U}`}});return`[
9
- ${f(E)}${B}]`}let se=V(l),Ee=s(c,b),Ne=se.map(([E,N],_)=>{let A=`${c}/${G(E)}`,O=`${JSON.stringify(E)}: `,U=_===se.length-1,$e=S.length+ae(O),De=u(N,A,d+2,$e,Ee,U?0:1);return{path:A,text:`${S}${O}${De}`}});return`{
10
- ${f(Ne)}${B}}`};return`${u(e,"",0,0,!1,0)}
11
- `}function Ve(e,t,o,n){let r=[],i="";for(let[s,a]of e.entries()){let f=`${le(a)}${s===e.length-1?"":","}`;if(i==="")i=`${t}${f}`;else if(i.length+1+f.length<=o)i=`${i} ${f}`;else r.push(i),i=`${t}${f}`;if(n(s)&&s<e.length-1)r.push(i,""),i=""}return r.push(i),r.join(`
12
- `)}var ce=new Set([Qn,yp]),Ze=new Set(["auto","light","dark"]);function qe(e){let{ui:t}=e.session;return{activeMedia:t.activeMedia,canvasMode:t.canvasMode,editZoom:t.editZoom,preview:t.preview,previewColorScheme:t.previewColorScheme,previewLocale:t.previewLocale,showLayout:t.showLayout,zoom:t.zoom}}function ue(){let e={},t=[];for(let o of m.panes){if(o.derived)continue;let n=[];for(let i of o.tabOrder){let s=m.tabs.get(i);if(!s?.documentPath)continue;n.push(s.documentPath),e[s.documentPath]=qe(s)}if(n.length===0)continue;let r=o.activeTabId?m.tabs.get(o.activeTabId):null;t.push({activeFile:r?.documentPath??null,files:n,id:o.id})}return{focusedPane:m.activePaneId,panes:t,ui:e}}function We(e){if(typeof e!=="object"||e===null)return{};let t=e,o={};if(typeof t.canvasMode==="string")o.canvasMode=t.canvasMode;if(typeof t.preview==="boolean")o.preview=t.preview;if(typeof t.zoom==="number"&&Number.isFinite(t.zoom))o.zoom=t.zoom;if(typeof t.editZoom==="number"&&Number.isFinite(t.editZoom))o.editZoom=t.editZoom;if(t.activeMedia===null||typeof t.activeMedia==="string")o.activeMedia=t.activeMedia;if(typeof t.previewColorScheme==="string"&&Ze.has(t.previewColorScheme))o.previewColorScheme=t.previewColorScheme;if(t.previewLocale===null||ov(t.previewLocale))o.previewLocale=t.previewLocale;if(typeof t.showLayout==="boolean")o.showLayout=t.showLayout;return o}function fe(e){if(typeof e!=="object"||e===null)return null;let t=e;if(!Array.isArray(t.panes))return null;let o=[];for(let r of t.panes){if(typeof r!=="object"||r===null)continue;let i=r;if(typeof i.id!=="string"||!ce.has(i.id))continue;let s=Array.isArray(i.files)?i.files.filter((a)=>typeof a==="string"&&a!==""):[];if(s.length===0)continue;o.push({activeFile:typeof i.activeFile==="string"&&s.includes(i.activeFile)?i.activeFile:null,files:s,id:i.id})}if(o.length===0)return null;let n={};if(typeof t.ui==="object"&&t.ui!==null)for(let[r,i]of Object.entries(t.ui))n[r]=We(i);return{focusedPane:typeof t.focusedPane==="string"&&ce.has(t.focusedPane)?t.focusedPane:Qn,panes:o,ui:n}}async function eL(e,t){let o=0;if(e.panes.some((n)=>n.id===yp))t.ensureSecondPane();for(let n of e.panes)for(let r of n.files){try{await t.openFile(r,n.id)}catch{}if([...m.tabs.values()].some((i)=>i.documentPath===r))o+=1}if(o===0)return 0;for(let n of m.tabs.values()){let r=n.documentPath?e.ui[n.documentPath]:void 0;if(!r)continue;let{ui:i}=n.session;if(r.canvasMode&&n.capabilities.modes.includes(r.canvasMode))i.canvasMode=r.canvasMode;if(r.preview!==void 0)i.preview=r.preview;if(r.zoom!==void 0)i.zoom=r.zoom;if(r.editZoom!==void 0)i.editZoom=r.editZoom;if(r.activeMedia!==void 0)i.activeMedia=r.activeMedia;if(r.previewColorScheme!==void 0)i.previewColorScheme=r.previewColorScheme;if(r.previewLocale!==void 0)i.previewLocale=r.previewLocale;if(r.showLayout!==void 0)i.showLayout=r.showLayout}for(let n of e.panes){let r=m.panes.find((s)=>s.id===n.id);if(!r||!n.activeFile)continue;let i=r.tabOrder.find((s)=>m.tabs.get(s)?.documentPath===n.activeFile);if(i)r.activeTabId=i}if(m.panes.some((n)=>n.id===e.focusedPane))$r(e.focusedPane);return o}var pe={default:{description:"Resume whatever was persisted — layout, recents, settings, chat history.",id:"default",reset:"none"},fresh:{description:"A first-run app: no layout, no recents, no settings, no history.",id:"fresh",reset:"app-state"}},Ke="default",Ye=/^jx[-._:]/;function Xe(e){return Ye.test(e)}function Qe(){let e=globalThis.localStorage;if(!e)return[];let t=[];try{for(let o=0;o<e.length;o++){let n=e.key(o);if(n&&Xe(n))t.push(n)}for(let o of t)e.removeItem(o)}catch{}return t}function et(e){let t=pe[e];if(!t)throw RangeError(`unknown startup profile "${e}"; declared: ${Object.keys(pe).join(", ")}`);if(t.reset==="app-state")Qe();return t}var J=null;function de(e){if(J)return J;let t=new URLSearchParams(e??globalThis.location?.search??""),o=et(t.get("profile")??Ke),n=t.get("clock");return J={clock:n===null?null:AI(n),profile:o},J}var W=["files","search","git","i18n","layers","page","data","packages","insert"],tt={blocks:"insert",head:"page",imports:"packages",state:"data"},ye="layers";function ee(e){return typeof e==="string"&&W.includes(e)}function yx(e,t){if(!ee(e))throw Error(`${t}: "${e}" is not a declared Navigator panel id.`);return e}function be(e){if(typeof e!=="string")return null;let t=tt[e];if(t)return t;return ee(e)?e:null}var K=["properties","style","events","assistant"],Gb="properties";function wx(e){return typeof e==="string"&&K.includes(e)}var Kb=["problems","logic","activity"],xx="problems";function Jb(e){return typeof e==="string"&&Kb.includes(e)}var Yb=["light","dark"],he="jx-studio-panel-widths",ve="jx-studio-project::",nt="dark";function rt(e){return typeof e==="string"&&Yb.includes(e)}function it(){let e=Lr(_t.theme);return rt(e)?e:nt}var Ed=["left","right","bottom"],R={bottom:{collapsed:!0,size:220},left:{collapsed:!1,size:240},right:{collapsed:!1,size:280}},tL={bottom:R.bottom.size,left:R.left.size,right:R.right.size},st={bottom:"--dock-h-bottom",left:"--panel-w-left",right:"--panel-w-right"},at={bottom:"bottom-collapsed",left:"left-collapsed",right:"right-collapsed"},OC=0.5,_x=0.2,Cx=0.8;function lt(e){return typeof e==="number"&&e>=_x&&e<=Cx?e:OC}function nL(e){y.paneSplit=Math.min(Cx,Math.max(_x,e))}function ct(){try{return JSON.parse(localStorage.getItem(he)||"{}")}catch{return{}}}function we(){return{branches:null,commitMessage:"",diffState:null,error:null,lastUpdated:null,loading:!1,logEntries:null,rev:0,status:null,subTab:"changes"}}function Pe(){return{customizedOnly:!1,filter:"",selection:null,tab:"elements"}}function ke(){return[{bottomTab:"problems",docks:{bottom:{collapsed:!0,size:220},left:{collapsed:!1,size:240},right:{collapsed:!0,size:280}},id:"write",inspectorTab:"properties",name:"Write",navigatorPanel:"files"},{bottomTab:"problems",docks:{bottom:{collapsed:!0,size:220},left:{collapsed:!1,size:240},right:{collapsed:!1,size:320}},id:"design",inspectorTab:"style",name:"Design",navigatorPanel:"layers"},{bottomTab:"logic",docks:{bottom:{collapsed:!0,size:260},left:{collapsed:!1,size:280},right:{collapsed:!1,size:300}},id:"build",inspectorTab:"events",name:"Build",navigatorPanel:"data"},{bottomTab:"activity",docks:{bottom:{collapsed:!1,size:240},left:{collapsed:!1,size:300},right:{collapsed:!0,size:280}},id:"ship",inspectorTab:"properties",name:"Ship",navigatorPanel:"git"}]}var z="design";function ut(){let e=ct(),t={};for(let o of Ed){let n=e[o],r=e[`${o}Collapsed`];t[o]={collapsed:typeof r==="boolean"?r:R[o].collapsed,size:typeof n==="number"&&n>0?n:R[o].size}}return{bottomTab:Jb(e.bottomTab)?e.bottomTab:xx,docks:t,focusRegion:"pane",paneSplit:lt(e.paneSplit),git:we(),layout:z,layoutSelection:null,layouts:ke(),leftTab:be(e.leftTab)??ye,settingsTab:"stylebook",stylebook:Pe(),theme:it()}}de();var y=v(ut());function Td(){try{localStorage.setItem(he,JSON.stringify({bottom:y.docks.bottom.size,bottomCollapsed:y.docks.bottom.collapsed,bottomTab:y.bottomTab,left:y.docks.left.size,leftCollapsed:y.docks.left.collapsed,leftTab:y.leftTab,paneSplit:y.paneSplit,right:y.docks.right.size,rightCollapsed:y.docks.right.collapsed}))}catch{}}var Y;function ft(e){if(typeof e!=="object"||e===null)return!1;let t=e;return typeof t.id==="string"&&t.id!==""&&typeof t.name==="string"&&ee(t.navigatorPanel)&&wx(t.inspectorTab)&&Jb(t.bottomTab)&&Ed.every((o)=>typeof t.docks?.[o]?.size==="number")}function oe(e){if(!e)return{};try{return JSON.parse(localStorage.getItem(`${ve}${e}`)||"{}")}catch{return{}}}function pt(e){let t={activeLayout:null,layouts:ke()};if(!e)return t;let o=oe(e),n=Array.isArray(o.layouts)?o.layouts.filter(ft):[];if(n.length===0)return t;return{activeLayout:typeof o.activeLayout==="string"?o.activeLayout:null,layouts:n}}function iL(e){return fe(oe(e).session)}var ne=null;function Zb(e){ne=e}function oL(){C()}function C(){let e=m.projectRoot;if(!e)return;try{localStorage.setItem(`${ve}${e}`,JSON.stringify({activeLayout:y.layout,layouts:y.layouts,session:e===ne?ue():oe(e).session}))}catch{}}function dt(e){if(e===Y)return;Y=e;let{activeLayout:t,layouts:o}=pt(e);y.layouts=o;let n=(r)=>r!==null&&o.some((i)=>i.id===r);y.layout=n(t)?t:n(y.layout)?y.layout:n(z)?z:o[0]?.id??z}function xe(e){return y.layouts.find((t)=>t.id===e)}function mt(e){return e.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-|-$/g,"")||"layout"}function Te(e,t){let o=xe(e);if(!o)throw RangeError(`no layout named "${e}" — this project has: ${y.layouts.map((n)=>n.id).join(", ")}`);y.layout=o.id,y.leftTab=o.navigatorPanel,y.bottomTab=o.bottomTab;for(let n of Ed)y.docks[n].collapsed=o.docks[n].collapsed,y.docks[n].size=o.docks[n].size;t.setInspectorTab(o.inspectorTab),Td(),C()}function gt(e,t){let o=e.trim(),n=mt(o),r={};for(let a of Ed)r[a]={collapsed:y.docks[a].collapsed,size:y.docks[a].size};let i={bottomTab:Jb(y.bottomTab)?y.bottomTab:xx,docks:r,id:n,inspectorTab:t.inspectorTab(),name:o||n,navigatorPanel:be(y.leftTab)??ye},s=y.layouts.findIndex((a)=>a.id===n);if(s===-1)y.layouts.push(i);else y.layouts.splice(s,1,i);return y.layout=n,C(),i}function yt(e,t){let o=xe(e),n=t.trim();if(!o||!n)return;o.name=n,C()}function bt(e){if(y.layouts.length<2)return;let t=y.layouts.findIndex((o)=>o.id===e);if(t===-1)return;if(y.layouts.splice(t,1),y.layout===e)y.layout=y.layouts[0].id;C()}function ht(e){Te(y.layout,e)}function up(e=y.theme){return e==="light"?"vs":"vs-dark"}function wt(){document.documentElement.dataset.theme=y.theme,nh()?.editor.setTheme(up())}function St(){let e=document.documentElement;for(let o of Ed)e.style.setProperty(st[o],`${y.docks[o].size}px`);let t=document.querySelector("#app");if(!t)return;for(let o of Ed)t.classList.toggle(at[o],y.docks[o].collapsed)}var Z=null,X=[];function um(e){if(!X.includes(e))X.push(e)}function rL(){if(Z)return;for(let e of X)e.mount();Z=ge(),Z.run(()=>{Q(()=>{St()}),Q(()=>{wt()}),Q(()=>{dt(m.projectRoot)}),Q(()=>{let e=m.projectRoot;m.activePaneId;for(let t of m.panes)t.id,t.activeTabId,t.tabOrder.join("\x00");if(e)C()})})}function fr(e,t){if(y.docks[e].collapsed===t){Td();return}y.docks[e].collapsed=t,Td()}function Pt(e){fr(e,!y.docks[e].collapsed)}function sL(e,t){y.docks[e].size=t}function fs(e){y.leftTab=e,fr("left",!1),Td()}function Ld(e){y.bottomTab=e,fr("bottom",!1),Td()}function MC(e){if(y.theme===e)return;y.theme=e,qr(_t.theme,e)}function aL(e){if(e===y.leftTab&&!y.docks.left.collapsed){fr("left",!0);return}fs(e)}function PC(e){y.layoutSelection=e}function Xb(){Object.assign(y.git,we()),Object.assign(y.stylebook,Pe()),y.settingsTab="stylebook",y.layoutSelection=null,ne=null,Y=void 0}var I=(e)=>e.project.open;function kt(e){return[{args:Se({tab:Do(W,"Which Navigator panel to show.")}),category:"View",id:"view.setActivity",level:"application",menus:["commandbar/overflow","palette"],group:"4_docks",requires:"an open project",when:I,run:(t,o)=>{let n=li("view.setActivity",o,"tab",W);if(e.panelAvailable&&!e.panelAvailable(n))throw RangeError(`command "view.setActivity" argument "tab": "${n}" names a panel that is registered but not available right now, so showing it would persist a Navigator tab nothing can draw`);fs(n)},title:"Show Navigator Panel"},{args:Se({tab:Do(K,"Which Inspector tab to show.")}),category:"View",id:"view.setRightTab",level:"document",menus:["palette"],group:"4_docks",requires:"an open document",when:(t)=>t.document.open,run:(t,o)=>{e.setInspectorTab(li("view.setRightTab",o,"tab",K))},title:"Show Inspector Tab"},{args:Se({open:oo("True to show the Navigator dock, false to collapse it.")}),category:"View",id:"view.setNavigator",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{fr("left",!yi("view.setNavigator",o,"open"))},title:"Show Navigator Dock"},{args:Se({open:oo("True to show the Inspector dock, false to collapse it.")}),category:"View",id:"view.setRightPanel",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{fr("right",!yi("view.setRightPanel",o,"open"))},title:"Show Inspector Dock"},{args:Se({open:oo("True to show the Bottom dock, false to collapse it.")}),category:"View",id:"view.setBottomDock",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{fr("bottom",!yi("view.setBottomDock",o,"open"))},title:"Show Bottom Dock"},{category:"View",id:"view.toggleBottomDock",keybinding:"mod+j",level:"application",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>{Pt("bottom")},title:"Toggle Bottom Dock"},{args:Se({tab:Do(Kb,"Which Bottom dock tab to show.")}),category:"View",id:"view.setBottomTab",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{let n=li("view.setBottomTab",o,"tab",Kb);if(e.panelAvailable&&!e.panelAvailable(n))throw RangeError(`command "view.setBottomTab" argument "tab": "${n}" names a panel that is registered but not available right now, so showing it would persist a Bottom dock tab nothing can draw`);Ld(n)},title:"Show Bottom Dock Tab"},{args:Se({open:oo("True to show the Assistant tab, false to step off it.")}),category:"View",id:"view.setAssistant",level:"application",menus:["never"],group:"4_docks",run:(t,o)=>{if(yi("view.setAssistant",o,"open")){fr("right",!1),e.setInspectorTab("assistant");return}if(e.inspectorTab()==="assistant")e.setInspectorTab(Gb)},title:"Show Assistant"},{args:Se({layout:He("The layout's id — one of this project's saved layouts.")}),category:"View",id:"view.setLayout",level:"application",menus:["palette"],group:"4_layouts",requires:"an open project",when:I,run:(t,o)=>{Te(ot("view.setLayout",o,"layout"),e)},title:"Switch Layout"},{args:Se({name:He("What to call this arrangement. An existing name is overwritten.")}),category:"View",id:"view.saveLayout",level:"application",menus:["palette"],group:"4_layouts",requires:"an open project",when:I,run:(t,o)=>{gt(ot("view.saveLayout",o,"name"),e)},title:"Save Layout"},{args:Se({layout:He("The layout's id."),name:He("Its new name. The id, and every reference to it, is unchanged.")}),category:"View",id:"view.renameLayout",level:"application",menus:["palette"],group:"4_layouts",requires:"an open project",when:I,run:(t,o)=>{yt(ot("view.renameLayout",o,"layout"),ot("view.renameLayout",o,"name"))},title:"Rename Layout"},{args:Se({layout:He("The layout's id. The last remaining layout is kept.")}),category:"View",id:"view.deleteLayout",level:"application",menus:["palette"],group:"4_layouts",requires:"an open project",when:I,run:(t,o)=>{bt(ot("view.deleteLayout",o,"layout"))},title:"Delete Layout"},{category:"View",id:"view.resetLayout",level:"application",menus:["palette"],group:"4_layouts",requires:"an open project",when:I,run:()=>{ht(e)},title:"Reset Layout"},{args:Se({color:Do(Yb,"The Studio chrome's theme.")}),category:"View",id:"view.setTheme",level:"application",menus:["palette"],group:"6_appearance",run:(t,o)=>{MC(li("view.setTheme",o,"color",Yb))},title:"Set Theme"}]}function lL(e,t){e.registerAll(kt(t))}function Hu(e){return pr(e,xt())}var P=null,L=null,j=null,T=null;function xt(){return Ce()?.doc.layout??T}var ie=null;function Ce(){let e=m.tabs.get(ai);return e?re(e):null}function Tt(){if(L)mp(L),L=null;P=null,j=null,T=null,ie=null}function Le(){return ie??=(async()=>{try{let e=await p().readFile(ai),{document:t,layout:o}=hs(e);T=o,j=Hu(t)}catch{j=null}})(),ie}async function NC(e){if(await Le(),e.doc.layout===null&&T!==null)e.doc.layout=T}function It(e){let t=vt();if(t.projectConfig===e)return;Bl({...t,projectConfig:e}),qa(m.projectRoot,e)}function Ct(){let e=vt()?.projectConfig;return e?re(e):null}function je(e,t){for(let o of Object.keys(e))delete e[o];Object.assign(e,t)}function _e(e){return P=e,e.scope.run(()=>{Q(()=>{let t=e.doc.document;if(P!==e||!vt())return;It(re(t))})}),e}function Ae(){let e=vt(),t=Ce();if(P&&(P!==(t??L)||re(P.doc.document)!==e.projectConfig))Tt();if(P)return P;if(t)return _e(t);return L=dv({document:e.projectConfig??{},documentPath:ai,id:ai}),_e(L)}function Ie(e){return JSON.stringify(e.extensions??null)}async function Lt(){let{loadFormats:e,refreshExtensionUi:t,refreshFormats:o}=await (me("t76b53f8"),import("./format-host-t76b53f8.js"));o(),e(),t(p())}async function Sd(e){let t=Ct(),o=Ae();await NC(o);let n=re(o.doc.document),r=Hu(n),i=t&&t!==n&&Hu(t)!==r?t:null;if(i&&o.doc.dirty){let d=Error(`${ai} has unsaved changes in its editor tab`);return k.error(`Could not save ${ai} — the file is open with unsaved changes. Save or `+"revert that tab, then make the settings change again.",{key:`save:${ai}`,path:ai,source:"Settings"}),{error:d,ok:!1}}let s=i??n,a=e?{...s,...e}:s,f=Hu(a);if(!i&&!o.doc.dirty&&f===j)return{ok:!0};let u=Ie(n);q(o,(d)=>{let g=d.doc.document;if(i)je(g,i);for(let[b,h]of Object.entries(e??{}))g[b]=h});let l=re(o.doc.document),c=Hu(l);try{await p().writeFile(ai,c)}catch(d){return k.error(`Could not save ${ai} — ${te(d)}`,{key:`save:${ai}`,path:ai,source:"Settings"}),{error:d,ok:!1}}if(j=c,o.doc.dirty=!1,Ie(l)!==u)await Lt();return{ok:!0}}async function YT(e,t){if(!vt()){qa(m.projectRoot,e);return}let o=Ae();q(o,(n)=>je(n.doc.document,e),{skipHistory:!0}),o.doc.dirty=!1,await Le(),T=H(t),o.doc.layout=T,j=Hu(e)}function Di(e){let t=D?.projectConfig?.$media;if(!t)return e||{};if(!e)return{...t};return{...t,...e}}function qo(e){let t=D?.projectConfig?.style;if(!t)return e||{};if(!e)return{...t};let o={...t};for(let[n,r]of Object.entries(e))o[n]=typeof r==="object"&&r!==null&&typeof o[n]==="object"&&o[n]!==null?{...o[n],...r}:r;return o}function ZT(e){let t=D?.projectConfig?.imports;if(!t)return e||{};if(!e)return{...t};return{...t,...e}}function Ub(e){let t=D?.projectConfig?.$elements;if(!t?.length)return e||[];if(!e?.length)return[...t];let o=new Set,n=[];for(let r of[...t,...e]){let i=typeof r==="string"?r:r?.$ref;if(i&&!o.has(i))o.add(i),n.push(r)}return n}function XT(e){let t=D?.projectConfig?.$head;if(!t?.length)return e||[];if(!e?.length)return[...t];let o=new Set,n=[];for(let r of[...t,...e]){let i=String(r?.attributes?.href||r?.attributes?.src||"")||JSON.stringify(r);if(!o.has(i))o.add(i),n.push(r)}return n}function ps(){let e=D?.projectConfig;return e?$o(e).i18n:null}var F=new Map;function vx(){F.clear()}function Dl(e){if(e===!1)return null;let t=D?.projectConfig?.defaults?.layout;return e||t||null}async function qb(e){let t=e.replace(/^\.\//,"");if(F.has(t))return structuredClone(F.get(t));try{let n=await p().readFile(t),r=JSON.parse(n);return F.set(t,r),structuredClone(r)}catch{return null}}function QT(e,t){let o=t.children??[],n=Array.isArray(o)?o:[],r=new Map,i=[];for(let s of n){let a=typeof s==="object"?s.attributes?.slot:void 0;if(typeof s==="object"&&typeof a==="string"&&a){if(!r.has(a))r.set(a,[]);r.get(a).push(s)}else i.push(s)}if(Re(e,r,i),t.state)e.state={...e.state,...t.state};if(t.$media)e.$media={...e.$media,...t.$media};if(t.style)e.style={...e.style,...t.style};if(t.attributes)e.attributes={...e.attributes,...t.attributes};return e}function Re(e,t,o){if(!e||typeof e!=="object")return;if(!Array.isArray(e.children))return;let n=[];for(let r of e.children)if(r&&typeof r==="object"&&r.tagName==="slot"){let i=r.attributes?.name;if(typeof i==="string"&&i&&t.has(i))n.push(...t.get(i)),t.delete(i);else if(!i&&o.length>0)n.push(...o);else if(Array.isArray(r.children))n.push(...r.children)}else{if(typeof r!=="string")Re(r,t,o);n.push(r)}e.children=n}async function Bi(e){let t=await Sd(e);if(!t.ok)throw t.error}
13
- export{hs,pr,Hu,NC,Sd,YT,Di,qo,ZT,Ub,XT,ps,vx,Dl,qb,QT,Bi,eL,yx,Gb,wx,Kb,xx,Jb,Yb,Ed,tL,OC,_x,Cx,nL,y,Td,iL,Zb,oL,up,um,rL,fr,sL,fs,Ld,MC,aL,PC,Xb,lL};
14
-
15
- //# debugId=D1FA63014C43549A64756E2164756E21
16
- //# sourceMappingURL=studio-q1h883bt.js.map
@@ -1,9 +0,0 @@
1
- var O=()=>new Map,Se=(t)=>{let e=O();return t.forEach((n,r)=>{e.set(r,n)}),e},P=(t,e,n)=>{let r=t.get(e);if(r===void 0)t.set(e,r=n());return r},vr=(t,e)=>{let n=[];for(let[r,s]of t)n.push(e(s,r));return n},Rr=(t,e)=>{for(let[n,r]of t)if(e(r,n))return!0;return!1};var Y=()=>new Set;var _e=(t)=>t[t.length-1];var Lr=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},z=Array.from,Te=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},zt=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1};var Vr=(t,e)=>{let n=Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n};var tt=Array.isArray;class Ue{constructor(){this._observers=O()}on(t,e){return P(this._observers,t,Y).add(e),e}once(t,e){let n=(...r)=>{this.off(t,n),e(...r)};this.on(t,n)}off(t,e){let n=this._observers.get(t);if(n!==void 0){if(n.delete(e),n.size===0)this._observers.delete(t)}}emit(t,e){return z((this._observers.get(t)||O()).values()).forEach((n)=>n(...e))}destroy(){this._observers=O()}}var N=Math.floor;var ct=Math.abs;var Ee=(t,e)=>t<e?t:e,et=(t,e)=>t>e?t:e;var Be=(t)=>t!==0?t<0:1/t<0;var Un=1,En=2,Ae=4,Ce=8;var bt=32,G=64,A=128;var Wt=31,Zt=63,nt=127;var Mr=2147483647;var{MAX_SAFE_INTEGER:It,MIN_SAFE_INTEGER:An}=Number;var Fr=Number.isInteger||((t)=>typeof t==="number"&&isFinite(t)&&N(t)===t);var{fromCharCode:Dn,fromCodePoint:Wo}=String,Hl=Dn(65535),Zo=(t)=>t.toLowerCase(),Xo=/^\s*/g,Qo=(t)=>t.replace(Xo,""),Yo=/([A-Z])/g,On=(t,e)=>Qo(t.replace(Yo,(n)=>`${e}${Zo(n)}`));var ti=(t)=>{let e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let s=0;s<n;s++)r[s]=e.codePointAt(s);return r},St=typeof TextEncoder<"u"?new TextEncoder:null,ei=(t)=>St.encode(t),$r=St?ei:ti;var kt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});if(kt&&kt.decode(new Uint8Array).length===1)kt=null;var jr=(t,e)=>Vr(e,()=>t).join("");class Tt{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}var Xt=()=>new Tt;var ni=(t)=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e};var H=(t)=>{let e=new Uint8Array(ni(t)),n=0;for(let r=0;r<t.bufs.length;r++){let s=t.bufs[r];e.set(s,n),n+=s.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},ri=(t,e)=>{let n=t.cbuf.length;if(n-t.cpos<e)t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(et(n,e)*2),t.cpos=0},E=(t,e)=>{let n=t.cbuf.length;if(t.cpos===n)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0;t.cbuf[t.cpos++]=e};var Oe=E;var w=(t,e)=>{while(e>nt)E(t,A|nt&e),e=N(e/128);E(t,nt&e)},Ne=(t,e)=>{let n=Be(e);if(n)e=-e;E(t,(e>Zt?A:0)|(n?G:0)|Zt&e),e=N(e/64);while(e>0)E(t,(e>nt?A:0)|nt&e),e=N(e/128)},Nn=new Uint8Array(30000),si=Nn.length/3,oi=(t,e)=>{if(e.length<si){let n=St.encodeInto(e,Nn).written||0;w(t,n);for(let r=0;r<n;r++)E(t,Nn[r])}else R(t,$r(e))},ii=(t,e)=>{let n=unescape(encodeURIComponent(e)),r=n.length;w(t,r);for(let s=0;s<r;s++)E(t,n.codePointAt(s))},lt=St&&St.encodeInto?oi:ii;var Qt=(t,e)=>{let n=t.cbuf.length,r=t.cpos,s=Ee(n-r,e.length),o=e.length-s;if(t.cbuf.set(e.subarray(0,s),r),t.cpos+=s,o>0)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(et(n*2,o)),t.cbuf.set(e.subarray(s)),t.cpos=o},R=(t,e)=>{w(t,e.byteLength),Qt(t,e)},vn=(t,e)=>{ri(t,e);let n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},ci=(t,e)=>vn(t,4).setFloat32(0,e,!1),li=(t,e)=>vn(t,8).setFloat64(0,e,!1),ai=(t,e)=>vn(t,8).setBigInt64(0,e,!1);var qr=new DataView(new ArrayBuffer(4)),hi=(t)=>(qr.setFloat32(0,t),qr.getFloat32(0)===t),_t=(t,e)=>{switch(typeof e){case"string":E(t,119),lt(t,e);break;case"number":if(Fr(e)&&ct(e)<=Mr)E(t,125),Ne(t,e);else if(hi(e))E(t,124),ci(t,e);else E(t,123),li(t,e);break;case"bigint":E(t,122),ai(t,e);break;case"object":if(e===null)E(t,126);else if(tt(e)){E(t,117),w(t,e.length);for(let n=0;n<e.length;n++)_t(t,e[n])}else if(e instanceof Uint8Array)E(t,116),R(t,e);else{E(t,118);let n=Object.keys(e);w(t,n.length);for(let r=0;r<n.length;r++){let s=n[r];lt(t,s),_t(t,e[s])}}break;case"boolean":E(t,e?120:121);break;default:E(t,127)}};class ve extends Tt{constructor(t){super();this.w=t,this.s=null,this.count=0}write(t){if(this.s===t)this.count++;else{if(this.count>0)w(this,this.count-1);this.count=1,this.w(this,t),this.s=t}}}var Gr=(t)=>{if(t.count>0){if(Ne(t.encoder,t.count===1?t.s:-t.s),t.count>1)w(t.encoder,t.count-2)}};class Ut{constructor(){this.encoder=new Tt,this.s=0,this.count=0}write(t){if(this.s===t)this.count++;else Gr(this),this.count=1,this.s=t}toUint8Array(){return Gr(this),H(this.encoder)}}var Hr=(t)=>{if(t.count>0){let e=t.diff*2+(t.count===1?0:1);if(Ne(t.encoder,e),t.count>1)w(t.encoder,t.count-2)}};class Yt{constructor(){this.encoder=new Tt,this.s=0,this.count=0,this.diff=0}write(t){if(this.diff===t-this.s)this.s=t,this.count++;else Hr(this),this.count=1,this.diff=t-this.s,this.s=t}toUint8Array(){return Hr(this),H(this.encoder)}}class Rn{constructor(){this.sarr=[],this.s="",this.lensE=new Ut}write(t){if(this.s+=t,this.s.length>19)this.sarr.push(this.s),this.s="";this.lensE.write(t.length)}toUint8Array(){let t=new Tt;return this.sarr.push(this.s),this.s="",lt(t,this.sarr.join("")),Qt(t,this.lensE.toUint8Array()),H(t)}}var M=(t)=>Error(t),F=()=>{throw M("Method unimplemented")},v=()=>{throw M("Unexpected case")};var Pr=M("Unexpected end of array"),zr=M("Integer out of Range");class te{constructor(t){this.arr=t,this.pos=0}}var ut=(t)=>new te(t),Jr=(t)=>t.pos!==t.arr.length;var fi=(t,e)=>{let n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},L=(t)=>fi(t,x(t));var at=(t)=>t.arr[t.pos++];var x=(t)=>{let e=0,n=1,r=t.arr.length;while(t.pos<r){let s=t.arr[t.pos++];if(e=e+(s&nt)*n,n*=128,s<A)return e;if(e>It)throw zr}throw Pr},Re=(t)=>{let e=t.arr[t.pos++],n=e&Zt,r=64,s=(e&G)>0?-1:1;if((e&A)===0)return s*n;let o=t.arr.length;while(t.pos<o){if(e=t.arr[t.pos++],n=n+(e&nt)*r,r*=128,e<A)return s*n;if(n>It)throw zr}throw Pr};var di=(t)=>{let e=x(t);if(e===0)return"";else{let n=String.fromCodePoint(at(t));if(--e<100)while(e--)n+=String.fromCodePoint(at(t));else while(e>0){let r=e<1e4?e:1e4,s=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,s),e-=r}return decodeURIComponent(escape(n))}},pi=(t)=>kt.decode(L(t)),ht=kt?pi:di;var Vn=(t,e)=>{let n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},gi=(t)=>Vn(t,4).getFloat32(0,!1),mi=(t)=>Vn(t,8).getFloat64(0,!1),xi=(t)=>Vn(t,8).getBigInt64(0,!1);var wi=[(t)=>{return},(t)=>null,Re,gi,mi,xi,(t)=>!1,(t)=>!0,ht,(t)=>{let e=x(t),n={};for(let r=0;r<e;r++){let s=ht(t);n[s]=Et(t)}return n},(t)=>{let e=x(t),n=[];for(let r=0;r<e;r++)n.push(Et(t));return n},L],Et=(t)=>wi[127-at(t)](t);class Le extends te{constructor(t,e){super(t);this.reader=e,this.s=null,this.count=0}read(){if(this.count===0)if(this.s=this.reader(this),Jr(this))this.count=x(this)+1;else this.count=-1;return this.count--,this.s}}class Bt extends te{constructor(t){super(t);this.s=0,this.count=0}read(){if(this.count===0){this.s=Re(this);let t=Be(this.s);if(this.count=1,t)this.s=-this.s,this.count=x(this)+2}return this.count--,this.s}}class ee extends te{constructor(t){super(t);this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let t=Re(this),e=t&1;if(this.diff=N(t/2),this.count=1,e)this.count=x(this)+2}return this.s+=this.diff,this.count--,this.s}}class Mn{constructor(t){this.decoder=new Bt(t),this.str=ht(this.decoder),this.spos=0}read(){let t=this.spos+this.decoder.read(),e=this.str.slice(this.spos,t);return this.spos=t,e}}var Jl=crypto.subtle,Kr=crypto.getRandomValues.bind(crypto);var Fn=()=>Kr(new Uint32Array(1))[0];var bi=[1e7]+-1000+-4000+-8000+-100000000000,Wr=()=>bi.replace(/[018]/g,(t)=>(t^Fn()&15>>t/4).toString(16));var Ve=Date.now;var $n=(t)=>new Promise(t);var Zl=Promise.all.bind(Promise);var jn=(t)=>t===void 0?null:t;class Xr{constructor(){this.map=new Map}setItem(t,e){this.map.set(t,e)}getItem(t){return this.map.get(t)}}var Qr=new Xr,_i=!0;try{if(typeof localStorage<"u"&&localStorage)Qr=localStorage,_i=!1}catch(t){}var Yr=Qr;var ft=Symbol("Equality"),Me=(t,e)=>t===e||!!t?.[ft]?.(e)||!1;var ts=(t)=>typeof t==="object",{assign:es,keys:Ui}=Object;var ns=(t,e)=>{for(let n in t)e(t[n],n)};var ne=(t)=>Ui(t).length;var rs=(t)=>{for(let e in t)return!1;return!0},At=(t,e)=>{for(let n in t)if(!e(t[n],n))return!1;return!0},re=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Gn=(t,e)=>t===e||ne(t)===ne(e)&&At(t,(n,r)=>(n!==void 0||re(e,r))&&Me(e[r],n)),Ei=Object.freeze,Hn=(t)=>{for(let e in t){let n=t[e];if(typeof n==="object"||typeof n==="function")Hn(t[e])}return Ei(t)};var oe=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{if(n<t.length)oe(t,e,n+1)}};var ss=(t)=>t;var se=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[ft]!=null)return t[ft](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(let n of t.keys())if(!e.has(n)||!se(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(ne(t)!==ne(e))return!1;for(let n in t)if(!re(t,n)||!se(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!se(t[n],e[n]))return!1;break;default:return!1}return!0},os=(t,e)=>e.includes(t);var ie=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";var Xl=typeof navigator<"u"?/Mac/.test(navigator.platform):!1,J,Bi=[],Ai=()=>{if(J===void 0)if(ie){J=O();let t=process.argv,e=null;for(let n=0;n<t.length;n++){let r=t[n];if(r[0]==="-"){if(e!==null)J.set(e,"");e=r}else if(e!==null)J.set(e,r),e=null;else Bi.push(r)}if(e!==null)J.set(e,"")}else if(typeof location==="object")J=O(),(location.search||"?").slice(1).split("&").forEach((t)=>{if(t.length!==0){let[e,n]=t.split("=");J.set(`--${On(e,"-")}`,n),J.set(`-${On(e,"-")}`,n)}});else J=O();return J},Jn=(t)=>Ai().has(t);var ce=(t)=>ie?jn(process.env[t.toUpperCase().replaceAll("-","_")]):jn(Yr.getItem(t));var is=(t)=>Jn("--"+t)||ce(t)!==null,cs=is("production"),Ci=ie&&os(process.env.FORCE_COLOR,["true","1","2"]),ls=Ci||!Jn("--no-colors")&&!is("no-color")&&(!ie||process.stdout.isTTY)&&(!ie||Jn("--color")||ce("COLORTERM")!==null||(ce("TERM")||"").includes("color"));var Di=(t)=>new Uint8Array(t);var hs=(t)=>{let e=Di(t.byteLength);return e.set(t),e};class us{constructor(t,e){this.left=t,this.right=e}}var K=(t,e)=>new us(t,e);var Wn=(t)=>t.next()>=0.5,Fe=(t,e,n)=>N(t.next()*(n+1-e)+e);var Zn=(t,e,n)=>N(t.next()*(n+1-e)+e);var Xn=(t,e,n)=>Zn(t,e,n);var vi=(t)=>Dn(Xn(t,97,122)),fs=(t,e=0,n=20)=>{let r=Xn(t,e,n),s="";for(let o=0;o<r;o++)s+=vi(t);return s};var $e=(t,e)=>e[Xn(t,0,e.length-1)];var Li=Symbol("0schema");class ps{constructor(){this._rerrs=[]}extend(t,e,n,r=null){this._rerrs.push({path:t,expected:e,has:n,message:r})}toString(){let t=[];for(let e=this._rerrs.length-1;e>0;e--){let n=this._rerrs[e];t.push(jr(" ",(this._rerrs.length-e)*2)+`${n.path!=null?`[${n.path}] `:""}${n.has} doesn't match ${n.expected}. ${n.message}`)}return t.join(`
2
- `)}}var Qn=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor)return!1;if(t[ft])return Me(t,e);if(tt(t))return Te(t,(n)=>zt(e,(r)=>Qn(n,r)));else if(ts(t))return At(t,(n,r)=>Qn(n,e[r]));return!1};class C{static _dilutes=!1;extends(t){let[e,n]=[this.shape,t.shape];if(this.constructor._dilutes)[n,e]=[e,n];return Qn(e,n)}equals(t){return this.constructor===t.constructor&&se(this.shape,t.shape)}[Li](){return!0}[ft](t){return this.equals(t)}validate(t){return this.check(t)}check(t,e){F()}get nullable(){return Nt(this,We)}get optional(){return new Yn(this)}cast(t){return ds(t,this),t}expect(t){return ds(t,this),t}}class Ge extends C{constructor(t,e){super();this.shape=t,this._c=e}check(t,e=void 0){let n=t?.constructor===this.shape&&(this._c==null||this._c(t));return!n&&e?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),n}}var S=(t,e=null)=>new Ge(t,e),Yl=S(Ge);class He extends C{constructor(t){super();this.shape=t}check(t,e){let n=this.shape(t);return!n&&e?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),n}}var _=(t)=>new He(t),ta=S(He);class ae extends C{constructor(t){super();this.shape=t}check(t,e){let n=this.shape.some((r)=>r===t);return!n&&e?.extend(null,this.shape.join(" | "),t.toString()),n}}var Pe=(...t)=>new ae(t),gs=S(ae),Vi=RegExp.escape||((t)=>t.replace(/[().|&,$^[\]]/g,(e)=>"\\"+e)),ms=(t)=>{if(Ot.check(t))return[Vi(t)];if(gs.check(t))return t.shape.map((e)=>e+"");if(_s.check(t))return["[+-]?\\d+.?\\d*"];if(Ts.check(t))return[".*"];if(je.check(t))return t.shape.map(ms).flat(1);v()};class xs extends C{constructor(t){super();this.shape=t,this._r=new RegExp("^"+t.map(ms).map((e)=>`(${e.join("|")})`).join("")+"$")}check(t,e){let n=this._r.exec(t)!=null;return!n&&e?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),n}}var ea=S(xs),Mi=Symbol("optional");class Yn extends C{constructor(t){super();this.shape=t}check(t,e){let n=t===void 0||this.shape.check(t);return!n&&e?.extend(null,"undefined (optional)","()"),n}get[Mi](){return!0}}var Fi=S(Yn);class tr extends C{check(t,e){return e?.extend(null,"never",typeof t),!1}}var na=new tr,ra=S(tr);class ze extends C{constructor(t,e=!1){super();this.shape=t,this._isPartial=e}static _dilutes=!0;get partial(){return new ze(this.shape,!0)}check(t,e){if(t==null)return e?.extend(null,"object","null"),!1;return At(this.shape,(n,r)=>{let s=this._isPartial&&!re(t,r)||n.check(t[r],e);return!s&&e?.extend(r.toString(),n.toString(),typeof t[r],"Object property does not match"),s})}}var $i=(t)=>new ze(t),ji=S(ze),qi=_((t)=>t!=null&&(t.constructor===Object||t.constructor==null));class er extends C{constructor(t,e){super();this.shape={keys:t,values:e}}check(t,e){return t!=null&&At(t,(n,r)=>{let s=this.shape.keys.check(r,e);return!s&&e?.extend(r+"","Record",typeof t,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(n,e)})}}var ws=(t,e)=>new er(t,e),Gi=S(er);class nr extends C{constructor(t){super();this.shape=t}check(t,e){return t!=null&&At(this.shape,(n,r)=>{let s=n.check(t[r],e);return!s&&e?.extend(r.toString(),"Tuple",typeof n),s})}}var Hi=(...t)=>new nr(t),sa=S(nr);class rr extends C{constructor(t){super();this.shape=t.length===1?t[0]:new Je(t)}check(t,e){let n=tt(t)&&Te(t,(r)=>this.shape.check(r));return!n&&e?.extend(null,"Array",""),n}}var ys=(...t)=>new rr(t),Pi=S(rr),zi=_((t)=>tt(t));class sr extends C{constructor(t,e){super();this.shape=t,this._c=e}check(t,e){let n=t instanceof this.shape&&(this._c==null||this._c(t));return!n&&e?.extend(null,this.shape.name,t?.constructor.name),n}}var Ji=(t,e=null)=>new sr(t,e),oa=S(sr),Ki=Ji(C);class bs extends C{constructor(t){super();this.len=t.length-1,this.args=Hi(...t.slice(-1)),this.res=t[this.len]}check(t,e){let n=t.constructor===Function&&t.length<=this.len;return!n&&e?.extend(null,"function",typeof t),n}}var Wi=S(bs),Zi=_((t)=>typeof t==="function");class Is extends C{constructor(t){super();this.shape=t}check(t,e){let n=Te(this.shape,(r)=>r.check(t,e));return!n&&e?.extend(null,"Intersectinon",typeof t),n}}var ia=S(Is,(t)=>t.shape.length>0);class Je extends C{static _dilutes=!0;constructor(t){super();this.shape=t}check(t,e){let n=zt(this.shape,(r)=>r.check(t,e));return e?.extend(null,"Union",typeof t),n}}var Nt=(...t)=>t.findIndex((e)=>je.check(e))>=0?Nt(...t.map((e)=>le(e)).map((e)=>je.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new Je(t),je=S(Je),ks=()=>!0,qe=_(ks),Xi=S(He,(t)=>t.shape===ks),or=_((t)=>typeof t==="bigint"),Qi=_((t)=>t===or),Ss=_((t)=>typeof t==="symbol"),ca=_((t)=>t===Ss),Dt=_((t)=>typeof t==="number"),_s=_((t)=>t===Dt),Ot=_((t)=>typeof t==="string"),Ts=_((t)=>t===Ot),Ke=_((t)=>typeof t==="boolean"),Yi=_((t)=>t===Ke),Us=Pe(void 0),la=S(ae,(t)=>t.shape.length===1&&t.shape[0]===void 0),aa=Pe(void 0);var We=Pe(null),tc=S(ae,(t)=>t.shape.length===1&&t.shape[0]===null),ha=S(Uint8Array),ua=S(Ge,(t)=>t.shape===Uint8Array),ec=Nt(Dt,Ot,We,Us,or,Ke,Ss),fa=(()=>{let t=ys(qe),e=ws(Ot,qe),n=Nt(Dt,Ot,We,Ke,t,e);return t.shape=n,e.shape.values=n,n})(),le=(t)=>{if(Ki.check(t))return t;else if(qi.check(t)){let e={};for(let n in t)e[n]=le(t[n]);return $i(e)}else if(zi.check(t))return Nt(...t.map(le));else if(ec.check(t))return Pe(t);else if(Zi.check(t))return S(t);v()},ds=cs?()=>{}:(t,e)=>{let n=new ps;if(!e.check(t,n))throw M(`Expected value to be of type ${e.constructor.name}.
3
- ${n.toString()}`)};class Es{constructor(t){this.patterns=[],this.$state=t}if(t,e){return this.patterns.push({if:le(t),h:e}),this}else(t){return this.if(qe,t)}done(){return(t,e)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(t))return r.h(t,e)}throw M("Unhandled pattern")}}}var nc=(t)=>new Es(t),Bs=nc(qe).if(_s,(t,e)=>Fe(e,An,It)).if(Ts,(t,e)=>fs(e)).if(Yi,(t,e)=>Wn(e)).if(Qi,(t,e)=>BigInt(Fe(e,An,It))).if(je,(t,e)=>Ct(e,$e(e,t.shape))).if(ji,(t,e)=>{let n={};for(let r in t.shape){let s=t.shape[r];if(Fi.check(s)){if(Wn(e))continue;s=s.shape}n[r]=Bs(s,e)}return n}).if(Pi,(t,e)=>{let n=[],r=Zn(e,0,42);for(let s=0;s<r;s++)n.push(Ct(e,t.shape));return n}).if(gs,(t,e)=>$e(e,t.shape)).if(tc,(t,e)=>null).if(Wi,(t,e)=>{let n=Ct(e,t.res);return()=>n}).if(Xi,(t,e)=>Ct(e,$e(e,[Dt,Ot,We,Us,or,Ke,ys(Dt),ws(Nt("a","b","c"),Dt)]))).if(Gi,(t,e)=>{let n={},r=Fe(e,0,3);for(let s=0;s<r;s++){let o=Ct(e,t.shape.keys),i=Ct(e,t.shape.values);n[o]=i}return n}).done(),Ct=(t,e)=>Bs(le(e),t);var dt=typeof document<"u"?document:{};var da=_((t)=>t.nodeType===cc);var pa=typeof DOMParser<"u"?new DOMParser:null;var ga=_((t)=>t.nodeType===sc);var ma=_((t)=>t.nodeType===oc);var As=(t)=>vr(t,(e,n)=>`${n}:${e};`).join("");var{ELEMENT_NODE:sc,TEXT_NODE:oc,CDATA_SECTION_NODE:xa,COMMENT_NODE:wa,DOCUMENT_NODE:ic,DOCUMENT_TYPE_NODE:ya,DOCUMENT_FRAGMENT_NODE:cc}=dt,ba=_((t)=>t.nodeType===ic);var W=Symbol;var he=W(),ue=W(),ir=W(),cr=W(),lr=W(),fe=W(),ar=W(),vt=W(),hr=W(),Cs=(t)=>{if(t.length===1&&t[0]?.constructor===Function)t=t[0]();let e=[],n=[],r=0;for(;r<t.length;r++){let s=t[r];if(s===void 0)break;else if(s.constructor===String||s.constructor===Number)e.push(s);else if(s.constructor===Object)break}if(r>0)n.push(e.join(""));for(;r<t.length;r++){let s=t[r];if(!(s instanceof Symbol))n.push(s)}return n};var Ia=Ve();var fc={[he]:K("font-weight","bold"),[ue]:K("font-weight","normal"),[ir]:K("color","blue"),[lr]:K("color","green"),[cr]:K("color","grey"),[fe]:K("color","red"),[ar]:K("color","purple"),[vt]:K("color","orange"),[hr]:K("color","black")},dc=(t)=>{if(t.length===1&&t[0]?.constructor===Function)t=t[0]();let e=[],n=[],r=O(),s=[],o=0;for(;o<t.length;o++){let i=t[o],c=fc[i];if(c!==void 0)r.set(c.left,c.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let a=As(r);if(o>0||a.length>0)e.push("%c"+i),n.push(a);else e.push(i)}else break}}if(o>0)s=n,s.unshift(e.join(""));for(;o<t.length;o++){let i=t[o];if(!(i instanceof Symbol))s.push(i)}return s},Ds=ls?dc:Cs,Ns=(...t)=>{console.log(...Ds(t)),vs.forEach((e)=>e.print(t))},ur=(...t)=>{console.warn(...Ds(t)),t.unshift(vt),vs.forEach((e)=>e.print(t))};var vs=Y();var Rs=(t)=>({[Symbol.iterator](){return this},next:t}),Ls=(t,e)=>Rs(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Ze=(t,e)=>Rs(()=>{let{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class xe{constructor(t,e){this.clock=t,this.len=e}}class wt{constructor(){this.clients=new Map}}var Vt=(t,e,n)=>e.clients.forEach((r,s)=>{let o=t.doc.store.clients.get(s);if(o!=null){let i=o[o.length-1],c=i.id.clock+i.length;for(let a=0,f=r[a];a<r.length&&f.clock<c;f=r[++a])ho(t,o,f.clock,f.len,n)}}),mc=(t,e)=>{let n=0,r=t.length-1;while(n<=r){let s=N((n+r)/2),o=t[s],i=o.clock;if(i<=e){if(e<i+o.len)return s;n=s+1}else r=s-1}return null},we=(t,e)=>{let n=t.clients.get(e.client);return n!==void 0&&mc(n,e.clock)!==null},xr=(t)=>{t.clients.forEach((e)=>{e.sort((s,o)=>s.clock-o.clock);let n,r;for(n=1,r=1;n<e.length;n++){let s=e[r-1],o=e[n];if(s.clock+s.len>=o.clock)e[r-1]=new xe(s.clock,et(s.len,o.clock+o.len-s.clock));else{if(r<n)e[r]=o;r++}}e.length=r})},dr=(t)=>{let e=new wt;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,s)=>{if(!e.clients.has(s)){let o=r.slice();for(let i=n+1;i<t.length;i++)Lr(o,t[i].clients.get(s)||[]);e.clients.set(s,o)}});return xr(e),e},de=(t,e,n,r)=>{P(t.clients,e,()=>[]).push(new xe(n,r))},Xs=()=>new wt,xc=(t)=>{let e=Xs();return t.clients.forEach((n,r)=>{let s=[];for(let o=0;o<n.length;o++){let i=n[o];if(i.deleted){let c=i.id.clock,a=i.length;if(o+1<n.length)for(let f=n[o+1];o+1<n.length&&f.deleted;f=n[++o+1])a+=f.length;s.push(new xe(c,a))}}if(s.length>0)e.clients.set(r,s)}),e},Ft=(t,e)=>{w(t.restEncoder,e.clients.size),z(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),w(t.restEncoder,n);let s=r.length;w(t.restEncoder,s);for(let o=0;o<s;o++){let i=r[o];t.writeDsClock(i.clock),t.writeDsLen(i.len)}})},wr=(t)=>{let e=new wt,n=x(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();let s=x(t.restDecoder),o=x(t.restDecoder);if(o>0){let i=P(e.clients,s,()=>[]);for(let c=0;c<o;c++)i.push(new xe(t.readDsClock(),t.readDsLen()))}}return e},Vs=(t,e,n)=>{let r=new wt,s=x(t.restDecoder);for(let o=0;o<s;o++){t.resetDsCurVal();let i=x(t.restDecoder),c=x(t.restDecoder),a=n.clients.get(i)||[],f=I(n,i);for(let l=0;l<c;l++){let h=t.readDsClock(),u=h+t.readDsLen();if(h<f){if(f<u)de(r,i,f,u-f);let d=Z(a,h),p=a[d];if(!p.deleted&&p.id.clock<h)a.splice(d+1,0,fn(e,p,h-p.id.clock)),d++;while(d<a.length)if(p=a[d++],p.id.clock<u){if(!p.deleted){if(u<p.id.clock+p.length)a.splice(d,0,fn(e,p,u-p.id.clock));p.delete(e)}}else break}else de(r,i,h,u-h)}}if(r.clients.size>0){let o=new it;return w(o.restEncoder,0),Ft(o,r),o.toUint8Array()}return null};var Qs=Fn;class lc extends Ue{constructor({guid:t=Wr(),collectionid:e=null,gc:n=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:i=!0}={}){super();this.gc=n,this.gcFilter=r,this.clientID=Qs(),this.guid=t,this.collectionid=e,this.share=new Map,this.store=new _r,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=i,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=$n((a)=>{this.on("load",()=>{this.isLoaded=!0,a(this)})});let c=()=>$n((a)=>{let f=(l)=>{if(l===void 0||l===!0)this.off("sync",f),a()};this.on("sync",f)});this.on("sync",(a)=>{if(a===!1&&this.isSynced)this.whenSynced=c();if(this.isSynced=a===void 0||a===!0,this.isSynced&&!this.isLoaded)this.emit("load",[this])}),this.whenSynced=c()}load(){let t=this._item;if(t!==null&&!this.shouldLoad)y(t.parent.doc,(e)=>{e.subdocsLoaded.add(this)},null,!0);this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(z(this.subdocs).map((t)=>t.guid))}transact(t,e=null){return y(this,t,e)}get(t,e=T){let n=P(this.share,t,()=>{let s=new e;return s._integrate(this,null),s}),r=n.constructor;if(e!==T&&r!==e)if(r===T){let s=new e;s._map=n._map,n._map.forEach((o)=>{for(;o!==null;o=o.left)o.parent=s}),s._start=n._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=n._length,this.share.set(t,s),s._integrate(this,null),s}else throw Error(`Type with the name ${t} has already been defined with a different constructor`);return n}getArray(t=""){return this.get(t,Os)}getText(t=""){return this.get(t,as)}getMap(t=""){return this.get(t,Ur)}getXmlElement(t=""){return this.get(t,Mt)}getXmlFragment(t=""){return this.get(t,mt)}toJSON(){let t={};return this.share.forEach((e,n)=>{t[n]=e.toJSON()}),t}destroy(){this.isDestroyed=!0,z(this.subdocs).forEach((e)=>e.destroy());let t=this._item;if(t!==null){this._item=null;let e=t.content;e.doc=new lc({guid:this.guid,...e.opts,shouldLoad:!1}),e.doc._item=t,y(t.parent.doc,(n)=>{let r=e.doc;if(!t.deleted)n.subdocsAdded.add(r);n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class yr{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return x(this.restDecoder)}readDsLen(){return x(this.restDecoder)}}class br extends yr{readLeftID(){return g(x(this.restDecoder),x(this.restDecoder))}readRightID(){return g(x(this.restDecoder),x(this.restDecoder))}readClient(){return x(this.restDecoder)}readInfo(){return at(this.restDecoder)}readString(){return ht(this.restDecoder)}readParentInfo(){return x(this.restDecoder)===1}readTypeRef(){return x(this.restDecoder)}readLen(){return x(this.restDecoder)}readAny(){return Et(this.restDecoder)}readBuf(){return hs(L(this.restDecoder))}readJSON(){return JSON.parse(ht(this.restDecoder))}readKey(){return ht(this.restDecoder)}}class Ys{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=x(this.restDecoder),this.dsCurrVal}readDsLen(){let t=x(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class gt extends Ys{constructor(t){super(t);this.keys=[],x(t),this.keyClockDecoder=new ee(L(t)),this.clientDecoder=new Bt(L(t)),this.leftClockDecoder=new ee(L(t)),this.rightClockDecoder=new ee(L(t)),this.infoDecoder=new Le(L(t),at),this.stringDecoder=new Mn(L(t)),this.parentInfoDecoder=new Le(L(t),at),this.typeRefDecoder=new Bt(L(t)),this.lenDecoder=new Bt(L(t))}readLeftID(){return new pt(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new pt(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Et(this.restDecoder)}readBuf(){return L(this.restDecoder)}readJSON(){return Et(this.restDecoder)}readKey(){let t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];else{let e=this.stringDecoder.read();return this.keys.push(e),e}}}class Ir{constructor(){this.restEncoder=Xt()}toUint8Array(){return H(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){w(this.restEncoder,t)}writeDsLen(t){w(this.restEncoder,t)}}class $t extends Ir{writeLeftID(t){w(this.restEncoder,t.client),w(this.restEncoder,t.clock)}writeRightID(t){w(this.restEncoder,t.client),w(this.restEncoder,t.clock)}writeClient(t){w(this.restEncoder,t)}writeInfo(t){Oe(this.restEncoder,t)}writeString(t){lt(this.restEncoder,t)}writeParentInfo(t){w(this.restEncoder,t?1:0)}writeTypeRef(t){w(this.restEncoder,t)}writeLen(t){w(this.restEncoder,t)}writeAny(t){_t(this.restEncoder,t)}writeBuf(t){R(this.restEncoder,t)}writeJSON(t){lt(this.restEncoder,JSON.stringify(t))}writeKey(t){lt(this.restEncoder,t)}}class kr{constructor(){this.restEncoder=Xt(),this.dsCurrVal=0}toUint8Array(){return H(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){let e=t-this.dsCurrVal;this.dsCurrVal=t,w(this.restEncoder,e)}writeDsLen(t){if(t===0)v();w(this.restEncoder,t-1),this.dsCurrVal+=t}}class it extends kr{constructor(){super();this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Yt,this.clientEncoder=new Ut,this.leftClockEncoder=new Yt,this.rightClockEncoder=new Yt,this.infoEncoder=new ve(Oe),this.stringEncoder=new Rn,this.parentInfoEncoder=new ve(Oe),this.typeRefEncoder=new Ut,this.lenEncoder=new Ut}toUint8Array(){let t=Xt();return w(t,0),R(t,this.keyClockEncoder.toUint8Array()),R(t,this.clientEncoder.toUint8Array()),R(t,this.leftClockEncoder.toUint8Array()),R(t,this.rightClockEncoder.toUint8Array()),R(t,H(this.infoEncoder)),R(t,this.stringEncoder.toUint8Array()),R(t,H(this.parentInfoEncoder)),R(t,this.typeRefEncoder.toUint8Array()),R(t,this.lenEncoder.toUint8Array()),Qt(t,H(this.restEncoder)),H(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){_t(this.restEncoder,t)}writeBuf(t){R(this.restEncoder,t)}writeJSON(t){_t(this.restEncoder,t)}writeKey(t){let e=this.keyMap.get(t);if(e===void 0)this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t);else this.keyClockEncoder.write(e)}}var wc=(t,e,n,r)=>{r=et(r,e[0].id.clock);let s=Z(e,r);w(t.restEncoder,e.length-s),t.writeClient(n),w(t.restEncoder,r);let o=e[s];o.write(t,r-o.id.clock);for(let i=s+1;i<e.length;i++)e[i].write(t,0)},Sr=(t,e,n)=>{let r=new Map;n.forEach((s,o)=>{if(I(e,o)>s)r.set(o,s)}),dn(e).forEach((s,o)=>{if(!n.has(o))r.set(o,0)}),w(t.restEncoder,r.size),z(r.entries()).sort((s,o)=>o[0]-s[0]).forEach(([s,o])=>{wc(t,e.clients.get(s),s,o)})},yc=(t,e)=>{let n=O(),r=x(t.restDecoder);for(let s=0;s<r;s++){let o=x(t.restDecoder),i=Array(o),c=t.readClient(),a=x(t.restDecoder);n.set(c,{i:0,refs:i});for(let f=0;f<o;f++){let l=t.readInfo();switch(Wt&l){case 0:{let h=t.readLen();i[f]=new j(g(c,a),h),a+=h;break}case 10:{let h=x(t.restDecoder);i[f]=new q(g(c,a),h),a+=h;break}default:{let h=(l&(G|A))===0,u=new b(g(c,a),null,(l&A)===A?t.readLeftID():null,null,(l&G)===G?t.readRightID():null,h?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,h&&(l&bt)===bt?t.readString():null,Ro(t,l));i[f]=u,a+=u.length}}}}return n},bc=(t,e,n)=>{let r=[],s=z(n.keys()).sort((d,p)=>d-p);if(s.length===0)return null;let o=()=>{if(s.length===0)return null;let d=n.get(s[s.length-1]);while(d.refs.length===d.i)if(s.pop(),s.length>0)d=n.get(s[s.length-1]);else return null;return d},i=o();if(i===null)return null;let c=new _r,a=new Map,f=(d,p)=>{let m=a.get(d);if(m==null||m>p)a.set(d,p)},l=i.refs[i.i++],h=new Map,u=()=>{for(let d of r){let p=d.id.client,m=n.get(p);if(m)m.i--,c.clients.set(p,m.refs.slice(m.i)),n.delete(p),m.i=0,m.refs=[];else c.clients.set(p,[d]);s=s.filter((B)=>B!==p)}r.length=0};while(!0){if(l.constructor!==q){let p=P(h,l.id.client,()=>I(e,l.id.client))-l.id.clock;if(p<0)r.push(l),f(l.id.client,l.id.clock-1),u();else{let m=l.getMissing(t,e);if(m!==null){r.push(l);let B=n.get(m)||{refs:[],i:0};if(B.refs.length===B.i)f(m,I(e,m)),u();else{l=B.refs[B.i++];continue}}else if(p===0||p<l.length)l.integrate(t,p),h.set(l.id.client,l.id.clock+l.length)}}if(r.length>0)l=r.pop();else if(i!==null&&i.i<i.refs.length)l=i.refs[i.i++];else if(i=o(),i===null)break;else l=i.refs[i.i++]}if(c.clients.size>0){let d=new it;return Sr(d,c,new Map),w(d.restEncoder,0),{missing:a,update:d.toUint8Array()}}return null},Ic=(t,e)=>Sr(t,e.doc.store,e.beforeState),kc=(t,e,n,r=new gt(t))=>y(e,(s)=>{s.local=!1;let o=!1,i=s.doc,c=i.store,a=yc(r,i),f=bc(s,c,a),l=c.pendingStructs;if(l){for(let[u,d]of l.missing)if(d<I(c,u)){o=!0;break}if(f){for(let[u,d]of f.missing){let p=l.missing.get(u);if(p==null||p>d)l.missing.set(u,d)}l.update=sn([l.update,f.update])}}else c.pendingStructs=f;let h=Vs(r,s,c);if(c.pendingDs){let u=new gt(ut(c.pendingDs));x(u.restDecoder);let d=Vs(u,s,c);if(h&&d)c.pendingDs=sn([h,d]);else c.pendingDs=h||d}else c.pendingDs=h;if(o){let u=c.pendingStructs.update;c.pendingStructs=null,to(s.doc,u)}},n,!1);var to=(t,e,n,r=gt)=>{let s=ut(e);kc(s,t,n,new r(s))},gS=(t,e,n)=>to(t,e,n,br),Sc=(t,e,n=new Map)=>{Sr(t,e.store,n),Ft(t,xc(e.store))},_c=(t,e=new Uint8Array([0]),n=new it)=>{let r=eo(e);Sc(n,t,r);let s=[n.toUint8Array()];if(t.store.pendingDs)s.push(t.store.pendingDs);if(t.store.pendingStructs)s.push(Mc(t.store.pendingStructs.update,e));if(s.length>1){if(n.constructor===$t)return Lc(s.map((o,i)=>i===0?o:$c(o)));else if(n.constructor===it)return sn(s)}return s[0]},bS=(t,e)=>_c(t,e,new $t),Tc=(t)=>{let e=new Map,n=x(t.restDecoder);for(let r=0;r<n;r++){let s=x(t.restDecoder),o=x(t.restDecoder);e.set(s,o)}return e},eo=(t)=>Tc(new yr(ut(t))),no=(t,e)=>(w(t.restEncoder,e.size),z(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{w(t.restEncoder,n),w(t.restEncoder,r)}),t),Uc=(t,e)=>no(t,dn(e.store)),Ec=(t,e=new kr)=>{if(t instanceof Map)no(e,t);else Uc(e,t);return e.toUint8Array()},vS=(t)=>Ec(t,new Ir);class ro{constructor(){this.l=[]}}var Ms=()=>new ro,Fs=(t,e)=>t.l.push(e),$s=(t,e)=>{let n=t.l,r=n.length;if(t.l=n.filter((s)=>e!==s),r===t.l.length)console.error("[yjs] Tried to remove event handler that doesn't exist.")},so=(t,e,n)=>oe(t.l,[e,n]);class pt{constructor(t,e){this.client=t,this.clock=e}}var Xe=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,g=(t,e)=>new pt(t,e);var oo=(t)=>{for(let[e,n]of t.doc.share.entries())if(n===t)return e;throw v()},rn=(t,e)=>{while(e!==null){if(e.parent===t)return!0;e=e.parent._item}return!1};class io{constructor(t,e,n,r=0){this.type=t,this.tname=e,this.item=n,this.assoc=r}}class co{constructor(t,e,n=0){this.type=t,this.index=e,this.assoc=n}}var Bc=(t,e,n=0)=>new co(t,e,n),Qe=(t,e,n)=>{let r=null,s=null;if(t._item===null)s=oo(t);else r=g(t._item.id.client,t._item.id.clock);return new io(r,s,e,n)},Wy=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Qe(t,null,n);e--}while(r!==null){if(!r.deleted&&r.countable){if(r.length>e)return Qe(t,g(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Qe(t,r.lastId,n);r=r.right}return Qe(t,null,n)};var Ac=(t,e)=>{let n=Lt(t,e),r=e.clock-n.id.clock;return{item:n,diff:r}},kf=(t,e,n=!0)=>{let r=e.store,{item:s,type:o,tname:i,assoc:c}=t,a=null,f=0;if(s!==null){if(I(r,s.client)<=s.clock)return null;let l=n?mr(r,s):Ac(r,s),h=l.item;if(!(h instanceof b))return null;if(a=h.parent,a._item===null||!a._item.deleted){f=h.deleted||!h.countable?0:l.diff+(c>=0?0:1);let u=h.left;while(u!==null){if(!u.deleted&&u.countable)f+=u.length;u=u.left}}}else{if(i!==null)a=e.get(i);else if(o!==null){if(I(r,o.client)<=o.clock)return null;let{item:l}=n?mr(r,o):{item:Lt(r,o)};if(l instanceof b&&l.content instanceof Q)a=l.content.type;else return null}else throw v();if(c>=0)f=a._length;else f=0}return Bc(a,f,t.assoc)};class lo{constructor(t,e){this.ds=t,this.sv=e}}var Cc=(t,e)=>new lo(t,e),Oa=Cc(Xs(),new Map);var Rt=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!we(e.ds,t.id),pr=(t,e)=>{let n=P(t.meta,pr,Y),r=t.doc.store;if(!n.has(e))e.sv.forEach((s,o)=>{if(s<I(r,o))V(t,g(o,s))}),Vt(t,e.ds,(s)=>{}),n.add(e)};class _r{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}var dn=(t)=>{let e=new Map;return t.clients.forEach((n,r)=>{let s=n[n.length-1];e.set(r,s.id.clock+s.length)}),e},I=(t,e)=>{let n=t.clients.get(e);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},ao=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{let r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw v()}n.push(e)},Z=(t,e)=>{let n=0,r=t.length-1,s=t[r],o=s.id.clock;if(o===e)return r;let i=N(e/(o+s.length-1)*r);while(n<=r){if(s=t[i],o=s.id.clock,o<=e){if(e<o+s.length)return i;n=i+1}else r=i-1;i=N((n+r)/2)}throw v()},Dc=(t,e)=>{let n=t.clients.get(e.client);return n[Z(n,e.clock)]},Lt=Dc,gr=(t,e,n)=>{let r=Z(e,n),s=e[r];if(s.id.clock<n&&s instanceof b)return e.splice(r+1,0,fn(t,s,n-s.id.clock)),r+1;return r},V=(t,e)=>{let n=t.doc.store.clients.get(e.client);return n[gr(t,n,e.clock)]},js=(t,e,n)=>{let r=e.clients.get(n.client),s=Z(r,n.clock),o=r[s];if(n.clock!==o.id.clock+o.length-1&&o.constructor!==j)r.splice(s+1,0,fn(t,o,n.clock-o.id.clock+1));return o},Oc=(t,e,n)=>{let r=t.clients.get(e.id.client);r[Z(r,e.id.clock)]=n},ho=(t,e,n,r,s)=>{if(r===0)return;let o=n+r,i=gr(t,e,n),c;do{if(c=e[i++],o<c.id.clock+c.length)gr(t,e,o);s(c)}while(i<e.length&&e[i].id.clock<o)};class uo{constructor(t,e,n){this.doc=t,this.deleteSet=new wt,this.beforeState=dn(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=e,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}var qs=(t,e)=>{if(e.deleteSet.clients.size===0&&!Rr(e.afterState,(n,r)=>e.beforeState.get(r)!==n))return!1;return xr(e.deleteSet),Ic(t,e),Ft(t,e.deleteSet),!0},Gs=(t,e,n)=>{let r=e._item;if(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)P(t.changed,e,Y).add(n)},en=(t,e)=>{let n=t[e],r=t[e-1],s=e;for(;s>0;n=r,r=t[--s-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor){if(r.mergeWith(n)){if(n instanceof b&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n)n.parent._map.set(n.parentSub,r);continue}}break}let o=e-s;if(o)t.splice(e+1-o,o);return o},Nc=(t,e,n)=>{for(let[r,s]of t.clients.entries()){let o=e.clients.get(r);for(let i=s.length-1;i>=0;i--){let c=s[i],a=c.clock+c.len;for(let f=Z(o,c.clock),l=o[f];f<o.length&&l.id.clock<a;l=o[++f]){let h=o[f];if(c.clock+c.len<=h.id.clock)break;if(h instanceof b&&h.deleted&&!h.keep&&n(h))h.gc(e,!1)}}}},vc=(t,e)=>{t.clients.forEach((n,r)=>{let s=e.clients.get(r);for(let o=n.length-1;o>=0;o--){let i=n[o],c=Ee(s.length-1,1+Z(s,i.clock+i.len-1));for(let a=c,f=s[a];a>0&&f.id.clock>=i.clock;f=s[a])a-=1+en(s,a)}})};var fo=(t,e)=>{if(e<t.length){let n=t[e],r=n.doc,s=r.store,{deleteSet:o,_mergeStructs:i}=n;try{xr(o),n.afterState=dn(n.doc.store),r.emit("beforeObserverCalls",[n,r]);let c=[];n.changed.forEach((a,f)=>c.push(()=>{if(f._item===null||!f._item.deleted)f._callObserver(n,a)})),c.push(()=>{n.changedParentTypes.forEach((a,f)=>{if(f._dEH.l.length>0&&(f._item===null||!f._item.deleted))c.push(()=>{a=a.filter((l)=>l.target._item===null||!l.target._item.deleted),a.forEach((l)=>{l.currentTarget=f,l._path=null}),a.sort((l,h)=>l.path.length-h.path.length),so(f._dEH,a,n)})}),c.push(()=>r.emit("afterTransaction",[n,r])),c.push(()=>{if(n._needFormattingCleanup)Xc(n)})}),oe(c,[])}finally{if(r.gc)Nc(o,s,r.gcFilter);vc(o,s),n.afterState.forEach((l,h)=>{let u=n.beforeState.get(h)||0;if(u!==l){let d=s.clients.get(h),p=et(Z(d,u),1);for(let m=d.length-1;m>=p;)m-=1+en(d,m)}});for(let l=i.length-1;l>=0;l--){let{client:h,clock:u}=i[l].id,d=s.clients.get(h),p=Z(d,u);if(p+1<d.length){if(en(d,p+1)>1)continue}if(p>0)en(d,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID))Ns(vt,he,"[yjs] ",ue,fe,"Changed the client-id because another client seems to be using it."),r.clientID=Qs();if(r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){let l=new $t;if(qs(l,n))r.emit("update",[l.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){let l=new it;if(qs(l,n))r.emit("updateV2",[l.toUint8Array(),n.origin,r,n])}let{subdocsAdded:c,subdocsLoaded:a,subdocsRemoved:f}=n;if(c.size>0||f.size>0||a.size>0)c.forEach((l)=>{if(l.clientID=r.clientID,l.collectionid==null)l.collectionid=r.collectionid;r.subdocs.add(l)}),f.forEach((l)=>r.subdocs.delete(l)),r.emit("subdocs",[{loaded:a,added:c,removed:f},r,n]),f.forEach((l)=>l.destroy());if(t.length<=e+1)r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t]);else fo(t,e+1)}}},y=(t,e,n=null,r=!0)=>{let s=t._transactionCleanups,o=!1,i=null;if(t._transaction===null){if(o=!0,t._transaction=new uo(t,n,r),s.push(t._transaction),s.length===1)t.emit("beforeAllTransactions",[t]);t.emit("beforeTransaction",[t._transaction,t])}try{i=e(t._transaction)}finally{if(o){let c=t._transaction===s[0];if(t._transaction=null,c)fo(s,0)}}return i};class po{constructor(t,e){this.insertions=e,this.deletions=t,this.meta=new Map}}var Hs=(t,e,n)=>{Vt(t,n.deletions,(r)=>{if(r instanceof b&&e.scope.some((s)=>s===t.doc||rn(s,r)))Cr(r,!1)})},Ps=(t,e,n)=>{let r=null,{doc:s,scope:o}=t;y(s,(c)=>{while(e.length>0&&t.currStackItem===null){let a=s.store,f=e.pop(),l=new Set,h=[],u=!1;Vt(c,f.insertions,(d)=>{if(d instanceof b){if(d.redone!==null){let{item:p,diff:m}=mr(a,d.id);if(m>0)p=V(c,g(p.id.client,p.id.clock+m));d=p}if(!d.deleted&&o.some((p)=>p===c.doc||rn(p,d)))h.push(d)}}),Vt(c,f.deletions,(d)=>{if(d instanceof b&&o.some((p)=>p===c.doc||rn(p,d))&&!we(f.insertions,d.id))l.add(d)}),l.forEach((d)=>{u=vo(c,d,l,f.insertions,t.ignoreRemoteMapChanges,t)!==null||u});for(let d=h.length-1;d>=0;d--){let p=h[d];if(t.deleteFilter(p))p.delete(c),u=!0}t.currStackItem=u?f:null}c.changed.forEach((a,f)=>{if(a.has(null)&&f._searchMarker)f._searchMarker.length=0}),r=c},t);let i=t.currStackItem;if(i!=null){let c=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:i,type:n,changedParentTypes:c,origin:t},t]),t.currStackItem=null}return i};class XR extends Ue{constructor(t,{captureTimeout:e=500,captureTransaction:n=(c)=>!0,deleteFilter:r=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:i=tt(t)?t[0].doc:t instanceof lc?t:t.doc}={}){super();this.scope=[],this.doc=i,this.addToScope(t),this.deleteFilter=r,s.add(this),this.trackedOrigins=s,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=e,this.afterTransactionHandler=(c)=>{if(!this.captureTransaction(c)||!this.scope.some((m)=>c.changedParentTypes.has(m)||m===this.doc)||!this.trackedOrigins.has(c.origin)&&(!c.origin||!this.trackedOrigins.has(c.origin.constructor)))return;let a=this.undoing,f=this.redoing,l=a?this.redoStack:this.undoStack;if(a)this.stopCapturing();else if(!f)this.clear(!1,!0);let h=new wt;c.afterState.forEach((m,B)=>{let k=c.beforeState.get(B)||0,Nr=m-k;if(Nr>0)de(h,B,k,Nr)});let u=Ve(),d=!1;if(this.lastChange>0&&u-this.lastChange<this.captureTimeout&&l.length>0&&!a&&!f){let m=l[l.length-1];m.deletions=dr([m.deletions,c.deleteSet]),m.insertions=dr([m.insertions,h])}else l.push(new po(c.deleteSet,h)),d=!0;if(!a&&!f)this.lastChange=u;Vt(c,c.deleteSet,(m)=>{if(m instanceof b&&this.scope.some((B)=>B===c.doc||rn(B,m)))Cr(m,!0)});let p=[{stackItem:l[l.length-1],origin:c.origin,type:a?"redo":"undo",changedParentTypes:c.changedParentTypes},this];if(d)this.emit("stack-item-added",p);else this.emit("stack-item-updated",p)},this.destroy=this.destroy.bind(this),this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",this.destroy)}addToScope(t){let e=new Set(this.scope);t=tt(t)?t:[t],t.forEach((n)=>{if(!e.has(n)){if(e.add(n),n instanceof T?n.doc!==this.doc:n!==this.doc)ur("[yjs#509] Not same Y.Doc");this.scope.push(n)}})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,e=!0){if(t&&this.canUndo()||e&&this.canRedo())this.doc.transact((n)=>{if(t)this.undoStack.forEach((r)=>Hs(n,this,r)),this.undoStack=[];if(e)this.redoStack.forEach((r)=>Hs(n,this,r)),this.redoStack=[];this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:e}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=Ps(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=Ps(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),this.doc.off("destroy",this.destroy),super.destroy()}}function*Rc(t){let e=x(t.restDecoder);for(let n=0;n<e;n++){let r=x(t.restDecoder),s=t.readClient(),o=x(t.restDecoder);for(let i=0;i<r;i++){let c=t.readInfo();if(c===10){let a=x(t.restDecoder);yield new q(g(s,o),a),o+=a}else if((Wt&c)!==0){let a=(c&(G|A))===0,f=new b(g(s,o),null,(c&A)===A?t.readLeftID():null,null,(c&G)===G?t.readRightID():null,a?t.readParentInfo()?t.readString():t.readLeftID():null,a&&(c&bt)===bt?t.readString():null,Ro(t,c));yield f,o+=f.length}else{let a=t.readLen();yield new j(g(s,o),a),o+=a}}}}class pn{constructor(t,e){this.gen=Rc(t),this.curr=null,this.done=!1,this.filterSkips=e,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===q);return this.curr}}class gn{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}var Lc=(t)=>sn(t,br,$t);var Vc=(t,e)=>{if(t.constructor===j){let{client:n,clock:r}=t.id;return new j(g(n,r+e),t.length-e)}else if(t.constructor===q){let{client:n,clock:r}=t.id;return new q(g(n,r+e),t.length-e)}else{let n=t,{client:r,clock:s}=n.id;return new b(g(r,s+e),null,g(r,s+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},sn=(t,e=gt,n=it)=>{if(t.length===1)return t[0];let r=t.map((l)=>new e(ut(l))),s=r.map((l)=>new pn(l,!0)),o=null,i=new n,c=new gn(i);while(!0){if(s=s.filter((u)=>u.curr!==null),s.sort((u,d)=>{if(u.curr.id.client===d.curr.id.client){let p=u.curr.id.clock-d.curr.id.clock;if(p===0)return u.curr.constructor===d.curr.constructor?0:u.curr.constructor===q?1:-1;else return p}else return d.curr.id.client-u.curr.id.client}),s.length===0)break;let l=s[0],h=l.curr.id.client;if(o!==null){let u=l.curr,d=!1;while(u!==null&&u.id.clock+u.length<=o.struct.id.clock+o.struct.length&&u.id.client>=o.struct.id.client)u=l.next(),d=!0;if(u===null||u.id.client!==h||d&&u.id.clock>o.struct.id.clock+o.struct.length)continue;if(h!==o.struct.id.client)st(c,o.struct,o.offset),o={struct:u,offset:0},l.next();else if(o.struct.id.clock+o.struct.length<u.id.clock)if(o.struct.constructor===q)o.struct.length=u.id.clock+u.length-o.struct.id.clock;else{st(c,o.struct,o.offset);let p=u.id.clock-o.struct.id.clock-o.struct.length;o={struct:new q(g(h,o.struct.id.clock+o.struct.length),p),offset:0}}else{let p=o.struct.id.clock+o.struct.length-u.id.clock;if(p>0)if(o.struct.constructor===q)o.struct.length-=p;else u=Vc(u,p);if(!o.struct.mergeWith(u))st(c,o.struct,o.offset),o={struct:u,offset:0},l.next()}}else o={struct:l.curr,offset:0},l.next();for(let u=l.curr;u!==null&&u.id.client===h&&u.id.clock===o.struct.id.clock+o.struct.length&&u.constructor!==q;u=l.next())st(c,o.struct,o.offset),o={struct:u,offset:0}}if(o!==null)st(c,o.struct,o.offset),o=null;Tr(c);let a=r.map((l)=>wr(l)),f=dr(a);return Ft(i,f),i.toUint8Array()},Mc=(t,e,n=gt,r=it)=>{let s=eo(e),o=new r,i=new gn(o),c=new n(ut(t)),a=new pn(c,!1);while(a.curr){let l=a.curr,h=l.id.client,u=s.get(h)||0;if(a.curr.constructor===q){a.next();continue}if(l.id.clock+l.length>u){st(i,l,et(u-l.id.clock,0)),a.next();while(a.curr&&a.curr.id.client===h)st(i,a.curr,0),a.next()}else while(a.curr&&a.curr.id.client===h&&a.curr.id.clock+a.curr.length<=u)a.next()}Tr(i);let f=wr(c);return Ft(o,f),o.toUint8Array()};var go=(t)=>{if(t.written>0)t.clientStructs.push({written:t.written,restEncoder:H(t.encoder.restEncoder)}),t.encoder.restEncoder=Xt(),t.written=0},st=(t,e,n)=>{if(t.written>0&&t.currClient!==e.id.client)go(t);if(t.written===0)t.currClient=e.id.client,t.encoder.writeClient(e.id.client),w(t.encoder.restEncoder,e.id.clock+n);e.write(t.encoder,n),t.written++},Tr=(t)=>{go(t);let e=t.encoder.restEncoder;w(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){let r=t.clientStructs[n];w(e,r.written),Qt(e,r.restEncoder)}},Fc=(t,e,n,r)=>{let s=new n(ut(t)),o=new pn(s,!1),i=new r,c=new gn(i);for(let f=o.curr;f!==null;f=o.next())st(c,e(f),0);Tr(c);let a=wr(s);return Ft(i,a),i.toUint8Array()};var $c=(t)=>Fc(t,ss,gt,$t),zs="You must not compute changes after the event-handler fired.";class ye{constructor(t,e){this.target=t,this.currentTarget=t,this.transaction=e,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=jc(this.currentTarget,this.target))}deletes(t){return we(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw M(zs);let t=new Map,e=this.target;this.transaction.changed.get(e).forEach((r)=>{if(r!==null){let s=e._map.get(r),o,i;if(this.adds(s)){let c=s.left;while(c!==null&&this.adds(c))c=c.left;if(this.deletes(s))if(c!==null&&this.deletes(c))o="delete",i=_e(c.content.getContent());else return;else if(c!==null&&this.deletes(c))o="update",i=_e(c.content.getContent());else o="add",i=void 0}else if(this.deletes(s))o="delete",i=_e(s.content.getContent());else return;t.set(r,{action:o,oldValue:i})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw M(zs);let e=this.target,n=Y(),r=Y(),s=[];if(t={added:n,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(e).has(null)){let i=null,c=()=>{if(i)s.push(i)};for(let a=e._start;a!==null;a=a.right)if(a.deleted){if(this.deletes(a)&&!this.adds(a)){if(i===null||i.delete===void 0)c(),i={delete:0};i.delete+=a.length,r.add(a)}}else if(this.adds(a)){if(i===null||i.insert===void 0)c(),i={insert:[]};i.insert=i.insert.concat(a.content.getContent()),n.add(a)}else{if(i===null||i.retain===void 0)c(),i={retain:0};i.retain+=a.length}if(i!==null&&i.retain===void 0)c()}this._changes=t}return t}}var jc=(t,e)=>{let n=[];while(e._item!==null&&e!==t){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,s=e._item.parent._start;while(s!==e._item&&s!==null){if(!s.deleted&&s.countable)r+=s.length;s=s.right}n.unshift(r)}e=e._item.parent}return n},D=()=>{ur("Invalid access: Add Yjs type to a document before reading data.")},mo=80,Er=0;class xo{constructor(t,e){t.marker=!0,this.p=t,this.index=e,this.timestamp=Er++}}var qc=(t)=>{t.timestamp=Er++},wo=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Er++},Gc=(t,e,n)=>{if(t.length>=mo){let r=t.reduce((s,o)=>s.timestamp<o.timestamp?s:o);return wo(r,e,n),r}else{let r=new xo(e,n);return t.push(r),r}},mn=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;let n=t._searchMarker.length===0?null:t._searchMarker.reduce((o,i)=>ct(e-o.index)<ct(e-i.index)?o:i),r=t._start,s=0;if(n!==null)r=n.p,s=n.index,qc(n);while(r.right!==null&&s<e){if(!r.deleted&&r.countable){if(e<s+r.length)break;s+=r.length}r=r.right}while(r.left!==null&&s>e)if(r=r.left,!r.deleted&&r.countable)s-=r.length;while(r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock)if(r=r.left,!r.deleted&&r.countable)s-=r.length;if(n!==null&&ct(n.index-s)<r.parent.length/mo)return wo(n,r,s),n;else return Gc(t._searchMarker,r,s)},pe=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){let s=t[r];if(n>0){let o=s.p;o.marker=!1;while(o&&(o.deleted||!o.countable))if(o=o.left,o&&!o.deleted&&o.countable)s.index-=o.length;if(o===null||o.marker===!0){t.splice(r,1);continue}s.p=o,o.marker=!0}if(e<s.index||n>0&&e===s.index)s.index=et(e,s.index+n)}};var xn=(t,e,n)=>{let r=t,s=e.changedParentTypes;while(!0){if(P(s,t,()=>[]).push(n),t._item===null)break;t=t._item.parent}so(r._eH,n,e)};class T{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Ms(),this._dEH=Ms(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,e){this.doc=t,this._item=e}_copy(){throw F()}clone(){throw F()}_write(t){}get _first(){let t=this._start;while(t!==null&&t.deleted)t=t.right;return t}_callObserver(t,e){if(!t.local&&this._searchMarker)this._searchMarker.length=0}observe(t){Fs(this._eH,t)}observeDeep(t){Fs(this._dEH,t)}unobserve(t){$s(this._eH,t)}unobserveDeep(t){$s(this._dEH,t)}toJSON(){}}var yo=(t,e,n)=>{if(t.doc??D(),e<0)e=t._length+e;if(n<0)n=t._length+n;let r=n-e,s=[],o=t._start;while(o!==null&&r>0){if(o.countable&&!o.deleted){let i=o.content.getContent();if(i.length<=e)e-=i.length;else{for(let c=e;c<i.length&&r>0;c++)s.push(i[c]),r--;e=0}}o=o.right}return s},bo=(t)=>{t.doc??D();let e=[],n=t._start;while(n!==null){if(n.countable&&!n.deleted){let r=n.content.getContent();for(let s=0;s<r.length;s++)e.push(r[s])}n=n.right}return e};var ge=(t,e)=>{let n=0,r=t._start;t.doc??D();while(r!==null){if(r.countable&&!r.deleted){let s=r.content.getContent();for(let o=0;o<s.length;o++)e(s[o],n++,t)}r=r.right}},Io=(t,e)=>{let n=[];return ge(t,(r,s)=>{n.push(e(r,s,t))}),n},Hc=(t)=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){while(e!==null&&e.deleted)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}let s=n[r++];if(n.length<=r)n=null;return{done:!1,value:s}}}},ko=(t,e)=>{t.doc??D();let n=mn(t,e),r=t._start;if(n!==null)r=n.p,e-=n.index;for(;r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},on=(t,e,n,r)=>{let s=n,o=t.doc,{clientID:i,store:c}=o,a=n===null?e._start:n.right,f=[],l=()=>{if(f.length>0)s=new b(g(i,I(c,i)),s,s&&s.lastId,a,a&&a.id,e,null,new xt(f)),s.integrate(t,0),f=[]};r.forEach((h)=>{if(h===null)f.push(h);else switch(h.constructor){case Number:case Object:case Boolean:case Array:case String:f.push(h);break;default:switch(l(),h.constructor){case Uint8Array:case ArrayBuffer:s=new b(g(i,I(c,i)),s,s&&s.lastId,a,a&&a.id,e,null,new be(new Uint8Array(h))),s.integrate(t,0);break;case lc:s=new b(g(i,I(c,i)),s,s&&s.lastId,a,a&&a.id,e,null,new Ie(h)),s.integrate(t,0);break;default:if(h instanceof T)s=new b(g(i,I(c,i)),s,s&&s.lastId,a,a&&a.id,e,null,new Q(h)),s.integrate(t,0);else throw Error("Unexpected content type in insert operation")}}}),l()},So=()=>M("Length exceeded!"),_o=(t,e,n,r)=>{if(n>e._length)throw So();if(n===0){if(e._searchMarker)pe(e._searchMarker,n,r.length);return on(t,e,null,r)}let s=n,o=mn(e,n),i=e._start;if(o!==null){if(i=o.p,n-=o.index,n===0)i=i.prev,n+=i&&i.countable&&!i.deleted?i.length:0}for(;i!==null;i=i.right)if(!i.deleted&&i.countable){if(n<=i.length){if(n<i.length)V(t,g(i.id.client,i.id.clock+n));break}n-=i.length}if(e._searchMarker)pe(e._searchMarker,s,r.length);return on(t,e,i,r)},Pc=(t,e,n)=>{let s=(e._searchMarker||[]).reduce((o,i)=>i.index>o.index?i:o,{index:0,p:e._start}).p;if(s)while(s.right)s=s.right;return on(t,e,s,n)},To=(t,e,n,r)=>{if(r===0)return;let s=n,o=r,i=mn(e,n),c=e._start;if(i!==null)c=i.p,n-=i.index;for(;c!==null&&n>0;c=c.right)if(!c.deleted&&c.countable){if(n<c.length)V(t,g(c.id.client,c.id.clock+n));n-=c.length}while(r>0&&c!==null){if(!c.deleted){if(r<c.length)V(t,g(c.id.client,c.id.clock+r));c.delete(t),r-=c.length}c=c.right}if(r>0)throw So();if(e._searchMarker)pe(e._searchMarker,s,-o+r)},cn=(t,e,n)=>{let r=e._map.get(n);if(r!==void 0)r.delete(t)},Br=(t,e,n,r)=>{let s=e._map.get(n)||null,o=t.doc,i=o.clientID,c;if(r==null)c=new xt([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new xt([r]);break;case Uint8Array:c=new be(r);break;case lc:c=new Ie(r);break;default:if(r instanceof T)c=new Q(r);else throw Error("Unexpected content type")}new b(g(i,I(o.store,i)),s,s&&s.lastId,null,null,e,n,c).integrate(t,0)},Ar=(t,e)=>{t.doc??D();let n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},Uo=(t)=>{let e={};return t.doc??D(),t._map.forEach((n,r)=>{if(!n.deleted)e[r]=n.content.getContent()[n.length-1]}),e},Eo=(t,e)=>{t.doc??D();let n=t._map.get(e);return n!==void 0&&!n.deleted};var zc=(t,e)=>{let n={};return t._map.forEach((r,s)=>{let o=r;while(o!==null&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0)))o=o.left;if(o!==null&&Rt(o,e))n[s]=o.content.getContent()[o.length-1]}),n},Ye=(t)=>(t.doc??D(),Ls(t._map.entries(),(e)=>!e[1].deleted));class Pg extends ye{}class Os extends T{constructor(){super();this._prelimContent=[],this._searchMarker=[]}static from(t){let e=new Os;return e.push(t),e}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Os}clone(){let t=new Os;return t.insert(0,this.toArray().map((e)=>e instanceof T?e.clone():e)),t}get length(){return this.doc??D(),this._length}_callObserver(t,e){super._callObserver(t,e),xn(this,t,new Pg(this,t))}insert(t,e){if(this.doc!==null)y(this.doc,(n)=>{_o(n,this,t,e)});else this._prelimContent.splice(t,0,...e)}push(t){if(this.doc!==null)y(this.doc,(e)=>{Pc(e,this,t)});else this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,e=1){if(this.doc!==null)y(this.doc,(n)=>{To(n,this,t,e)});else this._prelimContent.splice(t,e)}get(t){return ko(this,t)}toArray(){return bo(this)}slice(t=0,e=this.length){return yo(this,t,e)}toJSON(){return this.map((t)=>t instanceof T?t.toJSON():t)}map(t){return Io(this,t)}forEach(t){ge(this,t)}[Symbol.iterator](){return Hc(this)}_write(t){t.writeTypeRef(pl)}}var Jc=(t)=>new Os;class Vy extends ye{constructor(t,e,n){super(t,e);this.keysChanged=n}}class Ur extends T{constructor(t){super();if(this._prelimContent=null,t===void 0)this._prelimContent=new Map;else this._prelimContent=new Map(t)}_integrate(t,e){super._integrate(t,e),this._prelimContent.forEach((n,r)=>{this.set(r,n)}),this._prelimContent=null}_copy(){return new Ur}clone(){let t=new Ur;return this.forEach((e,n)=>{t.set(n,e instanceof T?e.clone():e)}),t}_callObserver(t,e){xn(this,t,new Vy(this,t,e))}toJSON(){this.doc??D();let t={};return this._map.forEach((e,n)=>{if(!e.deleted){let r=e.content.getContent()[e.length-1];t[n]=r instanceof T?r.toJSON():r}}),t}get size(){return[...Ye(this)].length}keys(){return Ze(Ye(this),(t)=>t[0])}values(){return Ze(Ye(this),(t)=>t[1].content.getContent()[t[1].length-1])}entries(){return Ze(Ye(this),(t)=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??D(),this._map.forEach((e,n)=>{if(!e.deleted)t(e.content.getContent()[e.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(t){if(this.doc!==null)y(this.doc,(e)=>{cn(e,this,t)});else this._prelimContent.delete(t)}set(t,e){if(this.doc!==null)y(this.doc,(n)=>{Br(n,this,t,e)});else this._prelimContent.set(t,e);return e}get(t){return Ar(this,t)}has(t){return Eo(this,t)}clear(){if(this.doc!==null)y(this.doc,(t)=>{this.forEach(function(e,n,r){cn(t,r,n)})});else this._prelimContent.clear()}_write(t){t.writeTypeRef(gl)}}var Kc=(t)=>new Ur,ot=(t,e)=>t===e||typeof t==="object"&&typeof e==="object"&&t&&e&&Gn(t,e);class ln{constructor(t,e,n,r){this.left=t,this.right=e,this.index=n,this.currentAttributes=r}forward(){if(this.right===null)v();switch(this.right.content.constructor){case U:if(!this.right.deleted)jt(this.currentAttributes,this.right.content);break;default:if(!this.right.deleted)this.index+=this.right.length;break}this.left=this.right,this.right=this.right.right}}var Js=(t,e,n)=>{while(e.right!==null&&n>0){switch(e.right.content.constructor){case U:if(!e.right.deleted)jt(e.currentAttributes,e.right.content);break;default:if(!e.right.deleted){if(n<e.right.length)V(t,g(e.right.id.client,e.right.id.clock+n));e.index+=e.right.length,n-=e.right.length}break}e.left=e.right,e.right=e.right.right}return e},tn=(t,e,n,r)=>{let s=new Map,o=r?mn(e,n):null;if(o){let i=new ln(o.p.left,o.p,o.index,s);return Js(t,i,n-o.index)}else{let i=new ln(null,e._start,0,s);return Js(t,i,n)}},Bo=(t,e,n,r)=>{while(n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===U&&ot(r.get(n.right.content.key),n.right.content.value))){if(!n.right.deleted)r.delete(n.right.content.key);n.forward()}let s=t.doc,o=s.clientID;r.forEach((i,c)=>{let{left:a,right:f}=n,l=new b(g(o,I(s.store,o)),a,a&&a.lastId,f,f&&f.id,e,null,new U(c,i));l.integrate(t,0),n.right=l,n.forward()})},jt=(t,e)=>{let{key:n,value:r}=e;if(r===null)t.delete(n);else t.set(n,r)},Ao=(t,e)=>{while(!0){if(t.right===null)break;else if(t.right.deleted||t.right.content.constructor===U&&ot(e[t.right.content.key]??null,t.right.content.value));else break;t.forward()}},Co=(t,e,n,r)=>{let s=t.doc,o=s.clientID,i=new Map;for(let c in r){let a=r[c],f=n.currentAttributes.get(c)??null;if(!ot(f,a)){i.set(c,f);let{left:l,right:h}=n;n.right=new b(g(o,I(s.store,o)),l,l&&l.lastId,h,h&&h.id,e,null,new U(c,a)),n.right.integrate(t,0),n.forward()}}return i},fr=(t,e,n,r,s)=>{n.currentAttributes.forEach((u,d)=>{if(s[d]===void 0)s[d]=null});let o=t.doc,i=o.clientID;Ao(n,s);let c=Co(t,e,n,s),a=r.constructor===String?new X(r):r instanceof T?new Q(r):new yt(r),{left:f,right:l,index:h}=n;if(e._searchMarker)pe(e._searchMarker,n.index,a.getLength());l=new b(g(i,I(o.store,i)),f,f&&f.lastId,l,l&&l.id,e,null,a),l.integrate(t,0),n.right=l,n.index=h,n.forward(),Bo(t,e,n,c)},Ks=(t,e,n,r,s)=>{let o=t.doc,i=o.clientID;Ao(n,s);let c=Co(t,e,n,s);t:while(n.right!==null&&(r>0||c.size>0&&(n.right.deleted||n.right.content.constructor===U))){if(!n.right.deleted)switch(n.right.content.constructor){case U:{let{key:a,value:f}=n.right.content,l=s[a];if(l!==void 0){if(ot(l,f))c.delete(a);else{if(r===0)break t;c.set(a,f)}n.right.delete(t)}else n.currentAttributes.set(a,f);break}default:if(r<n.right.length)V(t,g(n.right.id.client,n.right.id.clock+r));r-=n.right.length;break}n.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
4
- `;n.right=new b(g(i,I(o.store,i)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new X(a)),n.right.integrate(t,0),n.forward()}Bo(t,e,n,c)},Do=(t,e,n,r,s)=>{let o=e,i=O();while(o&&(!o.countable||o.deleted)){if(!o.deleted&&o.content.constructor===U){let f=o.content;i.set(f.key,f)}o=o.right}let c=0,a=!1;while(e!==o){if(n===e)a=!0;if(!e.deleted){let f=e.content;switch(f.constructor){case U:{let{key:l,value:h}=f,u=r.get(l)??null;if(i.get(l)!==f||u===h){if(e.delete(t),c++,!a&&(s.get(l)??null)===h&&u!==h)if(u===null)s.delete(l);else s.set(l,u)}if(!a&&!e.deleted)jt(s,f);break}}}e=e.right}return c},Wc=(t,e)=>{while(e&&e.right&&(e.right.deleted||!e.right.countable))e=e.right;let n=new Set;while(e&&(e.deleted||!e.countable)){if(!e.deleted&&e.content.constructor===U){let r=e.content.key;if(n.has(r))e.delete(t);else n.add(r)}e=e.left}},Zc=(t)=>{let e=0;return y(t.doc,(n)=>{let{_start:r,_start:s}=t,o=O(),i=Se(o);while(s){if(s.deleted===!1)switch(s.content.constructor){case U:jt(i,s.content);break;default:e+=Do(n,r,s,o,i),o=Se(i),r=s;break}s=s.right}}),e},Xc=(t)=>{let e=new Set,n=t.doc;for(let[r,s]of t.afterState.entries()){let o=t.beforeState.get(r)||0;if(s===o)continue;ho(t,n.store.clients.get(r),o,s,(i)=>{if(!i.deleted&&i.content.constructor===U&&i.constructor!==j)e.add(i.parent)})}y(n,(r)=>{Vt(t,t.deleteSet,(s)=>{if(s instanceof j||!s.parent._hasFormatting||e.has(s.parent))return;let o=s.parent;if(s.content.constructor===U)e.add(o);else Wc(r,s)});for(let s of e)Zc(s)})},Ws=(t,e,n)=>{let r=n,s=Se(e.currentAttributes),o=e.right;while(n>0&&e.right!==null){if(e.right.deleted===!1)switch(e.right.content.constructor){case Q:case yt:case X:if(n<e.right.length)V(t,g(e.right.id.client,e.right.id.clock+n));n-=e.right.length,e.right.delete(t);break}e.forward()}if(o)Do(t,o,e.right,s,e.currentAttributes);let i=(e.left||e.right).parent;if(i._searchMarker)pe(i._searchMarker,e.index,-r+n);return e};class Uy extends ye{constructor(t,e,n){super(t,e);this.childListChanged=!1,this.keysChanged=new Set,n.forEach((r)=>{if(r===null)this.childListChanged=!0;else this.keysChanged.add(r)})}get changes(){if(this._changes===null){let t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){let t=this.target.doc,e=[];y(t,(n)=>{let r=new Map,s=new Map,o=this.target._start,i=null,c={},a="",f=0,l=0,h=()=>{if(i!==null){let u=null;switch(i){case"delete":if(l>0)u={delete:l};l=0;break;case"insert":if(typeof a==="object"||a.length>0){if(u={insert:a},r.size>0)u.attributes={},r.forEach((d,p)=>{if(d!==null)u.attributes[p]=d})}a="";break;case"retain":if(f>0){if(u={retain:f},!rs(c))u.attributes=es({},c)}f=0;break}if(u)e.push(u);i=null}};while(o!==null){switch(o.content.constructor){case Q:case yt:if(this.adds(o)){if(!this.deletes(o))h(),i="insert",a=o.content.getContent()[0],h()}else if(this.deletes(o)){if(i!=="delete")h(),i="delete";l+=1}else if(!o.deleted){if(i!=="retain")h(),i="retain";f+=1}break;case X:if(this.adds(o)){if(!this.deletes(o)){if(i!=="insert")h(),i="insert";a+=o.content.str}}else if(this.deletes(o)){if(i!=="delete")h(),i="delete";l+=o.length}else if(!o.deleted){if(i!=="retain")h(),i="retain";f+=o.length}break;case U:{let{key:u,value:d}=o.content;if(this.adds(o)){if(!this.deletes(o)){let p=r.get(u)??null;if(!ot(p,d)){if(i==="retain")h();if(ot(d,s.get(u)??null))delete c[u];else c[u]=d}else if(d!==null)o.delete(n)}}else if(this.deletes(o)){s.set(u,d);let p=r.get(u)??null;if(!ot(p,d)){if(i==="retain")h();c[u]=p}}else if(!o.deleted){s.set(u,d);let p=c[u];if(p!==void 0){if(!ot(p,d)){if(i==="retain")h();if(d===null)delete c[u];else c[u]=d}else if(p!==null)o.delete(n)}}if(!o.deleted){if(i==="insert")h();jt(r,o.content)}break}}o=o.right}h();while(e.length>0){let u=e[e.length-1];if(u.retain!==void 0&&u.attributes===void 0)e.pop();else break}}),this._delta=e}return this._delta}}class as extends T{constructor(t){super();this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??D(),this._length}_integrate(t,e){super._integrate(t,e);try{this._pending.forEach((n)=>n())}catch(n){console.error(n)}this._pending=null}_copy(){return new as}clone(){let t=new as;return t.applyDelta(this.toDelta()),t}_callObserver(t,e){super._callObserver(t,e);let n=new Uy(this,t,e);if(xn(this,t,n),!t.local&&this._hasFormatting)t._needFormattingCleanup=!0}toString(){this.doc??D();let t="",e=this._start;while(e!==null){if(!e.deleted&&e.countable&&e.content.constructor===X)t+=e.content.str;e=e.right}return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:e=!0}={}){if(this.doc!==null)y(this.doc,(n)=>{let r=new ln(null,this._start,0,new Map);for(let s=0;s<t.length;s++){let o=t[s];if(o.insert!==void 0){let i=!e&&typeof o.insert==="string"&&s===t.length-1&&r.right===null&&o.insert.slice(-1)===`
5
- `?o.insert.slice(0,-1):o.insert;if(typeof i!=="string"||i.length>0)fr(n,this,r,i,o.attributes||{})}else if(o.retain!==void 0)Ks(n,this,r,o.retain,o.attributes||{});else if(o.delete!==void 0)Ws(n,r,o.delete)}});else this._pending.push(()=>this.applyDelta(t))}toDelta(t,e,n){this.doc??D();let r=[],s=new Map,o=this.doc,i="",c=this._start;function a(){if(i.length>0){let l={},h=!1;s.forEach((d,p)=>{h=!0,l[p]=d});let u={insert:i};if(h)u.attributes=l;r.push(u),i=""}}let f=()=>{while(c!==null){if(Rt(c,t)||e!==void 0&&Rt(c,e))switch(c.content.constructor){case X:{let l=s.get("ychange");if(t!==void 0&&!Rt(c,t)){if(l===void 0||l.user!==c.id.client||l.type!=="removed")a(),s.set("ychange",n?n("removed",c.id):{type:"removed"})}else if(e!==void 0&&!Rt(c,e)){if(l===void 0||l.user!==c.id.client||l.type!=="added")a(),s.set("ychange",n?n("added",c.id):{type:"added"})}else if(l!==void 0)a(),s.delete("ychange");i+=c.content.str;break}case Q:case yt:{a();let l={insert:c.content.getContent()[0]};if(s.size>0){let h={};l.attributes=h,s.forEach((u,d)=>{h[d]=u})}r.push(l);break}case U:if(Rt(c,t))a(),jt(s,c.content);break}c=c.right}a()};if(t||e)y(o,(l)=>{if(t)pr(l,t);if(e)pr(l,e);f()},"cleanup");else f();return r}insert(t,e,n){if(e.length<=0)return;let r=this.doc;if(r!==null)y(r,(s)=>{let o=tn(s,this,t,!n);if(!n)n={},o.currentAttributes.forEach((i,c)=>{n[c]=i});fr(s,this,o,e,n)});else this._pending.push(()=>this.insert(t,e,n))}insertEmbed(t,e,n){let r=this.doc;if(r!==null)y(r,(s)=>{let o=tn(s,this,t,!n);fr(s,this,o,e,n||{})});else this._pending.push(()=>this.insertEmbed(t,e,n||{}))}delete(t,e){if(e===0)return;let n=this.doc;if(n!==null)y(n,(r)=>{Ws(r,tn(r,this,t,!0),e)});else this._pending.push(()=>this.delete(t,e))}format(t,e,n){if(e===0)return;let r=this.doc;if(r!==null)y(r,(s)=>{let o=tn(s,this,t,!1);if(o.right===null)return;Ks(s,this,o,e,n)});else this._pending.push(()=>this.format(t,e,n))}removeAttribute(t){if(this.doc!==null)y(this.doc,(e)=>{cn(e,this,t)});else this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,e){if(this.doc!==null)y(this.doc,(n)=>{Br(n,this,t,e)});else this._pending.push(()=>this.setAttribute(t,e))}getAttribute(t){return Ar(this,t)}getAttributes(){return Uo(this)}_write(t){t.writeTypeRef(ml)}}var Qc=(t)=>new as;class nn{constructor(t,e=()=>!0){this._filter=e,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??D()}[Symbol.iterator](){return this}next(){let t=this._currentNode,e=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(e)))do if(e=t.content.type,!t.deleted&&(e.constructor===Mt||e.constructor===mt)&&e._start!==null)t=e._start;else while(t!==null){let n=t.next;if(n!==null){t=n;break}else if(t.parent===this._root)t=null;else t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));if(this._firstCall=!1,t===null)return{value:void 0,done:!0};return this._currentNode=t,{value:t.content.type,done:!1}}}class mt extends T{constructor(){super();this._prelimContent=[]}get firstChild(){let t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new mt}clone(){let t=new mt;return t.insert(0,this.toArray().map((e)=>e instanceof T?e.clone():e)),t}get length(){return this.doc??D(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new nn(this,t)}querySelector(t){t=t.toUpperCase();let n=new nn(this,(r)=>r.nodeName&&r.nodeName.toUpperCase()===t).next();if(n.done)return null;else return n.value}querySelectorAll(t){return t=t.toUpperCase(),z(new nn(this,(e)=>e.nodeName&&e.nodeName.toUpperCase()===t))}_callObserver(t,e){xn(this,t,new Oo(this,e,t))}toString(){return Io(this,(t)=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,e={},n){let r=t.createDocumentFragment();if(n!==void 0)n._createAssociation(r,this);return ge(this,(s)=>{r.insertBefore(s.toDOM(t,e,n),null)}),r}insert(t,e){if(this.doc!==null)y(this.doc,(n)=>{_o(n,this,t,e)});else this._prelimContent.splice(t,0,...e)}insertAfter(t,e){if(this.doc!==null)y(this.doc,(n)=>{let r=t&&t instanceof T?t._item:t;on(n,this,r,e)});else{let n=this._prelimContent,r=t===null?0:n.findIndex((s)=>s===t)+1;if(r===0&&t!==null)throw M("Reference item not found");n.splice(r,0,...e)}}delete(t,e=1){if(this.doc!==null)y(this.doc,(n)=>{To(n,this,t,e)});else this._prelimContent.splice(t,e)}toArray(){return bo(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return ko(this,t)}slice(t=0,e=this.length){return yo(this,t,e)}forEach(t){ge(this,t)}_write(t){t.writeTypeRef(wl)}}var Yc=(t)=>new mt;class Mt extends mt{constructor(t="UNDEFINED"){super();this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,e){super._integrate(t,e),this._prelimAttrs.forEach((n,r)=>{this.setAttribute(r,n)}),this._prelimAttrs=null}_copy(){return new Mt(this.nodeName)}clone(){let t=new Mt(this.nodeName),e=this.getAttributes();return ns(e,(n,r)=>{t.setAttribute(r,n)}),t.insert(0,this.toArray().map((n)=>n instanceof T?n.clone():n)),t}toString(){let t=this.getAttributes(),e=[],n=[];for(let i in t)n.push(i);n.sort();let r=n.length;for(let i=0;i<r;i++){let c=n[i];e.push(c+'="'+t[c]+'"')}let s=this.nodeName.toLocaleLowerCase(),o=e.length>0?" "+e.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(t){if(this.doc!==null)y(this.doc,(e)=>{cn(e,this,t)});else this._prelimAttrs.delete(t)}setAttribute(t,e){if(this.doc!==null)y(this.doc,(n)=>{Br(n,this,t,e)});else this._prelimAttrs.set(t,e)}getAttribute(t){return Ar(this,t)}hasAttribute(t){return Eo(this,t)}getAttributes(t){return t?zc(this,t):Uo(this)}toDOM(t=document,e={},n){let r=t.createElement(this.nodeName),s=this.getAttributes();for(let o in s){let i=s[o];if(typeof i==="string")r.setAttribute(o,i)}if(ge(this,(o)=>{r.appendChild(o.toDOM(t,e,n))}),n!==void 0)n._createAssociation(r,this);return r}_write(t){t.writeTypeRef(xl),t.writeKey(this.nodeName)}}var tl=(t)=>new Mt(t.readKey());class Oo extends ye{constructor(t,e,n){super(t,n);this.childListChanged=!1,this.attributesChanged=new Set,e.forEach((r)=>{if(r===null)this.childListChanged=!0;else this.attributesChanged.add(r)})}}class an extends Ur{constructor(t){super();this.hookName=t}_copy(){return new an(this.hookName)}clone(){let t=new an(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(t=document,e={},n){let r=e[this.hookName],s;if(r!==void 0)s=r.createDom(this);else s=document.createElement(this.hookName);if(s.setAttribute("data-yjs-hook",this.hookName),n!==void 0)n._createAssociation(s,this);return s}_write(t){t.writeTypeRef(yl),t.writeKey(this.hookName)}}var el=(t)=>new an(t.readKey());class hn extends as{get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new hn}clone(){let t=new hn;return t.applyDelta(this.toDelta()),t}toDOM(t=document,e,n){let r=t.createTextNode(this.toString());if(n!==void 0)n._createAssociation(r,this);return r}toString(){return this.toDelta().map((t)=>{let e=[];for(let r in t.attributes){let s=[];for(let o in t.attributes[r])s.push({key:o,value:t.attributes[r][o]});s.sort((o,i)=>o.key<i.key?-1:1),e.push({nodeName:r,attrs:s})}e.sort((r,s)=>r.nodeName<s.nodeName?-1:1);let n="";for(let r=0;r<e.length;r++){let s=e[r];n+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){let i=s.attrs[o];n+=` ${i.key}="${i.value}"`}n+=">"}n+=t.insert;for(let r=e.length-1;r>=0;r--)n+=`</${e[r].nodeName}>`;return n}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(bl)}}var nl=(t)=>new hn;class wn{constructor(t,e){this.id=t,this.length=e}get deleted(){throw F()}mergeWith(t){return!1}write(t,e,n){throw F()}integrate(t,e){throw F()}}var rl=0;class j extends wn{get deleted(){return!0}delete(){}mergeWith(t){if(this.constructor!==t.constructor)return!1;return this.length+=t.length,!0}integrate(t,e){if(e>0)this.id.clock+=e,this.length-=e;ao(t.doc.store,this)}write(t,e){t.writeInfo(rl),t.writeLen(this.length-e)}getMissing(t,e){return null}}class be{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new be(this.content)}splice(t){throw F()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeBuf(this.content)}getRef(){return 3}}var sl=(t)=>new be(t.readBuf());class me{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new me(this.len)}splice(t){let e=new me(this.len-t);return this.len=t,e}mergeWith(t){return this.len+=t.len,!0}integrate(t,e){de(t.deleteSet,e.id.client,e.id.clock,this.len),e.markDeleted()}delete(t){}gc(t){}write(t,e){t.writeLen(this.len-e)}getRef(){return 1}}var ol=(t)=>new me(t.readLen()),No=(t,e)=>new lc({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Ie{constructor(t){if(t._item)console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid.");this.doc=t;let e={};if(this.opts=e,!t.gc)e.gc=!1;if(t.autoLoad)e.autoLoad=!0;if(t.meta!==null)e.meta=t.meta}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ie(No(this.doc.guid,this.opts))}splice(t){throw F()}mergeWith(t){return!1}integrate(t,e){if(this.doc._item=e,t.subdocsAdded.add(this.doc),this.doc.shouldLoad)t.subdocsLoaded.add(this.doc)}delete(t){if(t.subdocsAdded.has(this.doc))t.subdocsAdded.delete(this.doc);else t.subdocsRemoved.add(this.doc)}gc(t){}write(t,e){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}var il=(t)=>new Ie(No(t.readString(),t.readAny()));class yt{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new yt(this.embed)}splice(t){throw F()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeJSON(this.embed)}getRef(){return 5}}var cl=(t)=>new yt(t.readJSON());class U{constructor(t,e){this.key=t,this.value=e}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new U(this.key,this.value)}splice(t){throw F()}mergeWith(t){return!1}integrate(t,e){let n=e.parent;n._searchMarker=null,n._hasFormatting=!0}delete(t){}gc(t){}write(t,e){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}var ll=(t)=>new U(t.readKey(),t.readJSON());class un{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new un(this.arr)}splice(t){let e=new un(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){let n=this.arr.length;t.writeLen(n-e);for(let r=e;r<n;r++){let s=this.arr[r];t.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}var al=(t)=>{let e=t.readLen(),n=[];for(let r=0;r<e;r++){let s=t.readString();if(s==="undefined")n.push(void 0);else n.push(JSON.parse(s))}return new un(n)},hl=ce("node_env")==="development";class xt{constructor(t){this.arr=t,hl&&Hn(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new xt(this.arr)}splice(t){let e=new xt(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){let n=this.arr.length;t.writeLen(n-e);for(let r=e;r<n;r++){let s=this.arr[r];t.writeAny(s)}}getRef(){return 8}}var ul=(t)=>{let e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new xt(n)};class X{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new X(this.str)}splice(t){let e=new X(this.str.slice(t));this.str=this.str.slice(0,t);let n=this.str.charCodeAt(t-1);if(n>=55296&&n<=56319)this.str=this.str.slice(0,t-1)+"�",e.str="�"+e.str.slice(1);return e}mergeWith(t){return this.str+=t.str,!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeString(e===0?this.str:this.str.slice(e))}getRef(){return 4}}var fl=(t)=>new X(t.readString()),dl=[Jc,Kc,Qc,tl,Yc,el,nl],pl=0,gl=1,ml=2,xl=3,wl=4,yl=5,bl=6;class Q{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Q(this.type._copy())}splice(t){throw F()}mergeWith(t){return!1}integrate(t,e){this.type._integrate(t.doc,e)}delete(t){let e=this.type._start;while(e!==null){if(!e.deleted)e.delete(t);else if(e.id.clock<(t.beforeState.get(e.id.client)||0))t._mergeStructs.push(e);e=e.right}this.type._map.forEach((n)=>{if(!n.deleted)n.delete(t);else if(n.id.clock<(t.beforeState.get(n.id.client)||0))t._mergeStructs.push(n)}),t.changed.delete(this.type)}gc(t){let e=this.type._start;while(e!==null)e.gc(t,!0),e=e.right;this.type._start=null,this.type._map.forEach((n)=>{while(n!==null)n.gc(t,!0),n=n.left}),this.type._map=new Map}write(t,e){this.type._write(t)}getRef(){return 7}}var Il=(t)=>new Q(dl[t.readTypeRef()](t)),mr=(t,e)=>{let n=e,r=0,s;do{if(r>0)n=g(n.client,n.clock+r);s=Lt(t,n),r=n.clock-s.id.clock,n=s.redone}while(n!==null&&s instanceof b);return{item:s,diff:r}},Cr=(t,e)=>{while(t!==null&&t.keep!==e)t.keep=e,t=t.parent._item},fn=(t,e,n)=>{let{client:r,clock:s}=e.id,o=new b(g(r,s+n),e,g(r,s+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));if(e.deleted)o.markDeleted();if(e.keep)o.keep=!0;if(e.redone!==null)o.redone=g(e.redone.client,e.redone.clock+n);if(e.right=o,o.right!==null)o.right.left=o;if(t._mergeStructs.push(o),o.parentSub!==null&&o.right===null)o.parent._map.set(o.parentSub,o);return e.length=n,o},Zs=(t,e)=>zt(t,(n)=>we(n.deletions,e)),vo=(t,e,n,r,s,o)=>{let i=t.doc,{store:c,clientID:a}=i,f=e.redone;if(f!==null)return V(t,f);let l=e.parent._item,h=null,u;if(l!==null&&l.deleted===!0){if(l.redone===null&&(!n.has(l)||vo(t,l,n,r,s,o)===null))return null;while(l.redone!==null)l=V(t,l.redone)}let d=l===null?e.parent:l.content.type;if(e.parentSub===null){h=e.left,u=e;while(h!==null){let k=h;while(k!==null&&k.parent._item!==l)k=k.redone===null?null:V(t,k.redone);if(k!==null&&k.parent._item===l){h=k;break}h=h.left}while(u!==null){let k=u;while(k!==null&&k.parent._item!==l)k=k.redone===null?null:V(t,k.redone);if(k!==null&&k.parent._item===l){u=k;break}u=u.right}}else{if(u=null,e.right&&!s){h=e;while(h!==null&&h.right!==null&&(h.right.redone||we(r,h.right.id)||Zs(o.undoStack,h.right.id)||Zs(o.redoStack,h.right.id))){h=h.right;while(h.redone)h=V(t,h.redone)}if(h&&h.right!==null)return null}else h=d._map.get(e.parentSub)||null;if(h!==null&&h.parent._item!==l)h=d._map.get(e.parentSub)||null}let p=I(c,a),m=g(a,p),B=new b(m,h,h&&h.lastId,u,u&&u.id,d,e.parentSub,e.content.copy());return e.redone=m,Cr(B,!0),B.integrate(t,0),B};class b extends wn{constructor(t,e,n,r,s,o,i,c){super(t,c.getLength());this.origin=n,this.left=e,this.right=r,this.rightOrigin=s,this.parent=o,this.parentSub=i,this.redone=null,this.content=c,this.info=this.content.isCountable()?En:0}set marker(t){if((this.info&Ce)>0!==t)this.info^=Ce}get marker(){return(this.info&Ce)>0}get keep(){return(this.info&Un)>0}set keep(t){if(this.keep!==t)this.info^=Un}get countable(){return(this.info&En)>0}get deleted(){return(this.info&Ae)>0}set deleted(t){if(this.deleted!==t)this.info^=Ae}markDeleted(){this.info|=Ae}getMissing(t,e){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=I(e,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=I(e,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===pt&&this.id.client!==this.parent.client&&this.parent.clock>=I(e,this.parent.client))return this.parent.client;if(this.origin)this.left=js(t,e,this.origin),this.origin=this.left.lastId;if(this.rightOrigin)this.right=V(t,this.rightOrigin),this.rightOrigin=this.right.id;if(this.left&&this.left.constructor===j||this.right&&this.right.constructor===j)this.parent=null;else if(!this.parent){if(this.left&&this.left.constructor===b)this.parent=this.left.parent,this.parentSub=this.left.parentSub;else if(this.right&&this.right.constructor===b)this.parent=this.right.parent,this.parentSub=this.right.parentSub}else if(this.parent.constructor===pt){let n=Lt(e,this.parent);if(n.constructor===j)this.parent=null;else this.parent=n.content.type}return null}integrate(t,e){if(e>0)this.id.clock+=e,this.left=js(t,t.doc.store,g(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(e),this.length-=e;if(this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let n=this.left,r;if(n!==null)r=n.right;else if(this.parentSub!==null){r=this.parent._map.get(this.parentSub)||null;while(r!==null&&r.left!==null)r=r.left}else r=this.parent._start;let s=new Set,o=new Set;while(r!==null&&r!==this.right){if(o.add(r),s.add(r),Xe(this.origin,r.origin)){if(r.id.client<this.id.client)n=r,s.clear();else if(Xe(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(Lt(t.doc.store,r.origin))){if(!s.has(Lt(t.doc.store,r.origin)))n=r,s.clear()}else break;r=r.right}this.left=n}if(this.left!==null){let n=this.left.right;this.right=n,this.left.right=this}else{let n;if(this.parentSub!==null){n=this.parent._map.get(this.parentSub)||null;while(n!==null&&n.left!==null)n=n.left}else n=this.parent._start,this.parent._start=this;this.right=n}if(this.right!==null)this.right.left=this;else if(this.parentSub!==null){if(this.parent._map.set(this.parentSub,this),this.left!==null)this.left.delete(t)}if(this.parentSub===null&&this.countable&&!this.deleted)this.parent._length+=this.length;if(ao(t.doc.store,this),this.content.integrate(t,this),Gs(t,this.parent,this.parentSub),this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)this.delete(t)}else new j(this.id,this.length).integrate(t,0)}get next(){let t=this.right;while(t!==null&&t.deleted)t=t.right;return t}get prev(){let t=this.left;while(t!==null&&t.deleted)t=t.left;return t}get lastId(){return this.length===1?this.id:g(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&Xe(t.origin,this.lastId)&&this.right===t&&Xe(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){let e=this.parent._searchMarker;if(e)e.forEach((n)=>{if(n.p===t){if(n.p=this,!this.deleted&&this.countable)n.index-=this.length}});if(t.keep)this.keep=!0;if(this.right=t.right,this.right!==null)this.right.left=this;return this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){let e=this.parent;if(this.countable&&this.parentSub===null)e._length-=this.length;this.markDeleted(),de(t.deleteSet,this.id.client,this.id.clock,this.length),Gs(t,e,this.parentSub),this.content.delete(t)}}gc(t,e){if(!this.deleted)throw v();if(this.content.gc(t),e)Oc(t,this,new j(this.id,this.length));else this.content=new me(this.length)}write(t,e){let n=e>0?g(this.id.client,this.id.clock+e-1):this.origin,r=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&Wt|(n===null?0:A)|(r===null?0:G)|(s===null?0:bt);if(t.writeInfo(o),n!==null)t.writeLeftID(n);if(r!==null)t.writeRightID(r);if(n===null&&r===null){let i=this.parent;if(i._item!==void 0){let c=i._item;if(c===null){let a=oo(i);t.writeParentInfo(!0),t.writeString(a)}else t.writeParentInfo(!1),t.writeLeftID(c.id)}else if(i.constructor===String)t.writeParentInfo(!0),t.writeString(i);else if(i.constructor===pt)t.writeParentInfo(!1),t.writeLeftID(i);else v();if(s!==null)t.writeString(s)}this.content.write(t,e)}}var Ro=(t,e)=>kl[e&Wt](t),kl=[()=>{v()},ol,al,sl,fl,cl,ll,Il,ul,il,()=>{v()}],Sl=10;class q extends wn{get deleted(){return!0}delete(){}mergeWith(t){if(this.constructor!==t.constructor)return!1;return this.length+=t.length,!0}integrate(t,e){v()}write(t,e){t.writeInfo(Sl),w(t.restEncoder,this.length-e)}getMissing(t,e){return null}}var Lo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},Vo="__ $YJS$ __";if(Lo[Vo]===!0)console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Lo[Vo]=!0;var Mo=Math.floor;var Fo=(t,e)=>t<e?t:e,$o=(t,e)=>t>e?t:e;var yn=128;var qt=127;var{MAX_SAFE_INTEGER:qo,MIN_SAFE_INTEGER:va}=Number;var{fromCharCode:Ul,fromCodePoint:Ra}=String,La=Ul(65535);var El=(t)=>{let e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let s=0;s<n;s++)r[s]=e.codePointAt(s);return r},Ht=typeof TextEncoder<"u"?new TextEncoder:null,Bl=(t)=>Ht.encode(t),Go=Ht?Bl:El;var Gt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});if(Gt&&Gt.decode(new Uint8Array).length===1)Gt=null;class Po{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}var Sf=()=>new Po;var x_=(t)=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e};var Ef=(t)=>{let e=new Uint8Array(x_(t)),n=0;for(let r=0;r<t.bufs.length;r++){let s=t.bufs[r];e.set(s,n),n+=s.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e};var bn=(t,e)=>{let n=t.cbuf.length;if(t.cpos===n)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0;t.cbuf[t.cpos++]=e};var rt=(t,e)=>{while(e>qt)bn(t,yn|qt&e),e=Mo(e/128);bn(t,qt&e)};var Dr=new Uint8Array(30000),Dl=Dr.length/3,Ol=(t,e)=>{if(e.length<Dl){let n=Ht.encodeInto(e,Dr).written||0;rt(t,n);for(let r=0;r<n;r++)bn(t,Dr[r])}else kn(t,Go(e))},Nl=(t,e)=>{let n=unescape(encodeURIComponent(e)),r=n.length;rt(t,r);for(let s=0;s<r;s++)bn(t,n.codePointAt(s))},In=Ht&&Ht.encodeInto?Ol:Nl;var vl=(t,e)=>{let n=t.cbuf.length,r=t.cpos,s=Fo(n-r,e.length),o=e.length-s;if(t.cbuf.set(e.subarray(0,s),r),t.cpos+=s,o>0)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array($o(n*2,o)),t.cbuf.set(e.subarray(s)),t.cpos=o},kn=(t,e)=>{rt(t,e.byteLength),vl(t,e)};var ja=new DataView(new ArrayBuffer(4));var Or=(t)=>Error(t);var Jo=Or("Unexpected end of array"),Vl=Or("Integer out of Range"),Ml=(t,e,n)=>{if(e<0||n<0||e+n>t.length)throw Jo;return new Uint8Array(t.buffer,t.byteOffset+e,n)};class Ko{constructor(t){this.arr=t,this.pos=0}}var qy=(t)=>new Ko(t);var Fl=(t,e)=>{let n=Ml(t.arr,t.pos,e);return t.pos+=e,n},Sn=(t)=>Fl(t,ke(t));var zo=(t)=>t.arr[t.pos++];var ke=(t)=>{let e=0,n=1,r=t.arr.length;while(t.pos<r){let s=t.arr[t.pos++];if(e=e+(s&qt)*n,n*=128,s<yn)return e;if(e>qo)throw Vl}throw Jo};var $l=(t)=>{let e=ke(t);if(e===0)return"";else{let n=String.fromCodePoint(zo(t));if(--e<100)while(e--)n+=String.fromCodePoint(zo(t));else while(e>0){let r=e<1e4?e:1e4,s=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,s),e-=r}return decodeURIComponent(escape(n))}},jl=(t)=>Gt.decode(Sn(t)),_n=Gt?jl:$l;var yS=0,wS=1,xS=2,_S=3;class Tf extends Error{constructor(t){super(t);this.name="EnvelopeError"}}function __(t){let e=Sf();switch(t.type){case"doc-sync":{rt(e,yS),In(e,t.path),rt(e,t.epoch),kn(e,t.body);break}case"awareness":{rt(e,wS),kn(e,t.body);break}case"doc-close":{rt(e,xS),In(e,t.path);break}case"control":{rt(e,_S),In(e,JSON.stringify(t.message));break}default:throw new Tf(`unknown-frame:${t.type}`)}return Ef(e)}function C_(t){try{let e=qy(t),n=ke(e);switch(n){case yS:{let r=_n(e),s=ke(e);return{body:Sn(e),epoch:s,path:r,type:"doc-sync"}}case wS:return{body:Sn(e),type:"awareness"};case xS:return{path:_n(e),type:"doc-close"};case _S:{let r=JSON.parse(_n(e));if(typeof r!=="object"||typeof r.type!=="string")throw new Tf("malformed-control");return{message:r,type:"control"}}default:throw new Tf(`unknown-frame-type:${n}`)}}catch(e){if(e instanceof Tf)throw e;throw new Tf(`malformed-frame: ${e instanceof Error?e.message:String(e)}`)}}
6
- export{lc,gS,bS,vS,Wy,kf,XR,Pg,Os,Vy,Ur,Uy,as,Sf,x_,Ef,qy,yS,wS,xS,_S,Tf,__,C_};
7
-
8
- //# debugId=C8A932CB0923CE9D64756E2164756E21
9
- //# sourceMappingURL=studio-q4tv82h7.js.map
@@ -1,5 +0,0 @@
1
- var i=globalThis;function pk(n){i.__jxPlatform=n}function Am(){return i.__jxLauncher}var e=new Map;function fk(){let n=[];for(let[r,a]of e)for(let t=0;t<a;t++)n.push(r);return n}function d(n){e.set(n,(e.get(n)??0)+1)}function m(n){let r=(e.get(n)??1)-1;if(r>0)e.set(n,r);else e.delete(n)}function h(n){let r=new Map;return new Proxy(n,{get(a,t){let o=Reflect.get(a,t);if(typeof o!=="function"||typeof t!=="string")return o;let f=r.get(t);if(f&&f.raw===o)return f.wrapper;let s=t,c=(...w)=>{let u=o.apply(a,w);if(typeof u?.then!=="function")return u;d(s);let g=()=>{m(s)};return u.then(g,g),u};return r.set(t,{raw:o,wrapper:c}),c}})}var l=null;function p(){let n=i.__jxPlatform;if(!n)throw Error("No platform registered. Call registerPlatform() before starting Studio.");if(l?.raw!==n)l={raw:n,wrapped:h(n)};return l.wrapped}function We(){return i.__jxPlatform!=null}
2
- export{pk,Am,fk,p,We};
3
-
4
- //# debugId=E67412EE62964ACB64756E2164756E21
5
- //# sourceMappingURL=studio-qpqa7vk3.js.map
@@ -1,5 +0,0 @@
1
- import{tt}from"./studio-5g0ag7c0.js";import{te}from"./studio-ery42sqr.js";import{fk,p,We}from"./studio-qpqa7vk3.js";import{Zt}from"./studio-tt2nactf.js";import{ge,Q,v,Mo,k}from"./studio-vzacdfsc.js";import{xn,YC,m,u,No,ci}from"./studio-3aey7dd3.js";import{Gi,pm,hp,Rd,zu}from"./studio-4m3826v2.js";import{un,rn}from"./studio-geq1ea6k.js";import{y}from"./studio-q1h883bt.js";import{rt,Zi,zt,T,R,An,Ct,Xo,Nn,vk}from"./studio-e7xxa0sj.js";import{qn}from"./studio-bmn4mn9j.js";import{kw}from"./studio-txjjzrsm.js";import{aa,KE,la,YE,kb,ZE}from"./studio-9ft45c83.js";import{cC,dC,cm}from"./studio-47y6fbpf.js";import{vE}from"./studio-5py436sf.js";import{ab,wE,lb,b1}from"./studio-954ds834.js";import{sI,D,cI,Oo}from"./studio-wgh5kxpj.js";import{Oe}from"./studio-a9yzstqj.js";import{me}from"./studio-v2bvmbjj.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",Y);function et(t,e){t.region=e.region,t.name=e.name,t.kind=e.kind,t.src=e.src,t.facts=e.facts,t.ref=e.ref,t.specimen=e.specimen,t.specimenFamily=e.specimenFamily,t.fontFace=e.fontFace,t.extLabel=e.extLabel,t.usageState=e.usageState,t.usageHeadline=e.usageHeadline,t.usageFiles=e.usageFiles,t.hasUsageFiles=e.usageFiles.length>0}function at(t,e,a){t.replaceChildren();let r=v({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});et(r,e);let i=null,o=!1,n=R("media-pane",r,t).then((s)=>{if(o)return s.dispose(),s.root;return i=s,s.root});return{attached:()=>{if(o)return!1;let s=i?.root;return s===void 0?!0:s instanceof HTMLElement&&t.contains(s)},dispose(){o=!0,i?.dispose(),i=null},ready:n,update:(s)=>et(r,s)}}var z="media",Ht=new Set([".woff",".woff2",".ttf",".otf"]),Ot="The quick brown fox jumps over the lazy dog",A=new Map;function H(t){return A.get(t)??null}function l1(t,e){let a=H(t);return a!==null&&a.tabId===e.id&&a.wrap.isConnected&&a.surface.attached()}function sb(t){let e=A.get(t);if(!e)return;e.scope.stop(),e.surface.dispose(),A.delete(t)}function Vt(t){let e=Gi(t);if(Ht.has(e))return"font";let a=hp({name:t});if(a==="image"||a==="video"||a==="audio")return a;return e===".pdf"?"embed":"unviewable"}function _t(t,e){let a=[hp({name:t})];if(e?.width!=null&&e.height!=null)a.push(`${e.width} × ${e.height}`);if(e?.bytes!=null)a.push(b1(e.bytes));if(e?.modified)a.push(`modified ${e.modified.slice(0,10)}`);return a.join(" · ")}function Jt(t){return`jx-specimen-${t.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function Wt(t){let e=ZE(t);if(e===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(t?.status==="ready"?t.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:e,usageState:"shown"}}async function Bt(t){let{openFileInTab:e}=await (me("dmc2xvcq"),import("./files-dmc2xvcq.js"));await e(t)}function mE(t,e){let{paneId:a,wrap:r}=t;if(l1(a,e))return;sb(a);let i=e.documentPath??"",o=Jt(i),n=zu(i),s=Rd(i),l=Gi(i),c=Vt(i),h=null,g=()=>{if(h!==null&&H(a)===h)f()},x=()=>{let j=ab(i),d=YE(i);if(j===null)wE(i).then(g);if(d===null||d.status==="pending")kb(i).then(g);return{extLabel:l||"this file",facts:_t(i,j),fontFace:c==="font"?`@font-face { font-family: "${o}"; src: url("${n}"); }`:"",kind:c,name:i.split("/").pop()??"",ref:s,region:Zi(a,"media"),specimen:Ot,specimenFamily:`--jx-specimen-family: "${o}"`,src:n,...Wt(d)}},f=()=>{h?.surface.update(x())},S=ge(),N=at(r,x(),{copyRef:()=>{navigator.clipboard?.writeText(s)},imageLoaded:(j,d)=>{if(lb(i,j,d))g()},openDocument:(j)=>{Bt(j)}});h={paneId:a,scope:S,surface:N,tabId:e.id,wrap:r},A.set(a,h),S.run(()=>{Q(()=>{if(H(a)!==h)return;e.documentPath,f()})})}var qt={children:[],tagName:"div"};function xw(t){return pm(t)}function Kt(t){return Gi(t)===".svg"?[z,"source"]:[z]}function gE(t,e={}){let a=m.tabs.get(t);if(a)return ci(t,{focus:e.focus!==!1}),a;return No({capabilities:{modes:Kt(t)},document:structuredClone(qt),documentPath:t,id:t,sourceFormat:null,...e.paneId!==void 0&&{paneId:e.paneId},...e.preview===!0&&{preview:!0},...e.focus===!1&&{focus:!1}})}var Xt={children:[],tagName:"div"},Yt=new Set(["bunfig.json","jsconfig.json","package-lock.json","package.json","tsconfig.json","wrangler.json"]);function Bf(t){let e=t.slice(t.lastIndexOf("/")+1);if(Yt.has(e)||e.endsWith(".schema.json"))return!1;return t.endsWith(".json")||Boolean(Zt(t))}function it(t,e){if(t.startsWith("../")||t.includes("/../"))return`"${t}" is outside this project, so its comparison belongs to the project that owns it.`;if(e==="R")return"A renamed file's comparison needs both paths, and Studio does not model the old name yet.";if(xw(t))return`"${t}" is an image or media file, and a comparison of one is not text.`;return null}function Qt(){return["git-diff"]}function ee(t){let e=m.tabs.get(t);if(e)return ci(t),e;return No({capabilities:{modes:Qt()},document:structuredClone(Xt),documentPath:t,id:t,sourceFormat:null})}async function ot(t){if(!Bf(t))return ee(t);let e=await (me("dmc2xvcq"),import("./files-dmc2xvcq.js"));return await e.openFileInTab(t,{})??[...m.tabs.values()].find((r)=>r.documentPath===t)??null}var nt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubPublish",$description:"Create GitHub Repository: the three things the flow needs before it calls the API — the repository's name, an optional description, and whether it is private. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answer buttons. Nothing here reaches GitHub: `github/github-publish.ts` keeps the token, the request and the activity, and this document only collects.",tagName:"jx-dialog",$props:{headline:"Create GitHub Repository",confirmLabel:"Create Repository",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-publish"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'What is NOT here is most of the conversion. `.github-publish-dialog` was a flex column with an 8px gap and `8px 0` of padding: the gap is the one thing it said that nothing else draws, and `jx-dialog`\'s own body already pads the content, so only the gap survives. `.github-publish-dialog sp-textfield { width: 100% }` had nothing to transcribe either — a `jx-field` row is a grid whose control cell stretches, so the field fills the row without being told to. The three `sp-field-label`s are gone with them, because `jx-field` draws the label AND names the control from it; the third of them carried no `for` at all, so "Visibility" was text beside a switch rather than a name for it.','& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"}},children:[{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Repository name"},attributes:{part:"row","data-field":"name"},children:[{tagName:"jx-textfield",$props:{placeholder:"my-project",value:{$ref:"#/state/name"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Description (optional)"},attributes:{part:"row","data-field":"description"},children:[{tagName:"jx-textfield",$props:{placeholder:"A brief description",value:{$ref:"#/state/description"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDescription"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Visibility"},attributes:{part:"row","data-field":"visibility"},children:[{tagName:"div",$description:'The row opens with a plain `div`, and that is the whole reason it exists: `jx-field` names the first thing slotted into it that observes `labelledby`, so a switch slotted straight in would be announced "Visibility" over the top of the words printed beside it. A `div` observes no naming, so the switch keeps the name its own label gives it.',attributes:{part:"visibility-row"},children:[{tagName:"jx-switch",attributes:{part:"toggle"},$props:{checked:{$ref:"#/state/isPrivate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setPrivate"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Private repository"}]}]}]}]}]};T("github-publish",nt);function st(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","github-publish")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm({description:i.description,isPrivate:i.isPrivate,name:i.name})},description:"",isPrivate:!0,name:t.name,setDescription:(l)=>{i.description=l},setName:(l)=>{i.name=l},setPrivate:(l)=>{i.isPrivate=l}}),o=null,n=R("github-publish",i,e).then(async(l)=>{o=l;let c=l.root;if(a)return l.dispose(),c;if(await An(c),a)return c;return un(c),c});return{close(){if(a)return;let l=o?.root;if(l instanceof HTMLElement)rn(l);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}var M=["Create the repository","Add the remote","Push"];function re(t){return new Promise((e)=>{let a=!1,r=(o)=>{if(a)return;a=!0,e(o)},i=st({layer:Ct("dialog"),name:t,onCancel:()=>{i.close()},onClosed:()=>{r(null)},onConfirm:(o)=>{r({...o,name:o.name||t}),i.close()}})})}async function O({projectName:t}){let e=await kw();if(!e)return!1;let a=await re(t);if(!a)return!1;let r=aa({source:"Source Control",status:`Creating ${a.name}…`,steps:[...M],title:"Create GitHub repository"});r.step(M[0]);let i=await fetch("https://api.github.com/user/repos",{body:JSON.stringify({auto_init:!1,description:a.description,name:a.name,private:a.isPrivate}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json"},method:"POST"}).catch((l)=>(r.log(te(l)),null));if(!i)return r.fail("Could not reach GitHub to create the repository.",{action:"git.createGithubRepository"}),!1;if(!i.ok){let l=await i.json();return r.log(l.errors?.[0]?.message||l.message||`GitHub answered ${i.status}.`),r.fail("Could not create the GitHub repository.",{action:"git.createGithubRepository"}),!1}let o=await i.json();r.log(`Created ${o.html_url}`);let n=p();r.step(M[1]);try{await n.gitAddRemote("origin",o.clone_url)}catch(l){return r.log(te(l)),r.fail("The repository was created, but the remote could not be added.",{action:"panel.focus.git"}),!1}r.step(M[2]);try{await n.gitPush({setUpstream:!0})}catch(l){return r.log(te(l)),r.fail("The repository was created, but the push failed.",{action:"git.push"}),!1}let{refreshGitStatus:s}=await (me("yef7bshy"),import("./git-panel-yef7bshy.js"));return await s(),r.done(o.html_url),k.success(`Repository created: ${o.html_url}`,{key:"github.repo"}),!0}var P=[];function ie(){return We()&&typeof p().listProjects==="function"}async function yw(){if(!ie()){P=[];return}try{P=await p().listProjects?.()??[]}catch{P=[]}}function pE(){return P}function lt(t){P=t}var ct=2,oe=1e4;class pt extends Error{blockedBy;constructor(t,e){super(t.length===0?`Studio did not report ${ct} consecutive quiet frames within ${e}ms`:`Studio was not idle after ${e}ms — blocked by ${t.join("; ")}`);this.name="NotIdleError",this.blockedBy=t}}function dt(){return[{blockers:()=>{let t=cI();return t>0?[`render: ${t} renderer(s) mid-paint`]:[]},name:"render"},{blockers:cC,name:"canvas"},{blockers:()=>{let t=fk();if(t.length===0)return[];return[`platform: ${t.length} in-flight (${[...new Set(t)].join(", ")})`]},name:"platform"},{blockers:vk,name:"overlay"},{blockers:KE,name:"activity"},{blockers:vE,name:"grid"}]}function ne(t=dt()){let e=[];for(let a of t)e.push(...a.blockers());return e}function ut(t={}){let{frames:e=ct,now:a=()=>Date.now(),raf:r=(n)=>{requestAnimationFrame(()=>n())},sources:i=dt(),timeoutMs:o=oe}=t;return new Promise((n,s)=>{let l=a()+o,c=0,h=!1,g=[],x=()=>{if(h)return;let f=ne(i);if(f.length>0)g=f,c=0;else if(c+=1,c>=e){h=!0,n();return}if(a()>=l){h=!0,s(new pt(f.length>0?f:g,o));return}r(x)};r(x)})}var mt=/\.toggle[A-Z]/;function se(t){return t.replace(/\.toggle([A-Z])/,(e,a)=>`.set${a}`)}function ht(t){return!mt.test(t.id)}var le={"file.contextMenu":{disposition:"refused",note:"opening a menu to press an item names a control; the ITEM is the command"},"layers.contextMenu":{disposition:"refused",note:"matched RENDERED TEXT, which R1 of scripts/screenshots/README.md forbids; a row is addressed by its data-jx-path"},"media.browse":{disposition:"command",note:"media.browse, site-architecture.md §9.4"},"project.showWelcome":{disposition:"refused",note:"cold start is a startup profile (?profile=fresh), not an action"},"settings.setSection":{disposition:"refused",note:`mirrored the section registry's LABELS; say settings.open { section: "cssVars" }`},"view.setStatus":{disposition:"refused",note:"the status bar is not staged — if a capture needs a calm shell, the app must BE calm"}},ce={openSettings:'a user opens Settings — run("settings.open")',select:'a user selects a node — run("selection.set", { path })',setActivity:'a user picks a Navigator panel — run("navigator.showPanel", { panel })',setRightTab:'a user picks an Inspector tab — run("inspector.setTab", { tab })',setStatus:"the status bar reports what the app just did; staging it is the one lie the Remote Rule (studio.md §13.5) names outright",setZoom:'a user zooms — run("canvas.setZoom", { zoom })'};function V(t,e){let a=t[e];if(a===void 0)return[];if(!Array.isArray(a))throw TypeError(`seed argument "${e}" must be an array`);return a}function pe(t,e){let a=t[e];if(a===null||typeof a!=="object")throw TypeError(`seed argument "${e}" must be an object`);return a}function de(t,e){let a=t[e];if(a===void 0)return;if(typeof a!=="string")throw TypeError(`seed argument "${e}" must be a string`);return a}function ue(t){return[{boundary:"the assistant's model stream",id:"seed.assistant",run:(e)=>{t.seedAssistantMessages(V(e,"messages"))}},{boundary:"the collaboration websocket (awareness + sync)",id:"seed.collab",run:(e)=>{let a=u.value;if(!a)return;let r=xn(a);r.status="synced",r.active=!0;let i=[];for(let o of V(e,"peers")){let n={...o.state};n.focusedPath??=a.documentPath,i.push({...o,state:n})}r.peers=i,Oo()}},{boundary:"the Cloudflare Pages API",id:"seed.publish",run:(e)=>{let a=de(e,"accountId");t.seedPublishConnected({deployment:pe(e,"deployment"),...a?{accountId:a}:{}})}},{boundary:"the platform's git routes (`gitStatus` / `gitBranches` / `gitLog`)",id:"seed.git",run:(e)=>{y.git.status=e.status??null,y.git.branches=e.branches??null,y.git.logEntries=e.log??null,y.git.loading=!1,y.git.error=null,Oo()}},{boundary:"the platform's recent-projects store (desktop IPC / cloud API)",id:"seed.projectList",run:(e)=>{lt(V(e,"projects")),Oo()}}]}class _ extends Error{id;constructor(t,e){super(`automation refuses "${t}" — ${e}`);this.name="AutomationRefusedError",this.id=t}}function he(t){let e=[];for(let a of t.visible()){if(!ht(a))continue;let r=t.disabledReason(a.id),i={enabled:r===void 0,id:a.id,title:a.title};if(a.args)i.args=a.args;if(r!==void 0)i.requires=r;e.push(i)}return e}function fe(t,e,a){if(a.has(t))return`"${t}" is a seed, not a command — call seed("${t}", …)`;let r=le[t];if(r?.disposition==="refused")return`"${t}" is refused by spec §13.5: ${r.note}`;if(r)return`"${t}" has no command record yet (${r.note}) — __jxAutomation.run projects the registry and nothing else`;let i=e.list().filter((o)=>ht(o)).map((o)=>o.id);return`unknown command "${t}" — the registry declares ${i.length} scriptable id(s)`}function be(t){let e=new Map(ue(t).map((r)=>[r.id,r])),a=new Set(e.keys());return{probe:{commands:()=>he(t.registry),idle:(r={})=>ut(r),pointAt:(r)=>dC(r.path),revealPath:(r)=>cm(r),seeds:()=>[...e.values()].map((r)=>({boundary:r.boundary,id:r.id})),state:()=>t.registry.context()},async run(r,i={}){if(mt.test(r))throw new _(r,`it names a delta against state the caller cannot observe; call "${se(r)}"`);let{registry:o}=t;if(!o.get(r))throw Error(fe(r,o,a));await o.run(r,i)},async seed(r,i={}){let o=r.startsWith("seed.")?r.slice(5):r,n=ce[o];if(n)throw new _(r,`a seed stands in for a remote, never for a user: ${n}`);let s=e.get(r.startsWith("seed.")?r:`seed.${r}`);if(!s)throw Error(`unknown seed "${r}" — declared seeds are ${[...e.keys()].join(", ")}`);await s.run(i)}}}function ob(t){return new URLSearchParams(t).get("automation")==="1"}function fE(t){if(!ob(location.search))return!1;return globalThis.__jxAutomation=be(t),!0}var gt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJxsuiteUpdate",$description:"The on-open offer to bring a project's `@jxsuite/*` dependencies up to their newest published versions: one sentence, and the packages that would move. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answers. Nothing here asks the registry or writes a manifest: `packages/jxsuite-update.ts` keeps the lookup, the dismissal key and the install, and this document only says what is on offer.",tagName:"jx-dialog",$props:{headline:"Update @jxsuite packages?",confirmLabel:"Update",cancelLabel:"Not now",size:"sm"},attributes:{part:"jxsuite-update"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'The old body was a lit template with no stylesheet at all, which is why the conversion is mostly a deletion. Two `<br />`s stood in for a paragraph break, and one `<span style="white-space: pre-line">` held every package as a single `\\n`-joined string — a list spelled as whitespace. Neither is addressable and neither announces as what it is, so a screen reader read one run-on line and a test could only match a substring of it. It is a `<ul>` of keyed rows now: the list says how many packages there are, and each row is `[data-package]`. The one token repair travels with it — that span asked for `--spectrum-font-size-75`, which resolves only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so the size silently fell back to the hard-coded `12px` written beside it.','& [part="offer"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="lede"]':{margin:"0"},'& [part="list"]':{$description:"Capped and scrolling, because the count is the registry's rather than this dialog's: a project that has not been opened in a year can have every `@jxsuite/*` package behind at once, and a dialog that grows past the viewport puts its own Update button off screen.",listStyle:"none",margin:"0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",maxHeight:"240px",overflowY:"auto"},'& [part="package"]':{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"var(--jx-space-3)",fontSize:"var(--jx-text-sm)"},'& [part="package-name"]':{color:"var(--fg)"},'& [part="package-move"]':{$description:"Tabular figures, so a column of versions does not jitter between rows of different widths.",color:"var(--fg-dim)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}},children:[{tagName:"div",attributes:{part:"offer"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Newer versions of these packages have been published. Update the project to them?"},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/packages"},key:{$ref:"$map/item/name"},map:{tagName:"li",attributes:{part:"package","data-package":"${$map.item.name}"},children:[{tagName:"span",attributes:{part:"package-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"package-move"},textContent:"${$map.item.current} → ${$map.item.target}"}]}}]}]}]};T("jxsuite-update",gt);function ft(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","jxsuite-update")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm()},packages:t.packages}),o=null,n=R("jxsuite-update",i,e).then(async(s)=>{o=s;let l=s.root;if(a)return s.dispose(),l;if(await An(l),a)return l;return un(l),l});return{close(){let s=o?.root;if(s instanceof HTMLElement)rn(s);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}function rb(t){return t.replace(/^[\^~>=<v\s]+/,"").trim().split(/\s+/)[0]??""}function bt(t){if(t.includes(":"))return!1;return/^\d+\.\d+/.test(rb(t))}function yt(t){let e=rb(t).split(/[-+]/)[0]??"",[a=0,r=0,i=0]=e.split(".").map((o)=>Math.trunc(Number(o))||0);return[a,r,i]}function we(t,e){let a=yt(t),r=yt(e);for(let i=0;i<3;i++){let o=a[i]??0,n=r[i]??0;if(o!==n)return o<n?-1:1}return 0}function ww(t,e){if(!bt(t)||!bt(e))return!1;return we(e,t)>0}var ve="@jxsuite/";async function J(){let t=p();if(!t.packageVersions)return[];let e;try{e=await t.packageVersions()}catch{return[]}let a=[];for(let r of e)if(r.name.startsWith(ve)&&ww(r.current,r.latest))a.push({current:r.current,dev:Boolean(r.dev),latest:r.latest,name:r.name});return a}function wt(t,e){let a=e.map((r)=>`${r.name}@${r.latest}`).toSorted().join(",");return`jx:jxsuite-update-dismissed:${t}:${a}`}function xe(t,e){try{return localStorage.getItem(wt(t,e))==="1"}catch{return!1}}function $e(t,e){try{localStorage.setItem(wt(t,e),"1")}catch{}}async function W(t){let e=p();if(!e.setPackageVersions||t.length===0)return;let a=la({status:"Updating @jxsuite packages…",title:"Updating dependencies"});try{let r=await e.setPackageVersions(t.map((i)=>({dev:i.dev,name:i.name,version:`^${i.latest}`})));if(r.ok)a.done(),k.success(`Updated ${t.length} @jxsuite package(s) to their latest versions.`);else a.fail(r.log??"Update failed")}catch(r){a.fail(r instanceof Error?r.message:String(r))}}function Se(t){return new Promise((e)=>{let a=!1,r=(s)=>{if(a)return;a=!0,e(s)},i=!1,o=()=>{if(i)return;i=!0,n.close()},n=ft({layer:Ct("dialog"),onCancel:()=>{o()},onClosed:()=>{r(!1),o()},onConfirm:()=>{r(!0),o()},packages:t.map((s)=>({current:s.current,name:s.name,target:`^${s.latest}`}))})})}async function np(t){if(ob(location.search))return;if(!p().setPackageVersions)return;let a=await J();if(a.length===0||xe(t,a))return;if(!await Se(a)){$e(t,a);return}await W(a)}var G=["package.json","bun.lock","bun.lockb"],ke=new Set(["??","U"]),je=25,Pe="@jxsuite/";function F(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function E(t){if(Array.isArray(t))return t.map((e)=>E(e));if(F(t)){let e={};for(let a of Object.keys(t).toSorted())e[a]=E(t[a]);return e}return t}function vt(t){let e={...t};for(let a of["dependencies","devDependencies"]){let r=e[a];if(!F(r))continue;let i={...r};for(let o of Object.keys(i))if(o.startsWith(Pe))i[o]="*";e[a]=i}return e}function Ce(t,e){if(t===null||e===null)return!1;let a,r;try{a=JSON.parse(t),r=JSON.parse(e)}catch{return!1}if(!F(a)||!F(r))return!1;return JSON.stringify(E(vt(a)))===JSON.stringify(E(vt(r)))}async function L(t,e){try{return await p().gitShow({path:t,ref:e})}catch{return null}}async function $t(t){try{return await p().readFile(t)}catch{return null}}async function St(t){let e=[],a=[],r=!0;for(let i of G){let o=t.files.filter((l)=>l.path===i);if(o.length===0)continue;let n=await L(i,"@{u}");if(o.every((l)=>ke.has(l.status))){if(n!==null)a.push(i);continue}let s=await L(i,"HEAD");if(n===null||n===s)continue;if(e.push(i),i==="package.json")r&&=Ce(s,await $t(i))}return{automated:r,discard:e,removeUntracked:a}}function kt(t){return t.discard.length===0&&t.removeUntracked.length===0}async function Ne(t){let e=[...new Set(t.files.filter((a)=>!G.includes(a.path)).map((a)=>a.path))];if(e.length>je)return!0;for(let a of e){let r=await L(a,"@{u}");if(r!==null&&r!==await L(a,"HEAD"))return!0}return!1}async function Ae(t){let e=p();if(t.discard.length>0)await e.gitUnstage(t.discard),await e.gitDiscard(t.discard);for(let a of t.removeUntracked)await e.deleteFile(a)}async function B(){let t=p(),e=[];try{e=await J()}catch{e=[]}if(e.length>0&&t.setPackageVersions){await W(e);return}if(!t.installDependencies)return;let a=la({status:"Running bun install…",title:"Syncing dependencies"});try{let r=await t.installDependencies();if(r.ok)a.done();else a.fail(r.log??"bun install failed")}catch(r){a.fail(te(r))}}async function jt(t){let e=p();try{await Ae(t)}catch(a){throw Error(`Could not reset local package files: ${te(a)}`,{cause:a})}try{await e.gitPull()}catch(a){throw await B(),a}k.warn("Local package updates were superseded by pulled changes.",{source:"Source Control"}),await B()}async function Re(t){let e=p(),a;try{a=await e.gitStatus()}catch{throw t}if(!(a.behind>0))throw t;let r=await St(a);if(kt(r)||await Ne(a))throw t;if(!r.automated){if(!await Xo("Discard local package changes?","package.json / bun.lock have local edits that conflict with incoming changes. Discard them, pull, and re-sync packages?",{confirmLabel:"Discard and pull",destructive:!0}))throw t}await jt(r)}async function xt(){let t;try{let e=await p().listDirectory("");t=new Set(e.filter((a)=>a.type==="file").map((a)=>a.name))}catch{t=new Set(G)}return Promise.all(G.map((e)=>t.has(e)?$t(e):Promise.resolve(null)))}async function q(){let t=p(),e=await xt(),a=null;try{await t.gitFetch(),a=await t.gitStatus()}catch{a=null}if(a&&a.behind>0){let i=await St(a);if(!kt(i)&&i.automated){await jt(i);return}}try{await t.gitPull()}catch(i){await Re(i);return}let r=await xt();if(e.some((i,o)=>i!==r[o]))await B()}async function ip(){let t=p(),e;try{e=await t.gitStatus()}catch{return}if(!e?.isRepo||(e.remotes?.length??0)===0)return;k.info("Syncing project…",{key:"project.sync",source:"Source Control"});try{await q()}catch(a){k.warn("The project could not be synced with its remote.",{detail:te(a),key:"project.sync",source:"Source Control",tier:"problem"})}}var Pt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelGit",$description:"The Navigator's Source Control panel: what git says about this project, and every verb that answers. It has four moods and the adapter names which one — no project, a first read still in flight, a project git is not tracking yet, and a repository — so nothing here asks whether `status` is null or what `isRepo` means. Under the fourth mood it draws the sync bar (with or without a remote), the branch row, the two sub-tabs, and then either the commit form over the changed files or the log. `panels/git-panel.ts` keeps every decision: what a comparison is, which files group under which component, what a status letter reads aloud, what a commit does before it runs, and which of the four verbs a row's buttons are. Rows arrive as strings and booleans, keyed by path.",tagName:"div",attributes:{part:"git-panel"},style:{$description:"The sixty-odd `.git-*` rules in `styles/overlays.css`, keyed on `part` and carried here. Four token repairs travel with them, all of the shape `surfaces/panel-imports.json` describes: `--spectrum-font-size-75` and `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read one would silently have taken its px fallback — they are `--jx-text-md` (12px) and `--jx-text-sm` (11px) here, at the same values, and the bare `10px` literals are `--jx-text-xs`. The one deliberate move is the two headline values, the sync label and the branch name: they were 13px, which is not a step on the scale, and they take `--jx-text-lg` (14px). Three rules are DELETED rather than moved, because the kit already draws them: the sub-tab strip's own fill, hover and selected underline are `jx-tabs`/`jx-tab`, the branch picker's box is `jx-select`, and `.git-split-btn`'s hand-built dropdown is the kit menu (see `openCommitMenu`). And one is repaired: a row's action buttons were `opacity: 0` until the ROW was hovered, so tabbing to Stage moved the keyboard onto an invisible control — the reveal is `:focus-within` as well as `:hover`.",display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"Drawn here rather than borrowed from `panels/empty-state.ts`, which is a lit template a document cannot call. What is kept is the pattern's rules (studio-ui-guidelines.md §11): one sentence saying what the region is for, then the action that fills it.",display:"flex",flex:"1",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-5)",textAlign:"center",color:"var(--fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-actions"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="sync-bar"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6), and it has exactly two items: `sync-head` (Refresh and the status, which never split) and what answers the status (the Fetch/Pull/Push group, or Create GitHub repository with no remote). It was a single line whose only shrinkable item was the status text, so a narrow Navigator never moved a button: it broke "3 behind / Last updated 09:04 AM" into a column one word wide (25px at the 160px floor) and painted "(no" under Create GitHub repository at the default 240px. Now the second item drops to a line of its own when the two no longer fit, and where that happens is decided by the status text\'s own width (a count, a locale\'s clock), never by a breakpoint. The row gap is the smaller step so a wrapped bar reads as one block.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="sync-bar"][data-remote="none"], & [part="sync-bar"][data-remote="none"] > [part="sync-head"]':{$description:"The no-remote bar keeps its tighter 8px between Refresh and the sentence, and on both axes: the head carries that gap now that Refresh and the text sit in it rather than in the bar.",gap:"var(--jx-space-3)"},'& [part="sync-head"]':{$description:"Refresh and the status, as one item of the bar, so wrapping never leaves the icon alone on a line above its text. `flex: 1 1 auto` makes its basis the status text's own width, which is the wrap threshold; with `min-width: 0` it can then shrink below that when it is alone on a line, and the status wraps as a sentence rather than word by word.",display:"flex",flex:"1 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="sync-text"]':{$description:"`1 1 auto` rather than `1`: the head's basis decides whether the verbs fit beside it, and it should be the status text's own width. An auto basis says that directly; the `0%` basis of `flex: 1` only reaches the same answer through how an engine treats a percentage while it measures.",display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="sync-label"]':{fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="sync-time"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="sync-actions"]':{$description:"The verbs never shrink: they are what moves. `margin-left: auto` keeps them at the inline end whether they share the status's line or sit on one of their own.",display:"flex",flex:"none",marginLeft:"auto"},'& [part="branch-row"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6) of two items, `branch-head` and the picker. It was a single line with the picker capped at 40% of it, so a long branch name was cut twice ("chor…" beside "cho…") and a narrow Navigator word-stacked "Active / branch". Now the picker drops below the name when the two no longer fit, at a width the name decides.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"10px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="branch-head"]':{$description:"The branch icon and the name, as one item so the icon is never alone on a line. The 999:1 grow ratio against the picker gives nearly all spare room to the name while the two share a line, so the picker stays the width of the branch it shows; once the picker wraps, it is alone and takes the whole line. A third item in this row needs its own flex decision.",display:"flex",flex:"999 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="branch-icon"]':{$description:"The hand-drawn 18px branch SVG this panel carried is the kit's `git-branch` glyph — the same key `PanelRecord.icon` already names for this panel's rail button, so the two drawings cannot drift.",flex:"none","--jx-icon-size":"18px",color:"var(--fg-dim)"},'& [part="branch-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="branch-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="branch-name"]':{overflow:"hidden",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="branch-picker"]':{$description:"Sized by the branch it shows while it shares the name's line, and the full width of the row once it wraps below it, which is where a long branch name finally reads whole. `min-width: 0` is the kit's own default, restated because studio-ui-guidelines.md §4.6 asks it of every flex child: when even a line of its own is narrower than the name, the picker shrinks and the kit's preview ellipsizes.",flex:"1 1 auto",minWidth:"0"},'& [part="tab"]':{$description:`The sub-tabs may shrink below their labels. A flex item's automatic minimum is its content, and a tab's label is nowrap, so "Local Changes (3)" and "History" held 179px against the 159px the Navigator has at its 160px floor and scrolled the whole panel sideways; the kit's label ellipsis could never engage. \`inspector-dock.json\` makes the same call for its tabs. It is a surface decision and not a kit default because the document tab strip deliberately scrolls instead.`,minWidth:"0"},'& [part="create-repository"] > [part="control"], & [part="init"] > [part="control"], & [part="clone"] > [part="control"], & [part="commit-button"] > [part="control"]':{$description:`The panel's labelled buttons wrap their words at the Navigator's floor instead of overflowing it. The kit's control is nowrap, which is right for a toolbar and made each label a floor of its own: "Create GitHub repository" held 165px in a 135px sync bar, "Clone Git Repository" and "Initialize Repository" held 141px and 135px in the empty state's 127px, and "Commit and sync" beside its menu had about a pixel to spare in the commit form's 135px. Nothing changes where the label fits, because a nowrap label and a wrapping one have the same max-content width. This reaches into the kit's \`control\` part as \`commandbar.json\` does for its primary button.`,whiteSpace:"normal"},'& [part="commit"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="commit-label"]':{fontWeight:"500",color:"var(--fg-dim)"},'& [part="commit-actions"]':{display:"flex",gap:"var(--jx-space-2)"},'& [part="commit-button"]':{flex:"1"},'& [part="section"]':{borderBottom:"1px solid var(--border)"},'& [part="section-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4) 6px",fontWeight:"700",color:"var(--fg)"},'& [part="count"]':{$description:"The pill beside a section title. `margin-inline-end: auto` is what pushes the section's own button to the right edge — it was a second rule (`.git-section-header .git-count`) over the same element, and there is only one place a count is drawn.",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",marginInlineEnd:"auto",padding:"0 5px",borderRadius:"9px",background:"var(--accent-15)",color:"var(--accent)",fontSize:"var(--jx-text-xs)",fontWeight:"600"},'& [part="group"]':{marginBottom:"var(--jx-space-1)"},'& [part="group-header"]':{display:"flex",alignItems:"center",gap:"6px",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="group-name"]':{fontWeight:"500",color:"var(--fg)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-3) var(--jx-space-1) var(--jx-space-5)"},'& [part="file-row"]:hover':{background:"var(--hover-bg)"},'& [part="file-open"]':{$description:"A REAL button, because it does something. It was a bare span with a cursor and a `title`: not focusable, no role, and Enter did nothing — so the panel's primary verb was mouse-only. A `<button>` needs no role, no tabindex and no key handler of its own, which is three lines of the old row that simply go.",display:"flex",flex:"1",alignItems:"baseline",gap:"6px",minWidth:"0",margin:"0",padding:"0",overflow:"hidden",border:"none",borderRadius:"var(--radius)",background:"none",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="file-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-dir"]':{overflow:"hidden",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-actions"]':{$description:"Revealed on `:focus-within` as well as on the row's hover. Opacity alone hid a control the keyboard could still reach: tabbing through a changed file landed on an invisible Stage button.",display:"flex",flex:"none",opacity:"0"},'& [part="file-row"]:hover [part="file-actions"], & [part="file-actions"]:focus-within':{opacity:"1"},'& [part="badge"]':{$description:"One letter and a colour, which is why every row's open button carries the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"], & [part="badge"][data-status="C"]':{color:"var(--tag)"},'& [part="history"]':{flex:"1",overflowY:"auto",padding:"var(--jx-space-2) 0"},'& [part="history-list"]':{margin:"0",padding:"0",listStyle:"none"},'& [part="history-entry"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",padding:"6px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="history-entry"]:hover':{background:"var(--hover-bg)"},'& [part="history-hash"]':{color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)"},'& [part="history-message"]':{color:"var(--fg)"},'& [part="history-meta"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="status"]':{margin:"0",padding:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textAlign:"center"},'& [part="failure"]':{$description:"The panel's own refusal banner. It is `failure` rather than `error` because the branch picker and the commit field each draw a permanent, empty `[part=\"error\"]` of their own inside this same light-DOM tree: under that name this padding, rule and wash drew a 16×13 box over both fields' top-left corners that took the click, and dressed either field's real refusal sentence as a banner.",margin:"0",padding:"6px var(--jx-space-3)",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--danger) 8%, transparent)",color:"var(--danger)",fontSize:"var(--jx-text-sm)"},"@(forced-colors: active)":{'& [part="failure"]':{$description:"The wash behind the banner collapses into the page when every author colour is replaced, so the border is what is left to mark it.",border:"1px solid CanvasText",color:"CanvasText"}}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/view"},cases:{"no-project":{tagName:"div",attributes:{part:"empty","data-view":"no-project"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Source control keeps every version of a project, so any change can be undone. Open a project to see its history."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"clone","data-action":"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}]}}}]},loading:{tagName:"p",attributes:{part:"status","data-view":"loading"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty","data-view":"no-repo"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Start tracking it to keep a history of every change and to publish it anywhere."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init","data-action":"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}]},repo:{tagName:"div",attributes:{part:"repo",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"div",attributes:{part:"sync-bar","data-remote":"yes"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]}]},{$description:"Three quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, so the `quiet: true` each verb below writes would have been silently framed into a segmented control; Spectrum's group here was quiet and never compact, which is what compact=false and the 2px gap between the verbs restore.",tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Remote actions",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch","data-action":"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull","data-action":"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push","data-action":"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]}]},local:{tagName:"div",attributes:{part:"sync-bar","data-remote":"none"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"Local only (no remote)"}]}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}}},{tagName:"div",attributes:{part:"branch-row"},children:[{tagName:"div",attributes:{part:"branch-head"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"div",attributes:{part:"branch-text"},children:[{tagName:"span",attributes:{part:"branch-label"},textContent:"Active branch"},{tagName:"span",attributes:{part:"branch-name"},textContent:"${state.branchName}"}]}]},{tagName:"jx-select",attributes:{part:"branch-picker"},$props:{label:"Switch branch",size:"sm",options:{$ref:"#/state/branchOptions"},value:{$ref:"#/state/branchValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chooseBranch"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.subTab}"},$props:{label:"Source control views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{tagName:"jx-tab",attributes:{part:"tab","data-tab":"changes",value:"changes",label:"${state.changesLabel}",panel:"git-panel-body"}},{tagName:"jx-tab",attributes:{part:"tab","data-tab":"history",value:"history",label:"History",panel:"git-panel-body"}}]},{tagName:"div",attributes:{part:"body",id:"git-panel-body",role:"tabpanel","data-tab":"${state.subTab}"},style:{display:"contents"},$switch:{$ref:"#/state/subTab"},cases:{changes:{tagName:"div",attributes:{part:"changes",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"commit","data-jx-region":"navigator/panel:git/commit"},children:[{tagName:"span",attributes:{part:"commit-label",id:"git-commit-label"},textContent:"Please write a commit message"},{tagName:"jx-textfield",attributes:{part:"commit-input","data-field":"commit-message"},$props:{labelledby:"git-commit-label",multiline:!0,size:"sm",placeholder:"Describe your changes",value:{$ref:"#/state/commitMessage"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editMessage"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{if:{operator:"||",target:{$ref:"event#/ctrlKey"},value:{$ref:"event#/metaKey"}},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/commit"},value:[]}]}]}}]}},{tagName:"div",attributes:{part:"commit-actions"},children:[{tagName:"jx-button",attributes:{part:"commit-button","data-action":"commit-and-sync"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitAndSync"},value:[]}]},children:[{tagName:"span",textContent:"Commit and sync"}]},{tagName:"jx-action-button",attributes:{part:"commit-menu","data-action":"commit-menu"},$props:{icon:"caret-down",size:"sm",label:"More commit options",hint:"More commit options",haspopup:"menu"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openCommitMenu"},value:[{$ref:"event#/currentTarget"}]}]}}]}]},{tagName:"div",attributes:{part:"staged-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasStaged"},cases:{true:{tagName:"section",attributes:{part:"section","data-section":"staged","aria-label":"Staged Changes"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Staged Changes"},{tagName:"span",attributes:{part:"count"},textContent:"${state.stagedCount}"},{tagName:"jx-action-button",attributes:{part:"unstage-all","data-action":"unstage-all"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage all",hint:"Unstage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstageAll"},value:[]}]}}]},{$prototype:"Array",items:{$ref:"#/state/stagedFiles"},key:{$ref:"$map/item/key"},map:{$description:"One changed file. Every row opens the file it names — renderability decides which VIEW opens, not whether the row responds — and carries the two or three verbs its staged state allows. `$map/item` inside a nested map is the FILE, which is why the row hands its own path back to every action rather than an index.",tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}},{tagName:"section",attributes:{part:"section","data-section":"changed","aria-label":"Changed Components"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Changed Components"},{tagName:"span",attributes:{part:"count"},textContent:"${state.changedCount}"},{tagName:"span",attributes:{part:"stage-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasUnstaged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"stage-all","data-action":"stage-all"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage all",hint:"Stage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stageAll"},value:[]}]}}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"group-header"},children:[{tagName:"span",attributes:{part:"group-name"},textContent:"${$map.item.name}"}]},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"changes"},textContent:"Nothing to commit. Files you edit and save show up here."}}}]}]},history:{tagName:"div",attributes:{part:"history"},children:[{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry","data-hash":"${$map.item.hash}"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"history"},textContent:"No commits yet. Each commit you make is a version you can come back to."}}}]}}},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"status","data-status":"busy"},textContent:"Loading…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]}}}]};T("git-panel",Pt);function Nt(t,e){t.view=e.view,t.canClone=e.canClone,t.busy=e.busy,t.hasError=e.hasError,t.error=e.error,t.remoteState=e.remoteState,t.syncLabel=e.syncLabel,t.lastUpdated=e.lastUpdated,t.hasLastUpdated=e.hasLastUpdated,t.pullLabel=e.pullLabel,t.pushLabel=e.pushLabel,t.branchName=e.branchName,t.branchValue=e.branchValue,t.branchOptions=e.branchOptions,t.subTab=e.subTab,t.changesLabel=e.changesLabel,t.commitMessage=e.commitMessage,t.hasStaged=e.hasStaged,t.stagedCount=e.stagedCount,t.stagedFiles=e.stagedFiles,t.changedCount=e.changedCount,t.hasUnstaged=e.hasUnstaged,t.filesState=e.filesState,t.groups=e.groups,t.historyState=e.historyState,t.commits=e.commits}function Me(){return{branchName:"",branchOptions:[],branchValue:"",busy:!1,canClone:!1,changedCount:"0",changesLabel:"Local Changes",commitMessage:"",commits:[],error:"",filesState:"empty",groups:[],hasError:!1,hasLastUpdated:!1,hasStaged:!1,hasUnstaged:!1,historyState:"empty",lastUpdated:"",pullLabel:"Pull",pushLabel:"Push",remoteState:"local",stagedCount:"0",stagedFiles:[],subTab:"changes",syncLabel:"",view:"loading"}}function At(t,e,a){let r=v({...Me(),...a});Nt(r,e);let i=null,o=!1;return R("git-panel",r,t).then((n)=>{if(o){n.dispose();return}i=n}),{connected:()=>!o&&(i===null||i.root.parentNode===t),dispose(){o=!0,i?.dispose(),i=null},update:(n)=>{Nt(r,n)}}}async function uc(){if(!D)return;let t=p(),{git:e}=y;e.loading=!0,e.error=null;try{let[a,r]=await Promise.allSettled([t.gitStatus(),t.gitBranches()]);if(a.status==="fulfilled")e.status=a.value;if(r.status==="fulfilled")e.branches=r.value;let i=a.status==="rejected"?a.reason:r.status==="rejected"&&a.value?.isRepo?r.reason:null;if(i)e.error=te(i);e.lastUpdated=Mo(),e.rev+=1,await Ge()}catch(a){e.error=te(a)}finally{e.loading=!1}}async function Ge(){let t=y.git.diffState;if(!t)return;let e=y.git.status?.files.find((a)=>a.path===t.filePath);if(!e||!Tt(e.status)){y.git.diffState=null;return}try{y.git.diffState=await I(t.filePath,e.status)}catch{}}async function c1(t){y.git.rev+=1;let e=y.git.diffState;if(!t||e?.filePath!==t)return;try{y.git.diffState=await I(t,e.fileStatus)}catch{}}async function _w(t){let e=p();if(!e.gitClone){k.warn("Cloning is not supported on this platform.",{source:"Source Control"});return}let a=await Nn("Clone Git Repository",{confirmLabel:"Clone",message:"Repository URL",placeholder:"https://github.com/user/repo.git",validate:(r)=>r.trim()?"":"Enter a repository URL."});if(!a)return;try{k.info("Cloning repository…",{key:"git.clone",source:"Source Control"});let r=await e.gitClone(a);if(r?.root)k.success("Clone complete.",{key:"git.clone"}),await t.openRecentProject(r.root)}catch(r){k.error("Could not clone the repository.",{detail:te(r),key:"git.clone",source:"Source Control"})}}function Cw(){return We()&&Boolean(p().gitClone)}var Fe={A:"added",D:"deleted",M:"modified",R:"renamed",U:"untracked"},De=new Set(["M","A","U","D"]);function Tt(t){return De.has(t)}async function I(t,e){let a=p(),r=e!=="A"&&e!=="U",i=e!=="D",[o,n]=await Promise.all([r?a.gitShow({path:t,ref:"HEAD"}):Promise.resolve(""),i?a.readFile(t):Promise.resolve("")]);return{currentContent:n,filePath:t,fileStatus:e,originalContent:o}}async function d1(t,e){try{return await I(t,e)}catch(a){return console.warn("loadDiffForLens:",te(a)),null}}async function Mt(){try{k.info("Initializing repository…",{key:"git.init"}),await p().gitInit(),k.success("Repository initialized.",{key:"git.init"})}catch(t){k.error("Could not initialize the repository.",{action:"git.init",detail:te(t),key:"git.init",source:"Source Control"});return}await uc()}async function Ee(){await b("gitPush")}async function Le(){if(await kw())k.success("Signed in to GitHub.",{key:"github.auth"})}async function b(t,e){let a=p();y.git.loading=!0,y.git.error=null;try{return await a[t](e),await uc(),!0}catch(r){return y.git.error=te(r),y.git.loading=!1,!1}}function Gt(t){if(!y.git.commitMessage)y.git.commitMessage=t}async function Ue(){y.git.loading=!0,y.git.error=null;try{await q(),await uc()}catch(t){y.git.error=te(t),y.git.loading=!1}}var C=null;async function Ie(){let t=p();try{y.git.logEntries=await t.gitLog(30)}catch(e){y.git.error=te(e)}}var U={},K=null;function Ft(t){let e=t.path.split("/"),a=e.pop()??t.path,r=e.join("/");return{cannotDiscard:t.status==="U",dir:r,hasDir:r!=="",key:t.path,label:`${t.path}, ${Fe[t.status]??"changed"}`,name:a,path:t.path,staged:Boolean(t.staged),status:t.status}}function He(t){let e=new Map;for(let a of t){let r=a.path.split("/"),i;if(a.path.endsWith(".json")||a.path.endsWith(".class.json")||Zt(a.path))i=r.length>1?`/${r.at(-2)}`:`/${r[0]}`;else i="Other";if(!e.has(i))e.set(i,[]);e.get(i).push(a)}return[...e.entries()].map(([a,r])=>({files:r.map((i)=>Ft(i)),key:a,name:a}))}function ze(t){return{hash:t.hash.slice(0,7),key:t.hash,message:t.message,meta:`${t.author} · ${ta(t.date)}`}}function Ve(t){return t?`Last updated ${new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""}function Dt(){if(!D)return"no-project";let{error:t,loading:e,status:a}=y.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function X(){let{branches:t,commitMessage:e,error:a,lastUpdated:r,loading:i,logEntries:o,status:n,subTab:s}=y.git,l=n?.files??[],c=l.filter((d)=>d.staged),h=l.filter((d)=>!d.staged),g=[...c,...h],x=!n?.ahead&&!n?.behind,f=n?.ahead?`${n.ahead} ahead`:"",S=n?.behind?`${n.behind} behind`:"",N=o??[];return{branchName:(t?.current??n?.branch??"")||"—",branchOptions:[...(t?.branches??[]).map((d)=>({label:d,value:d})),{label:"+ New branch…",value:Z}],branchValue:K??t?.current??"",busy:Boolean(i),canClone:Cw(),changedCount:String(g.length),changesLabel:g.length>0?`Local Changes (${g.length})`:"Local Changes",commitMessage:e,commits:N.map((d)=>ze(d)),error:a??"",filesState:g.length>0?"listed":"empty",groups:He(g),hasError:Boolean(a),hasLastUpdated:Boolean(r),hasStaged:c.length>0,hasUnstaged:h.length>0,historyState:N.length>0?"listed":"empty",lastUpdated:Ve(r),pullLabel:S?`Pull (${S})`:"Pull",pushLabel:f?`Push (${f})`:"Push",remoteState:(n?.remotes?.length??0)>0?"remote":"local",stagedCount:String(c.length),stagedFiles:c.map((d)=>Ft(d)),subTab:s,syncLabel:x?"Up to date":`${f}${f&&S?", ":""}${S}`,view:Dt()}}var Z="__new__";function Et(t){return y.git.status?.files.find((e)=>e.path===t)}async function Lt(){let t=y.git.commitMessage.trim();if(!t)return;if(y.git.commitMessage="",await YC(),!await b("gitCommit",t))Gt(t)}async function _e(){let t=y.git.commitMessage.trim();if(!t)return;y.git.commitMessage="",y.git.loading=!0,y.git.error=null,await YC();let e=p(),a=!1;try{await e.gitCommit(t),a=!0,await e.gitPush(),await uc()}catch(r){if(y.git.error=te(r),y.git.loading=!1,!a)Gt(t)}}async function Je(t){let{branches:e,status:a}=y.git;if(t===Z){K=Z,Rt();let r=await Nn("New Branch",{confirmLabel:"Create",message:`Branching from ${e?.current||a?.branch||"the current branch"}.`,placeholder:"feature/my-change",validate:(i)=>i.trim()?"":"Enter a branch name."});if(K=null,Rt(),r)await b("gitCreateBranch",r);return}if(t!==e?.current)await b("gitCheckout",t)}async function Be(t){let e=Et(t);if(!e)return;let a=Tt(e.status)?it(e.path,e.status):`"${e.path}" has no change this view can open.`;if(a){y.git.error=a;return}try{y.git.loading=!0;let r=await I(e.path,e.status);y.git.diffState=r;let i=await ot(e.path);if(U.setGitDiffState?.(r),i)U.setCanvasMode?.(i,"git-diff")}catch(r){y.git.error=`Failed to load diff: ${te(r)}`}finally{y.git.loading=!1}}async function qe(t){if(Et(t)?.status==="U")return;if(!await Xo("Discard Changes",`Discard changes to ${t}?`,{confirmLabel:"Discard",destructive:!0}))return;await b("gitDiscard",[t])}function Ke(t){(me("2e4y9j7b"),import("./menu-2e4y9j7b.js")).then(({openMenu:e})=>{e({label:"Commit options",opener:t,place:(a)=>{let r=Oe(t);return{x:Math.max(4,r.right-a.width),y:r.bottom+4}},region:"git-commit",rows:[{destructive:!1,disabled:!1,dividerAbove:!1,id:"git.commitWithoutSync",run:()=>{Lt()},title:"Commit (don't sync)"}]})})}function Xe(t){if(y.git.subTab=t,t==="history"&&!y.git.logEntries)Ie()}var Ze={chooseBranch:(t)=>{Je(t)},clone:()=>{U.cloneRepository?.()},commit:()=>{Lt()},commitAndSync:()=>{_e()},createRepository:()=>{O({projectName:D?.name||"my-project"})},discard:(t)=>{qe(t)},editMessage:(t)=>{y.git.commitMessage=t},fetch:()=>{b("gitFetch")},initRepository:()=>{Mt()},openCommitMenu:Ke,openFile:(t)=>{Be(t)},pull:()=>{Ue()},push:()=>{b("gitPush")},refresh:()=>{uc()},selectTab:Xe,stage:(t)=>{b("gitStage",[t])},stageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>!e.staged).map((e)=>e.path);b("gitStage",t)},unstage:(t)=>{b("gitUnstage",[t])},unstageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>e.staged).map((e)=>e.path);b("gitUnstage",t)}},w=null;function Ut(){if(!w)return;w.scope.stop(),w.handle.dispose(),w=null}function Rt(){w?.handle.update(X())}function Ye(){if(C)return;C=setInterval(()=>{if(y.leftTab==="git"&&!y.git.loading)uc()},sI)}function Qe(t,e){U=e;let a=t.querySelector(".panel-content")??t;if(We()&&Dt()==="loading")uc();if(w&&(w.host!==a||!w.handle.connected()))Ut();if(w)return;let r=At(a,X(),Ze),i=ge();i.run(()=>{Q(()=>{let o=X();if(o.view==="repo")Ye();r.update(o)})}),w={handle:r,host:a,scope:i}}function u1(t){return tt}function ta(t){let e=new Date(t),a=Mo()-e.getTime(),r=Math.floor(a/60000);if(r<1)return"just now";if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);if(o<30)return`${o}d ago`;return e.toLocaleDateString()}function ea(){return[{category:"Source Control",id:"git.init",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"an open project that git is not already tracking",when:(t)=>t.project.open,enablement:(t)=>!t.project.isRepo,run:async()=>{await Mt()},title:"Initialize Repository"},{category:"Source Control",id:"git.createGithubRepository",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await O({projectName:D?.name||"my-project"})},title:"Create GitHub Repository"},{category:"Source Control",id:"git.push",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await Ee()},title:"Push"},{category:"Source Control",id:"git.signInToGithub",level:"application",menus:["palette"],group:"7_scm",run:async()=>{await Le()},title:"Sign In to GitHub"}]}function h1(t){t.registerAll(ea())}function zf(){if(C)clearInterval(C),C=null;Ut()}function p1(){qn({id:"git",title:"Source Control",railLabel:"Source",level:"project",dock:"navigator",icon:"git-branch",badge:(t)=>t.git.dirtyCount||null,render:()=>tt,afterRender:(t,e)=>{Qe(e,t.deps)}})}
2
- export{yw,pE,ob,fE,rb,ww,np,ip,l1,sb,mE,xw,gE,Bf,uc,c1,_w,Cw,d1,u1,h1,zf,p1};
3
-
4
- //# debugId=6F301EE160DDEC2A64756E2164756E21
5
- //# sourceMappingURL=studio-qqz8e5gk.js.map