@jxsuite/studio 10.4.0 → 10.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/data/locales/en/elements.json +434 -0
  2. package/data/webdata.json +116 -139
  3. package/dist/chunks/2020-rqm7qrje.js +4 -0
  4. package/dist/chunks/adapter-cyy8vbcx.js +4 -0
  5. package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
  6. package/dist/chunks/{cf-account-picker-xb8vvt2h.js → cf-account-picker-v3qd2dhw.js} +3 -3
  7. package/dist/chunks/cf-settings-1fnw874z.js +4 -0
  8. package/dist/chunks/{color-area-h8dbasp1.js → color-area-frd9y9q6.js} +2 -2
  9. package/dist/chunks/color-field-rebpbe33.js +4 -0
  10. package/dist/chunks/{color-slider-nz2mrzky.js → color-slider-6bzmk3s7.js} +2 -2
  11. package/dist/chunks/color-t2bnnj8y.js +4 -0
  12. package/dist/chunks/{combobox-6hs00996.js → combobox-c49x7gf1.js} +3 -3
  13. package/dist/chunks/components-y8yhdd7d.js +4 -0
  14. package/dist/chunks/content-source-9e7qvmsf.js +4 -0
  15. package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
  16. package/dist/chunks/editor-mb9jzdrw.js +4 -0
  17. package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
  18. package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
  19. package/dist/chunks/file-ops-dtdvjmza.js +4 -0
  20. package/dist/chunks/files-8pf70854.js +4 -0
  21. package/dist/chunks/format-host-fd3m2y2a.js +4 -0
  22. package/dist/chunks/fs-events-hrk29vcv.js +4 -0
  23. package/dist/chunks/grid-open-bh74v82z.js +4 -0
  24. package/dist/chunks/{grid-view-2f03wcgw.js → grid-view-a51mgzmq.js} +17 -17
  25. package/dist/chunks/{icons-gb967qc8.js → icons-qp8fn1k8.js} +2 -2
  26. package/dist/chunks/{iframe-entry-btck0e9s.js → iframe-entry-mpwe5pwk.js} +4 -4
  27. package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
  28. package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
  29. package/dist/chunks/{iframe-entry-b5qgggyp.js → iframe-entry-v40cr813.js} +4 -4
  30. package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
  31. package/dist/chunks/{image-bake-4afr4y6a.js → image-bake-q9ajdjsj.js} +3 -3
  32. package/dist/chunks/{image-editor-x7t8jbjn.js → image-editor-ke9std9b.js} +3 -3
  33. package/dist/chunks/index-57ang7ma.js +4 -0
  34. package/dist/chunks/index-eytr7av4.js +17 -0
  35. package/dist/chunks/{index-yjrfeks8.js → index-x495reff.js} +3 -3
  36. package/dist/chunks/{javascript-hy2mws8v.js → javascript-qe34bvaz.js} +3 -3
  37. package/dist/chunks/jsonMode-m8rseh31.js +13 -0
  38. package/dist/chunks/jx-validate-bbd1mary.js +4 -0
  39. package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
  40. package/dist/chunks/layers-yscpys6q.js +4 -0
  41. package/dist/chunks/{listbox-7gka1h86.js → listbox-tktzq5xj.js} +2 -2
  42. package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
  43. package/dist/chunks/media-library-2hfff88g.js +4 -0
  44. package/dist/chunks/media-open-4pb05cne.js +4 -0
  45. package/dist/chunks/media-picker-bzktmmwr.js +4 -0
  46. package/dist/chunks/menu-xc3cbgsd.js +4 -0
  47. package/dist/chunks/{monaco-binding-a51py33c.js → monaco-binding-7t38arh9.js} +3 -3
  48. package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
  49. package/dist/chunks/monaco-setup-fstdew02.js +4 -0
  50. package/dist/chunks/notify-gbdcckrh.js +4 -0
  51. package/dist/chunks/parse-fpdzgk4c.js +4 -0
  52. package/dist/chunks/platform-9g72gdqr.js +4 -0
  53. package/dist/chunks/popover-cnmsav6b.js +4 -0
  54. package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
  55. package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
  56. package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
  57. package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
  58. package/dist/chunks/references-yg1g9rwx.js +4 -0
  59. package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
  60. package/dist/chunks/source-control-rrc4jgp5.js +4 -0
  61. package/dist/chunks/{split-m5rwn31z.js → split-d15yencd.js} +2 -2
  62. package/dist/chunks/studio-0jhhznxy.js +9 -0
  63. package/dist/chunks/studio-0nb57pjg.js +7 -0
  64. package/dist/chunks/{studio-s24mhq0z.js → studio-0wa4wv4s.js} +4 -4
  65. package/dist/chunks/studio-0z8kp4xk.js +5 -0
  66. package/dist/chunks/{studio-g0hxtcga.js → studio-18gc5t3v.js} +4 -4
  67. package/dist/chunks/{studio-4fnb5648.js → studio-1b79rpcb.js} +4 -4
  68. package/dist/chunks/studio-211q5j7m.js +4 -0
  69. package/dist/chunks/studio-213pyfxh.js +16 -0
  70. package/dist/chunks/studio-2b1smjvp.js +5 -0
  71. package/dist/chunks/{studio-nwf0c32p.js → studio-2v6tc9jp.js} +4 -4
  72. package/dist/chunks/studio-30j0wz99.js +5 -0
  73. package/dist/chunks/studio-3kmqhwtt.js +5 -0
  74. package/dist/chunks/studio-44drsmhw.js +5 -0
  75. package/dist/chunks/{studio-2pk7kc7z.js → studio-495b6f2r.js} +4 -4
  76. package/dist/chunks/{studio-jma2q8r9.js → studio-4gthb2fd.js} +4 -4
  77. package/dist/chunks/{studio-0gvvqj3h.js → studio-4xadhxj1.js} +4 -4
  78. package/dist/chunks/{studio-nvcn2ykc.js → studio-52mzbxqm.js} +4 -4
  79. package/dist/chunks/{studio-v7a7yb5w.js → studio-56mmnsw8.js} +7 -7
  80. package/dist/chunks/studio-59hz8f4r.js +5 -0
  81. package/dist/chunks/{studio-sce30r7b.js → studio-5k9mfafh.js} +3 -3
  82. package/dist/chunks/{studio-rr00ex23.js → studio-5qez462c.js} +6 -6
  83. package/dist/chunks/studio-6tnpg0vx.js +5 -0
  84. package/dist/chunks/studio-6w8mt734.js +6 -0
  85. package/dist/chunks/studio-7hm04x5z.js +5 -0
  86. package/dist/chunks/studio-8atmfjjm.js +7 -0
  87. package/dist/chunks/{studio-wmjmsw0p.js → studio-8n99z71s.js} +4 -4
  88. package/dist/chunks/studio-8vmad6x2.js +5 -0
  89. package/dist/chunks/studio-93p5k4r4.js +5 -0
  90. package/dist/chunks/{studio-2x972v58.js → studio-9gb0m81w.js} +4 -4
  91. package/dist/chunks/studio-a4ymg4vd.js +5 -0
  92. package/dist/chunks/studio-anc8067x.js +5 -0
  93. package/dist/chunks/{studio-2e4hry72.js → studio-dbdt67kr.js} +5 -5
  94. package/dist/chunks/studio-dbex091t.js +5 -0
  95. package/dist/chunks/{studio-amaz545p.js → studio-dj8ctxey.js} +4 -4
  96. package/dist/chunks/{studio-k2evngrj.js → studio-ed9bz68j.js} +5 -5
  97. package/dist/chunks/{studio-4bgvvzhv.js → studio-fe2d1fp5.js} +4 -4
  98. package/dist/chunks/{studio-45mj4jqe.js → studio-fgp4cyy3.js} +4 -4
  99. package/dist/chunks/studio-ft706q02.js +5 -0
  100. package/dist/chunks/studio-g79s1dyg.js +6 -0
  101. package/dist/chunks/{studio-pj216fmn.js → studio-gahswxp4.js} +4 -4
  102. package/dist/chunks/studio-gbqc12bk.js +5 -0
  103. package/dist/chunks/studio-gxphbetb.js +6 -0
  104. package/dist/chunks/studio-hdf01j7q.js +7 -0
  105. package/dist/chunks/studio-hf259xzd.js +48 -0
  106. package/dist/chunks/studio-jbva4wxw.js +5 -0
  107. package/dist/chunks/studio-jj9gf1qc.js +5 -0
  108. package/dist/chunks/studio-jsjg3mjv.js +5 -0
  109. package/dist/chunks/studio-jtvb8hd7.js +5 -0
  110. package/dist/chunks/{studio-g9brbewz.js → studio-kp4vzrct.js} +4 -4
  111. package/dist/chunks/studio-kpx02gaa.js +7 -0
  112. package/dist/chunks/{studio-3na1r48j.js → studio-kv1728ex.js} +8 -8
  113. package/dist/chunks/studio-m25ry0mf.js +5 -0
  114. package/dist/chunks/studio-mcbwmkyh.js +5 -0
  115. package/dist/chunks/studio-meajkr51.js +5 -0
  116. package/dist/chunks/studio-mkjrjpr2.js +6 -0
  117. package/dist/chunks/{studio-eqcddvc2.js → studio-mr084886.js} +201 -201
  118. package/dist/chunks/studio-mrb10hv3.js +5 -0
  119. package/dist/chunks/{studio-0939t1q1.js → studio-nhpg405j.js} +4 -4
  120. package/dist/chunks/studio-nsec0hxm.js +64 -0
  121. package/dist/chunks/{studio-xx3r3sb0.js → studio-nv0mh0p5.js} +4 -4
  122. package/dist/chunks/studio-pafmb06w.js +5 -0
  123. package/dist/chunks/{studio-pm17wdc4.js → studio-pgftd79b.js} +4 -4
  124. package/dist/chunks/{studio-4zd6an2b.js → studio-pk961xgz.js} +4 -4
  125. package/dist/chunks/studio-pzbr7g05.js +5 -0
  126. package/dist/chunks/studio-qcc5hsw2.js +10 -0
  127. package/dist/chunks/studio-qfq58c8n.js +5 -0
  128. package/dist/chunks/studio-qvb2jr83.js +5 -0
  129. package/dist/chunks/studio-r85zw6ay.js +5 -0
  130. package/dist/chunks/studio-s0kwce5w.js +9 -0
  131. package/dist/chunks/studio-s6ymkf3q.js +14 -0
  132. package/dist/chunks/{studio-0x6f3nk9.js → studio-s7p5ccxa.js} +4 -4
  133. package/dist/chunks/{studio-1410q5dw.js → studio-s9jjap3x.js} +4 -4
  134. package/dist/chunks/{studio-evq47j2z.js → studio-t5hde1ws.js} +4 -4
  135. package/dist/chunks/studio-vj9yv897.js +5 -0
  136. package/dist/chunks/studio-wmak8xjw.js +5 -0
  137. package/dist/chunks/{studio-bnc50f9h.js → studio-wqsmvtqj.js} +4 -4
  138. package/dist/chunks/studio-x3z3rhej.js +5 -0
  139. package/dist/chunks/{studio-bg8pzprg.js → studio-xb55kpmy.js} +4 -4
  140. package/dist/chunks/studio-xxtdajmv.js +12 -0
  141. package/dist/chunks/studio-xxttcym1.js +5 -0
  142. package/dist/chunks/{studio-90zkgne5.js → studio-y2zsnzye.js} +7 -7
  143. package/dist/chunks/{studio-3qr08sxq.js → studio-y3tjh2xb.js} +3 -3
  144. package/dist/chunks/studio-y4f1rdsj.js +5 -0
  145. package/dist/chunks/studio-ybkd5w8k.js +5 -0
  146. package/dist/chunks/{studio-tpxcryf2.js → studio-yetr4gg1.js} +4 -4
  147. package/dist/chunks/studio-z295anhs.js +6 -0
  148. package/dist/chunks/studio-z89e6wpg.js +9 -0
  149. package/dist/chunks/{studio-5tet77de.js → studio-zbwr6prc.js} +3 -3
  150. package/dist/chunks/{studio-daksw8kh.js → studio-zdbsv5q2.js} +4 -4
  151. package/dist/chunks/{studio-abh9kfdh.js → studio-zvthj8hg.js} +4 -4
  152. package/dist/chunks/toast-2kn2vrn4.js +4 -0
  153. package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
  154. package/dist/chunks/{tooltip-dj1pvgz7.js → tooltip-ghkxkasp.js} +3 -3
  155. package/dist/chunks/{tree-j0ebwr5s.js → tree-vw4nc63s.js} +2 -2
  156. package/dist/chunks/tsMode-7gngmamr.js +14 -0
  157. package/dist/chunks/workspace-gv0hxgsm.js +4 -0
  158. package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
  159. package/dist/chunks/{ws-client-arz2qsy9.js → ws-client-vs11sxc5.js} +3 -3
  160. package/dist/iframe-entry.js +14 -14
  161. package/dist/manifest.json +84 -83
  162. package/dist/studio.js +99 -98
  163. package/dist/workers/ts.worker.js +3 -3
  164. package/package.json +12 -12
  165. package/src/browse/library-layouts.ts +9 -12
  166. package/src/browse/library-pane.ts +22 -16
  167. package/src/browse/library-source.ts +3 -4
  168. package/src/browse/preview-style.ts +2 -1
  169. package/src/canvas/canvas-live-render.ts +2 -5
  170. package/src/canvas/canvas-page-context.ts +5 -0
  171. package/src/canvas/canvas-render.ts +6 -1
  172. package/src/canvas/iframe-drop.ts +84 -1
  173. package/src/canvas/iframe-entry.ts +9 -6
  174. package/src/canvas/iframe-render.ts +13 -0
  175. package/src/collab/collab-session.ts +2 -2
  176. package/src/commands/levels.ts +1 -1
  177. package/src/content/entry-commands.ts +32 -27
  178. package/src/content/entry-editor.ts +46 -44
  179. package/src/content/entry-inspector.ts +15 -12
  180. package/src/content/entry-model.ts +3 -3
  181. package/src/content/entry-summaries.ts +5 -5
  182. package/src/content/hold-state.ts +172 -0
  183. package/src/content/page-summaries.ts +10 -14
  184. package/src/create/add-new-flow.ts +2 -1
  185. package/src/editor/convert-targets.ts +2 -23
  186. package/src/editor/inline-edit.ts +6 -1
  187. package/src/editor/repeater-scope.ts +333 -74
  188. package/src/editor/slash-menu.ts +35 -17
  189. package/src/files/files.ts +18 -0
  190. package/src/format/format-choices.ts +5 -5
  191. package/src/format/format-host.ts +35 -3
  192. package/src/grid/redirects-grid.ts +4 -4
  193. package/src/grid/sources/content-source.ts +42 -66
  194. package/src/locale/element-names.ts +131 -0
  195. package/src/panels/block-action-bar.ts +3 -4
  196. package/src/panels/dnd.ts +3 -1
  197. package/src/panels/elements-panel.ts +93 -36
  198. package/src/panels/events-panel.ts +6 -2
  199. package/src/panels/formula-workspace.ts +9 -0
  200. package/src/panels/imports-panel.ts +3 -2
  201. package/src/panels/navigator-panels.ts +10 -10
  202. package/src/panels/panel-registry.ts +3 -3
  203. package/src/panels/properties-panel.ts +127 -35
  204. package/src/panels/site-panel.ts +2 -1
  205. package/src/panels/statement-editor.ts +4 -0
  206. package/src/panels/style-panel.ts +2 -1
  207. package/src/panels/styles-panel.ts +2 -2
  208. package/src/panels/tab-strip.ts +29 -26
  209. package/src/platforms/cloud.ts +5 -2
  210. package/src/services/ai-command-tools.ts +2 -1
  211. package/src/services/ai-project-tools.ts +21 -8
  212. package/src/services/ai-tools.ts +5 -5
  213. package/src/services/ai-write-report.ts +22 -4
  214. package/src/services/context-manager.ts +110 -2
  215. package/src/services/document-assistant.ts +2 -2
  216. package/src/services/harness/chat-reducer.ts +9 -4
  217. package/src/services/jxn-language.ts +110 -0
  218. package/src/services/model-uri.ts +3 -0
  219. package/src/services/monaco-setup.ts +6 -2
  220. package/src/services/render-critic.ts +234 -12
  221. package/src/services/tool-executor.ts +16 -8
  222. package/src/settings/contributed-section.ts +2 -1
  223. package/src/settings/extension-commands.ts +2 -1
  224. package/src/settings/general-settings.ts +2 -2
  225. package/src/settings/settings-document.ts +5 -5
  226. package/src/shell.ts +1 -1
  227. package/src/studio.ts +28 -11
  228. package/src/style/variables-view.ts +2 -2
  229. package/src/surfaces/collections-panel.json +1 -1
  230. package/src/surfaces/collections-panel.ts +1 -1
  231. package/src/surfaces/entry-editor.json +10 -10
  232. package/src/surfaces/entry-editor.ts +22 -19
  233. package/src/surfaces/entry-inspector.json +11 -11
  234. package/src/surfaces/entry-inspector.ts +17 -10
  235. package/src/surfaces/panel-elements.json +466 -206
  236. package/src/surfaces/panel-elements.ts +61 -25
  237. package/src/surfaces/tab-strip.json +5 -5
  238. package/src/surfaces/tab-strip.ts +2 -2
  239. package/src/tabs/project-config.ts +13 -13
  240. package/src/tabs/tab.ts +7 -2
  241. package/src/types.ts +13 -2
  242. package/src/ui/expression-editor.ts +10 -5
  243. package/src/ui/schema-form.ts +18 -1
  244. package/src/utils/edit-display.ts +27 -1
  245. package/src/view.ts +9 -2
  246. package/src/workspace/tab-workspace.ts +2 -2
  247. package/src/workspace/workspace-back.ts +2 -2
  248. package/dist/chunks/2020-906vx2dq.js +0 -4
  249. package/dist/chunks/adapter-hnvad61x.js +0 -4
  250. package/dist/chunks/add-new-flow-v0pm96mr.js +0 -4
  251. package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
  252. package/dist/chunks/color-04361ttk.js +0 -4
  253. package/dist/chunks/color-field-qv5r2b16.js +0 -4
  254. package/dist/chunks/components-w5zqwva1.js +0 -4
  255. package/dist/chunks/content-source-g38w0d3f.js +0 -4
  256. package/dist/chunks/convert-to-repeater-r8sfxjjm.js +0 -4
  257. package/dist/chunks/editor-wvf5e6j9.js +0 -4
  258. package/dist/chunks/entry-commands-t13dyw3c.js +0 -4
  259. package/dist/chunks/extension-sections-vjzw46xb.js +0 -4
  260. package/dist/chunks/file-ops-1sghzgcr.js +0 -4
  261. package/dist/chunks/files-zrqtgt41.js +0 -4
  262. package/dist/chunks/format-host-9gy76erh.js +0 -4
  263. package/dist/chunks/fs-events-45rhg3me.js +0 -4
  264. package/dist/chunks/grid-open-t4fq6bbm.js +0 -4
  265. package/dist/chunks/iframe-entry-42hpmwz5.js +0 -5
  266. package/dist/chunks/iframe-host-9aq8ze3q.js +0 -4
  267. package/dist/chunks/index-f9qr7kzh.js +0 -4
  268. package/dist/chunks/jsonMode-vj30te2h.js +0 -13
  269. package/dist/chunks/jx-validate-r4ax11e3.js +0 -4
  270. package/dist/chunks/layers-m49nmwvx.js +0 -4
  271. package/dist/chunks/layers-panel-zr92pwdp.js +0 -4
  272. package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
  273. package/dist/chunks/media-library-j74rt0w4.js +0 -4
  274. package/dist/chunks/media-open-mypr0k6b.js +0 -4
  275. package/dist/chunks/media-picker-pemtbsjv.js +0 -4
  276. package/dist/chunks/menu-d2jxpgma.js +0 -4
  277. package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
  278. package/dist/chunks/monaco-setup-0hw9f835.js +0 -4
  279. package/dist/chunks/notify-bwehrp7q.js +0 -4
  280. package/dist/chunks/parse-hee7ne9b.js +0 -4
  281. package/dist/chunks/platform-kv0k65cy.js +0 -4
  282. package/dist/chunks/popover-9tf4cjrk.js +0 -4
  283. package/dist/chunks/publish-panel-vg1n880b.js +0 -4
  284. package/dist/chunks/publish-quick-4fwngwrw.js +0 -4
  285. package/dist/chunks/publish-workspace-jv4w2bx2.js +0 -4
  286. package/dist/chunks/quick-search-nh29rt8a.js +0 -4
  287. package/dist/chunks/references-vqyr5s9x.js +0 -4
  288. package/dist/chunks/right-panel-3ws9f2w0.js +0 -4
  289. package/dist/chunks/source-control-h3hcs5gy.js +0 -4
  290. package/dist/chunks/studio-0khd8xtx.js +0 -4
  291. package/dist/chunks/studio-1ctnw3xv.js +0 -5
  292. package/dist/chunks/studio-1ks5d9y4.js +0 -5
  293. package/dist/chunks/studio-1y9mab9m.js +0 -5
  294. package/dist/chunks/studio-2kpxm0eh.js +0 -7
  295. package/dist/chunks/studio-2zz4qbv9.js +0 -5
  296. package/dist/chunks/studio-3pz4t5a2.js +0 -5
  297. package/dist/chunks/studio-4f7thq0p.js +0 -5
  298. package/dist/chunks/studio-61rg2cz5.js +0 -5
  299. package/dist/chunks/studio-7rrdbvex.js +0 -5
  300. package/dist/chunks/studio-9c6cbq2c.js +0 -4
  301. package/dist/chunks/studio-9dq7rwc7.js +0 -5
  302. package/dist/chunks/studio-9gr7xs9r.js +0 -6
  303. package/dist/chunks/studio-a88ej93p.js +0 -7
  304. package/dist/chunks/studio-acer0g8w.js +0 -5
  305. package/dist/chunks/studio-az3wvyh2.js +0 -5
  306. package/dist/chunks/studio-brh8d2pr.js +0 -5
  307. package/dist/chunks/studio-c2fa783p.js +0 -9
  308. package/dist/chunks/studio-cfnn70h1.js +0 -5
  309. package/dist/chunks/studio-cqxj4fcy.js +0 -5
  310. package/dist/chunks/studio-cw11h078.js +0 -5
  311. package/dist/chunks/studio-dn56z7sn.js +0 -5
  312. package/dist/chunks/studio-egnjpyde.js +0 -9
  313. package/dist/chunks/studio-ejrypvmq.js +0 -5
  314. package/dist/chunks/studio-frc16j8v.js +0 -10
  315. package/dist/chunks/studio-gnazwtv3.js +0 -5
  316. package/dist/chunks/studio-hfqpfmpk.js +0 -5
  317. package/dist/chunks/studio-hh394phe.js +0 -5
  318. package/dist/chunks/studio-j0zf5x2x.js +0 -5
  319. package/dist/chunks/studio-j5fcp6gj.js +0 -5
  320. package/dist/chunks/studio-jd1qb1st.js +0 -7
  321. package/dist/chunks/studio-k0xzrse2.js +0 -64
  322. package/dist/chunks/studio-k1xqrgm5.js +0 -5
  323. package/dist/chunks/studio-k3we3kqb.js +0 -5
  324. package/dist/chunks/studio-knsjyx7n.js +0 -5
  325. package/dist/chunks/studio-mrjtnm62.js +0 -5
  326. package/dist/chunks/studio-n9qba0gx.js +0 -5
  327. package/dist/chunks/studio-nzemfbkk.js +0 -14
  328. package/dist/chunks/studio-pwctzka3.js +0 -16
  329. package/dist/chunks/studio-q80fg1d6.js +0 -12
  330. package/dist/chunks/studio-q9hx2qp0.js +0 -5
  331. package/dist/chunks/studio-qrzmfaf6.js +0 -5
  332. package/dist/chunks/studio-r6mx7vm5.js +0 -7
  333. package/dist/chunks/studio-swedpd82.js +0 -5
  334. package/dist/chunks/studio-tmfcn347.js +0 -6
  335. package/dist/chunks/studio-v5wktj6f.js +0 -5
  336. package/dist/chunks/studio-vpevkfxw.js +0 -5
  337. package/dist/chunks/studio-wqfaqw4m.js +0 -5
  338. package/dist/chunks/studio-xpx91fby.js +0 -6
  339. package/dist/chunks/studio-xva3hzkv.js +0 -5
  340. package/dist/chunks/studio-z3fztxrp.js +0 -9
  341. package/dist/chunks/studio-z9453ypn.js +0 -6
  342. package/dist/chunks/toast-w11qpkyz.js +0 -4
  343. package/dist/chunks/tsMode-jg1dtphj.js +0 -14
  344. package/dist/chunks/workspace-6ztqcrsh.js +0 -4
  345. package/dist/chunks/workspace-home-rse9h8a0.js +0 -4
  346. package/src/content/draft-state.ts +0 -108
@@ -0,0 +1,9 @@
1
+ import{ae}from"./studio-dbex091t.js";import{p,we}from"./studio-1b79rpcb.js";import{Z}from"./studio-mkjrjpr2.js";import{Wy}from"./studio-hf259xzd.js";import{Rr}from"./studio-52mzbxqm.js";import{Zl,$p}from"./studio-8vmad6x2.js";import{ln,Zx,Da,Vi,Jn,X,eu,g,Ft}from"./studio-ybkd5w8k.js";import{Is}from"./studio-44drsmhw.js";import{ca,Ot,Cf}from"./studio-6tnpg0vx.js";import{io}from"./studio-jj9gf1qc.js";import{Hd,Qw,Lp,Om,Ts,Rp}from"./studio-qcc5hsw2.js";import{xo,rh,NC,ey,pi,ic}from"./studio-m25ry0mf.js";import{to,pO}from"./studio-a4ymg4vd.js";import{Js,ll,oO,sO}from"./studio-pafmb06w.js";import{Op}from"./studio-x3z3rhej.js";import{x}from"./studio-anc8067x.js";import{Ce}from"./studio-ft706q02.js";import{$n,E,I}from"./studio-xxttcym1.js";import{me,Os,te,b}from"./studio-y3tjh2xb.js";import{n,J,qe,S,f}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var j=b(new Map);function Y(e,t){j.set(e,t)}function ID(e){return e?j.get(e):void 0}function ND(e){j.delete(e)}var B={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a hold switch commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-hold-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="hold"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"hold-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/holdSwitch"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"hold"},$props:{checked:{$ref:"#/state/holdOn"},hint:"${state.holdHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setHold"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"${state.holdLabel}"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};E("entry-editor",B);function W(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.holdSwitch=t.holdSwitch,e.holdOn=t.holdOn,e.holdLabel=t.holdLabel,e.holdHint=t.holdHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function be(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function q(e,t,r,o){e.replaceChildren();let s=b({collection:"",holdHint:"",holdLabel:"",holdOn:!1,holdSwitch:"hidden",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setHold:r.setHold,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});W(s,t);let i=null,a=!1,l=I("entry-editor",s,e,{onNodeCreated:(d,c,O)=>{if(d instanceof HTMLElement&&be(O)==="fields")o.fieldsSlot(d)}}).then((d)=>{let c=d.root;if(a)return d.dispose(),c;return i=d,c});return{attached:()=>{if(a)return!1;let d=i?.root;return d===void 0?!0:d instanceof HTMLElement&&e.contains(d)},dispose(){a=!0,i?.dispose(),i=null},ready:l,update:(d)=>W(s,d)}}var xe=["title","name","label","heading"];function kp(e,t={}){let r=(o)=>{for(let s of xe){let i=o.find((a)=>a.toLowerCase()===s);if(i!==void 0)return i}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((o)=>n(t[o])))}function k(e){if(e instanceof Date)return Db(e);if(n(e))return e;if(J(e)||qe(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||J(t)).map(String).join(", ");return""}function Ee(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,k(t[r])]))}var Se=["date","published","publishedAt","pubDate","publishDate"];function OS(e,t){for(let[r,o]of Object.entries(e?.properties??{}))if(o.format==="date"||o.format==="date-time")return r;return Se.find((r)=>(r in t))??null}function CT(e){let t=e?.properties??{};return OS(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function Db(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let o=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${o}-${s}`}return r.toISOString().slice(0,10)}function D(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function Q(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",o=[...r===""?[]:r.split("/"),...t.split("/")],s=[];for(let i of o){if(i===""||i===".")continue;if(i==="..")s.pop();else s.push(i)}return s.join("/")}var ee=/^[a-z][\d+.a-z-]*:/i;function Fe(e,t){let r=t.trim();if(r==="")return"";return ee.test(r)?r:io(Q(e,r))}function ne(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":ne(t)}if(f(e)){let{src:t}=e;return n(t)?t:""}return""}function re(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&re(e.items)}function kT(e,t,r){for(let[o,s]of Object.entries(r?.properties??{}))if(re(s)){let i=Fe(e,ne(t[o]));if(i!=="")return i}for(let o of Object.values(t)){if(!n(o)||ee.test(o))continue;let s=o.lastIndexOf(".");if(s>0&&Cf(o.slice(s)))return io(Q(e,o))}return""}function oe(e,t,r){let o=Js(t),s=o?.schema??null,i=kp(s,r),a=i===null?void 0:r[i],l=OS(s,r);return{date:l===null?"":Db(r[l]),fields:Ee(s,r),path:e,status:Om(o?.def,r),thumb:kT(e,r,s),title:n(a)&&a.trim()!==""?a:D(e)}}async function Le(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let s=JSON.parse(t);return S(s)&&!Array.isArray(s)?s:{}}let{parseSourceForPath:r}=await (ce("dtdvjmza"),import("./file-ops-dtdvjmza.js"));return(await r(e,t)).frontmatter}catch{return{}}}var L=new Map,F=new Map,P=0,T=new Set,U=200;async function ve(e,t){let r=t.slice(0,U),o=await Promise.all(r.map(async(i)=>oe(i,e,await Le(i)))),s=t.slice(U).map((i)=>({date:"",path:i,status:"",thumb:"",title:D(i)}));return[...o,...s]}function Aw(e,t){let r=t.join(`
2
+ `),o=L.get(e);if(o?.key===r)return o.entries;if(!we())return t.map((i)=>({date:"",path:i,status:"",thumb:"",title:D(i)}));let s=`${e}
3
+ ${r}`;if(!F.has(s)){let i=P,a=ve(e,t).then((l)=>{if(F.get(s)===a)F.delete(s);if(i===P){L.set(e,{entries:l,key:r});for(let d of T)d()}return l});F.set(s,a)}return null}function Te(e,t,r){let o=L.get(t),s=o?.entries.findIndex((a)=>a.path===e)??-1;if(!o||s===-1)return!1;let i=o.entries.with(s,oe(e,t,r));L.set(t,{entries:i,key:o.key});for(let a of T)a();return!0}function LD(e,t){let r=ic(e);if(e===null||r===null||r===pi)return!1;return Te(e,r,t)}function ET(){P+=1,L.clear(),F.clear()}function Pw(e){return T.add(e),()=>{T.delete(e)}}var Re=/^\d{4}-\d{2}-\d{2}/,m="entry",h=b(new Map);function A(e){let t=h.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return to(e)?.state.rows[t.row]?.key??null}function Oe(e){return h.has(e.id)}function H(e,t){h.set(e.id,{key:t})}function Ne(e){h.delete(e.id)}function y(e){return Oe(e)&&to(e)!==null}function ie(e){let t=to(e),r=A(e);if(!t||r===null)return{};let o={};for(let s of t.state.columns){let i=t.buffer.effectiveValue(r,s.field);if(i===null||i==="")continue;if(s.kind==="date"&&n(i)&&!Re.test(i)){o[s.field]=Db(i)||i;continue}o[s.field]=S(i)&&!Array.isArray(i)?i.$ref:i}return o}function je(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||J(e)||qe(e))return e;return JSON.stringify(e)}function _(e,t){let r=to(e),o=A(e);if(!r||o===null)return;let s=new Set(r.state.columns.map((i)=>i.field));r.buffer.group(()=>{for(let[i,a]of Object.entries(t))if(s.has(i))r.buffer.setCell(o,i,je(a))})}function v(e){let t=to(e),r=A(e),o=t?.state.rows??[],s=r===null?-1:o.findIndex((i)=>i.key===r);return{index:s,next:s===-1?null:o[s+1]?.key??null,previous:s<=0?null:o[s-1]?.key??null,total:o.length}}async function RD(e,t){let{openFileInTab:r}=await (ce("8pf70854"),import("./files-8pf70854.js"));await r(e);let o=g.tabs.get(e)??null;if(!o||!to(o))return o;if(!h.has(o.id))o.scope.run(()=>{Os(()=>Ne(o))});if(h.set(o.id,{row:t}),!o.capabilities.modes.includes(m))o.capabilities.modes.unshift(m);return o.session.ui.canvasMode=m,o.session.ui.preview=!1,Ft(o.id),o}function se(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Gl(e){if(y(e))return ie(e);return se(e)?e.doc.document:e.doc.content.frontmatter}function Pe(e,t,r){let o=e.doc.document,s=Object.hasOwn(o,t)?Ce(o[t]):void 0,i=r===void 0||r===null||r==="";if(i)delete o[t];else o[t]=r;let a=i?void 0:Ce(r);Vi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:s}}),e.doc.dirty=!0,pO()}function M(e,t,r){if(y(e))_(e,{[t]:r});else if(se(e))Pe(e,t,r);else eu(e,t,r)}function AS(e,t){if(y(e)){_(e,t);return}X(e,(r)=>{for(let[o,s]of Object.entries(t))M(r,o,s)})}function w(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function ke(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function le(e,t){let r=[];for(let i of e)r.push(w(i));let o=[],s=t?.content??{};for(let i of Object.values(s)){if(!n(i.source)||i.source===""||ke(i.source))continue;let a=w(i.source),l=a.indexOf(Rr);if(l!==-1)a=w(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...o].some((c)=>a===c||a.startsWith(`${c}/`)))o.push(a)}return o.length===0?e:[...e,...o]}function De(e,t){let r=ic(e);if(r===null)return null;if(r===pi)return t===void 0||rh(e,t)?r:null;let o=Jn(e);if(!o||o.name!==r||!o.def.format||o.ext===null)return r;return e.toLowerCase().endsWith(o.ext.toLowerCase())?r:null}var $e=new Set(["node_modules",".git",".jx",".cache"]);function Ae(e){let t=w(e);return t===""||t==="."}async function de(e,t,r=!1){let o;try{o=await Is(()=>t.platform.listDirectory(e))}catch(i){if(!r)t.failures.push({dir:e,error:Z(i)});return}let s=[];for(let i of o){if(i.type==="directory"){let l=w(i.path);if(!$e.has(i.name)&&!Ae(l)&&!t.claimed.has(l))t.claimed.add(l),s.push(i.path);continue}let a=Ot(i.name);t.out.push({collection:De(i.path,t.pageExtensions),ext:a,locale:Zx(i.path,t.i18n)??void 0,media:ca.has(a),modified:i.modified,name:i.name,path:i.path,size:i.size,type:a||"file"})}await Promise.all(s.map((i)=>de(i,t)))}async function Em(e,t,r=new Set,o){let{i18n:s}=ln(x?.projectConfig??{}),i={claimed:new Set,failures:[],i18n:s,out:[],pageExtensions:o,platform:t};await Promise.all(e.map((d)=>{let c=w(d);if(i.claimed.has(c))return Promise.resolve();return i.claimed.add(c),de(d,i,r.has(d))}));let{failures:a,out:l}=i;return l.sort((d,c)=>d.path.localeCompare(c.path)),{failures:a,files:l}}function TT(e,t){let r=e.filter((i)=>i.collection===t.collection),o=t.query.trim().toLowerCase();if(o)r=r.filter((i)=>i.name.toLowerCase().includes(o)||i.path.toLowerCase().includes(o));let s=t.locale?.trim();if(s)r=r.filter((i)=>i.locale===s);return r}var Tm=["table","cards","calendar","board"],Mw={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var DD=new Set(["cards"]),Ie=/^(\d{4}-\d{2}-\d{2})/;function $T(e){let t=Ie.exec(e.name);if(t)return t[1];if(e.modified){let r=Op(new Date(e.modified));if(r)return r}return null}function Ob(){return ln(x?.projectConfig??{}).i18n?.locales??[]}function OD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return Ob().filter((r)=>t.has(r))}function AD(e,t=$T){let r=new Map,o=[];for(let i of e){let a=t(i);if(a===null){o.push(i);continue}let l=r.get(a);if(l)l.push(i);else r.set(a,[i])}return{days:[...r.entries()].map(([i,a])=>({date:i,files:a})).toSorted((i,a)=>a.date.localeCompare(i.date)),undated:o}}function He(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function PD(e){let t=new Map;for(let r of e){let o=He(r.path),s=t.get(o);if(s)s.push(r);else t.set(o,[r])}return[...t.entries()].map(([r,o])=>({files:o,group:r})).toSorted((r,o)=>r.group.localeCompare(o.group))}function _e(e,t,r,o){let s=kp(e,t),i=s===null?"":t[s]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(i||a||o||`Row ${r+1}`).trim()}function Me(e){let{headers:t,rows:r}=Hd(e);return r.flatMap((o,s)=>o.some((i)=>i.trim()!=="")?[{fields:Object.fromEntries(t.map((i,a)=>[i,o[a]??""])),row:s}]:[])}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(o)=>S(o)&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([s,i])=>[s,k(i)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((o,s)=>({fields:r(o),row:s}))}function ue(e,t,r){let o=e.toLowerCase(),s=o.endsWith(".csv")?Me(t):o.endsWith(".json")?Ge(t):null;if(s===null)return null;let i=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return s.map(({fields:a,row:l,single:d},c)=>({fields:a,index:c,row:l,title:_e(r,a,c,d?i:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ve(e){return`field:${e}`}function MD(e){return e.startsWith("field:")?e.slice(6):null}var Je=6,pe=new Set(["image","markdown","html","richtext"]);function V(e){return ey(NC(e))}function FD(e,t){return Object.entries(e?.properties??{}).filter(([r,o])=>{if(t.has(r))return!1;if(o.type==="object"||n(o.format)&&pe.has(o.format))return!1;let s=o.items?.format;return o.type!=="array"||o.items?.type==="string"&&!(n(s)&&pe.has(s))}).slice(0,Je).map(([r,o])=>{let s={name:r,title:V(r)};if(o.type==="array")s.list=!0;if(o.type==="number"||o.type==="integer"||o.format==="date"||o.format==="date-time")s.measure=!0;return s})}function ze(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function LT(e=pi,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===pi)return ze(t);let o=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)o.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)o.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let s of t?.fields??[])o.push({editable:!1,field:Ve(s.name),kind:"string",title:s.title,widthHint:140});return[...o,...r]}function Ke(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===pi?xo(e.path).urlPattern:null},key:e.path}}async function Ye(e,t){return(await Promise.all(e.map(async(o)=>{let s=o.collection===null?null:Jn(o.path);if(!s?.fileBacked)return[o];let i;try{i=await t(o.path)}catch{return[o]}let a=ue(o.path,i,s.def.schema);if(a===null)return[o];return a.map((l)=>Be(o,l))}))).flat()}function Be(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function We(e){let t=p(),r=await Ye(e.files,(o)=>t.readFile(o));return{...e,files:r}}function jD(e){let t=null,r=null,o=null,s=e??(()=>le(x?.projectDirs??[],x?.projectConfig??null));async function i(){if(t)return t;let a=s(),l=new Set(e?a:x?.projectDirs??[]),d=new Set(a.filter((c)=>!l.has(c)));return r??=Wy().then((c)=>Em(a,p(),d,c)).then(We).then((c)=>(t=c,o=a.join(`
4
+ `),r=null,c)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(LT()),commit(a){return Promise.resolve({cells:a.cells.map((l)=>({error:G,field:l.field,ok:!1,rowKey:l.rowKey})),deletes:a.deletes.map((l)=>({error:G,ok:!1,rowKey:l.rowKey})),inserts:a.inserts.map((l)=>({error:G,ok:!1,tempKey:l.tempKey}))})},failures:()=>t?.failures??[],files:()=>t?.files??[],id:Da("content"),label:"Content",async refresh(){t=null,r=null,await i()},async rows(){let a=await i();return{rows:a.files.map((l)=>Ke(l)),total:a.files.length}},scanned:()=>t!==null,stale:()=>t!==null&&o!==s().join(`
5
+ `)}}var Ue=[m],R=new Map;function z(e){return R.get(e)??null}function RT(e,t){let r=z(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function Fw(e){let t=R.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),R.delete(e)}function Ab(e,t){let r=Ts(C(e)?.def);if(r)X(e,(o)=>M(o,r.field,t))}function HD(e){let t=C(e)?.def;if(!Qw(t))return null;let r=Gl(e),o=Lp(t,r);return{held:o!==null,text:Om(t,r),title:Rp(o)}}function IT(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function NT(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>$p(t,{projectConfig:x?.projectConfig??{},scope:r})}}function DT(e,t){return Object.fromEntries(sO(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function C(e){return y(e)?oO(e.documentPath):ll(e.documentPath)}function OT(e,t,r){let o=kp(t,r),s=e.properties??{},i=o===null?void 0:s[o];if(o===null||i===void 0)return e;return{...e,properties:{[o]:i,...s}}}function Xe(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ye(e,t,r){let o=$n(e,"entry"),s=$n(e,"entry/fields");if(!r)return{collection:"",emptyLine:Xe(t),fieldsRegion:s,holdHint:Rp(null),holdLabel:"",holdOn:!1,holdSwitch:"hidden",name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:o,stage:"empty"};let i=Gl(t),a=Lp(r.def,i),l=Ts(r.def),d=y(t),c=v(t);return{collection:r.name,emptyLine:"",fieldsRegion:s,holdHint:Rp(a),holdLabel:l?.label??"",holdOn:l!==null&&i[l.field]===!0,holdSwitch:l?"shown":"hidden",name:d?Qe(r,i,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:Rp(a),noteState:a===null?"hidden":"shown",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:d?"shown":"hidden",region:o,stage:"entry"}}function Qe(e,t,r){let o=kp(e.schema,t),s=o===null?void 0:t[o];if(n(s)&&s.trim()!=="")return s.trim();return r===-1?"Record":`Row ${r+1}`}function BD(e,t){let{paneId:r,wrap:o}=e;if(RT(r,t))return;Fw(r);let s=null,i=null,a=()=>{if(s!==null&&z(r)===s)d()},l=(u)=>{if(!i||!u)return;let N=Gl(t),K=Zl(`entry:${r}`,OT(u.schema,u.schema,N),N,{context:NT(t),errors:DT(u,N),onChange:(he)=>AS(t,he),rerender:a,ui:IT(u.schema)});if(K.parentNode!==i)i.replaceChildren(K)},d=()=>{let u=C(t);if(!u)i=null;s?.surface.update(ye(r,t,u)),l(u)},c=me(),O=q(o,ye(r,t,C(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=v(t);if(u!==-1&&t.documentPath)Y(t.documentPath,u);t.session.ui.canvasMode="grid"},setHold:(u)=>Ab(t,u),showNext:()=>{let{next:u}=v(t);if(u!==null)H(t,u)},showPrevious:()=>{let{previous:u}=v(t);if(u!==null)H(t,u)}},{fieldsSlot:(u)=>{i=u,l(C(t))}});s={paneId:r,scope:c,surface:O,tabId:t.id,wrap:o},R.set(r,s),c.run(()=>{te(()=>{if(z(r)!==s)return;t.doc.document,t.doc.content.frontmatter,x?.projectConfig?.content,d()})})}async function VD(e){let{openFileInTab:t}=await (ce("8pf70854"),import("./files-8pf70854.js"));await t(e);for(let[r,o]of g.tabs.entries()){if(o.documentPath!==e)continue;for(let s of Ue)if(!o.capabilities.modes.includes(s))o.capabilities.modes.unshift(s);return o.session.ui.canvasMode=m,o.session.ui.preview=!1,Ft(r),o}return null}
6
+ export{kp,OS,CT,Db,kT,Aw,LD,ET,Pw,RD,Gl,AS,ID,ND,Em,TT,Tm,Mw,DD,$T,Ob,OD,AD,PD,MD,FD,LT,jD,RT,Fw,Ab,HD,IT,NT,DT,OT,BD,VD};
7
+
8
+ //# debugId=7FD60CFA03D209B764756E2164756E21
9
+ //# sourceMappingURL=studio-z89e6wpg.js.map
@@ -2,7 +2,7 @@ var C=globalThis,O=(t)=>t,b=C.trustedTypes,j=b?b.createPolicy("lit-html",{create
2
2
  \f\r](?:([^\\s"'>=/]+)([
3
3
  \f\r]*=[
4
4
  \f\r]*(?:[^
5
- \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),Wr=E(1),J=E(2),K=E(3),Zc=Symbol.for("lit-noChange"),ft=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Zc)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=ft,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===ft||t==null||t===""?(this._$AH!==ft&&this._$AR(),this._$AH=ft):t!==this._$AH&&t!==Zc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ft&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=ft,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=ft}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Zc,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Zc&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===ft?t=ft:t!==ft&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===ft?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ft?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ft)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??ft)===Zc)return;let s=this._$AH,i=t===ft&&s!==ft||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==ft&&(s===ft||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var eI={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var io=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{Wr,Zc,ft,eI,io};
5
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),Jo=E(1),J=E(2),K=E(3),Qc=Symbol.for("lit-noChange"),ft=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Qc)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=ft,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===ft||t==null||t===""?(this._$AH!==ft&&this._$AR(),this._$AH=ft):t!==this._$AH&&t!==Qc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ft&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=ft,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=ft}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Qc,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Qc&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===ft?t=ft:t!==ft&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===ft?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ft?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ft)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??ft)===Qc)return;let s=this._$AH,i=t===ft&&s!==ft||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==ft&&(s===ft||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var vR={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var rr=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{Jo,Qc,ft,vR,rr};
6
6
 
7
- //# debugId=B0F4542A6C5B6EBD64756E2164756E21
8
- //# sourceMappingURL=studio-5tet77de.js.map
7
+ //# debugId=468552AAC01762DB64756E2164756E21
8
+ //# sourceMappingURL=studio-zbwr6prc.js.map
@@ -1,5 +1,5 @@
1
- import{WI}from"./studio-nzemfbkk.js";import{Xs,av}from"./studio-tpxcryf2.js";import{E,R}from"./studio-9dq7rwc7.js";import{Me}from"./studio-0gvvqj3h.js";import{g}from"./studio-3qr08sxq.js";var x={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};E("menu",x);var j="block-end span-inline-end";function P(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?j:""}function N(e){if(!e)return{x:0,y:0};let n=Me(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function b(e,n=0){let r=n===0?(e.children??[]).map((t)=>b(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function S(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((a)=>a.id===n);if(t)return t}return}function zt(e){let n=Xs("popover",e.region),r=new AbortController,t=null,a=null,s=!1,h=()=>{if(s)return;s=!0,r.abort(),a?.(),a=null,av("popover",e.region),q(e.opener??null),e.onClosed?.(f)},v=e.place?e.place(new DOMRect):e.origin??N(e.opener),c=g({floor:e.floor?.()??0,label:e.label,placement:P(e),rows:e.rows.map((o)=>b(o)),select:(o,u)=>{let i=String(u.detail),d=S(c.rows,i);if(!d)return;if(k(t,e.opener??null),d.run)d.run();else e.run?.(i);f.close()},x:v.x,y:v.y}),w=()=>{if(s||!t||!e.place)return;let o=e.place(Me(t));c.x=o.x,c.y=o.y},p=()=>r.signal.aborted,M=(async()=>{let o=await R("menu",c,n,{signal:r.signal});if(p())return;if({dispose:a}=o,t=o.root,t.addEventListener("toggle",(i)=>{if(i.newState==="closed")h()}),!t.hasAttribute("popover"))await new Promise((i)=>{t.addEventListener("jx-ready",()=>i(),{once:!0})});if(p())return;if(await C(r.signal),p())return;let u=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(u?{source:u}:void 0),w(),requestAnimationFrame(w)})(),f={close:()=>{if(s)return;if(t?.open)t.hidePopover();h()},host:n,ready:M,setRows:(o)=>{if(s)return;let i=document.activeElement?.closest("jx-menu"),d=i&&i!==t?i.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;c.rows=o.map((m)=>b(m)),setTimeout(()=>{if(s||!t||t.contains(document.activeElement))return;let m=d?t.querySelector(`jx-menu-item[data-command-id="${d}"]`):null,y=m?.querySelector("jx-menu")??null;if(m&&!(y?.open&&y.querySelector("jx-menu-item")))m.focus();else WI(t)},0)}};return f}var l=new Set;if(typeof window<"u")window.addEventListener("pointerdown",(e)=>l.add(e.pointerId),!0),window.addEventListener("pointerup",(e)=>l.delete(e.pointerId),!0),window.addEventListener("pointercancel",(e)=>l.delete(e.pointerId),!0),window.addEventListener("blur",()=>l.clear());function C(e){if(l.size===0||e.aborted)return Promise.resolve();return new Promise((n)=>{let r=new AbortController,t=()=>{if(l.size===0||e.aborted)r.abort(),n()},a={capture:!0,signal:r.signal};window.addEventListener("pointerup",t,a),window.addEventListener("pointercancel",t,a),window.addEventListener("blur",t,{signal:r.signal}),e.addEventListener("abort",t,{signal:r.signal})})}function k(e,n){if(e?.contains(document.activeElement)&&n?.isConnected&&n!==document.body)n.focus({preventScroll:!0})}function q(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
- export{zt};
1
+ import{lI}from"./studio-s6ymkf3q.js";import{na,gy}from"./studio-yetr4gg1.js";import{E,I}from"./studio-xxttcym1.js";import{Me}from"./studio-4xadhxj1.js";import{b}from"./studio-y3tjh2xb.js";var x={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};E("menu",x);var j="block-end span-inline-end";function P(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?j:""}function N(e){if(!e)return{x:0,y:0};let n=Me(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function h(e,n=0){let r=n===0?(e.children??[]).map((t)=>h(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function S(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((a)=>a.id===n);if(t)return t}return}function Vt(e){let n=na("popover",e.region),r=new AbortController,t=null,a=null,s=!1,v=()=>{if(s)return;s=!0,r.abort(),a?.(),a=null,gy("popover",e.region),k(e.opener??null),e.onClosed?.(f)},w=e.place?e.place(new DOMRect):e.origin??N(e.opener),c=b({floor:e.floor?.()??0,label:e.label,placement:P(e),rows:e.rows.map((o)=>h(o)),select:(o,u)=>{let i=String(u.detail),d=S(c.rows,i);if(!d)return;if(R(t,e.opener??null),d.run)d.run();else e.run?.(i);f.close()},x:w.x,y:w.y}),g=()=>{if(s||!t||!e.place)return;let o=e.place(Me(t));c.x=o.x,c.y=o.y},p=()=>r.signal.aborted,M=(async()=>{let o=await I("menu",c,n,{signal:r.signal});if(p())return;if({dispose:a}=o,t=o.root,t.addEventListener("toggle",(i)=>{if(i.newState==="closed")v()}),!t.hasAttribute("popover"))await new Promise((i)=>{t.addEventListener("jx-ready",()=>i(),{once:!0})});if(p())return;if(await C(r.signal),p())return;let u=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(u?{source:u}:void 0),g(),requestAnimationFrame(g)})(),f={close:()=>{if(s)return;if(t?.open)t.hidePopover();v()},host:n,ready:M,setRows:(o)=>{if(s)return;let i=document.activeElement?.closest("jx-menu"),d=i&&i!==t?i.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;c.rows=o.map((m)=>h(m)),setTimeout(()=>{if(s||!t||t.contains(document.activeElement))return;let m=d?t.querySelector(`jx-menu-item[data-command-id="${d}"]`):null,y=m?.querySelector("jx-menu")??null;if(m&&!(y?.open&&y.querySelector("jx-menu-item")))m.focus();else lI(t)},0)}};return f}var l=new Set;if(typeof window<"u")window.addEventListener("pointerdown",(e)=>l.add(e.pointerId),!0),window.addEventListener("pointerup",(e)=>l.delete(e.pointerId),!0),window.addEventListener("pointercancel",(e)=>l.delete(e.pointerId),!0),window.addEventListener("blur",()=>l.clear());function C(e){if(l.size===0||e.aborted)return Promise.resolve();return new Promise((n)=>{let r=new AbortController,t=()=>{if(l.size===0||e.aborted)r.abort(),n()},a={capture:!0,signal:r.signal};window.addEventListener("pointerup",t,a),window.addEventListener("pointercancel",t,a),window.addEventListener("blur",t,{signal:r.signal}),e.addEventListener("abort",t,{signal:r.signal})})}function R(e,n){if(e?.contains(document.activeElement)&&n?.isConnected&&n!==document.body)n.focus({preventScroll:!0})}function k(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
+ export{Vt};
3
3
 
4
- //# debugId=B72746DFA893FF8864756E2164756E21
5
- //# sourceMappingURL=studio-daksw8kh.js.map
4
+ //# debugId=9BCCB53FA9E523F964756E2164756E21
5
+ //# sourceMappingURL=studio-zdbsv5q2.js.map
@@ -1,5 +1,5 @@
1
- var n;function w2(e){n=new URL("./",e).href}function k0(e){if(n===void 0)throw Error(`bundleUrl(${JSON.stringify(e)}) before setBundleBase(). An entry module (src/studio.ts or src/canvas/iframe-entry.ts) must call setBundleBase(import.meta.url) first; a test needs tests/with-dom.ts, which sets one.`);return new URL(e,n).href}
2
- export{w2,k0};
1
+ var n;function UM(e){n=new URL("./",e).href}function j_(e){if(n===void 0)throw Error(`bundleUrl(${JSON.stringify(e)}) before setBundleBase(). An entry module (src/studio.ts or src/canvas/iframe-entry.ts) must call setBundleBase(import.meta.url) first; a test needs tests/with-dom.ts, which sets one.`);return new URL(e,n).href}
2
+ export{UM,j_};
3
3
 
4
- //# debugId=8300D7D8CE386E7764756E2164756E21
5
- //# sourceMappingURL=studio-abh9kfdh.js.map
4
+ //# debugId=631B994FA61CC89D64756E2164756E21
5
+ //# sourceMappingURL=studio-zvthj8hg.js.map
@@ -0,0 +1,4 @@
1
+ import{N,C,A,L,q,z,G,Y,X,Q}from"./iframe-entry-msd43x9h.js";export{N as TOAST_PAUSE,C as TOAST_RESUME,L as closeToast,Q as onToastAction,X as onToastDismiss,G as onToastHold,q as onToastMount,Y as onToastRelease,z as onToastUnmount,A as staysInside};
2
+
3
+ //# debugId=E007B270B667B77464756E2164756E21
4
+ //# sourceMappingURL=toast-2kn2vrn4.js.map
@@ -1,4 +1,4 @@
1
- import{L,C,A}from"./iframe-entry-2x9bn5ng.js";var d="jx-toast-host",E='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',i=new WeakMap,s=new WeakMap;function l(t){let e=t.currentTarget??t.target;return e instanceof Element?e.closest(d):null}function m(t){return[...t.querySelectorAll(E)].filter((e)=>e.closest("jx-toast")?.dataset.open!==void 0)}function v(t){let e=t.ownerDocument.activeElement;return e instanceof Node&&t.contains(e)}function T(t){let[e]=m(t);if(!e)return!1;let n=t.ownerDocument.activeElement;if(n instanceof HTMLElement&&!t.contains(n))i.set(t,n);return e.focus(),!0}function r(t){let e=i.get(t);if(i.delete(t),e?.isConnected===!0)return e.focus(),!0;let n=t.ownerDocument.activeElement;if(n instanceof HTMLElement&&t.contains(n))n.blur();return!1}function u(t,e){for(let n of t.querySelectorAll("jx-toast"))n.dispatchEvent(new Event(e))}function M(t,e){let n=l(e);if(n)u(n,L)}function S(t,e){let n=l(e);if(n&&!A(e))u(n,C)}function b(t,e){let n=l(e);if(!n)return;let c=n.ownerDocument.activeElement,o=e.target,a=c===null||c===n.ownerDocument.body,f=o instanceof Node&&c instanceof Node&&o.contains(c);if(a||f)r(n)}function x(t,e){let n=e.getRootNode(),c=(o)=>{if(!(o instanceof KeyboardEvent)||o.altKey||o.ctrlKey||o.metaKey)return;let a=t.hotkey??"";if(a!==""&&o.key===a){if(T(e))o.preventDefault();return}if(o.key==="Escape"&&v(e))r(e),o.preventDefault()};n.addEventListener("keydown",c),s.set(t,()=>n.removeEventListener("keydown",c))}function y(t){s.get(t)?.(),s.delete(t)}export{T as focusStack,m as focusablesIn,x as onHostMount,y as onHostUnmount,b as onStackClose,M as onStackHold,S as onStackRelease,r as returnFocus};
1
+ import{N,C,A}from"./iframe-entry-msd43x9h.js";var d="jx-toast-host",E='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',i=new WeakMap,s=new WeakMap;function l(t){let e=t.currentTarget??t.target;return e instanceof Element?e.closest(d):null}function m(t){return[...t.querySelectorAll(E)].filter((e)=>e.closest("jx-toast")?.dataset.open!==void 0)}function v(t){let e=t.ownerDocument.activeElement;return e instanceof Node&&t.contains(e)}function T(t){let[e]=m(t);if(!e)return!1;let n=t.ownerDocument.activeElement;if(n instanceof HTMLElement&&!t.contains(n))i.set(t,n);return e.focus(),!0}function r(t){let e=i.get(t);if(i.delete(t),e?.isConnected===!0)return e.focus(),!0;let n=t.ownerDocument.activeElement;if(n instanceof HTMLElement&&t.contains(n))n.blur();return!1}function u(t,e){for(let n of t.querySelectorAll("jx-toast"))n.dispatchEvent(new Event(e))}function M(t,e){let n=l(e);if(n)u(n,N)}function L(t,e){let n=l(e);if(n&&!A(e))u(n,C)}function S(t,e){let n=l(e);if(!n)return;let c=n.ownerDocument.activeElement,o=e.target,a=c===null||c===n.ownerDocument.body,f=o instanceof Node&&c instanceof Node&&o.contains(c);if(a||f)r(n)}function b(t,e){let n=e.getRootNode(),c=(o)=>{if(!(o instanceof KeyboardEvent)||o.altKey||o.ctrlKey||o.metaKey)return;let a=t.hotkey??"";if(a!==""&&o.key===a){if(T(e))o.preventDefault();return}if(o.key==="Escape"&&v(e))r(e),o.preventDefault()};n.addEventListener("keydown",c),s.set(t,()=>n.removeEventListener("keydown",c))}function x(t){s.get(t)?.(),s.delete(t)}export{T as focusStack,m as focusablesIn,b as onHostMount,x as onHostUnmount,S as onStackClose,M as onStackHold,L as onStackRelease,r as returnFocus};
2
2
 
3
- //# debugId=84590F1808CDB39064756E2164756E21
4
- //# sourceMappingURL=toast-host-g3r2s0kn.js.map
3
+ //# debugId=E40FBAF81247141664756E2164756E21
4
+ //# sourceMappingURL=toast-host-3rxeyj3d.js.map
@@ -1,4 +1,4 @@
1
- import{p,a,f}from"./iframe-entry-b5qgggyp.js";import{t}from"./iframe-entry-42hpmwz5.js";var j=150,R=6,h=4,w=new WeakMap,g=new WeakMap;function D(e,n){let o=g.get(e);if(!o){let l=new Set,s=(u)=>{if(!(u instanceof KeyboardEvent)||u.key!=="Escape")return;for(let c of l)c()};e.addEventListener("keydown",s,!0),o={dismiss:l,listener:s},g.set(e,o)}let{dismiss:i,listener:r}=o;return i.add(n),()=>{if(i.delete(n),i.size===0&&g.get(e)?.listener===r)e.removeEventListener("keydown",r,!0),g.delete(e)}}function G(e){try{return e.matches(":popover-open")}catch{return!1}}function U(e,n){if(n)return!1;if(!(e instanceof Element))return!0;try{return e.matches(":focus-visible")}catch{return!0}}var v=new WeakMap;function K(){return t(globalThis.HTMLButtonElement)&&"interestForElement"in HTMLButtonElement.prototype}function J(e,n){return K()&&e.id!==""&&n.getAttribute("interestfor")===e.id}function Q(e,n){a(e,n)}function V(e){f(e)}function X(e,n){if(J(e,n))return()=>{};let o=e.getRootNode(),i=null,r=null,l=!1,s=!1,u=!1,c=!1,m=!1,d=()=>{if(i!==null)clearTimeout(i),i=null;if(r!==null)clearTimeout(r),r=null},M=()=>{d(),m=!0,Q(e,n)},y=()=>{m=!1,V(e)},H=()=>{if(d(),l||s||u)return;y()},I=()=>{d();let T="delay"in e?Number(e.delay)||0:0;i=setTimeout(M,T)},S=()=>{d(),r=setTimeout(H,j)},O=()=>{l=!0,I()},A=()=>{l=!1,c=!1,S()},B=()=>{c=!0},N=()=>{c=!1},P=(T)=>{let E=U(T.target,c);if(c=!1,!E)return;u=!0,M()},q=()=>{u=!1,H()},C=()=>{s=!0,d()},z=()=>{s=!1,S()},W=()=>{if(!m&&!G(e))return;d(),y()},x=[[n,"pointerenter",O],[n,"pointerleave",A],[n,"pointerdown",B],[n,"pointerup",N],[n,"focusin",P],[n,"focusout",q],[e,"pointerenter",C],[e,"pointerleave",z]];for(let[T,E,b]of x)T.addEventListener(E,b,!0);let _=D(o,W);return()=>{d(),_();for(let[T,E,b]of x)T.removeEventListener(E,b,!0)}}function k(e,n){let o=n.getRootNode(),i=e.for??"",r=i===""?null:o.getElementById?.(i)??null;if(r)return r;let l=n.id;if(!/^[\w-]+$/.test(l))return null;return o.querySelector(`[interestfor="${l}"]`)}function L(e,n){let o=k(e,n);if(o)return o;let i=n.getRootNode(),r=n.id;if(!/^[\w-]+$/.test(r))return null;return i.querySelector(`[aria-describedby~="${r}"]`)}function Y(e,n){let o=L(e,n);if(!o)return;let i=o.getBoundingClientRect();if(i.width===0&&i.height===0)return;e.x=Math.round(i.left),e.y=Math.round(i.bottom+R),e.flipped=!1;let r=()=>{let l=n.getBoundingClientRect();if(l.width===0&&l.height===0)return;if(l.right>window.innerWidth-h)e.x=Math.max(h,Math.round(window.innerWidth-l.width-h));if(l.bottom>window.innerHeight-h)e.y=Math.max(h,Math.round(i.top-l.height-R)),e.flipped=!0};if(t(globalThis.requestAnimationFrame))requestAnimationFrame(r);else r()}function Z(e,n){v.get(e)?.();let o=L(e,n),i=()=>{if(!o||e.anchored!==!0)return;let m=n.getBoundingClientRect(),d=o.getBoundingClientRect();if(m.width===0&&m.height===0)return;e.flipped=m.bottom<=d.top};if(!o||!t(globalThis.requestAnimationFrame))return i(),()=>{};let r=null,l=()=>{r=null,i()},s=()=>{if(r===null)r=requestAnimationFrame(l)};window.addEventListener("scroll",s,{capture:!0,passive:!0}),window.addEventListener("resize",s);let u=t(globalThis.ResizeObserver)?new ResizeObserver(s):null;if(u)u.observe(n),u.observe(o);let c=()=>{if(r!==null)cancelAnimationFrame(r),r=null;if(window.removeEventListener("scroll",s,{capture:!0}),window.removeEventListener("resize",s),u?.disconnect(),v.get(e)===c)v.delete(e)};return v.set(e,c),s(),c}function te(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i="newState"in n&&n.newState==="open",r="source"in n?n.source:null,l=r instanceof Element?r:L(e,o);if(e.anchored=i&&l!==null,!i)e.flipped=!1}function oe(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i="newState"in n&&n.newState==="open";if(e.open=i,!i){v.get(e)?.();return}if(e.anchored===!0&&p())Z(e,o);else Y(e,o)}function ie(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i=k(e,o);if(!i)return;w.get(e)?.dispose(),w.set(e,{dispose:X(o,i),tip:o})}function re(e){v.get(e)?.();let n=w.get(e);if(!n)return;queueMicrotask(()=>{if(w.get(e)!==n)return;if(n.tip.isConnected)return;n.dispose(),w.delete(e)})}var F=0;function le(e,n){F+=1,e.uid=`${n.localName}-${F}`}export{j as TOOLTIP_HIDE_GRACE_MS,X as bindTooltip,Z as measureAnchoredFlip,le as mintHintId,te as onTooltipBeforeToggle,ie as onTooltipReady,oe as onTooltipToggle,re as onTooltipUnmount,Y as placeTooltip,K as supportsInterestInvokers};
1
+ import{p,l,f}from"./iframe-entry-v40cr813.js";import{t}from"./iframe-entry-rt8jz5t8.js";var j=150,R=6,h=4,w=new WeakMap,g=new WeakMap;function D(e,n){let o=g.get(e);if(!o){let s=new Set,u=(c)=>{if(!(c instanceof KeyboardEvent)||c.key!=="Escape")return;for(let d of s)d()};e.addEventListener("keydown",u,!0),o={dismiss:s,listener:u},g.set(e,o)}let{dismiss:i,listener:r}=o;return i.add(n),()=>{if(i.delete(n),i.size===0&&g.get(e)?.listener===r)e.removeEventListener("keydown",r,!0),g.delete(e)}}function G(e){try{return e.matches(":popover-open")}catch{return!1}}function U(e,n){if(n)return!1;if(!(e instanceof Element))return!0;try{return e.matches(":focus-visible")}catch{return!0}}var v=new WeakMap;function K(){return t(globalThis.HTMLButtonElement)&&"interestForElement"in HTMLButtonElement.prototype}function J(e,n){return K()&&e.id!==""&&n.getAttribute("interestfor")===e.id}function Q(e,n){l(e,n)}function V(e){f(e)}function X(e,n){if(J(e,n))return()=>{};let o=e.getRootNode(),i=null,r=null,s=!1,u=!1,c=!1,d=!1,m=!1,a=()=>{if(i!==null)clearTimeout(i),i=null;if(r!==null)clearTimeout(r),r=null},M=()=>{a(),m=!0,Q(e,n)},y=()=>{m=!1,V(e)},H=()=>{if(a(),s||u||c)return;y()},I=()=>{a();let T="delay"in e?Number(e.delay)||0:0;i=setTimeout(M,T)},S=()=>{a(),r=setTimeout(H,j)},O=()=>{s=!0,I()},A=()=>{s=!1,d=!1,S()},B=()=>{d=!0},N=()=>{d=!1},P=(T)=>{let E=U(T.target,d);if(d=!1,!E)return;c=!0,M()},q=()=>{c=!1,H()},C=()=>{u=!0,a()},z=()=>{u=!1,S()},W=()=>{if(!m&&!G(e))return;a(),y()},x=[[n,"pointerenter",O],[n,"pointerleave",A],[n,"pointerdown",B],[n,"pointerup",N],[n,"focusin",P],[n,"focusout",q],[e,"pointerenter",C],[e,"pointerleave",z]];for(let[T,E,b]of x)T.addEventListener(E,b,!0);let _=D(o,W);return()=>{a(),_();for(let[T,E,b]of x)T.removeEventListener(E,b,!0)}}function k(e,n){let o=n.getRootNode(),i=e.for??"",r=i===""?null:o.getElementById?.(i)??null;if(r)return r;let s=n.id;if(!/^[\w-]+$/.test(s))return null;return o.querySelector(`[interestfor="${s}"]`)}function L(e,n){let o=k(e,n);if(o)return o;let i=n.getRootNode(),r=n.id;if(!/^[\w-]+$/.test(r))return null;return i.querySelector(`[aria-describedby~="${r}"]`)}function Y(e,n){let o=L(e,n);if(!o)return;let i=o.getBoundingClientRect();if(i.width===0&&i.height===0)return;e.x=Math.round(i.left),e.y=Math.round(i.bottom+R),e.flipped=!1;let r=()=>{let s=n.getBoundingClientRect();if(s.width===0&&s.height===0)return;if(s.right>window.innerWidth-h)e.x=Math.max(h,Math.round(window.innerWidth-s.width-h));if(s.bottom>window.innerHeight-h)e.y=Math.max(h,Math.round(i.top-s.height-R)),e.flipped=!0};if(t(globalThis.requestAnimationFrame))requestAnimationFrame(r);else r()}function Z(e,n){v.get(e)?.();let o=L(e,n),i=()=>{if(!o||e.anchored!==!0)return;let m=n.getBoundingClientRect(),a=o.getBoundingClientRect();if(m.width===0&&m.height===0)return;e.flipped=m.bottom<=a.top};if(!o||!t(globalThis.requestAnimationFrame))return i(),()=>{};let r=null,s=()=>{r=null,i()},u=()=>{if(r===null)r=requestAnimationFrame(s)};window.addEventListener("scroll",u,{capture:!0,passive:!0}),window.addEventListener("resize",u);let c=t(globalThis.ResizeObserver)?new ResizeObserver(u):null;if(c)c.observe(n),c.observe(o);let d=()=>{if(r!==null)cancelAnimationFrame(r),r=null;if(window.removeEventListener("scroll",u,{capture:!0}),window.removeEventListener("resize",u),c?.disconnect(),v.get(e)===d)v.delete(e)};return v.set(e,d),u(),d}function te(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i="newState"in n&&n.newState==="open",r="source"in n?n.source:null,s=r instanceof Element?r:L(e,o);if(e.anchored=i&&s!==null,!i)e.flipped=!1}function oe(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i="newState"in n&&n.newState==="open";if(e.open=i,!i){v.get(e)?.();return}if(e.anchored===!0&&p())Z(e,o);else Y(e,o)}function ie(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i=k(e,o);if(!i)return;w.get(e)?.dispose(),w.set(e,{dispose:X(o,i),tip:o})}function re(e){v.get(e)?.();let n=w.get(e);if(!n)return;queueMicrotask(()=>{if(w.get(e)!==n)return;if(n.tip.isConnected)return;n.dispose(),w.delete(e)})}var F=0;function le(e,n){F+=1,e.uid=`${n.localName}-${F}`}export{j as TOOLTIP_HIDE_GRACE_MS,X as bindTooltip,Z as measureAnchoredFlip,le as mintHintId,te as onTooltipBeforeToggle,ie as onTooltipReady,oe as onTooltipToggle,re as onTooltipUnmount,Y as placeTooltip,K as supportsInterestInvokers};
2
2
 
3
- //# debugId=F94B5FFCE20D7B3B64756E2164756E21
4
- //# sourceMappingURL=tooltip-dj1pvgz7.js.map
3
+ //# debugId=25C4A76890B55CFF64756E2164756E21
4
+ //# sourceMappingURL=tooltip-ghkxkasp.js.map
@@ -1,4 +1,4 @@
1
- import{t}from"./iframe-entry-42hpmwz5.js";var p="jx-tree",y="jx-tree-item",L=new WeakMap,H=new WeakMap,T=new WeakMap;function b(n){let e=n.currentTarget;return e instanceof HTMLElement&&e.localName===p?e:null}function v(n,e){return e instanceof Element&&e.closest(p)===n}function h(n,e,r){let o=n[e];return o===void 0?n.getAttribute(r)??"":String(o)}function u(n){return h(n,"value","value")}function g(n){let e=Number(h(n,"level","aria-level"));return Number.isFinite(e)&&e>=1?Math.trunc(e):1}function M(n){let e=h(n,"expanded","aria-expanded");return e==="true"||e==="false"?e:""}function E(n){return n.disabled===void 0?n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true":n.disabled===!0}function N(n){let e=h(n,"label","label");return e===""?n.textContent:e}function K(n,e={}){let r=[...n.querySelectorAll(y)].filter((o)=>o.closest(p)===n);return e.includeDisabled?r:r.filter((o)=>!E(o))}function x(n){let e=K(n,{includeDisabled:!0});if(e.length===0)return;let r=String(n.current??""),o=e.filter((l)=>!E(l)),a=o.find((l)=>u(l)===r)??o[0]??null;for(let l of e)l.caret=l===a;F(n,r,a)}function P(n,e){let r=n.ownerDocument,o=r.activeElement;if(o instanceof Node&&n.contains(o))return!0;return(o===null||o===r.body)&&e.held!==null&&!e.held.isConnected}function F(n,e,r){let o=T.get(n);if(!o)return;if(!P(n,o)){T.delete(n);return}if(e===o.from||r===null||u(r)!==e)return;if(r.focus(),n.ownerDocument.activeElement===r)T.delete(n)}function W(n){if(H.has(n))return;let e=new MutationObserver(()=>{x(n)});e.observe(n,{attributeFilter:["tabindex"],attributes:!0,childList:!0,subtree:!0}),H.set(n,e)}function z(n){let e=String(n.current??""),r=L.get(n);if(r)x(r);return e}function G(n,e){let r=b(e);if(!r)return;L.set(n,r),x(r),W(r)}function j(n,e){return n.findIndex((r)=>r===e||e instanceof Node&&r.contains(e))}function f(n,e,r){n.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function O(n,e,r){if(e.current=u(r),x(n),r.focus(),t(r.scrollIntoView))r.scrollIntoView({block:"nearest"});f(n,"change",u(r))}function S(n){return Number(n.padtop??0)>0}function D(n){return Number(n.padbottom??0)>0}function A(n,e){T.set(n,{from:String(e.current??""),held:n.ownerDocument.activeElement})}function I(n,e,r){A(n,e),f(n,"move",{from:String(e.current??""),key:r})}function R(n){return S(n)||D(n)}function V(n,e,r){A(n,e),f(n,"typeahead",{char:r,from:String(e.current??"")})}function w(n,e,r,o,a){let l=e.multiple===!0?o:"replace",d=String(e.anchor??""),i=l==="range"?d===""?a||r:d:r;e.anchor=i,f(n,"select",{anchor:i,mode:l,value:r})}function C(n){if(n.shiftKey)return"range";return n.ctrlKey||n.metaKey?"toggle":"replace"}function _(n){return n.key.length===1&&!n.ctrlKey&&!n.metaKey&&!n.altKey?n.key.toLowerCase():null}function q(n,e,r){let o=n.map((a)=>N(a).trim().toLowerCase());for(let a=1;a<=o.length;a++){let l=(e+a)%o.length;if(o[l].startsWith(r))return l}return-1}function B(n,e){let r=g(n[e]);for(let o=e-1;o>=0;o--)if(g(n[o])<r)return o;return-1}function J(n,e){let r=b(e);if(!r||!v(r,e.target))return;let o=K(r);if(o.length===0)return;let a=j(o,e.target),l=String(n.current??""),d=e.ctrlKey||e.metaKey,i=o[a],s=null;switch(e.key){case"ArrowDown":{s={key:e.key,select:!d,to:a===-1?0:a+1};break}case"ArrowUp":{s={key:e.key,select:!d,to:a===-1?o.length-1:a-1};break}case"Home":case"End":{if(e.key==="Home"?S(n):D(n)){e.preventDefault(),e.stopPropagation(),I(r,n,e.key);return}s={key:e.key,select:!0,to:e.key==="Home"?0:o.length-1};break}case"ArrowRight":{if(!i)return;let c=M(i);if(c==="")return;if(c==="false"){e.preventDefault(),e.stopPropagation(),f(r,"expand",{expanded:!0,value:u(i)});return}let m=o[a+1];if(m&&g(m)<=g(i))return;s={key:e.key,select:!0,to:a+1};break}case"ArrowLeft":{if(!i)return;if(M(i)==="true"){e.preventDefault(),e.stopPropagation(),f(r,"expand",{expanded:!1,value:u(i)});return}let c=B(o,a);if(c===-1&&g(i)===1)return;s={key:e.key,select:!0,to:c};break}case"Enter":{if(!i)return;e.preventDefault(),e.stopPropagation(),f(r,"activate",u(i));return}case" ":{if(!i)return;e.preventDefault(),e.stopPropagation(),w(r,n,u(i),n.multiple===!0?"toggle":"replace",l);return}default:{let c=_(e);if(c===null)return;if(R(n)){e.preventDefault(),e.stopPropagation(),V(r,n,c);return}let m=q(o,a,c);if(m===-1)return;s={key:e.key,select:!0,to:m}}}e.preventDefault(),e.stopPropagation();let k=o[s.to];if(!k){if(s.to<0?S(n):D(n))I(r,n,s.key);return}if(O(r,n,k),s.select)w(r,n,u(k),C(e),l)}function Q(n,e){let r=b(e);if(!r||!(e.target instanceof Element))return;let o=e.target.closest(y);if(!o||o.closest(p)!==r||E(o))return;let a=String(n.current??"");O(r,n,o),w(r,n,u(o),C(e),a)}function X(n,e){let r=b(e);if(!r||!(e.target instanceof Element))return;let o=e.target.closest(y);if(!o||o.closest(p)!==r||E(o))return;f(r,"activate",u(o))}function Y(n,e){let r=b(e);if(!r||!v(r,e.target)||!(e.target instanceof Element))return;e.stopPropagation();let o=e.target.closest(y);if(!o||E(o))return;f(r,"expand",{expanded:M(o)!=="true",value:u(o)})}export{z as applyCurrent,K as itemsOf,Q as onTreeClick,X as onTreeDblClick,J as onTreeKeydown,G as onTreeMount,Y as onTreeToggle,x as syncTree};
1
+ import{t}from"./iframe-entry-rt8jz5t8.js";var p="jx-tree",y="jx-tree-item",L=new WeakMap,H=new WeakMap,T=new WeakMap;function b(n){let e=n.currentTarget;return e instanceof HTMLElement&&e.localName===p?e:null}function v(n,e){return e instanceof Element&&e.closest(p)===n}function h(n,e,r){let o=n[e];return o===void 0?n.getAttribute(r)??"":String(o)}function u(n){return h(n,"value","value")}function g(n){let e=Number(h(n,"level","aria-level"));return Number.isFinite(e)&&e>=1?Math.trunc(e):1}function M(n){let e=h(n,"expanded","aria-expanded");return e==="true"||e==="false"?e:""}function E(n){return n.disabled===void 0?n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true":n.disabled===!0}function N(n){let e=h(n,"label","label");return e===""?n.textContent:e}function K(n,e={}){let r=[...n.querySelectorAll(y)].filter((o)=>o.closest(p)===n);return e.includeDisabled?r:r.filter((o)=>!E(o))}function x(n){let e=K(n,{includeDisabled:!0});if(e.length===0)return;let r=String(n.current??""),o=e.filter((l)=>!E(l)),a=o.find((l)=>u(l)===r)??o[0]??null;for(let l of e)l.caret=l===a;F(n,r,a)}function P(n,e){let r=n.ownerDocument,o=r.activeElement;if(o instanceof Node&&n.contains(o))return!0;return(o===null||o===r.body)&&e.held!==null&&!e.held.isConnected}function F(n,e,r){let o=T.get(n);if(!o)return;if(!P(n,o)){T.delete(n);return}if(e===o.from||r===null||u(r)!==e)return;if(r.focus(),n.ownerDocument.activeElement===r)T.delete(n)}function W(n){if(H.has(n))return;let e=new MutationObserver(()=>{x(n)});e.observe(n,{attributeFilter:["tabindex"],attributes:!0,childList:!0,subtree:!0}),H.set(n,e)}function z(n){let e=String(n.current??""),r=L.get(n);if(r)x(r);return e}function G(n,e){let r=b(e);if(!r)return;L.set(n,r),x(r),W(r)}function j(n,e){return n.findIndex((r)=>r===e||e instanceof Node&&r.contains(e))}function f(n,e,r){n.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function O(n,e,r){if(e.current=u(r),x(n),r.focus(),t(r.scrollIntoView))r.scrollIntoView({block:"nearest"});f(n,"change",u(r))}function S(n){return Number(n.padtop??0)>0}function D(n){return Number(n.padbottom??0)>0}function A(n,e){T.set(n,{from:String(e.current??""),held:n.ownerDocument.activeElement})}function I(n,e,r){A(n,e),f(n,"move",{from:String(e.current??""),key:r})}function R(n){return S(n)||D(n)}function V(n,e,r){A(n,e),f(n,"typeahead",{char:r,from:String(e.current??"")})}function w(n,e,r,o,a){let l=e.multiple===!0?o:"replace",d=String(e.anchor??""),i=l==="range"?d===""?a||r:d:r;e.anchor=i,f(n,"select",{anchor:i,mode:l,value:r})}function C(n){if(n.shiftKey)return"range";return n.ctrlKey||n.metaKey?"toggle":"replace"}function _(n){return n.key.length===1&&!n.ctrlKey&&!n.metaKey&&!n.altKey?n.key.toLowerCase():null}function q(n,e,r){let o=n.map((a)=>N(a).trim().toLowerCase());for(let a=1;a<=o.length;a++){let l=(e+a)%o.length;if(o[l].startsWith(r))return l}return-1}function B(n,e){let r=g(n[e]);for(let o=e-1;o>=0;o--)if(g(n[o])<r)return o;return-1}function J(n,e){let r=b(e);if(!r||!v(r,e.target))return;let o=K(r);if(o.length===0)return;let a=j(o,e.target),l=String(n.current??""),d=e.ctrlKey||e.metaKey,i=o[a],s=null;switch(e.key){case"ArrowDown":{s={key:e.key,select:!d,to:a===-1?0:a+1};break}case"ArrowUp":{s={key:e.key,select:!d,to:a===-1?o.length-1:a-1};break}case"Home":case"End":{if(e.key==="Home"?S(n):D(n)){e.preventDefault(),e.stopPropagation(),I(r,n,e.key);return}s={key:e.key,select:!0,to:e.key==="Home"?0:o.length-1};break}case"ArrowRight":{if(!i)return;let c=M(i);if(c==="")return;if(c==="false"){e.preventDefault(),e.stopPropagation(),f(r,"expand",{expanded:!0,value:u(i)});return}let m=o[a+1];if(m&&g(m)<=g(i))return;s={key:e.key,select:!0,to:a+1};break}case"ArrowLeft":{if(!i)return;if(M(i)==="true"){e.preventDefault(),e.stopPropagation(),f(r,"expand",{expanded:!1,value:u(i)});return}let c=B(o,a);if(c===-1&&g(i)===1)return;s={key:e.key,select:!0,to:c};break}case"Enter":{if(!i)return;e.preventDefault(),e.stopPropagation(),f(r,"activate",u(i));return}case" ":{if(!i)return;e.preventDefault(),e.stopPropagation(),w(r,n,u(i),n.multiple===!0?"toggle":"replace",l);return}default:{let c=_(e);if(c===null)return;if(R(n)){e.preventDefault(),e.stopPropagation(),V(r,n,c);return}let m=q(o,a,c);if(m===-1)return;s={key:e.key,select:!0,to:m}}}e.preventDefault(),e.stopPropagation();let k=o[s.to];if(!k){if(s.to<0?S(n):D(n))I(r,n,s.key);return}if(O(r,n,k),s.select)w(r,n,u(k),C(e),l)}function Q(n,e){let r=b(e);if(!r||!(e.target instanceof Element))return;let o=e.target.closest(y);if(!o||o.closest(p)!==r||E(o))return;let a=String(n.current??"");O(r,n,o),w(r,n,u(o),C(e),a)}function X(n,e){let r=b(e);if(!r||!(e.target instanceof Element))return;let o=e.target.closest(y);if(!o||o.closest(p)!==r||E(o))return;f(r,"activate",u(o))}function Y(n,e){let r=b(e);if(!r||!v(r,e.target)||!(e.target instanceof Element))return;e.stopPropagation();let o=e.target.closest(y);if(!o||E(o))return;f(r,"expand",{expanded:M(o)!=="true",value:u(o)})}export{z as applyCurrent,K as itemsOf,Q as onTreeClick,X as onTreeDblClick,J as onTreeKeydown,G as onTreeMount,Y as onTreeToggle,x as syncTree};
2
2
 
3
3
  //# debugId=3A07049B25E0DD9964756E2164756E21
4
- //# sourceMappingURL=tree-j0ebwr5s.js.map
4
+ //# sourceMappingURL=tree-vw4nc63s.js.map
@@ -0,0 +1,14 @@
1
+ import{pp,ka,j0,$d,Un,ve}from"./studio-mr084886.js";import{P_}from"./studio-0jhhznxy.js";import{DI}from"./studio-nsec0hxm.js";class C{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){if(this._worker)this._worker.dispose(),this._worker=null;this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();if(this._updateExtraLibsToken!==e)return;t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){if(!this._client)this._client=(async()=>{if(this._worker=P_({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("ts.worker.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync())return await this._worker.withSyncedResources(Un.getModels().filter((e)=>e.getLanguageId()===this._modeId).map((e)=>e.uri));return await this._worker.getProxy()})();return this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();if(this._worker)await this._worker.withSyncedResources(e);return t}}var s={};s["lib.d.ts"]=!0;s["lib.decorators.d.ts"]=!0;s["lib.decorators.legacy.d.ts"]=!0;s["lib.dom.asynciterable.d.ts"]=!0;s["lib.dom.d.ts"]=!0;s["lib.dom.iterable.d.ts"]=!0;s["lib.es2015.collection.d.ts"]=!0;s["lib.es2015.core.d.ts"]=!0;s["lib.es2015.d.ts"]=!0;s["lib.es2015.generator.d.ts"]=!0;s["lib.es2015.iterable.d.ts"]=!0;s["lib.es2015.promise.d.ts"]=!0;s["lib.es2015.proxy.d.ts"]=!0;s["lib.es2015.reflect.d.ts"]=!0;s["lib.es2015.symbol.d.ts"]=!0;s["lib.es2015.symbol.wellknown.d.ts"]=!0;s["lib.es2016.array.include.d.ts"]=!0;s["lib.es2016.d.ts"]=!0;s["lib.es2016.full.d.ts"]=!0;s["lib.es2016.intl.d.ts"]=!0;s["lib.es2017.arraybuffer.d.ts"]=!0;s["lib.es2017.d.ts"]=!0;s["lib.es2017.date.d.ts"]=!0;s["lib.es2017.full.d.ts"]=!0;s["lib.es2017.intl.d.ts"]=!0;s["lib.es2017.object.d.ts"]=!0;s["lib.es2017.sharedmemory.d.ts"]=!0;s["lib.es2017.string.d.ts"]=!0;s["lib.es2017.typedarrays.d.ts"]=!0;s["lib.es2018.asyncgenerator.d.ts"]=!0;s["lib.es2018.asynciterable.d.ts"]=!0;s["lib.es2018.d.ts"]=!0;s["lib.es2018.full.d.ts"]=!0;s["lib.es2018.intl.d.ts"]=!0;s["lib.es2018.promise.d.ts"]=!0;s["lib.es2018.regexp.d.ts"]=!0;s["lib.es2019.array.d.ts"]=!0;s["lib.es2019.d.ts"]=!0;s["lib.es2019.full.d.ts"]=!0;s["lib.es2019.intl.d.ts"]=!0;s["lib.es2019.object.d.ts"]=!0;s["lib.es2019.string.d.ts"]=!0;s["lib.es2019.symbol.d.ts"]=!0;s["lib.es2020.bigint.d.ts"]=!0;s["lib.es2020.d.ts"]=!0;s["lib.es2020.date.d.ts"]=!0;s["lib.es2020.full.d.ts"]=!0;s["lib.es2020.intl.d.ts"]=!0;s["lib.es2020.number.d.ts"]=!0;s["lib.es2020.promise.d.ts"]=!0;s["lib.es2020.sharedmemory.d.ts"]=!0;s["lib.es2020.string.d.ts"]=!0;s["lib.es2020.symbol.wellknown.d.ts"]=!0;s["lib.es2021.d.ts"]=!0;s["lib.es2021.full.d.ts"]=!0;s["lib.es2021.intl.d.ts"]=!0;s["lib.es2021.promise.d.ts"]=!0;s["lib.es2021.string.d.ts"]=!0;s["lib.es2021.weakref.d.ts"]=!0;s["lib.es2022.array.d.ts"]=!0;s["lib.es2022.d.ts"]=!0;s["lib.es2022.error.d.ts"]=!0;s["lib.es2022.full.d.ts"]=!0;s["lib.es2022.intl.d.ts"]=!0;s["lib.es2022.object.d.ts"]=!0;s["lib.es2022.regexp.d.ts"]=!0;s["lib.es2022.string.d.ts"]=!0;s["lib.es2023.array.d.ts"]=!0;s["lib.es2023.collection.d.ts"]=!0;s["lib.es2023.d.ts"]=!0;s["lib.es2023.full.d.ts"]=!0;s["lib.es2023.intl.d.ts"]=!0;s["lib.es2024.arraybuffer.d.ts"]=!0;s["lib.es2024.collection.d.ts"]=!0;s["lib.es2024.d.ts"]=!0;s["lib.es2024.full.d.ts"]=!0;s["lib.es2024.object.d.ts"]=!0;s["lib.es2024.promise.d.ts"]=!0;s["lib.es2024.regexp.d.ts"]=!0;s["lib.es2024.sharedmemory.d.ts"]=!0;s["lib.es2024.string.d.ts"]=!0;s["lib.es5.d.ts"]=!0;s["lib.es6.d.ts"]=!0;s["lib.esnext.array.d.ts"]=!0;s["lib.esnext.collection.d.ts"]=!0;s["lib.esnext.d.ts"]=!0;s["lib.esnext.decorators.d.ts"]=!0;s["lib.esnext.disposable.d.ts"]=!0;s["lib.esnext.error.d.ts"]=!0;s["lib.esnext.float16.d.ts"]=!0;s["lib.esnext.full.d.ts"]=!0;s["lib.esnext.intl.d.ts"]=!0;s["lib.esnext.iterator.d.ts"]=!0;s["lib.esnext.promise.d.ts"]=!0;s["lib.esnext.sharedmemory.d.ts"]=!0;s["lib.scripthost.d.ts"]=!0;s["lib.webworker.asynciterable.d.ts"]=!0;s["lib.webworker.d.ts"]=!0;s["lib.webworker.importscripts.d.ts"]=!0;s["lib.webworker.iterable.d.ts"]=!0;function x(e,t,n=0){if(typeof e==="string")return e;else if(e===void 0)return"";let a="";if(n){a+=t;for(let i=0;i<n;i++)a+=" "}if(a+=e.messageText,n++,e.next)for(let i of e.next)a+=x(i,t,n);return a}function m(e){if(e)return e.map((t)=>t.text).join("");return""}class h{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),a=e.getPositionAt(t.start+t.length),{lineNumber:i,column:c}=n,{lineNumber:l,column:r}=a;return{startLineNumber:i,startColumn:c,endLineNumber:l,endColumn:r}}}class D{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){if(!e)return!1;if(e.path.indexOf("/lib.")===0)return!!s[e.path.slice(1)];return!1}getOrCreateModel(e){let t=$d.parse(e),n=Un.getModel(t);if(n)return n;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return Un.createModel(this._libFiles[t.path.slice(1)],"typescript",t);let a=DI.getExtraLibs()[e];if(a)return Un.createModel(a.content,"typescript",t);return null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){if(!this._containsLibFile(e))return;await this._fetchLibFiles()}_fetchLibFiles(){if(!this._fetchLibFilesPromise)this._fetchLibFilesPromise=this._worker().then((e)=>e.getLibFiles()).then((e)=>{this._hasFetchedLibFiles=!0,this._libFiles=e});return this._fetchLibFilesPromise}}class F extends h{constructor(e,t,n,a){super(a);this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let i=(r)=>{if(r.getLanguageId()!==n)return;let u=()=>{let{onlyVisible:g}=this._defaults.getDiagnosticsOptions();if(g){if(r.isAttachedToEditor())this._doValidate(r)}else this._doValidate(r)},p,f=r.onDidChangeContent(()=>{clearTimeout(p),p=window.setTimeout(u,500)}),d=r.onDidChangeAttached(()=>{let{onlyVisible:g}=this._defaults.getDiagnosticsOptions();if(g)if(r.isAttachedToEditor())u();else Un.setModelMarkers(r,this._selector,[])});this._listener[r.uri.toString()]={dispose(){f.dispose(),d.dispose(),clearTimeout(p)}},u()},c=(r)=>{Un.setModelMarkers(r,this._selector,[]);let u=r.uri.toString();if(this._listener[u])this._listener[u].dispose(),delete this._listener[u]};this._disposables.push(Un.onDidCreateModel((r)=>i(r))),this._disposables.push(Un.onWillDisposeModel(c)),this._disposables.push(Un.onDidChangeModelLanguage((r)=>{c(r.model),i(r.model)})),this._disposables.push({dispose(){for(let r of Un.getModels())c(r)}});let l=()=>{for(let r of Un.getModels())c(r),i(r)};this._disposables.push(this._defaults.onDidChange(l)),this._disposables.push(this._defaults.onDidExtraLibsChange(l)),Un.getModels().forEach((r)=>i(r))}dispose(){this._disposables.forEach((e)=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let n=[],{noSyntaxValidation:a,noSemanticValidation:i,noSuggestionDiagnostics:c}=this._defaults.getDiagnosticsOptions();if(!a)n.push(t.getSyntacticDiagnostics(e.uri.toString()));if(!i)n.push(t.getSemanticDiagnostics(e.uri.toString()));if(!c)n.push(t.getSuggestionDiagnostics(e.uri.toString()));let l=await Promise.all(n);if(!l||e.isDisposed())return;let r=l.reduce((p,f)=>f.concat(p),[]).filter((p)=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(p.code)===-1),u=r.map((p)=>p.relatedInformation||[]).reduce((p,f)=>f.concat(p),[]).map((p)=>p.file?$d.parse(p.file.fileName):null);if(await this._libFiles.fetchLibFilesIfNecessary(u),e.isDisposed())return;Un.setModelMarkers(e,this._selector,r.map((p)=>this._convertDiagnostics(e,p)))}_convertDiagnostics(e,t){let n=t.start||0,a=t.length||1,{lineNumber:i,column:c}=e.getPositionAt(n),{lineNumber:l,column:r}=e.getPositionAt(n+a),u=[];if(t.reportsUnnecessary)u.push(j0.Unnecessary);if(t.reportsDeprecated)u.push(j0.Deprecated);return{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:i,startColumn:c,endLineNumber:l,endColumn:r,message:x(t.messageText,`
2
+ `),code:t.code.toString(),tags:u,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];let n=[];return t.forEach((a)=>{let i=e;if(a.file)i=this._libFiles.getOrCreateModel(a.file.fileName);if(!i)return;let c=a.start||0,l=a.length||1,{lineNumber:r,column:u}=i.getPositionAt(c),{lineNumber:p,column:f}=i.getPositionAt(c+l);n.push({resource:i.uri,startLineNumber:r,startColumn:u,endLineNumber:p,endColumn:f,message:x(a.messageText,`
3
+ `)})}),n}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return ka.Error;case 3:return ka.Info;case 0:return ka.Warning;case 2:return ka.Hint}return ka.Info}}class _ extends h{get triggerCharacters(){return["."]}async provideCompletionItems(e,t,n,a){let i=e.getWordUntilPosition(t),c=new pp(t.lineNumber,i.startColumn,t.lineNumber,i.endColumn),l=e.uri,r=e.getOffsetAt(t),u=await this._worker(l);if(e.isDisposed())return;let p=await u.getCompletionsAtPosition(l.toString(),r);if(!p||e.isDisposed())return;return{suggestions:p.entries.map((d)=>{let g=c;if(d.replacementSpan){let k=e.getPositionAt(d.replacementSpan.start),S=e.getPositionAt(d.replacementSpan.start+d.replacementSpan.length);g=new pp(k.lineNumber,k.column,S.lineNumber,S.column)}let y=[];if(d.kindModifiers!==void 0&&d.kindModifiers.indexOf("deprecated")!==-1)y.push(ve.CompletionItemTag.Deprecated);return{uri:l,position:t,offset:r,range:g,label:d.name,insertText:d.name,sortText:d.sortText,kind:_.convertKind(d.kind),tags:y}})}}async resolveCompletionItem(e,t){let n=e,{uri:a,position:i,offset:c}=n,r=await(await this._worker(a)).getCompletionEntryDetails(a.toString(),c,n.label);if(!r)return n;return{uri:a,position:i,label:r.name,kind:_.convertKind(r.kind),detail:m(r.displayParts),documentation:{value:_.createDocumentationString(r)}}}static convertKind(e){switch(e){case o.primitiveType:case o.keyword:return ve.CompletionItemKind.Keyword;case o.variable:case o.localVariable:return ve.CompletionItemKind.Variable;case o.memberVariable:case o.memberGetAccessor:case o.memberSetAccessor:return ve.CompletionItemKind.Field;case o.function:case o.memberFunction:case o.constructSignature:case o.callSignature:case o.indexSignature:return ve.CompletionItemKind.Function;case o.enum:return ve.CompletionItemKind.Enum;case o.module:return ve.CompletionItemKind.Module;case o.class:return ve.CompletionItemKind.Class;case o.interface:return ve.CompletionItemKind.Interface;case o.warning:return ve.CompletionItemKind.File}return ve.CompletionItemKind.Property}static createDocumentationString(e){let t=m(e.documentation);if(e.tags)for(let n of e.tags)t+=`
4
+
5
+ ${V(n)}`;return t}}function V(e){let t=`*@${e.name}*`;if(e.name==="param"&&e.text){let[n,...a]=e.text;if(t+=`\`${n.text}\``,a.length>0)t+=` — ${a.map((i)=>i.text).join(" ")}`}else if(Array.isArray(e.text))t+=` — ${e.text.map((n)=>n.text).join(" ")}`;else if(e.text)t+=` — ${e.text}`;return t}class v extends h{constructor(){super(...arguments);this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(e){switch(e.triggerKind){case ve.SignatureHelpTriggerKind.TriggerCharacter:if(e.triggerCharacter)if(e.isRetrigger)return{kind:"retrigger",triggerCharacter:e.triggerCharacter};else return{kind:"characterTyped",triggerCharacter:e.triggerCharacter};else return{kind:"invoked"};case ve.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case ve.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(e,t,n,a){let i=e.uri,c=e.getOffsetAt(t),l=await this._worker(i);if(e.isDisposed())return;let r=await l.getSignatureHelpItems(i.toString(),c,{triggerReason:v._toSignatureHelpTriggerReason(a)});if(!r||e.isDisposed())return;let u={activeSignature:r.selectedItemIndex,activeParameter:r.argumentIndex,signatures:[]};return r.items.forEach((p)=>{let f={label:"",parameters:[]};f.documentation={value:m(p.documentation)},f.label+=m(p.prefixDisplayParts),p.parameters.forEach((d,g,y)=>{let k=m(d.displayParts),S={label:k,documentation:{value:m(d.documentation)}};if(f.label+=k,f.parameters.push(S),g<y.length-1)f.label+=m(p.separatorDisplayParts)}),f.label+=m(p.suffixDisplayParts),u.signatures.push(f)}),{value:u,dispose(){}}}}class T extends h{async provideHover(e,t,n){let a=e.uri,i=e.getOffsetAt(t),c=await this._worker(a);if(e.isDisposed())return;let l=await c.getQuickInfoAtPosition(a.toString(),i);if(!l||e.isDisposed())return;let r=m(l.documentation),u=l.tags?l.tags.map((f)=>V(f)).join(`
6
+
7
+ `):"",p=m(l.displayParts);return{range:this._textSpanToRange(e,l.textSpan),contents:[{value:"```typescript\n"+p+"\n```\n"},{value:r+(u?`
8
+
9
+ `+u:"")}]}}}class L extends h{async provideDocumentHighlights(e,t,n){let a=e.uri,i=e.getOffsetAt(t),c=await this._worker(a);if(e.isDisposed())return;let l=await c.getDocumentHighlights(a.toString(),i,[a.toString()]);if(!l||e.isDisposed())return;return l.flatMap((r)=>r.highlightSpans.map((u)=>({range:this._textSpanToRange(e,u.textSpan),kind:u.kind==="writtenReference"?ve.DocumentHighlightKind.Write:ve.DocumentHighlightKind.Text})))}}class A extends h{constructor(e,t){super(t);this._libFiles=e}async provideDefinition(e,t,n){let a=e.uri,i=e.getOffsetAt(t),c=await this._worker(a);if(e.isDisposed())return;let l=await c.getDefinitionAtPosition(a.toString(),i);if(!l||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(l.map((u)=>$d.parse(u.fileName))),e.isDisposed())return;let r=[];for(let u of l){let p=this._libFiles.getOrCreateModel(u.fileName);if(p)r.push({uri:p.uri,range:this._textSpanToRange(p,u.textSpan)})}return r}}class I extends h{constructor(e,t){super(t);this._libFiles=e}async provideReferences(e,t,n,a){let i=e.uri,c=e.getOffsetAt(t),l=await this._worker(i);if(e.isDisposed())return;let r=await l.getReferencesAtPosition(i.toString(),c);if(!r||e.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(r.map((p)=>$d.parse(p.fileName))),e.isDisposed())return;let u=[];for(let p of r){let f=this._libFiles.getOrCreateModel(p.fileName);if(f)u.push({uri:f.uri,range:this._textSpanToRange(f,p.textSpan)})}return u}}class P extends h{async provideDocumentSymbols(e,t){let n=e.uri,a=await this._worker(n);if(e.isDisposed())return;let i=await a.getNavigationTree(n.toString());if(!i||e.isDisposed())return;let c=(r,u)=>({name:r.text,detail:"",kind:b[r.kind]||ve.SymbolKind.Variable,range:this._textSpanToRange(e,r.spans[0]),selectionRange:this._textSpanToRange(e,r.spans[0]),tags:[],children:r.childItems?.map((f)=>c(f,r.text)),containerName:u});return i.childItems?i.childItems.map((r)=>c(r)):[]}}class o{}o.unknown="";o.keyword="keyword";o.script="script";o.module="module";o.class="class";o.interface="interface";o.type="type";o.enum="enum";o.variable="var";o.localVariable="local var";o.function="function";o.localFunction="local function";o.memberFunction="method";o.memberGetAccessor="getter";o.memberSetAccessor="setter";o.memberVariable="property";o.constructorImplementation="constructor";o.callSignature="call";o.indexSignature="index";o.constructSignature="construct";o.parameter="parameter";o.typeParameter="type parameter";o.primitiveType="primitive type";o.label="label";o.alias="alias";o.const="const";o.let="let";o.warning="warning";var b=Object.create(null);b[o.module]=ve.SymbolKind.Module;b[o.class]=ve.SymbolKind.Class;b[o.enum]=ve.SymbolKind.Enum;b[o.interface]=ve.SymbolKind.Interface;b[o.memberFunction]=ve.SymbolKind.Method;b[o.memberVariable]=ve.SymbolKind.Property;b[o.memberGetAccessor]=ve.SymbolKind.Property;b[o.memberSetAccessor]=ve.SymbolKind.Property;b[o.variable]=ve.SymbolKind.Variable;b[o.const]=ve.SymbolKind.Variable;b[o.localVariable]=ve.SymbolKind.Variable;b[o.variable]=ve.SymbolKind.Variable;b[o.function]=ve.SymbolKind.Function;b[o.localFunction]=ve.SymbolKind.Function;class w extends h{static _convertOptions(e){return{ConvertTabsToSpaces:e.insertSpaces,TabSize:e.tabSize,IndentSize:e.tabSize,IndentStyle:2,NewLineCharacter:`
10
+ `,InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(e,t){return{text:t.newText,range:this._textSpanToRange(e,t.span)}}}class O extends w{constructor(){super(...arguments);this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(e,t,n,a){let i=e.uri,c=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),l=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),r=await this._worker(i);if(e.isDisposed())return;let u=await r.getFormattingEditsForRange(i.toString(),c,l,w._convertOptions(n));if(!u||e.isDisposed())return;return u.map((p)=>this._convertTextChanges(e,p))}}class N extends w{get autoFormatTriggerCharacters(){return[";","}",`
11
+ `]}async provideOnTypeFormattingEdits(e,t,n,a,i){let c=e.uri,l=e.getOffsetAt(t),r=await this._worker(c);if(e.isDisposed())return;let u=await r.getFormattingEditsAfterKeystroke(c.toString(),l,n,w._convertOptions(a));if(!u||e.isDisposed())return;return u.map((p)=>this._convertTextChanges(e,p))}}class M extends w{async provideCodeActions(e,t,n,a){let i=e.uri,c=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),l=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),r=w._convertOptions(e.getOptions()),u=n.markers.filter((g)=>g.code).map((g)=>g.code).map(Number),p=await this._worker(i);if(e.isDisposed())return;let f=await p.getCodeFixesAtPosition(i.toString(),c,l,u,r);if(!f||e.isDisposed())return{actions:[],dispose:()=>{}};return{actions:f.filter((g)=>g.changes.filter((y)=>y.isNewFile).length===0).map((g)=>this._tsCodeFixActionToMonacoCodeAction(e,n,g)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(e,t,n){let a=[];for(let c of n.changes)for(let l of c.textChanges)a.push({resource:e.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(e,l.span),text:l.newText}});return{title:n.description,edit:{edits:a},diagnostics:t.markers,kind:"quickfix"}}}class R extends h{constructor(e,t){super(t);this._libFiles=e}async provideRenameEdits(e,t,n,a){let i=e.uri,c=i.toString(),l=e.getOffsetAt(t),r=await this._worker(i);if(e.isDisposed())return;let u=await r.getRenameInfo(c,l,{allowRenameOfImportPath:!1});if(u.canRename===!1)return{edits:[],rejectReason:u.localizedErrorMessage};if(u.fileToRename!==void 0)throw Error("Renaming files is not supported.");let p=await r.findRenameLocations(c,l,!1,!1,!1);if(!p||e.isDisposed())return;let f=[];for(let d of p){let g=this._libFiles.getOrCreateModel(d.fileName);if(g)f.push({resource:g.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(g,d.textSpan),text:n}});else throw Error(`Unknown file ${d.fileName}.`)}return{edits:f}}}class E extends h{async provideInlayHints(e,t,n){let a=e.uri,i=a.toString(),c=e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn}),l=e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn}),r=await this._worker(a);if(e.isDisposed())return null;return{hints:(await r.provideInlayHints(i,c,l)).map((f)=>({...f,label:f.text,position:e.getPositionAt(f.position),kind:this._convertHintKind(f.kind)})),dispose:()=>{}}}_convertHintKind(e){switch(e){case"Parameter":return ve.InlayHintKind.Parameter;case"Type":return ve.InlayHintKind.Type;default:return ve.InlayHintKind.Type}}}var H,W;function te(e){W=j(e,"typescript")}function se(e){H=j(e,"javascript")}function re(){return new Promise((e,t)=>{if(!H)return t("JavaScript not registered!");e(H)})}function ie(){return new Promise((e,t)=>{if(!W)return t("TypeScript not registered!");e(W)})}function j(e,t){let n=[],a=new C(t,e),i=(...r)=>a.getLanguageServiceWorker(...r),c=new D(i);function l(){let{modeConfiguration:r}=e;if(B(n),r.completionItems)n.push(ve.registerCompletionItemProvider(t,new _(i)));if(r.signatureHelp)n.push(ve.registerSignatureHelpProvider(t,new v(i)));if(r.hovers)n.push(ve.registerHoverProvider(t,new T(i)));if(r.documentHighlights)n.push(ve.registerDocumentHighlightProvider(t,new L(i)));if(r.definitions)n.push(ve.registerDefinitionProvider(t,new A(c,i)));if(r.references)n.push(ve.registerReferenceProvider(t,new I(c,i)));if(r.documentSymbols)n.push(ve.registerDocumentSymbolProvider(t,new P(i)));if(r.rename)n.push(ve.registerRenameProvider(t,new R(c,i)));if(r.documentRangeFormattingEdits)n.push(ve.registerDocumentRangeFormattingEditProvider(t,new O(i)));if(r.onTypeFormattingEdits)n.push(ve.registerOnTypeFormattingEditProvider(t,new N(i)));if(r.codeActions)n.push(ve.registerCodeActionProvider(t,new M(i)));if(r.inlayHints)n.push(ve.registerInlayHintsProvider(t,new E(i)));if(r.diagnostics)n.push(new F(c,e,t,i))}return l(),i}function B(e){while(e.length)e.pop().dispose()}export{h as Adapter,M as CodeActionAdaptor,A as DefinitionAdapter,F as DiagnosticsAdapter,L as DocumentHighlightAdapter,O as FormatAdapter,w as FormatHelper,N as FormatOnTypeAdapter,E as InlayHintsAdapter,o as Kind,D as LibFiles,P as OutlineAdapter,T as QuickInfoAdapter,I as ReferenceAdapter,R as RenameAdapter,v as SignatureHelpAdapter,_ as SuggestAdapter,C as WorkerManager,x as flattenDiagnosticMessageText,re as getJavaScriptWorker,ie as getTypeScriptWorker,se as setupJavaScript,te as setupTypeScript};
12
+
13
+ //# debugId=75DF89990C495D1264756E2164756E21
14
+ //# sourceMappingURL=tsMode-7gngmamr.js.map
@@ -0,0 +1,4 @@
1
+ import{mi,og,FR,g,h,Yo,pn,Pa,ko,sg,_1,S1,lc,ag,lg,C1,k1,E1,cg,kh,cc,Qp,xl,T1,Si,id,$1,jR,Dy,b_,HR,tu,BR,VR,Ft,Oy,WR,zR}from"./studio-ybkd5w8k.js";import"./studio-r85zw6ay.js";import"./studio-5k9mfafh.js";import"./studio-hf259xzd.js";import"./studio-1b79rpcb.js";import"./studio-52mzbxqm.js";import"./studio-213pyfxh.js";import"./studio-mkjrjpr2.js";export{FR as MAX_PANES,mi as PRIMARY_PANE,og as SECONDARY_PANE,Ft as activateTab,Yo as activePane,h as activeTab,T1 as clearPaneActiveTab,BR as closeAllTabs,ag as closePane,tu as closeTab,cg as detachTab,ko as focusPane,kh as insertIntoPane,sg as isPaneFocused,Qp as isTabActive,HR as moveTab,Oy as moveTabToPane,Si as openTab,S1 as paneBeside,pn as paneById,lg as paneIsEmpty,Pa as paneOfTab,$1 as promoteDirtyPreviewTabs,id as promoteTab,lc as receivingPane,zR as registerTabCommands,WR as renameTab,VR as replaceAllTabs,E1 as setCloseLanding,jR as setEditBesideDocument,k1 as setEmptyPaneFallback,b_ as setTabPinned,C1 as setTabScope,cc as setWorkspaceProject,_1 as splitRight,Dy as tabHoldsEditBesideDocument,xl as tabIsLive,g as workspace};
2
+
3
+ //# debugId=E1226C74BED7501F64756E2164756E21
4
+ //# sourceMappingURL=workspace-gv0hxgsm.js.map
@@ -0,0 +1,4 @@
1
+ import{uF,nS,RE,IE,iS,ub,NE}from"./studio-2b1smjvp.js";import"./studio-kpx02gaa.js";import"./studio-495b6f2r.js";import"./studio-nv0mh0p5.js";import"./studio-9gb0m81w.js";import"./studio-6w8mt734.js";import"./studio-jbva4wxw.js";import"./studio-z89e6wpg.js";import"./studio-2v6tc9jp.js";import"./studio-8vmad6x2.js";import"./studio-fe2d1fp5.js";import"./studio-8atmfjjm.js";import"./studio-pafmb06w.js";import"./studio-93p5k4r4.js";import"./studio-zdbsv5q2.js";import"./studio-qcc5hsw2.js";import"./studio-a4ymg4vd.js";import"./studio-gxphbetb.js";import"./studio-wmak8xjw.js";import"./studio-ed9bz68j.js";import"./studio-4gthb2fd.js";import"./studio-56mmnsw8.js";import"./studio-qvb2jr83.js";import"./studio-5qez462c.js";import"./studio-g79s1dyg.js";import"./studio-0nb57pjg.js";import"./studio-m25ry0mf.js";import"./studio-mrb10hv3.js";import"./studio-3kmqhwtt.js";import"./studio-kp4vzrct.js";import"./studio-y2zsnzye.js";import"./studio-jj9gf1qc.js";import"./studio-yetr4gg1.js";import"./studio-zbwr6prc.js";import"./studio-wqsmvtqj.js";import"./studio-pk961xgz.js";import"./studio-meajkr51.js";import"./studio-dbex091t.js";import"./studio-44drsmhw.js";import"./studio-ybkd5w8k.js";import"./studio-r85zw6ay.js";import"./studio-5k9mfafh.js";import"./studio-hf259xzd.js";import"./studio-1b79rpcb.js";import"./studio-xxttcym1.js";import"./studio-s6ymkf3q.js";import"./studio-52mzbxqm.js";import"./studio-s9jjap3x.js";import"./studio-6tnpg0vx.js";import"./studio-k1wvtp03.js";import"./studio-213pyfxh.js";import"./studio-mkjrjpr2.js";export{uF as WORKSPACE_HOME_MODE_SET,ub as detachWorkspaceHome,nS as isWorkspaceHomeMode,RE as openWorkspaceHome,IE as placeWorkspaceHome,NE as renderWorkspaceHome,iS as workspaceHomeMounted};
2
+
3
+ //# debugId=A617DF28A6DDE9EF64756E2164756E21
4
+ //# sourceMappingURL=workspace-home-j7e0mjy5.js.map
@@ -1,4 +1,4 @@
1
- import{Yk,is,Qa,Zk,br,_t,el,zo,tl,Xo,Dt,nl,$u,fp,Td,WR,VR,UR,Xk,Qk}from"./studio-3na1r48j.js";import{Qy}from"./studio-0x6f3nk9.js";var x=30000;class I extends Yk{constructor(e){super();this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=$u();if(this.getLocalState()!==null&&x/2<=r-this.meta.get(this.clientID).lastUpdated)this.setLocalState(this.getLocalState());let s=[];if(this.meta.forEach((o,c)=>{if(c!==this.clientID&&x<=r-o.lastUpdated&&this.states.has(c))s.push(c)}),s.length>0)L(this,s,"timeout")},is(x/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let r=this.clientID,s=this.meta.get(r),o=s===void 0?0:s.clock+1,c=this.states.get(r);if(e===null)this.states.delete(r);else this.states.set(r,e);this.meta.set(r,{clock:o,lastUpdated:$u()});let a=[],d=[],y=[],f=[];if(e===null)f.push(r);else if(c==null){if(e!=null)a.push(r)}else if(d.push(r),!fp(c,e))y.push(r);if(a.length>0||y.length>0||f.length>0)this.emit("change",[{added:a,updated:y,removed:f},"local"]);this.emit("update",[{added:a,updated:d,removed:f},"local"])}setLocalStateField(e,r){let s=this.getLocalState();if(s!==null)this.setLocalState({...s,[e]:r})}getStates(){return this.states}}var L=(e,r,s)=>{let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(e.states.has(a)){if(e.states.delete(a),a===e.clientID){let d=e.meta.get(a);e.meta.set(a,{clock:d.clock+1,lastUpdated:$u()})}o.push(a)}}if(o.length>0)e.emit("change",[{added:[],updated:[],removed:o},s]),e.emit("update",[{added:[],updated:[],removed:o},s])},M=(e,r,s=e.states)=>{let o=r.length,c=Qa();_t(c,o);for(let a=0;a<o;a++){let d=r[a],y=s.get(d)||null,f=e.meta.get(d).clock;_t(c,d),_t(c,f),el(c,JSON.stringify(y))}return br(c)};var F=(e,r,s)=>{let o=tl(r),c=$u(),a=[],d=[],y=[],f=[],U=Dt(o);for(let b=0;b<U;b++){let h=Dt(o),g=Dt(o),S=JSON.parse(nl(o)),v=e.meta.get(h),k=e.states.get(h),w=v===void 0?0:v.clock;if(w<g||w===g&&S===null&&e.states.has(h)){if(S===null)if(h===e.clientID&&e.getLocalState()!=null)g++;else e.states.delete(h);else e.states.set(h,S);if(e.meta.set(h,{clock:g,lastUpdated:c}),v===void 0&&S!==null)a.push(h);else if(v!==void 0&&S===null)f.push(h);else if(S!==null){if(!fp(S,k))y.push(h);d.push(h)}}}if(a.length>0||y.length>0||f.length>0)e.emit("change",[{added:a,updated:y,removed:f},s]);if(a.length>0||d.length>0||f.length>0)e.emit("update",[{added:a,updated:d,removed:f},s])};var W=0,D=1,R=2,j=(e,r)=>{_t(e,W);let s=UR(r);zo(e,s)},H=(e,r,s)=>{_t(e,D),zo(e,VR(r,s))},B=(e,r,s)=>H(r,s,Xo(e)),N=(e,r,s,o)=>{try{WR(r,Xo(e),s)}catch(c){if(o!=null)o(c);console.error("Caught error while handling a Yjs update",c)}},J=(e,r)=>{_t(e,R),zo(e,r)},z=N,_=(e,r,s,o,c)=>{let a=Dt(e);switch(a){case W:B(e,r,s);break;case D:N(e,s,o,c);break;case R:z(e,s,o,c);break;default:throw Error("Unknown message type")}return a};var K=1;function se(e){let r=e.webSocketImpl??globalThis.WebSocket,s=e.openTimeoutMs??1e4,o=new Map,c=new Set,a=new Td,d=new I(a);d.setLocalState(null);let y=null,f=null,U="connecting",b=!1,h=(n)=>{if(U===n)return;U=n;for(let t of c)t(n)},g=(n)=>{if(y&&y.readyState===K)try{y.send(Xk(n))}catch{}},S=(n)=>{g({message:{path:n,type:"open"},type:"control"})};d.on("update",(n,t)=>{if(t==="remote")return;let l=[...n.added,...n.updated,...n.removed];g({body:M(d,l),type:"awareness"})});let v=(n)=>{switch(n.type){case"hello":{let t={color:n.color,login:n.login,permission:n.permission};if(n.name!==void 0)t.name=n.name;if(n.avatarUrl!==void 0)t.avatarUrl=n.avatarUrl;f=t;return}case"opened":{let t=o.get(n.path);if(!t)return;if(t.opened&&t.epoch!==n.epoch){w(n.path,t);return}t.epoch=n.epoch,t.opened=!0,t.resolveOpen?.(!0),t.resolveOpen=null;let l=Qa();j(l,t.doc),g({body:br(l),epoch:t.epoch,path:n.path,type:"doc-sync"});return}case"doc-reset":{let t=o.get(n.path);if(t)w(n.path,t);return}case"flush-ack":{let t=o.get(n.path);if(t){for(let l of t.pendingFlush)l();t.pendingFlush.clear()}return}case"doc-dirty":{let t=o.get(n.path);if(t){t.dirty=n.dirty;for(let l of t.dirtyCbs)l(n.dirty)}return}case"error":{if(!n.path)return;let t=o.get(n.path);if(!t)return;if(n.code==="content-not-loaded"&&e.hydratePath&&!t.hydrated){t.hydrated=!0,e.hydratePath(n.path).then(()=>S(n.path),()=>{t.resolveOpen?.(!1),t.resolveOpen=null});return}if(!t.opened)t.resolveOpen?.(!1),t.resolveOpen=null;break}default:break}},k=(n,t,l)=>{let u=o.get(n);if(!u||!u.opened||u.epoch!==t)return;let i=tl(l),m=Qa(),T=_(i,m,u.doc,"remote");if(Zk(m)>0)g({body:br(m),epoch:t,path:n,type:"doc-sync"});if(T===D&&!u.synced)u.synced=!0,u.resolveSynced()},w=(n,t)=>{o.delete(n),t.resolveOpen?.(!1),t.resolveOpen=null;for(let l of t.resetCbs)l();t.doc.destroy()},P=()=>{h("connecting");let n=e.protocols,t=n===void 0||n.length===0?new r(e.url):new r(e.url,n);y=t,t.binaryType="arraybuffer",t.onopen=()=>{O.opened(),h("connected");for(let u of o.keys())S(u);if(d.getLocalState()!==null)g({body:M(d,[d.clientID]),type:"awareness"})},t.onmessage=(l)=>{let u=l.data,i=u instanceof ArrayBuffer?new Uint8Array(u):u instanceof Uint8Array?u:null;if(!i)return;let m;try{m=Qk(i)}catch{return}switch(m.type){case"control":{v(m.message);return}case"doc-sync":{k(m.path,m.epoch,m.body);return}case"awareness":{F(d,m.body,"remote");break}default:break}},t.onclose=()=>{if(b)return;h("offline");for(let l of o.values())l.opened=!1;O.scheduleRetry()},t.onerror=()=>{}},A={};if(e.reconnectDelayMs!==void 0)A.baseMs=e.reconnectDelayMs;if(e.reconnectRandom!==void 0)A.random=e.reconnectRandom;let O=Qy(P,A);return P(),{destroy(){if(b)return;b=!0,O.dispose(),L(d,[d.clientID],"destroy"),d.destroy(),a.destroy();for(let[n,t]of o)t.resolveOpen?.(!1),t.doc.destroy(),o.delete(n);y?.close()},async openDoc(n){if(b)return null;let t=o.get(n);if(t&&!t.handleDestroyed)return null;let l=()=>{},u=new Promise((p)=>{l=p}),i={dirty:!1,dirtyCbs:new Set,doc:new Td,epoch:0,handleDestroyed:!1,hydrated:!1,opened:!1,pendingFlush:new Set,resetCbs:new Set,resolveOpen:null,resolveSynced:l,synced:!1,whenSynced:u};if(o.set(n,i),i.doc.on("update",(p,V)=>{if(V==="remote"||!i.opened)return;let C=Qa();J(C,p),g({body:br(C),epoch:i.epoch,path:n,type:"doc-sync"})}),!await new Promise((p)=>{i.resolveOpen=p;let V=setTimeout(()=>{i.resolveOpen=null,p(!1)},s);i.resolveOpen=(C)=>{clearTimeout(V),p(C)},S(n)})){if(o.get(n)===i)o.delete(n);return i.doc.destroy(),null}return{awareness:d,destroy:()=>{if(i.handleDestroyed)return;if(i.handleDestroyed=!0,o.get(n)===i)o.delete(n),g({path:n,type:"doc-close"});i.doc.destroy()},doc:i.doc,flush:()=>new Promise((p)=>{i.pendingFlush.add(p),g({message:{path:n,type:"flush"},type:"control"})}),identity:()=>f,onDirty:(p)=>(i.dirtyCbs.add(p),p(i.dirty),()=>i.dirtyCbs.delete(p)),onReset:(p)=>(i.resetCbs.add(p),()=>i.resetCbs.delete(p)),onStatus:(p)=>(c.add(p),()=>c.delete(p)),whenSynced:i.whenSynced}},status:()=>U}}export{se as createWsCollabConnection};
1
+ import{mE,os,tl,gE,vo,_t,nl,zr,il,Qr,Nt,rl,Iu,mp,Ld,cN,dN,uN,bE,yE}from"./studio-kv1728ex.js";import{dw}from"./studio-s7p5ccxa.js";var x=30000;class I extends mE{constructor(e){super();this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=Iu();if(this.getLocalState()!==null&&x/2<=r-this.meta.get(this.clientID).lastUpdated)this.setLocalState(this.getLocalState());let s=[];if(this.meta.forEach((o,c)=>{if(c!==this.clientID&&x<=r-o.lastUpdated&&this.states.has(c))s.push(c)}),s.length>0)L(this,s,"timeout")},os(x/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let r=this.clientID,s=this.meta.get(r),o=s===void 0?0:s.clock+1,c=this.states.get(r);if(e===null)this.states.delete(r);else this.states.set(r,e);this.meta.set(r,{clock:o,lastUpdated:Iu()});let a=[],d=[],y=[],f=[];if(e===null)f.push(r);else if(c==null){if(e!=null)a.push(r)}else if(d.push(r),!mp(c,e))y.push(r);if(a.length>0||y.length>0||f.length>0)this.emit("change",[{added:a,updated:y,removed:f},"local"]);this.emit("update",[{added:a,updated:d,removed:f},"local"])}setLocalStateField(e,r){let s=this.getLocalState();if(s!==null)this.setLocalState({...s,[e]:r})}getStates(){return this.states}}var L=(e,r,s)=>{let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(e.states.has(a)){if(e.states.delete(a),a===e.clientID){let d=e.meta.get(a);e.meta.set(a,{clock:d.clock+1,lastUpdated:Iu()})}o.push(a)}}if(o.length>0)e.emit("change",[{added:[],updated:[],removed:o},s]),e.emit("update",[{added:[],updated:[],removed:o},s])},M=(e,r,s=e.states)=>{let o=r.length,c=tl();_t(c,o);for(let a=0;a<o;a++){let d=r[a],y=s.get(d)||null,f=e.meta.get(d).clock;_t(c,d),_t(c,f),nl(c,JSON.stringify(y))}return vo(c)};var F=(e,r,s)=>{let o=il(r),c=Iu(),a=[],d=[],y=[],f=[],U=Nt(o);for(let b=0;b<U;b++){let h=Nt(o),g=Nt(o),S=JSON.parse(rl(o)),v=e.meta.get(h),k=e.states.get(h),w=v===void 0?0:v.clock;if(w<g||w===g&&S===null&&e.states.has(h)){if(S===null)if(h===e.clientID&&e.getLocalState()!=null)g++;else e.states.delete(h);else e.states.set(h,S);if(e.meta.set(h,{clock:g,lastUpdated:c}),v===void 0&&S!==null)a.push(h);else if(v!==void 0&&S===null)f.push(h);else if(S!==null){if(!mp(S,k))y.push(h);d.push(h)}}}if(a.length>0||y.length>0||f.length>0)e.emit("change",[{added:a,updated:y,removed:f},s]);if(a.length>0||d.length>0||f.length>0)e.emit("update",[{added:a,updated:d,removed:f},s])};var W=0,D=1,R=2,j=(e,r)=>{_t(e,W);let s=uN(r);zr(e,s)},H=(e,r,s)=>{_t(e,D),zr(e,dN(r,s))},B=(e,r,s)=>H(r,s,Qr(e)),N=(e,r,s,o)=>{try{cN(r,Qr(e),s)}catch(c){if(o!=null)o(c);console.error("Caught error while handling a Yjs update",c)}},J=(e,r)=>{_t(e,R),zr(e,r)},z=N,_=(e,r,s,o,c)=>{let a=Nt(e);switch(a){case W:B(e,r,s);break;case D:N(e,s,o,c);break;case R:z(e,s,o,c);break;default:throw Error("Unknown message type")}return a};var K=1;function se(e){let r=e.webSocketImpl??globalThis.WebSocket,s=e.openTimeoutMs??1e4,o=new Map,c=new Set,a=new Ld,d=new I(a);d.setLocalState(null);let y=null,f=null,U="connecting",b=!1,h=(n)=>{if(U===n)return;U=n;for(let t of c)t(n)},g=(n)=>{if(y&&y.readyState===K)try{y.send(bE(n))}catch{}},S=(n)=>{g({message:{path:n,type:"open"},type:"control"})};d.on("update",(n,t)=>{if(t==="remote")return;let l=[...n.added,...n.updated,...n.removed];g({body:M(d,l),type:"awareness"})});let v=(n)=>{switch(n.type){case"hello":{let t={color:n.color,login:n.login,permission:n.permission};if(n.name!==void 0)t.name=n.name;if(n.avatarUrl!==void 0)t.avatarUrl=n.avatarUrl;f=t;return}case"opened":{let t=o.get(n.path);if(!t)return;if(t.opened&&t.epoch!==n.epoch){w(n.path,t);return}t.epoch=n.epoch,t.opened=!0,t.resolveOpen?.(!0),t.resolveOpen=null;let l=tl();j(l,t.doc),g({body:vo(l),epoch:t.epoch,path:n.path,type:"doc-sync"});return}case"doc-reset":{let t=o.get(n.path);if(t)w(n.path,t);return}case"flush-ack":{let t=o.get(n.path);if(t){for(let l of t.pendingFlush)l();t.pendingFlush.clear()}return}case"doc-dirty":{let t=o.get(n.path);if(t){t.dirty=n.dirty;for(let l of t.dirtyCbs)l(n.dirty)}return}case"error":{if(!n.path)return;let t=o.get(n.path);if(!t)return;if(n.code==="content-not-loaded"&&e.hydratePath&&!t.hydrated){t.hydrated=!0,e.hydratePath(n.path).then(()=>S(n.path),()=>{t.resolveOpen?.(!1),t.resolveOpen=null});return}if(!t.opened)t.resolveOpen?.(!1),t.resolveOpen=null;break}default:break}},k=(n,t,l)=>{let u=o.get(n);if(!u||!u.opened||u.epoch!==t)return;let i=il(l),m=tl(),T=_(i,m,u.doc,"remote");if(gE(m)>0)g({body:vo(m),epoch:t,path:n,type:"doc-sync"});if(T===D&&!u.synced)u.synced=!0,u.resolveSynced()},w=(n,t)=>{o.delete(n),t.resolveOpen?.(!1),t.resolveOpen=null;for(let l of t.resetCbs)l();t.doc.destroy()},P=()=>{h("connecting");let n=e.protocols,t=n===void 0||n.length===0?new r(e.url):new r(e.url,n);y=t,t.binaryType="arraybuffer",t.onopen=()=>{O.opened(),h("connected");for(let u of o.keys())S(u);if(d.getLocalState()!==null)g({body:M(d,[d.clientID]),type:"awareness"})},t.onmessage=(l)=>{let u=l.data,i=u instanceof ArrayBuffer?new Uint8Array(u):u instanceof Uint8Array?u:null;if(!i)return;let m;try{m=yE(i)}catch{return}switch(m.type){case"control":{v(m.message);return}case"doc-sync":{k(m.path,m.epoch,m.body);return}case"awareness":{F(d,m.body,"remote");break}default:break}},t.onclose=()=>{if(b)return;h("offline");for(let l of o.values())l.opened=!1;O.scheduleRetry()},t.onerror=()=>{}},A={};if(e.reconnectDelayMs!==void 0)A.baseMs=e.reconnectDelayMs;if(e.reconnectRandom!==void 0)A.random=e.reconnectRandom;let O=dw(P,A);return P(),{destroy(){if(b)return;b=!0,O.dispose(),L(d,[d.clientID],"destroy"),d.destroy(),a.destroy();for(let[n,t]of o)t.resolveOpen?.(!1),t.doc.destroy(),o.delete(n);y?.close()},async openDoc(n){if(b)return null;let t=o.get(n);if(t&&!t.handleDestroyed)return null;let l=()=>{},u=new Promise((p)=>{l=p}),i={dirty:!1,dirtyCbs:new Set,doc:new Ld,epoch:0,handleDestroyed:!1,hydrated:!1,opened:!1,pendingFlush:new Set,resetCbs:new Set,resolveOpen:null,resolveSynced:l,synced:!1,whenSynced:u};if(o.set(n,i),i.doc.on("update",(p,V)=>{if(V==="remote"||!i.opened)return;let C=tl();J(C,p),g({body:vo(C),epoch:i.epoch,path:n,type:"doc-sync"})}),!await new Promise((p)=>{i.resolveOpen=p;let V=setTimeout(()=>{i.resolveOpen=null,p(!1)},s);i.resolveOpen=(C)=>{clearTimeout(V),p(C)},S(n)})){if(o.get(n)===i)o.delete(n);return i.doc.destroy(),null}return{awareness:d,destroy:()=>{if(i.handleDestroyed)return;if(i.handleDestroyed=!0,o.get(n)===i)o.delete(n),g({path:n,type:"doc-close"});i.doc.destroy()},doc:i.doc,flush:()=>new Promise((p)=>{i.pendingFlush.add(p),g({message:{path:n,type:"flush"},type:"control"})}),identity:()=>f,onDirty:(p)=>(i.dirtyCbs.add(p),p(i.dirty),()=>i.dirtyCbs.delete(p)),onReset:(p)=>(i.resetCbs.add(p),()=>i.resetCbs.delete(p)),onStatus:(p)=>(c.add(p),()=>c.delete(p)),whenSynced:i.whenSynced}},status:()=>U}}export{se as createWsCollabConnection};
2
2
 
3
- //# debugId=A6B7FFCBD3BA89FB64756E2164756E21
4
- //# sourceMappingURL=ws-client-arz2qsy9.js.map
3
+ //# debugId=9B0F3031F05D35D564756E2164756E21
4
+ //# sourceMappingURL=ws-client-vs11sxc5.js.map